Help me, oh Solomonic filters

February 28, 2007

A few weeks ago I was introduced to kayak by Nick. I’d never before seen meta-search executed this brilliantly. The filters, along with the flexible date implementation, beautifully integrated Ajaxian city searches, among dozens of other features left me with an absolutely jaw-dropping user experience.

If that weren’t enough, it made me smile a big, huge dumb grin, seeing the personality they crammed into this finely crafted application:

Well done to the folks at Kayak.

A Note On Rails Deployments

February 23, 2007

Never, ever deploy Rails on a shared server. GRRRRR! I’ll be off DreamHost as soon as I’m not too busy writing code and doing work.

A Note To Dan Benjamin

February 17, 2007

If we ever meet, I will buy you a beer, or wine, or whatever you want.

You are forever in my gratitude for how much time you save me thanks to this and this.

For the uninformed: If you need to install Ruby/Rails/Mongrel/RMagick/etc. on Mac OS X, and you don’t want to have to figure it out yourself, or think, then follow the above links.

Hijacking

February 16, 2007

The nice thing about writing a little ‘signup’ application for a class that your wife teaches is that you have full control over the hijacking of that application any time you feel like it. See figure one:

Fortunately for me I didn’t get shot down, and we got some Gold Class seats at VivoCity.

Today, unfortunately, is not turning out nearly as good as yesterday. My mac is seriously on the fritz exhibiting the following completely random and seemingly unrelated ‘features’.

  1. Adium can not connect to any of the IM protocols I have configured including Yahoo, MSN, AIM and GTalk.
  2. Microsoft Word opens all files as Read-Only so if I want to modify them I have to “Save As…” first.
  3. Although CPU usage is completely normal, the entire systemm locks up at random, and I can barely switch between applications or type at a normal speed.
  4. My Airport signal strength indicator is in a “permanent off” state. My laptop is 100% convinced that my Airport is turned off, but I’m connected wirelessly to my network as I post this.
  5. DNS is completely screwed. I have to hit Shift-Reload sometimes 3, 4 or 5 times to get a page to show up in FireFox or Safari because it can’t seem to resolve random hosts. (This could partially, maybe, explain the Adium behavior.)
  6. Random applications terminate as soon as I start them. Yesterday it was Remote Desktop Connection. I would start it up to connect to a Windows box, and it would terminate before I could do anything. Today it’s photoDrop droplets that are crapping out.
  7. Mail.app won’t download any of my Mail (potentially also could be related to network issues, I suppose).
  8. Often when I start an application (say, TextMate or iPhoto for example) – I can’t click on any of the menu items in the menu bar. They’re locked. Which means I’m limited to only being able to use the functionality of the app that I remember via keyboard shortcuts, until it magically decides at some point in the future (20 minutes, 40 minutes – it’s all a great guessing game) when it decides it will permit me to now click on said menu items.

As I’m typing this, SuperDuper! has just finished backing up all my user files, and Mr. Laptop is now going to receive a full enema. I sure hope that this isn’t a hardware problem, or I’ll be severely unimpressed. At least the thing is under warranty. But if Apple is going to take my laptop for a week while they try to figure out what’s going wrong – I might have switched to Ubuntu by the time they give it back to me.

Deserialize Objects From YAML

February 15, 2007

Coding in Ruby is like using a Mac. If you’re not used to it, you spend quite some time looking for an obtuse way to do something, only to come to a “one line of code” solution about 2 hours later.

For me, I wanted to deserialize a YAML serialized ActiveRecord::Base subclass. Looking at the YAMLrdoc, it appeared that I could register a custom type via YAML::add_domain_type – but I wanted to Google around a bit just to see if anyone had already solved this <ahem>YAML deserialization problem</ahem>, to find me some sample code.

I learned nothing via Google, so I turned to the handy rails console (may it live forever) for a quick test, and I ended up with something like this:

monkey:~/Work/[client]/trunk daniel$ ruby script/console
Loading development_daniel environment.
>>
>> class BlaTest
>> attr_accessor :bla
>> end
=> nil
>> b = BlaTest.new
=> #<BlaTest:0x3718164>
>> b.bla = "Yay Test"
=> "Yay Test"
>> c = YAML::load( b.to_yaml )
=> #<BlaTest:0x37138bc @bla="Yay Test">
>> c.class
=> BlaTest
>> c.bla
=> "Yay Test"

So basically, we’ve created a new class with a single property, instantiated an instance of the class, set the property, and then we’ve called YAML::load for the YAML representation of our created instance. The result of YAML::load we’ve assigned to c.

To my surprise (astonishment?), I didn’t even need to register my custom type at all. As you can see, the resulting instance c is of type BlaClass with the appropriate value for the bla property.

One line of code. Beautiful.

Google Thinks I'm Spyware :(

February 12, 2007

Over the past 3 days, I’ve found that more and more of the searches that I do on Google via the little Google search box in FireFox is sending me off to this page:

Now, these searches have been anything from stuff like “rdoc syntax” to tourism information on Laos. I’m really not sure why I keep getting dumped to this page, but it’s starting to get freakin’ annoying.

Programming and Philosophy

February 09, 2007

As one might already know, I read a lot of books. Two of the latest titles have been A Generous Orthodoxy and A New Kind Of Christian – both written by Brian McLaren.

These books discuss a lot about Christianity (and other religions) as they pertain to modernism and post-modernism (among other things).

This got me to thinking about the software development industry, and how the industry is reacting to an era in transition. We are transitioning from the modern era to the post-modern era (and probably have been for a while, whether or not we knew it) – and I’ve formed a bit of an opinion (hypothesis?) about programming languages, tools and frameworks as they relate to this post-modern transition.

It seems to me that the characteristics of dynamically typed languages are those that seem to embrace post-modern characteristics, whereas the characteristics of statically types languages seem to more tightly cling to the characteristics of modernism.

Some terms I’ve heard, used in characterizing post-modernism are things like transience, flux, pluralism, fragmentation. Modernism seems to try harder to rationalize everything, with concreteness – very ‘scientific method’ like.

Am I completely out to lunch, and off my rocker? Probably. But I see a lot of post-modern characteristics in tools like Python, Ruby and Rails. And I see a lot of modern characteristics in tools like Java, C#, etc.

If I wanted to start to talk really crazy, I might say that tools like ASM, BCEL and ideas like Aspect Oriented Programming attempt to take a modern paradigm (in this case Java related) – and, keeping the ‘safety’ and ‘concreteness’ offered by Java as a statically typed language, apply manipulations to byte code at compile or load time, in an attempt to provide some of the benefits that a language like Ruby provides out of the box (in these examples, the ability to dynamically modify and redefine code at run-time). One thing that’s great about tools like Spring is how it manages to take the best of what it can from both paradigms (given the limitation that it’s a framework written in Java for Java developers) – and bring all sorts of post-modern characteristics with it to the Java platform (load-time weaving, friendly AOP, etc.).

I’m probably blabbing about a whole lot of nothing, but no one said you had to read it. :)

Java Meetup With Ben Alex

February 06, 2007

Last night proved to be a great time, with a Java meetup here in Singapore once again brilliantly organized by Christopher Marsh-Bourdon. The event was held at Brewerkz and us Java geeks were on the receiving end of a great overview of the many facets of the Spring Framework from one Ben Alex, of Interface 21 and Acegi/Spring Security fame.

It was great to have a chance to chat with Ben a bit about Spring, open source companies, and different approaches that companies seem to take in building APIs and interacting with developers and users of said APIs.

My first experience with Spring was on a somewhat large personal project that I started working on about a year ago. Code that hasn’t seen the light of day in the real world, but has been a phenomenal learning experience as far as working with Spring, Acegi, as well as the Spring HibernateTemplate support, Spring MVC – and a bunch of other stuff that I just can’t remember.

If any of you out there have the attitude that I used to have, which was something like:

“Why do I need to use Spring, it’s just another framework, and all it does is manage other frameworks.”

I highly recommend that you download Spring right now, and use it. You won’t be disappointed. It’s worth the download and integration for the IoC and Dependency Injection alone.

Slowly...

February 02, 2007

New company with Nick Means (from Texas y’all) is slowly starting to take shape. Between getting paperwork sorted out, coding for clients and looking for new clients – it’s keeping us pretty busy.

So for all your Ruby, Rails, Java and PHP needs…click.