User loginCMS by Drupal |
TechRandom bits of technology User trap of the week: Android SDK sqlite3 libreadlineThis user trap was a nice one. I noticed a month or so ago that the "libreadline" support in my "sqlite3" executable on my home box was no longer working. For the uninitiated, this means that I couldn't use line history and line editing when working on database queries. Really annoying. Tonight I decided I would fix it, dammit. An hour or so of careful investigation later I finally noticed that some joker had stuck a copy of sqlite3 without readline support in the Android SDK "tools" directory; my path stuff was configured to find that one first. For the record, that's really user-hostile behavior. Don't stick spare copies of standard utilities where I will run into them. Yes, I probably should have my path in the other order, or sooner or later a hostile 'ls' is going to get me. Oh well. Update: I've been working for probably 10 hours on optimizing a particular sqlite3 query which was inexplicably slow (a minute or so), which is what started all this. Guess what? With the current Debian sqlite3, it runs instantly! Dammit.
User trap of the week: GIMP Script-FuWhen I was rebuilding my crosshatch plugin for the GIMP as Script-Fu Scheme a week or two ago, I ran into a beautiful little problem. It seemed that sometimes I needed to take the
The 'Sleep Sort' memePeople keep pointing me at Sleep Sort in email and IRL; it is apparently a popular topic right now. To Sleep Sort an array of integers, you spawn one process per array element. Each process sleeps t seconds, where t is the value of its array element, and then outputs t…
Proposals for Open Source Bridge
I have put up the first of my session proposals for the Open Source Bridge Conference. For those of you who don't know, Open Source Bridge will happen for the third year here in Portland Oregon June 21-24. [Update 2011/04/17: Corrected date as suggested by an anonymous reader. Somehow I had 2010 info on here before. Oops—hope I didn't confuse anyone.] It is a most awesome event, and I can highly recommend it to anyone and everyone. My proposals this year are:
Hope to see you all there!
Things I see in student codeI've read quite a lot of student code over the years. Some of it is quite good. A lot of it is full of predictable badnesses. These notes attempt to enumerate some of this badness, so that you may avoid it. This is pretty C-centric in its current form. However, many of its lessons are multilingual. This is a living document, so don't expect it to be the same next time you look at it. In particular, the numbering may change if something gets inserted in the middle. It is revisioned automatically by Drupal, so feel free to point at a particular revision if you care.
Acknowledgements: My undergraduate software engineering students contributed a lot to this document, as did the commenters at FOB. Thanks much to all. Why cut-copy-paste is hard[This note is primarily a response to a recent LWN thread. I'm posting it here because it got a bit long for a discussion forum.] Several years ago, I joined the X.Org Foundation Board of Directors. One of my campaign pledges was to organize a project to finally "fix" X cut-copy-paste (CCP). It has long been acknowledged by anyone paying attention that the user experience around CCP on the X desktop is horrible (although it has improved a bit in the last couple of years). I'm smart, I could fix it, right? Uh, no. Here's some reasons why CCP is hard, especially on X…
HOWTO: Rotated Halftones in InkscapeThere are a few good tutorials on the web about how to get a (mediocre) halftone screen in Inkscape (1, 2). (The GIMP, by contrast, has a special halftoning plugin that does a nice job. I wish that Inkscape had one of those.) One thing that none of these tutorials tell you is how to rotate the halftone screen. This turns out to be important, since unrotated screens of different colors do not overlay well. In this tutorial, I summarize the basic technique for halftoning in Inkscape, and suggest a way to do rotation… Notes on getting Debian Gnome Bluetooth workingThis is a rought-draft page that I'm making to take some notes on how I got the Debian Gnome Bluetooth support to work this time around. Bluez and its supporting utilities are an endless source of frustration and perhaps even of nightmare, so it's probably a good idea to have some notes…
Random non-repeating sequencesWhile doing some research for an upcoming paper, I came upon a 2008 blog post describing a special case of the following interesting problem:
[Updated 2009/12/14] The difficulty arises when both m and n are large. The obvious method is a rejection method: repeatedly pick a random symbol from the alphabet and check whether you've picked it already. If not, append it to your target number. The problem is that the duplicate check seems to require log m time even if you code it cleverly, giving an asymptotic performance of O(m log m). Hash tables can help some, but ultimately you're going to waste a lot of time checking for the unlikely case that you've generated a duplicate. There were various solutions given in the comments, but none of them were optimal. A spoiler follows…
Everything broke at onceI woke up yesterday morning in Tuscon. A lovely day…
|