May 18, 2008
Coding Horror, one of the many things on the internet that sucks away my time, had a story a few years back comparing software development to moving stones for a pyramid. The gist is that there’s a big stone block a distance from your building site and you have a deadline to get it there. Brute force says take the distance, divide by days, move it that much every day, which is great, but likely to result in unhappy slaves (meh) and non-reproducible results (ouch).
The lesson is that every day you need to move the stone at least one day closer to its eventual location or do work that increases your speed such that the moving stone can get there in one less day.
I think thus far in my development efforts my approach has mostly been of the brute force method, which kinda hurts. I do my best to quickly write code that gets the job done well, without any n factorial algorithms or similar badness, but ultimately my current problem is in those first few words “I do my best to quickly write code”. I’ve succeeded in the past based on the ability to solve small problems rapidly, but ultimately the more valuable skill is the ability to solve large problems early. It’s one of the reasons I really like being at Credera, so many of the senior people in the technology practices approach problems in methodical ways that I think I used to mistake for a lack of agility, but now recognize as using proven resources and techniques.
It’s silly to walk up to a hunk of marble and say “lets not use logs to roll this piece” because it’s not made of granite.
April 26, 2007
My sojourn back into the wild frontier of Linux as a client machine has been mostly good, but one thing that frustrates me is the lack of support for iTunes podcasts. The phobos.apple.com/blah/blah/blah urls that everyone and their mother (including The Austin Stone Community Church, by way of me) provide aren’t supported by most clients. This is fine for many sites (like Stone’s) because they also provide the link to the raw rss feed.
The thing of it is that it’s not a terribly complicated task to actually get the rss feed from an Apple link. At first I thought they were running some tpe of weird binary format, but those first 2 bytes were that magical combination 1f8b, gzip! Ok, maybe i’m an idiot for not realizing that it was a gzip compressed stream to begin with, but whatever. One zcat later and I see that those phobos.apple links are just redirects to an edge-caching site using an “itms://” link that is supposed to only be understood by iTunes. Replace itms with http and you’ll get another gzipped stream that contains the iTunes formatted feed. But that just means it’s XML that’s already pretty darn close to what you want. I guess I ought to check out the code and see about writing a patch…
Update: The last thing you get isn’t the original rss feed, but rather some marching orders for iTunes that has all the data contained in the original feed, but luckily embedded in there is a link that has the original feed given to iTunes. So if for example Cornerstone Church in Simi Valley is lame and doesn’t post that their rss feed is at http://feeds.feedburner.com/CornerstonePodcasts and only gives you an iTunes link, you can figure that out.
November 16, 2006
“The three chief virtues of a programmer are: Laziness, Impatience and Hubris”
November 3, 2006
With Ethereal you can capture all the packets that go through your network adapters, including for example the first packet in a new session with SQL Server. The stream isn’t encrypted by default, but the password is obfuscated. The password is in UTF-8, each byte has it’s high order nibble (4 bits) and low order nibble swapped and then is bitwise XOR’d with A5. So of course to deobfuscate you just need to XOR with A5 and then swap the nibbles. There is no particular reason that i know this.
June 30, 2006
I’ve spent maybe 4-6 hours trying to get Ruby on Rails running on Apache, using mod_fcgid under Ubuntu Dapper Drake and I was about ready to kill someone. I’d edited apache.conf, the site confiuration, mod files, .htaccess files ruby files, pretty much everthing in /var/www and /etc/apache2. The problem? I owned the files in the Rails application instead of the www user. Bah!!!
June 27, 2006
#!/usr/bin/env perl
while (<>) {
 if ( /([^,]*),(Incoming|”[^"]*”),([^,]*),([-0-9]*),[^.]*,([0-9]+),[^,]*,[^,]*,[^,]*/ ) {
               $phone = $4;
               $date = "$1 $3";
               $minutes = $5;
               if ($2 =~ /ncoming/i){
                       $inc = 1;
               } else {
                       $inc = 0;
               }
               $phone =~ s/[^0-9]//g;
               $date =~ m!([0-9]+)/([0-9]+)/([0-9]+) ([0-9]+):([0-9]+) (AM|PM)!;
               $mo = sprintf(”%02d”,$1);
               $dy = sprintf(”%02d”,$2);
               $yr = $3;
               $hr = $4;
               $mn = $5;
               $hf = $6;
               if ($hf == “PM” && $hr < 12) {
                       $hr += 12;
               } elsif ($hf == "AM" && $hr == 12) {
                       $hr = 0;
               }
               $hr = sprintf("%02d",$hr);
               print "INSERT INTO calls (person_number, time, duration, incoming) VALUES ($phone, TIMESTAMP '$yr-$mo-$dy $hr:$mn:00', $minutes, $inc);
"
 }
}