LOLC0DE
lolcat. LOL President. I can has cheezburger?. And now: LOL CODE:
HAI
CAN HAS STDIO?
PLZ OPEN FILE “LOLCATS.TXT”?
AWSUM THX
VISIBLE FILE
O NOES
INVISIBLE “ERROR!”
KTHXBYE
Absolutely feckin’ brilliant!
chris on May 29th 2007 in /dev/random
lolcat. LOL President. I can has cheezburger?. And now: LOL CODE:
HAI
CAN HAS STDIO?
PLZ OPEN FILE “LOLCATS.TXT”?
AWSUM THX
VISIBLE FILE
O NOES
INVISIBLE “ERROR!”
KTHXBYE
Absolutely feckin’ brilliant!
chris on May 29th 2007 in /dev/random
It's fairly common to want to grab a bunch of unique database entries and display them as a set of form option tags. Rails has which does quite a nice job of it.
But what to do when I also want to include items not in the database, such as "all" or "none"?
In this case I'm appending "all" onto the hash that constitutes the options.
(Note that it's probably better to have the uniq be in the SQL as DISTINCT but that's for another day.)
chris on May 23rd 2007 in /dev/rails
If you're a Windows user and you like it, skip this post.
Today I have the pleasure of spending most of a beautiful afternoon attempting to ressurect and back up a dying Windows XP machine to a USB drive.
External drive: check.
Drive is formatted: check.
Backup software: ... Backup software? ... Backup software...?
It seems that Microsoft perhaps didn't think the average Joe installer would want to back up their computer so XP doesn't install its backup software by default. Instead there is this helpful bit:
Windows XP includes its own backup program, although you may need to do some digging to find it. You can also take your pick of third-party programs (listed at the end of this column) that add bells and whistles you won't find in the basic Windows XP Backup utility.
If you use Windows XP Professional, the Windows Backup utility (Ntbackup.exe) should be ready for use. If you use Windows XP Home Edition, you'll need to follow these steps to install the utility:
- Insert your Windows XP CD into the drive and, if necessary, double-click the CD icon in My Computer.
- On the Welcome to Microsoft Windows XP screen, click Perform Additional Tasks.
- Click Browse this CD.
- In Windows Explorer, double-click the ValueAdd folder, then Msft, and then Ntbackup.
- Double-click Ntbackup.msi to install the Backup utility.
So let me get this straight: a default XP install comes with games, crippled third-party software and the most defective web browser in the short history of the web but not something so incredibly useful as backup software? And the only way a user can find said software is to Google an obscure article on microsoft.com?
And once installed this software that I would argue is rather valuable software, ends up here: Start > Programs > Accessories > System Tools > Backup.
That PoS that is Outlook ends up at the root level of the Start menu and the backup software ends up buried deep in a directory most novice users would fear to tread.
I am disappointed, but not in the least bit surprised.
(If you're a Windows user and have made it this far, I recommend you install that software and use it. And you really don't want to know what I do to back up my Mac OS machines but I'll give you a hint: it only requires one step.)
Update: I am fascinated by the fact that I can leave my office with a backup job running and Windows will dutifuly steamroll right over that job by putting the machine to sleep before the backup finishes. Yes, I do have it set to sleep after 30 minutes by default but would it be so hard to throw a routine into the sleep code that checks if any user-activated tasks are still running and, say, waits until they're done?
I am also fascinated by the way in which the Windows Task Manager cannot kill a running job. And then the way in which the Windows Task Manager then also chokes up and though it still me to take all the appropriate steps to kill itself, will not do that either. Stupid pacifist program.
And my fascinating grows yet again with how Windows, on a machine with no internet connection, asks me if I'd like to send a crash report to Microsoft presumably about all the other freezing software on the system, and then have that error-sending software freeze up as well.
Windows, you fascinate me. In a bad way.
chris on May 21st 2007 in /dev/random
Over on bitbashing in I Must Admit I Don't Quite Understand the Thought Process the post's author asked a potential hire which features of C# in particular the developer liked. The developer answered:
His first response was that there were no pointers in C# which prevented a lot of bugs. When I probed further, he also mentioned that the lack of multiple inheritance was really nice.
The author was taken aback by this response, this acceptance of a lack of features as a feature in and of itself and as a result found the candidate unfavourable. To the author's credit he's continued to think about it and wonder if his reaction was perhaps the incorrect one.
Personally, anyone who answered the "favourite feature" question by citing a lack of features from other languages and who can justify that answer moves immediately to the top of my pile!
Two of my favourite interview questions are: "What's your favourite programming language and why?" and "What's something you hate about your favourite programming language?" If a candidate has no answers for either of those that's a big negative to me, as both are intended to be strarting points for probing deeper into the candidate's passion for programming and their desire to really know the realm in which they're going to spend at least a third of their lives. If you don't love and hate something about your favourite programming language you either don't know it well enough yet or you've become a souless code-monkey bashing away at the keyboard until the clock chimes (warning: flamebait).
That this particular developer was able to cite what most people might percieve as negatives of the language as positives, and was able to do so rather than cite the actual, obvious benefits of C# (a language I'm quite fond of myself) tells me three things:
The author writes: "In retrospect I wish I had probed deeper into his though processes when he named these language 'features'" and I think he should have. It sounds like this developer wouldn't have been hired anyway, so no big deal in hindsight, but I think he might have missed an opportunity to examine his interview approach all that much more.
Sometimes being shocked awake in an interview is a good thing.
chris on May 19th 2007 in /dev/random
Over on DaveM's Linux Networking BLOG he relates a cute annecdote about what defines a programmer from a non-programmer in Hacker world view....
I like his tale but I respectfully disagree with his conclusion - I've had some of my best "Ah ha!" moments standing in the can (Too much detail? I never know...)
I say: code monkeys sit and bash at the keyboard, real programmers head for the zen of the loo, or the calm of a nap, or the tranquility of a pint ![]()
chris on May 9th 2007 in /dev/random
Much controversy lately in the world of Linux over on Slashdot about some obscure (to those of us who just want to store our files without caring about the minutae) feature of the ZFS filesystem leading to many, many comments.
The thing about Slashdot (and Digg and Reddit and...) is that the sheer volume of inane comments is so great, and the teeny volume of worthwhile comments so small that the worthwhile ones can be effectively thought of as zero. It is sad but true that on the day-to-day the vox populi really does have nothing to say.
Which is why when someone sticks their head up and does post a comment that seems to contain information - knowledge even - you'd think that the rest of the mass would consider carefully before flinging the feces. Witness this comment replete with factual insight:
Lovely biting sarcasm aside, to be honest, our storage layering in Linux leaves much to be desired. As witness the slow pace of improvement of the volume manager in recent years. This does not prove that layering is bad, but it suggests that our current conception of layering sucks pretty badly.
Note the poster's use of our in the first sentence. Subtle indeed, but important. Connoting some sort of first-person association with the topic at hand, it would seem. But alas not so important that poster DaleGlass failed to notice it and proceeded to school Mr. Daniel Phillips with a sound
You don't seem to understand snapshots.
That would be Daniel Phillips who doesn't understand filesystem snapshots. This Daniel Phillips:
Daniel Phillips is a Linux Kernel hacker who specializes in filesystem, virtual memory and storage work. He is the designer and original implementer of the HTree directory indexing system, now a standard feature of Linux's Ext3 filesystem, and was involved in architecting the virtual memory subsystem for Linux 2.6
Sometimes it really is better to keep your head down and enjoy the anonymous safety of the crowd Mr. Glass.
chris on May 5th 2007 in /dev/random
chris on May 4th 2007 in /dev/random
When the time comes to deploy on a production server, the following sets up the database:
rake db:migrate RAILS_ENV=production
chris on May 3rd 2007 in /dev/rails
Upper limits? We don't check no stinking upper limits!

(Courtesy of iPhoto.)
chris on May 1st 2007 in /dev/random