Friday, September 05, 2008

Nut graf fail


Alas, if even Paris Hilton has fallen prey to this hacker's scheme, what possible chance could we mere mortals have? For truly, he has bested the greatest of our ranks and cannot now be stopped. As for me, I'm going to pour water on my keyboard and return to the simpler days of abaci — they don't generally have passwords...

Friday, August 22, 2008

Not so deep thought...

When Safari on the iPhone crashes there is no indication, no dialog box, no apology - it just returns you to the main screen. This was a good decision on Apple's part, otherwise I'd wear out the part of the screen where the OK button would be for "Sorry, Safari has crashed. Tap OK to continue." Crashy, crashy.

Wednesday, August 20, 2008

Java's EnumSet - fun for the whole family!

In the dark, rarely visited corners of Java lies a rather powerful, often overlooked tool - the EnumSet. When Java finally got enums in Java 5, there was enough celebration to overlook this useful little construct.
An EnumSet provides a quick and easy way to stuff many enum'ed values into one variable and pass it around. Some surprisingly good static syntatic sugar makes creating EnumSets very easy.
Where EnumSets come in particularly handy is eradicating that ugly vestige of C code, the bit-stuffed integer value. I recently came across some new code that still uses named constants in order to work around a custom data serialization issue, and while I can't fix that data serialization weakness, I can hide it while adding type safety to the code via an EnumSet.
How about a short, informative, correct example:

import java.util.EnumSet;

public class TestingEnumSet {

enum Simpsons { Homer, Marge, Lisa, Bart, Maggie };
public static void main(String[] args) {
EnumSet<Simpsons> parents = EnumSet.of(Simpsons.Homer, Simpsons.Marge);

// Uses the order of defined enum to determine range inclusion
EnumSet<Simpsons> kids = EnumSet.range(Simpsons.Lisa, Simpsons.Maggie);

EnumSet<Simpsons> parents2 = EnumSet.complementOf(kids);

EnumSet<Simpsons> everybody = EnumSet.allOf(Simpsons.class);

// Look Ma, no if(simpsons & HOMER_FLAG != 0) Yay!
if(parents.contains(Simpsons.Homer))
System.out.println("Homer is present");

if(parents.contains(Simpsons.Bart))
System.out.println("D'oh!");

System.out.println("The kids...");
for(Simpsons s : kids)
System.out.println(s);

System.out.println("Go to Moe's bar? " +
canGoToMoes(EnumSet.of( Simpsons.Homer,
Simpsons.Marge,
Simpsons.Bart)));
}

public static boolean canGoToMoes(EnumSet<Simpsons> atDoor) {
return !atDoor.contains( EnumSet.range(Simpsons.Lisa, Simpsons.Maggie) );
}
}

Learning new things is fun.

Sunday, August 03, 2008

Yep, I am still alive. And having a great time at Hadoop HQ

For any who may be following along at home, sorry for the long absence. I'm alive and kicking in Santa Clara, Calif., interning with the Hadoop team at Yahoo! I'm having a great time, working on some cool code and learning more than I thought possible in such a short time.
Blogging about my work at Yahoo! is... problematic and, quite frankly, not worth it, so even though I'm living large with the yellow elephants, I'm not going to be talking much about them. However, I can say that Yahoo! is an amazing place to intern, both because of the love they show the interns and regular staff, and because you're right in the middle of some of the coolest stuff happening in technology. We'll see what happens in the fall. Right now I'm just enjoying the pressure.

Saturday, May 03, 2008

Updated Hadoop resources

It's been a while but I've updated the Hadoop resources post to include some neat Hadoop blogs. This post receives a lot of traffic, so I'm hoping it's useful. Please let me know if there's anything I should add.

Thursday, May 01, 2008

Subversion is the most important tool that a CS student can possess...

... or at least it's firmly in the top three.
Subversion is a content-versioning system, meaning that it records all important changes you make to your files. As you work, you tell Subversion to record milestones, such as the completion of a function, the fixing of a bug or the end of a day's work. With this information you can see how a file has changed over time, who made those changes and if necessary, even revert them away, restoring the file to an earlier version.
Subversion is certainly not the only versioning system around, but it's modern and popular. CVS is the granddaddy of versioning software, and git is the shiny new kid on the block with an impressive pedigree.
Version-control software is a vital tool in the effective programmer's toolbox, but for the computer science student it is arguably the most important tool to use and master. Regardless of which programming experience, language, compiler, IDE, course or program you use, subversion or one of its cousins will one day save your bacon. Here's how and why.
(n.b. These comments of course apply to all content-version systems, not just Subversion. Subversion happens to be the one that I've used and grown to love. If you prefer another, just replace all instances of Subversion in this text with your choice.)

  1. Subversion will save your time
    I regularly use three different development machines: my laptop, my desktop and the school computers. Trying to maintain the files from all of my classes on all of these machines would be a nightmare. I've seen people with thumb drives, people who email themselves the files from one computer to another and people who are too panicked to try to work on a different computer. None of this is necessary or even reasonable for a proficient coder. Instead, just import your work onto each machine, commit your changes after each session and when you need to move to another computer update your local repository. No muss, no fuss and no lost time trying to keep your files with you.
  2. Subversion will save your friendship
    Despite the average programmer's antisocial tendencies, group projects are a fact of life in a CS degree. And like any group endeavour, they can lead to quite a bit of tension as each member works on different sections of the codebase. Taken to an extreme, this can be very bad: a group member may disappear with crucial code, it may be difficult to get everyone together to code at once or, worst of all, multiple versions of the code may develop as people work independently. Eventually, the final code may be turned in with bugs that no one will own up to creating. This is a pretty good approach to straining or ending friendships.
    Subversion prevents all of this from happening by allowing each member to work independently, have access to the latest (committed) code, and to commit their code when it's tested and ready. And because Subversion lets you track every change made to every line of code, ownership and accountability is built into the system. It can even provide contribution statistics to provide a very approximate estimate of who pulled their weight.
    An aside: Subversion is a godsend when working with people running different operating systems or development environments.
  3. Subversion will save your ass
    Part a: Coding when you should have gone to sleep

    It took me several wasted all-nighters to finally learn a valuable lesson: eventually you're doing more harm than good when coding while sleepy. I would finally wander off to bed, crash, come back to my code the next day and wonder what the hell I had been trying to accomplish. Without Subversion, this would lead to hours of re-constructing and repairing the code. With subversion, all that is necessary is to revert back to a version where I was still making sense. Regular, reasonable code check-ins are the key to long-term success. If I know I've got a long night of hacking in front of me, I will usually commit every hour or so, to give myself many possible restore points even if I don't realize I've passed the point of gibberish.
    Another aside: Subversion also allows you to easily explore other ways of doing things and play with your code, knowing that you can always get back to where you were before with no risk.
    Part b: Hard drive crash

    Related to the issue of working on multiple computers is what happens when the single computer you are working on crashes or you accidentally rm your files into oblivion. If you're relying on zips and manual backups, at a minimum repairing the damage is a hassle and at maximum it's impossible. With your own Subversion repository hosted by a reputable, reliable provider, it's a breeze to import your work into a new machine and continue on as if nothing had happened.
  4. Subversion will make you look good
    Virtually every professional programmer, software development company and open-source project uses some type of version control. Be very, very wary if they don't. In fact, be terrified. Along with project planning, requirements gathering, modelling and other necessities of software engineering, version control is a required skill that's not usually included in the CS curriculum. If you have this skill and experience as a student, it's a strong plus to add to your resume when it comes time for internship and job applications. It will set you apart from other students and demonstrate that you're committed to turning out quality code.
Hopefully this has convinced you to invest the time in learning version control If so, go grab a copy for your OS (Subversion is completely multiplatform), learn the basic commands, install an IDE plugin (Eclipse and Visual Studio both have great plugins: subclipse and AnkhSVN, respectively) create an account with a subversion host and start checking your work in.

Congratulations Calli and Hannah-Jo!

Just a note to say congratulations to my two nieces for doing great on the SAT-10 test, ending up in the top 3% of the test takers (not to mention the straight As they earned). Woohoo! We miss you girls. I just realized I don't have a picture with both of you, we need to fix that. Nen and I are so proud of you both!
Sorry this is a bit late; I'm swamped, but we got the package out today. It should be there early next week. We can't wait to see you guys again.
Love, Uncle Jakob

Wednesday, April 30, 2008

LinuxFest 2008 wrapup

Oh, so many pale guys in black tshirts (myself included) - It was like a ThinkGeek store fashion show. Also, an excellent couple of days. What other group would think to hold its conference party at the Museum of Electricity and Radio - and then invite a live band to play at the radio museum?
There were several excellent presentations:

  • Sean Boisen from Logos Bible Software presented an excellent talk on using Python's NLTK for linguistic analysis, to a room so full that people were sitting on the counters. It's well worth going through the presentation slides (in a neat browser-based format!) if you're at all interested in computational linguistics or Python hacking, go through these.
  • Ted Haeger from Bungee Labs had quite a bit to say about the GPL, LGPL and AGPL, and an imagined LAGPLorsomething. Not something I had given much thought to, but he certainly makes a slick and persusaive case as to why pretty every programmer will be bitten by this eventually. Interesting cloud-based development platform Bungee Labs is working on as well.
  • Dirk Morris from Untangle.com gave a very cool talk about software development riffing from Zen and the Art of Motorcycle Maintenance. An absolute must-read: it puts the whole 'programming is an art or science' debate into an appropriate frame. And he did it while dealing with one of the more annoying human beings I've ever been in the same room with. Dirk's blog entry that covers this material is a must-read. Also, his presentation sold me on using Untangle at work.
It would be nice if there were more exhibitors: hopefully the large turnout this year will entice more local and national companies next time around. Maybe I can do a Hadoop presentation next year?

Wednesday, April 23, 2008

LinuxFest Northwest 2008

Looking forward to heading up to Bellingham for the weekend to LinuxFest Northwest 2008. Must get homework done ahead of time... Must get homework done ahead of time...
There's a huge variety of topics this year. I found something in each time slot:
Saturday:

Sunday:
Interestingly, quite a lot of Python stuff. Tons of fun.

Tuesday, April 08, 2008

Continuing quest to be king of the geeks: My TARDIS cake

Been meaning to post this for a while: here is another entry in my 42-part quest to be king of the geeks: My TARDIS grooms cake from our rehearsal dinner. At the very least, it's proof that I can look really, really dorky in any photo. I tried to convince Selina to use the cake as our main wedding cake, but even she has limits. Being a non-descript blue box made it easy for the cake decorators.




The TARDIS doesn't usually have a candle sticking out from its door, of course, but the nice staff at the restaurant thought we were having a birthday party. Every Doctor Who fan should try a tasty, tasty TARDIS sometime.

Monday, April 07, 2008

Man pages for linux software development

Maybe I'm just a bit dense tonight, but it took me about 30 minutes of searching to find this answer. If you're going to be using any of the C/C++ system calls, such as fork or dup2, and would like to have their man pages local, install the manpages-dev package like so:

sudo apt-get install manpages-dev
I'm a bit surprised they weren't included in the build-essential package.

Friday, March 28, 2008

Hadoop Conference rocks, or so I hear

Google Alerts would like me to know that the Hadoop conference rocks...

Google Blogs Alert for: hadoop

Hadoop Summit - Best in Show
By Kevin Merritt
Yesterday I attended the Hadoop Summit and expected to hear all the cool stuff Yahoo and Powerset were doing with it. By far, however, the runaway winner for “best use of Hadoop” in my book goes to Facebook. Joydeep Sen Sarma and Asish ...
blist blog - http://blog.blist.com

Yahoo offers free supercomputing to Hadoop developers
By Linux W
... facilities free to academic institutions in India that are researching large scale computing, particularly around Apache Hadoop, an open source distributed computing project of the Apache Software Foundation that Yahoo supports.
CentOS, Linux and Operating Systems - http://www.centos.se

At the Hadoop Summit
By Peter Lee
The first Hadoop Summit was hosted yesterday by Yahoo! Research in Santa Clara. (Hadoop is the open-source suite of software packages for “map-reduce” style distributed computing.) The Summit had been planned originally as a workshop ...
CSDiary - http://www.csdhead.cs.cmu.edu/blog

Visited Hadoop Conference

By Mikael Ronstrom(Mikael Ronstrom)
It was interesting to see the wide scope of web-scale problems that could be attacked using Hadoop. The major disruptive feature in Hadoop is the MapReduce solution to solving parallel data analysis problems. ...
Mikael Ronstrom - http://mikaelronstrom.blogspot.com/

Hadoop Summit 2008: My take, part 1
By Nathan Fiedler(Nathan Fiedler)
On Tuesday I attended the first Hadoop Summit held in the TechMart building in Sunnyvale. It was a fabulous experience, much better than I had expected. It doesn't help that my expectations have been tempered by such events as the first ...
Caffeinated - http://cafenate.blogspot.com/

Sounds like fun. Unfortunately, I'm stuck in Edmonds, Washington, 723 miles away... where's it's snowing... at the beginning of April. Here's to next year and California sunshine.

Monday, March 24, 2008

Ryan and Stella's wedding was wonderful

Ryan and Stella are married and it was great. I've created an album for the photos that Selina and I shot with my shiny new Rebel XTi. If anyone wants any of the full-resolution photos for prints let me know.

Ryan and Stella's Wedding
I've know Ryan for almost 15 years (not counting the time in elementary school when I beat him up for very good reasons that I don't recall). Sitting there during the reception, watching old and new friends dance and laugh, was one of those times that I'll remember. It's what life's about.

Sunday, March 23, 2008

iZombies

This was a long, hard quarter. Much more exhausting than I had expected. I've not posted in two months and felt like the walking dead for the last two hellish weeks. But to my great horror I discovered that while I was studying, my closest friends really had been turned into zombies... iZombies.
They wander around, looking nearly alive, but that little brick never leaves their hands. You speak to them and their eyes don't register you. Some simply mumble, "iPhone. iPhone." Others try to convert you, "did I show you this cool new iPhone app I installed?"
It's sad. I miss my friends. And what's worse, I know that soon - as soon as that stupid government rebate check arrives - I'll likely join them. iiiiiiiiiiiiiPhoooooooooooone...... iiiiiiiiiiPhoooooooooooooone.