February 07, 2007

Jazz.net goes live

paris.jpg

If you'd like a peek at what I've been up to at work for the past eight months, head over to jazz.net, which just went live.

The details are still kinda sketchy, but expect more real soon now :)

In Technology and Software

Posted at 11:44 PM | Permanent link

January 18, 2007

Eclipse is a dead system

dead_fish.jpg

(DON'T PANIC! I probably don't mean what you think I mean.)

On a long enough timeline, the survival rate for everyone drops to zero.

Steve Yegge has a thought-provoking essay on living systems vs. dead systems, in essence: systems that can be modified at runtime vs. systems that you have to stop (kill) first to modify.

In this context Eclipse is a "dead system" (or "hardware" as Stevey says). And this makes me sad :(

In fact, it's saddened me for a while, though I've never framed the issue in these terms.

Even though Eclipse has a world-class extension system, we have to go through an onerous process of launching and relaunching Eclipse instances to make the slightest change to a plugin.

In contrast, a "living" system like Emacs doesn't have this problem. In Emacs we can evaluate s-expression, set variables, rewrite functions, and swap code on the fly without having to relaunch - which is why writing Emacs extensions is an order of magnitude easier (and more fun) than writing Eclipse extensions.

Stevey also draws a parallel between how long a system can stay running without reboot, and how long people will continue to use the system.

*shrug*

I think it has more to do with how close your system gets to hitting the best solutions to the problems people are trying to solve on any given day. But here's the thing: the problems of today aren't necessarily the problems of tomorrow, nor the problems of ten years from now.

The more malleable your system is, the better its chance of solving the problems of 2007, and 2008, and 2017, and 2027. And as it happens, systems that can be modified without a reboot are much easier to modify and far more malleable than systems that can't.

Eclipse has many advantages over Emacs (mostly in terms of gooeyness), but as ugly as Emacs looks on the outside, it's definitely the more malleable of the two. So, if I had to choose pick which one is more likely to be around in 100 years, my money would be on Emacs. And if history is any guide, that's probably not a bad bet.

UPDATE:

Hehe, as Bill points out in the comments, I do feel like kind of a bastard for writing this post (especially the inflammatory title). But my aim isn't to disparage Eclipse. I love Eclipse. It's a great platform, and it's very good at what it does.

And no... it's certainly not "dying" :)

My aim is to point out that there are other kinds of extensibility out there that we don't typically get with Eclipse... at least not right now, and it's the kind of extensibility I'd very much like to see.

And just for full disclosure, I work for the company that originally founded the Eclipse project. All views expressed here are my own and not those of my employer.

In Technology and Software

Posted at 06:05 PM | Permanent link

January 15, 2007

How to install bzr on Dreamhost

hot_dog_stand_05.jpg

Bazaar or bzr is a Python-based source code management system that I've noticed is becoming increasingly popular amongst small open-source projects.

Right now I'm not sure what advantages bzr might have over other SCM systems such as Subversion (I suspect it's more light-weight), but it's handy to have when you want to grab the source for a project like Planet Venus.

Here's how I installed bzr on my Dreamhost shell account.

(note: There's not anything special here. This is all pretty standard Unix tarball installation fair. In fact, there's little here that isn't already in the bzr installation guide. I'm providing this as a confidence cushion for other Dreamhost users.)

Fetch it

Downloads of bzr are available here: http://bazaar-vcs.org/Download

Fetch the tarball install into a directory of your choice:

~$ cd ~/incoming
~/incoming$ wget http://bazaar-vcs.org/releases/src/bzr-0.13.tar.gz

Unzip it

~/incoming$ tar -zxvf bzr-0.13.tar.gz

Install it

~/incoming$ cd bzr-0.13
~/incoming/bzr-0.13$ python2.4 setup.py install --home ~

No problem...

Adjust environmental variables

... except one hiccup when we try to run bzr:

$ bzr
bzr: ERROR: Couldn't import bzrlib and dependencies.
Please check bzrlib is on your PYTHONPATH.

Traceback (most recent call last):
  File "/home/joshstaiger/bin/bzr", line 62, in ?
    import bzrlib
ImportError: No module named bzrlib

Because we installed bzr in our home directory, the Python code behind bzr is living in a nonstandard location that Python can't see. We add this location to our Python library path by setting the PYTHONPATH environmental variable in our .bashrc.

Modify .bashrc as follows:

echo "export PYTHONPATH=/home/joshstaiger/lib/python" >> ~/.bashrc

(replace "joshstaiger" with your shell login name)

We'll also want the bzr manual to be in our MANPATH if it isn't already, so we can read about bzr in our spare time instead of picking up women:

echo 'export MANPATH=$MANPATH:/home/joshstaiger/man' >> ~/.bashrc

Source .bashrc (or relogin) to pick up our changes:

. ~/.bashrc

Run it

And we're set:
~$ bzr
Bazaar -- a free distributed version-control tool
http://bazaar-vcs.org/

Basic commands:

  bzr init           makes this directory a versioned branch
  bzr branch         make a copy of another branch

  bzr add            make files or directories versioned
  bzr ignore         ignore a file or pattern
  bzr mv             move or rename a versioned file

  bzr status         summarize changes in working copy
  bzr diff           show detailed diffs

  bzr merge          pull in changes from another branch
  bzr commit         save some or all changes

  bzr log            show history of changes
  bzr check          validate storage

  bzr help init      more help on e.g. init command
  bzr help commands  list all commands
  bzr help topics    list all help topics

In Technology and Software

Posted at 10:54 PM | Permanent link

January 12, 2007

The iPhone is NOT a platform

apple-store-times-square-02.jpg

Ok, I was wrong.

Looks like they will be fighting us every step of the way.

*shrug*

Steve just lost my willingness to give him $599 and put my balls in a vice grip with his carrier (which I otherwise would have done gladly, just to play in the new sandbox).

I will, however, continue to write webapps that incidentally work well on his phone, safe in the knowledge they'll no longer have to be crippled to be mobile.

In Technology and Software

Posted at 03:51 AM | Permanent link

January 09, 2007

The iPhone as a platform

apple-store-times-square-07.jpg

Tonight, every nerd I know is salivating over the iPhone.

Obviously people are orgasmic over the sexyness: the form-factor, the fluid touch-screen, the (for serious!) smart calling software, the media apps, and the internet connectivity.

But I think the real story here is we finally have a real platform for mobile application development, complete with real OS, real apis, and a real web browser capable of running real web applications - all delivered by a company that isn't going to fight us every step of the way.

And the sexyness ensures it's going to be very popular.

It almost sounds like the mobile platform we've been waiting for for the past ten years!

This is going to be big :)

In Technology and Software

Posted at 09:47 PM | Permanent link

December 29, 2006

Metaprogramming method closures in Ruby

night01.jpg

In my previous post, Of Closures, methods, procs, scope, and Ruby, I discussed how blocks and procs are closures in Ruby while methods are not.

To review, this won't work:

class MyClass
    @friend

    hello_string = "Hello"

    def initialize
        @friend = "Kitty"
    end

    def say_hello
        puts hello_string + " " + @friend  # Bzzt!  hello_string is not in scope
    end
end

my_object = MyClass.new

my_object.say_hello # Bzzt!

And neither will this (at the toplevel):

hello_string = "Hello, world!"

def say_hello
    puts hello_string  # Bzzt!  hello_string is not in scope
end

say_hello # Bzzt!

In response Kurt hypothesized we could get method closures in Ruby with a bit of metaprogramming.

And he's right.

As Bryce points out, Ruby's Module class has a private method nammed define_method that defines a new method given a symbol representing its name, and a block representing its body.

Because the second parameter is a block, and blocks can be closures, this gives us the key to defining method closures.

Within the context of a class definition:

class MyClass
    @friend
    hello_string = "Hello"

    def initialize
        @friend = "Kitty"
    end

    define_method(:say_hello) { puts hello_string + " " + @friend }
end

my_object = MyClass.new  

my_object.say_hello # Hello Kitty

Yay!

But suppose we want to define one-off methods from the top-level instead.

Because define_method is private, normally we wouldn't be able to call it outside a class definition, but we can get around this using the send hack.

Let's define a convenience method:

def lexdef(method_symbol, &block) 
    self.class.send :define_method, method_symbol, &block
end

And now we can define method closures from the toplevel:

hello_string = "Hello"

lexdef :say_hello do |friend|
    puts hello_string + " " + friend
end

say_hello "Kitty" # Hello Kitty

Voilà! An unobtrusive syntax for defining method closures!

I like it :)

As of Ruby 1.8, blocks don't yet support Ruby's first-class syntax for receiving block arguments. So this won't work:

hello_string = "Hello"

lexdef :say_hello do |friend, &formalize|   # Bzzt!  Syntax error
    puts hello_string + " " + yield(friend)
end

say_hello("Kitty") { |friend| "Ms. " + friend }

But word on the street is &block arguments to blocks will be supported in Ruby 1.9.

In Technology and Software

Posted at 06:34 PM | Permanent link

December 28, 2006

The Ruby send hack: how to gain access to an object's privates

lady_liberty01.jpg

I stumbled across an interesting Ruby hack that doesn't seem to be written down anywhere.

It turns out that private methods in Ruby aren't entirely private, and with a bit of indirection you can gain access to them as though they were public methods.

In Ruby 1.8 all we have to do is use the Object#send method.

To demonstrate:

class MyClass
    private
    def say_hello(name)
        puts "Let's go back to my place, #{name}."
    end
end

my_object = MyClass.new
So we get smacked if we try:
> my_object.say_hello
Nomethoderror: private method `say_hello' called for #<MyClass:0x820b4>
	from (irb):8
	from :0
but instead:
> my_object.send :say_hello, "world"
Let's go back to my place, world.

Touché!

Now, honestly, this strikes me as odd. Conceptually, I don't see why send should function differently from an ordinary method call with respect to access control.

The rubydoc for send says nothing of this, and there is some debate on the mailinglist as to whether Ruby 1.9's send will maintain this behavior.

But for now this can be very useful if you disagree with a class designer's method access choices.

In Technology and Software

Posted at 01:06 PM | Permanent link

December 26, 2006

Of closures, methods, procs, scope, and Ruby

giant-piano-06.jpg

One thing I hate about Ruby is that Ruby methods aren't closures.

For instance, this blows up:

hello_string = "Hello, world!\n"

def say_hello
    puts hello_string # bzzt! hello_string isn't in scope
end

say_hello # bzzt!

Which is a little odd because Ruby does support closures on procs:

hello_string = "Hello, world!\n"

say_hello = Proc.new do
    puts hello_string
end

say_hello.call # Hello, world!

It kinda sucks that every time I want to create a closure I'm forced to use the less succinct ".call" syntax.

So why can procs be closures while methods cannot?

After a bit of thinking I realized this comes down to a design tradeoff on whether or not we have to type "self" or "this" all over the place when writing methods as we do in Python and JavaScript.

In Ruby we don't have to do this, and Ruby accomplishes this by making procs and methods two different things with different scoping rules.

Proc bodies have a lexical scope like functions in Lisp and JavaScript, meaning that when Ruby encounters a free variable inside a proc body, its value is resolved within the context the proc was defined. This is what makes closures possible.

Methods are different, however. A method's context is the object to which they are bound. When Ruby encounters a free variable inside a method body, it assumes the variable refers to another method on the object, and this is what saves us from having to prefix same-object methods with "this" or "self".

To demonstrate:

irb(main):171:0> hello_string = "Hello, world!"
=> "Hello, world!"
irb(main):172:0> def say_hello
irb(main):173:1>     puts hello_string
irb(main):174:1> end
=> nil
irb(main):175:0> say_hello
NameError: undefined local variable or method `hello_string' for #
	from (irb):173:in `say_hello'
	from (irb):175
	from :0
irb(main):176:0> def hello_string
irb(main):177:1>     "Hello, world!"
irb(main):178:1> end
=> nil
irb(main):179:0> say_hello
Hello, world!
=> nil

Personally, I'm not sure I like this tradeoff.

Procs and methods are conceptually very similar. They are both composed of a list of arguments, a block of code, and a context in which the block is evaluated. I'm not sure they should be different things.

The way I see it, a method should just be a special case of proc that happens to have an implicit "self" parameter. In this case methods would inherit the proc scoping rules and therefore could be used as closures.

If this means we have to be verbose and type "self" to call other methods on the same object, I'm fine with that.

And in fact, this is how things work in JavaScript:

var helloString = "Hello";

var myObject = { 
    friend: "Kitty",
    sayHello: function() { 
        print(helloString + " " + this.friend);
    }
};

myObject.sayHello(); // Hello Kitty

Matz clearly recognizes that there are issues with Ruby's current scoping implementation, so maybe this is one of them.

But, hey, this kind of tradeoff may just be a Rubyish thing to do, and I probably dig closures more than most.

In Technology and Software

Posted at 05:54 PM | Permanent link | Comments (3)

December 20, 2006

Real life search

I love how whenever I lose something in my house, my first instinct is:

Oh, no problem. I'll just do a search.

And a short instant later...

Goddammit!

In Technology and Software

Posted at 08:39 PM | Permanent link

December 18, 2006

Five things you didn't know about me

starfish_dance01.jpg

There's a massive game of tag going around the blogosphere. I've been tagged by Bill and Dave.

So here goes. Five things you didn't know about me:

  1. I all but gave up Computer Science in favor of law my junior year of college. I even convinced my friend Evan to do the same... except he actually did :)
  2. I've been to London, Paris, Amsterdam, and Zurich, but only set foot west of the Mississippi in May of this year.
  3. I scored higher on the language portion of the SAT than the math portion.
  4. I play piano.
  5. I've been skydiving... twice.

I tag Ryan, Jeff, Kurt, Vinnie, and Anton.

In Matters that are otherwise worthwhile, Technology and Software

Posted at 10:30 PM | Permanent link

December 15, 2006

On Variable Naming in Code

night

Much is made of the pain of typing long variable names (or function names or class names), but code is usually read more often than it's typed. And when I'm reading code (even if it's my own), I'm grateful for names that err on the side of descriptiveness.

This means:

  • navigationElement instead of navigation or nav
  • queryString instead of query, queryStr, string, or str
  • libraryLookupUrl instead of libraryLookup or url

The exceptions are common language idioms which any programmer could reasonably be expected to know (ie: cons in Lisp, def in Python, x as an index into array loops). These should be abbreviated as their meaning is more intrinsic and independent of the name.

In Technology and Software

Posted at 08:37 AM | Permanent link

December 13, 2006

When designing a user interface ...

... imagine that your program is all that stands between the user and hot, sweaty, tangled-bedsheets-fingertips-digging-into-the-back sex.

Words to live by :)

I love xkcd.

In Technology and Software

Posted at 05:56 AM | Permanent link

December 12, 2006

Surprise! It's not Java.

Bubble Tea

So Java SE 6 is out.

I think the most exciting thing about this release is Sun's inclusion of Rhino, Mozilla's JVM-based Javascript engine, out of the box.

This could mean that Sun finally recognizes there *might* be life after Java for the JVM. If so, this is very good news.

In Technology and Software

Posted at 09:01 PM | Permanent link

December 11, 2006

Wall Street to Craigslist: Bitchsezwhat!!?

skate_01.jpg

Wall Street is finding it a little hard to swallow that Craigslist is more interested in maximizing user value than revenue.

To be fair, it's much easier for a privately held company like Cragislist to do this kind of thing than a publicly held one.

I'm sure Craig Newmark and friends have the leverage to be opinionated about how they run Craigslist, whereas when you're dealing with millions of different shareholders with no long-term commitment to the company, it's a lot harder to find a common goal other than "make money as fast as possible".

As tech becomes less capital intensive, it makes me wonder if we'll see privately held companies like Craigslist wield more and more power because they can try innovative business models, they can think long term, and they don't have to march to Wall Street's drumbeat.

In Technology and Software

Posted at 07:54 PM | Permanent link

December 06, 2006

Spam

alcohol.jpg

The New York Times reports that spam has doubled over the past year and spammers are combating Paul Graham's plan for spam by hiding their hello kitty vibrator ads in bitmap images where the filter can't pick them out.

I've been using Gmail as my mail client for a while now. If there were a way to whitelist who can send me file attachments (ie: anyone in my addressbook) my Gmail spam would be near-zero.

As it is 5-10 attachment spams get through the filter per day.

If solving spam means sacrificing email attachments, I'm all for it. Then again, maybe not (NSFW!!).

In Technology and Software

Posted at 10:40 PM | Permanent link

A PBF comics RSS feed WITH IMAGES

PBF195-The_Pacific_Council.jpg

Feed: /services/pbf-rss/

Source: pbf-rss.rb

Writing this script reminded me of just how much I love Ruby.

I was tempted to write in Common Lisp - just for fun, but there's no Lisp equivalent of Ruby's open-uri module. And dammit if open-uri isn't really convenient.

In Technology and Software

Posted at 01:02 AM | Permanent link

November 17, 2006

Man

7:48:46 PM [anonymous-friend]: ok
7:48:48 PM [anonymous-friend]: man question
7:49:22 PM joshstaiger: no manual entry for question
7:49:27 PM joshstaiger: ok, that was bad

In General, Technology and Software

Posted at 11:21 PM | Permanent link

November 16, 2006

MIT making the switch?

Looks like MIT is considering a switch from Scheme to Python for its introductory CS course.

I always thought it was pretty cool that MIT started off their students in Scheme. Probably did wonders for separating those with a deep understanding of Computer Science from the code monkeys.

But hey, Python is a great teaching language, and it looks like Hal Abelson (SICP) is involved in this course as well. I'd be surprised if it's not very well done.

In Technology and Software

Posted at 11:47 PM | Permanent link

November 13, 2006

Doubletake

Wow, Rumsfeld gets fired and Java gets opensourced.

Am I dreaming?

Hell must be chilly these days.

In Matters that are otherwise worthwhile, Technology and Software

Posted at 09:43 AM | Permanent link

September 22, 2006

Advice for web application developers (circa 2006)

"why don't you take your skirt off and write some f***ing Javascript man?!"

-- Bill Higgins

(quoted with permission)

I love it :)

In Technology and Software

Posted at 08:30 AM | Permanent link

September 19, 2006

Who reads Knuth?

If I get one more email FROM THE DESK OF THE LOTTO CHANCELLOR I'm going to stick a fork in my eye and join Donald Knuth in signing off email altogether.

Hmm, Knuth... Knuth came up in conversation the other day!

Over IM I suggested to Bill we "knudge" a particular project in a particular direction.

"knudge? have you been excessively reading knuth?"

No... No, I haven't.

Which begs the question... Does anyone read Knuth? There's a consensus he's a great man, and I get warm fuzzies knowing he's a product of my alma mater. Yet, I personally can't think of anyone who's read his work.

I own volumes 1-3 of The Art of Computer Programming, and they look real impressive sitting on my bookshelf (just don't tell anyone they've never been opened). Same story for everyone I know.

I get the feeling Knuth's writings are becoming the "classical literature" of computer science - books everyone wants to have read, but nobody wants to read.

Then again, speaking as someone who's never read Knuth, I probably come off as a young, naive, arrogant bastard (as I do sometimes).

So I'm curious... I'd like to read Knuth. Have you read Knuth? What did you think? I could use some knudging.

Steve Jobs meets Donald Knuth

"It's a pleasure to meet you, Professor Knuth," Steve said. "I've read all of your books."

"You're full of shit," Knuth responded.

In Technology and Software

Posted at 08:05 AM | Permanent link

May 22, 2006

My trip to California

Yes, I'm alive :)

I've been meaning to write, but it's hard to find a spare moment. Images of ugly code and piano chords and Jazz and cats dance in my head.

This entry has been sitting in draft state for three weeks and is now belated, but what can ya do? I'm publishing it.

California was amazing.

Startup School

Startup School was great, as expected.

paul_graham.jpg

This time around with real founders such Joe Kraus (Excite/Jotspot), Mark Fletcher (Bloglines), Caterina Fake (Flickr), and Joshua Schachter (del.icio.us) speaking we got an excellent "view from the trenches". Lots of great tips.

I'll skip the details as they've been covered extensively elsewhere.

How did it compare to last fall? Favorably. In fact, I liked this year's conference better.

The speakers last fall were great, but the lineup included more finance, VC, journalist, economist, and inspirational types, giving the conference a somewhat "meta" feel. This time around there were more founders with more battle stories and I liked that.

A side effect of raving about a previous conference is that a large number of your friends find their way to the next one :) It was great to see Vinnie, Martin, Didier, Quinnie, Pratik, Rich, and Jason at the conference.

And as expected, I met many great people. That's what happens when you throw a bunch of young, smart, entrepreneurial types in a room together. Too many great conversations to mention, but if we talked, I really enjoyed it, so thank you!

Super Happy Dev House

After the conference I was really feeling the effects of jet-lag and wanted nothing more than to go home and collapse on the couch -- but that was not to be.

Vinnie mentioned he was going to a party later that night that he assured me I would really enjoy. The name of the party? Super Happy Dev House. Yeah... Super Happy Dev House.

So I had Jason drop me off at Vinnie's apartment in Palo Alto afterward and this gave me a chance to tour the famous Meetro World Headquarters (picture1, picture2).

That was fun :)

Afterwards Vinnie, Didier, Zak, and I headed out to the party.

So, the Super Happy Dev House. What is the Super Happy Dev House?

This is the Super Happy Dev House:

shdn04.jpg

shdn03.jpg

shdn02.jpg

shdn01.jpg

The Super Happy Dev House is a party just south of San Francisco hosted by David Weekly of PB Wiki fame. It's half hackfest, half party, and it's amazing. I've never seen anything like this. I had no idea that things like this existed.

About SuperHappyDevHouse (according to the SuperHappyDevHouse Wiki)

The party runs from 7pm in the evening until 7am the next day, and the idea is you bring your laptop and hack... or not. It's freeform. You can sit around and work on a project amongst other smart people doing the same, or you can walk around and get to know those smart people.

But whatever it is, it's cool. I met some amazing people including David Weekly, himself, Gabe Rivera of Memeorandum, some of the Technorati folks, and countless others.

Everyone is really smart. Everyone has an idea. And everyone wants to talk about it.

It's an incredible atmosphere, and it made me realize what's special about Silicon Valley... and why I need to move there... soon...

The Flat

We left the Super Happy Dev house 4am - ish and everyone was really tired. But the night wasn't over as it turns out.

During the drive home, at the last exit before we hit San Jose:

*scraping noise*
Vinnie: "What's that noise? I think we're dragging something."
Me: "Umm, no dude, I think your have a flat."

We blew a flat in the darkest stretch of Highway 280...

... and we had no flashlight ...

... so we had to use our cellphones as light ...

... Oh we have laptops! Laptops give off more light! ...

... Somebody take pictures of this, I need to blog about this! ...

tire_change05.jpg

tire_change02.jpg

tire_change01.jpg

I'm a nerd :)

Thanks to Zak, who had the most experience of the four of us with changing a tire.

"Old" Friends

After sleeping half the next day I called my "old" college friend Anders (college buddy presently working on PhD in Chemical Engineering at Stanford) to see if he and Vinay (other college buddy presently working on PhD in Electrical Engineering at Stanford) if they would like to meet for dinner. Why yes! So we met at a Mexican restaurant (with ridiculously cheap margaritas) just off campus.

Afterwards I got a tour of the Anders and Vinay pad. Foosball was played (apparently I'm past the prime of my foosball career, which is a bad thing), and much good conversation was had. It was great to catch up.

By the way for those who know him, Anders is still the same old Anders - he still doesn't sleep.

The next day Anders gave me a brief tour of Stanford, which is incredibly beautiful if you've never been.

stanford03.jpg

stanford02.jpg

stanford01.jpg

Then he dropped me off at the Caltrain station where I took the train into San Francisco for the rest of the day.

San Francisco

This was my first time in San Francisco, and I spent most of the day doing unashamedly touristy things - Pier 39, Fisherman's Wharf, Ghirardelli Square, Trollies, Golden Gate Bridge (which is *massive* in person).

There's not much to say, really, except I love this city and hope it won't be long before I return.

san_francisco038.jpg

san_francisco005.jpg

san_francisco019.jpg

san_francisco027.jpg

san_francisco037.jpg

san_francisco053.jpg

san_francisco067.jpg

san_francisco076.jpg

san_francisco094.jpg

san_francisco129.jpg

san_francisco113.jpg

Summary

Tons of other Photos in my California Photoset.

In short, I'm going to have to move west to the Bay Area, I don't see any way around it. So that's that.

In Matters that are otherwise worthwhile, Technology and Software

Posted at 10:30 PM | Permanent link

April 27, 2006

Startup School 2006

Tomorrow I'm catching a plane west for Startup School 2006 at Stanford University. If it's anywhere near as good as it was last fall at Harvard, should be a treat.

Looks like another impressive array of speakers. Looking forward to chatting with a few of them, along with the myriad of other young entrepreneurial types.

It will also be nice to see Vinnie, Martin, and Jason each of whom will be at the conference.

Going to be there? Or have I forgotten you live in the Bay Area? Gimme a call: 216-570-8595. I'll be in town until Tuesday evening.

In Technology and Software

Posted at 11:06 PM | Permanent link

April 01, 2006

Pretty Printing XML Attributes

Bill poses an interesting question on his blog.

Why is element-based XML easier for humans to read than attribute-based XML?

IE:

<person>
    <firstName>Bill</firstName>
    <lastName>Higgins</lastName>
    <emailAddress>bhiggins@us.ibm.com</emailAddress>
    <city>Durham</city>
    <state>NC</state>
</person>

is easier to read than:

<person firstName="Bill" lastName="Higgins" emailAddress="bhiggins@us.ibm.com" city="Durham" state="NC"/>

I think the answer is that we never learned good formating conventions for long lists of XML attributes. In such cases, most people are content to let the attributes run horizontally off the side of the page (sucks).

If we did the same thing with element-based XML, it would be hard to read as well:

<person><firstName>Bill</firstName><lastName>Higgins</lastName><emailAddress>bhiggins@us.ibm.com</emailAddress><city>Durham</city><state>NC</state></person>

I use the following convention for long attribute lists, which I've kind of borrowed from Lisp (all roads lead to Lisp):

<person firstName="Josh"
        lastName="Staiger"
        emailAddress="joshstaiger@gmail.com"
        city="Durham"
        state="NC" />

Much easier on the eyes, huh?

My algorithm goes something like this:

Write the first attribute on the same line as the tag name. Each consecutive attribute gets its own line and is indented to the level of the first attribute. Write the closing angle bracket on the same line as the last attribute.

I even wrote a SAX-based Python script which slurps XML and pretty prints it in this manner. I can dig it up and post if anyone is interested.

In Technology and Software

Posted at 08:04 AM | Permanent link | Comments (7)

March 20, 2006

Pink Bunnies and Lisp

The problem with Lisp is that once you understand it... and I mean really understand it ... really grasp the implications of code as data and having the full power of the language available at all times, it causes you to go a little bit insane.

I've seen the future. The future is 1958, and it's all madening enough to make one want to put on a pink bunny outfit, wave a white flag, and mumble something about going to rodeo clown school (where the real crazies live1).

It's like finding out the ancient Romans had cold fusion, yet we continue to use crap like fossil fuels.

Nowadays whenever I'm on a date with a girl, I somehow manage to bring up the topic of Lisp. If that's not insane I don't know what is. Incidentally, this explains both why I'm still single and why the number of Lispers seems to be decreasing with every passing generation.

What a state of affairs...

Well, I'm off to find my propeller hat and head to work... Try not to trust me with any heavy machinery, though. I don't recommend it.

seriously.jpg

[1] That was a joke. No offense to any rodeo clowns. I don't actually know enough of them to know if they're crazy on the whole.

In Technology and Software

Posted at 08:18 AM | Permanent link

March 08, 2006

Notes for CS Undergrads: Do I really need to know assembly?

Paraphrasing a recent question from a CS undergrad:

Do I really have to know assembly? I hate everything about the language we're using. It's pretty much obsolete. It's hard to debug, and it is VERY time consuming.

etc. etc. ad infinitum

Yes, learning some form of assembly is very important. In order to be a competant computer scientist you need to know how the machine works down to the metal.

Even if you never write production code in assembly (and god I hope you never have to do that unless you happen to be writing a compiler or optimizing a critical path), understanding how to peek and poke registers and memory addresses under the Von Neuman architecture is key to grasping why certain higher level abstractions are what they are.

If you don't understand assembly then chances are you don't *really* understand pointers in C (and most people don't) which likely means you don't *really* understand references in C++, Java, Perl, Ruby, or Lisp either... nor why C and Java arrays aren't resizeable... nor why 2,147,483,647 + 2,147,483,639 can sometimes equal -10.

Needless to say, this leads to all manner of stupidity.

Yes. Learn assembly. Yes, yes, yes, absolutely! Even if it's for an architecture that's not in heavy use... Even if you're never paid to write a line of it in your life... It's like veggies and vitamins. It's good for you.

In Technology and Software

Posted at 08:06 PM | Permanent link

February 24, 2006

Tech Book Binge

Books I've bought over the past week:

Total: $208.92

This is what happens when you mix reading great technical essays with wine and amazon.com a few clicks away.

These are mostly the books from this list that I haven't read yet. Oh boy just wait until I go back and read this other list with a glass of wine in hand. That one's going to hurt the old pocketbook.

Luckily, I've become a true believer in the Mark Cuban philosophy of read as much as you possibly can. One good idea gleaned from a book can potentially pay for itself many times over over the course of a lifetime.

Nine times out of ten you can tell how good a programmer is by looking at what's on his bookshelf (assuming that he actually reads what's on his bookshelf and it's not just there for show). Most programmers don't read books on programming at all. Draw your own conclusions from that.

I've been trying to take up the habit of reading for ~3 hours per day. I think it's easier if you get up early in the morning, read for an hour and a half before work, and then read some more in the evening. This ensures that you've already got some reading in the bag before you tire yourself programming for eight hours straight, and it usually helps with the motivation to keep going in the evening. A nice bonus is that it also gives you something to think about during your morning commute (if you have one).

In Technology and Software

Posted at 07:47 PM | Permanent link

February 22, 2006

Wordiness Considered Harmful

Good programmers know that code is not an asset. Code is a liability. Lines of code are something you spend in order to build a product.

Why?

Two reasons (mainly):

  1. The only code you can be absolutely, positively sure is bug free is no code.
  2. The more code you write, the more you or someone else has to (re)read to understand what your system is doing.

This is the Zen.

I was pondering this idea on my way home from work this evening when it hit me that there is actually a corollary in writing (English, that is).

Words are not assets. Sentences are something that you need to spend to get your point across.

Whenever I finish a new blog, the first thing I do is go back and delete all the nonessential crap: extra words, prepositional phrases - usually sentences and paragraphs too. A lot of the in order to's, that's, anyway's and so's get the axe.

Then I go back and read what I wrote again with an eye towards rewording sentences so they require fewer words. Then I go back and rewrite what I wrote with an eye towards rewording sentences so they require fewer words.

Why does this make your writing better?

In our code corollary, above, it has more to do with point two than point one. Words are things that your eyes have to travel over and your mind has to process in order to absorbe their meaning. Reading, itself, would really blow if it weren't for the ideas conveyed by those words on the page. The less you have to read to get at that meaning the better1, but then if extra words are necessary to convey the exact feeling you want then they're necessary and there's nothing to be done about it.

This is why someone like Jane Austen is such a pleasure to read while someone like Kant is so awful that we mostly just keep him around to make fun of his writing in essays like this2.

In most cases, however, the difference isn't so pronounced. It's more subtle and subconscious.

It's the difference between walking into a room that has just been dusted and one that hasn't. Ninety-nine times out of a hundred you can't peg the difference unless you're specifically looking for it. You just know that the tidy room feels better.

Concise writing just feels better.

In and of itself, it may not be the quality without a name (that magical quality that defines good writing). But if the quality without a name is there, it allows it to come through more clearly. So bring the axe, and keep it clean.

This, similarly, is the Zen.

[1] With notable exceptions mostly having to do with poetry and word play I think.

[2] Ok, I'm being facetious here. I don't actually know very much about Kant. I'm sure his philosophies are brilliant in their own way. I just wouldn't know because whenever I try to read his stuff it feels so much like trying to wade through maple syrup that I have to stop.

In Matters that are otherwise worthwhile, Technology and Software, Writing

Posted at 09:39 PM | Permanent link

February 19, 2006

A Tribute to Steve Yegge

I don't know who Steve Yegge is, but he rocks.

And here I thought I was the only one in the world with a day job programming Java, an unhealthy obsession with Emacs, and secret affairs with Lisp, Scheme, Ruby, blogging, and Google on the side.

Observe:

and similar drunken blog rants.

I don't care how much of an idiot Stevey says he is; he's right up there with Paul Graham, Philip Greenspun, and Mark Pilgrim in my book. Those who know me know that's the highest compliment I can possibly pay a person.

Reading these guys for the first time stretches your mind. It makes it hurt a little - in a good way. It allows you to catch glimpses of things that were right in front of your nose that you didn't know were there. I can't really describe it other than to say, from what I've read about the Zen and Buddhism, this has to be what the enlightenment is like... at least a little bit... at least the awakening part. Ok, maybe not, but still.

'Welcome to my life. I'm the cow in the Gary Larsen comic1 -- the one who looks up, shocked, and says: "Hey, wait a minute! This is grass! We've been eating grass." The other cows stare blankly, munching the grass.'

-- Steve Yegge in The Emacs Problem

Quotes like that get me all kinda teary-eyed.

After years of pondering the Lisp and Emacs and Java and closures and SQL and XML and RSS and Atom and REST and continuations and Javascript and Objective-C and Cocoa and Perl and Python and Ruby and the Gang of Four and blogging and blog meetups and Peopleware problem I think I've finally gotten to the point where I can read a guy like Stevey, understand exactly where he's coming from on many issues and feel completely comfortable saying something like:

"See all that crap that guy over there is ranting about? Yeah... what he said. Right on, brotha."

Whereas before I would have simply said "Aha!" or "Holy hell, he's right!".

Of course, I'm still saying those things - often, in fact - just not exclusively anymore, and it's a far cry from that kid who just graduated from college and was trying to convince himself that J2EE was the best thing since sliced bread, because it had to be, right? Because that's what they used at IBM, and IBM couldn't be wrong.

That's the feeling I get, and it's none too bad. Now if only I were only smarter... If I only knew how to write like these guys. If if if...

[1] For the love of god, if anyone actually has this comic or knows where I can find it, please let me know.

Disclaimer: Just so you know, in honor of Steve, I've had a few glasses of wine before writing this - which, if my previous entry is any indication, might become a theme with me for a while. So pardon the misspellings and horrible grammar.

In Matters that are otherwise worthwhile, Technology and Software

Posted at 12:09 AM | Permanent link

February 12, 2006

A short review of Peter Seibel's Practical Common Lisp

I recently finished reading Practical Common Lisp by Peter Seibel. For anyone who wishes to check it out, the entire text is available online at:

http://www.gigamonkeys.com/book/

This book serves as a very good introduction to Common Lisp.

It contains some of the best explanations I've seen of Common Lisp's loop macro, format directives, and condition system. These alone were worth the price, as it's difficult to find good information about them elsewhere.

My one major complaint is, with the notable exception of the Unit test framework chapter early on, the "Practical" chapters don't capture the incremental development style of Lisp very well. Most of the latter chapters involve typing out pages and pages worth of code at the end of which everything magically just works.

This is fine and all, but it neglects Lisp's major advantage over less dynamic languages like C and Java: the ability to build up larger systems piece by piece, experimenting with bits of functionality in the toplevel as one goes along.

Understandably, it's more difficult to capture this style of programming in book form1, but it would have been nice if Peter would have alluded to it a few more times in some of the larger examples.

I'm also somewhat puzzled that he chose to introduce his HTML Generation library at the very end of the book, when it had already been in use for four chapters. I believe the book flows better if you read chapters 31 and 32 prior to chapter 26.

Still, studying the compiled version of Peter's HTML generation language was absolutely fascinating for me - one of those "aha" moments.

A very good read overall. I'd also recommend Paul Graham's ANSI Common Lisp for Lisp beginners. I think it does a slightly better job of conveying the Lisp way of thinking, and does an exceptional job of explaining recursion if you're a beginning programmer and haven't *gotten* it yet.

[1] Although I hear Norvig does a very good job of capturing the incremental development style in PAIP, which is next on my reading list.

In Technology and Software

Posted at 09:53 AM | Permanent link

November 13, 2005

Aardvark'd

There's this custom amongst programmers of being nice. Just like there's this custom amongst Wall Street people of seeming like a dick.

-- Paul Graham from the Aardvark'd Trailer.

I just pre-ordered a copy of the Aardvark'd documentary as a Christmas present to myself. More info on Aardvark'd here.

In Technology and Software

Posted at 11:44 PM | Permanent link

October 27, 2005

Intelligent Design theory of code

After much deep thought, I've come to the conclusion that I'm not very smart. I'm forced to write good code because I'm not smart enough to write bad code.

Trying to read bad code makes my head hurt to the point where I want to stick a fork in my eye. The 1000 line method bodies...the layers and layers of nested loops and branches...the non-locally declared variables...non-descriptive names... I marvel at the intellectual heft necessary to make it all work. Genius. If only I could be half as smart as those who write this kind of code.

Or have I made a jump in logic somewhere?

In Technology and Software

Posted at 04:12 PM | Permanent link | Comments (4)

October 26, 2005

Xanga gets their RSS House in Order

When I got home from work this evening, I noticed something odd about the Xanga feeds I'm subscribed to in my feedreader - they were all marked as unread.

A quick glance at some of the RSS Xanga is generating reveals what looks like RSS 2.0.

And indeed, FeedValidator confirms this as valid RSS 2.0 (well, with some warnings about relative URLs, but still valid).

After one full year of frustration, Xanga finally gets it right.

To continue supporting those who may be subscribed to Xanga feeds through my site, I've modified my Xanga Rss Fixer script so that it now simply passes through the valid RSS with some *very* slight modifications. It does still fix the relative URL warnings to make FeedValidator completely happy, but I think that at this point we can say that the fixer is pretty much obsolete. It had a good run.

In spite of now being one with the RSS 2.0 spec, Xanga continues to do some semi-brain-dead things with their feeds - like putting dates in the entry title fields. I've gotten some requests to replace this with an entry excerpt, so perhaps that will be my next trick (hello REXML, nice to meet ya).

For now - kudos, Xanga.

In Projects, Technology and Software

Posted at 10:35 PM | Permanent link

October 01, 2005

Atom 1.0 Compliant!

Given that Atom 0.3 is now deprecated, I've finally gotten around to creating an Atom 1.0 feed for this blog.

[Valid Atom 1.0]

Yay!

MovableType users might be interested in my Atom 1.0 template. Just replace "Josh Staiger" inside the rights element of the feed with your own name. Everything else should work automagically.

No need to worry if you're subscribed to my Atom 0.3 feed. I'll be serving both Atom 0.3 and Atom 1.0 (along with RSS, of course) for the foreseeable future.

In Site News, Technology and Software

Posted at 11:37 PM | Permanent link

Planning a trip to Boston

I've been accepted for the Startup School conference at Harvard University, Oct 15 2005. Glancing at the speakers list makes me want to scream like a teenage girl at a Beatles concert (the mere idea of being in the same room as Wozniak does that to me).

So, I'm planning a trip to Boston for that weekend. I've already talked to Amy and Renee. If anyone else from the northeast would like to grab some chowdah while I'm in town, let me know!

Jeff and Jason will be flying in to attend as well.

In Matters that are otherwise worthwhile, Technology and Software

Posted at 10:09 PM | Permanent link

September 10, 2005

Amazon.com Wake County Library Lookup

Now that the security hole in Greasemonkey is fixed, I finally feel comfortable dusting-off and releasing my most ambitious Greasemonkey effort to date:

Amazon.com Wake County Library Lookup

This script will tell you if any editions of the item you are currently browsing on Amazon.com are stocked at Wake County Public Library.

As always, see the project page for details, screenshots, and downloads.

If this idea sounds familiar, it's because Jon Udell did it six months ago. I was inspired by his script, and decided to write my own version from the ground up.

Searching Multiple Book Editions

Why the rewrite? Why not simply modify Udell's script? My script is slightly more sophisticated than Udell's. The problem with Jon's script is that it only searches for the one edition of the book that you're currently browsing.

For instance, if you're looking at the paperback edition of a book on Amazon, but the library only stocks the hardcover edition then you get a "no". As a result, any time you're browsing a book on Amazon and the script reports "no", you have to wonder whether it's lying to you.

On the other hand, my script searches all editions of the book you're browsing. It lets you know if any editions are available, and if so, which ones.

I've found this to be very helpful, and it has increased my usage of the library tremendously (even if I don't live in Wake County anymore - shh!).

The Future

I have time then I'll write dialects for the Duke, UNC, and Orange County libraries. I'd do one for the Durham County Library, except their online catalog seems to be trapped in the mid 1990s when Java Applets were the way of the future.

Generally, I've written the script so that only one function need be modified to adapt it to different libraries. Please feel free to write a version for your own local library, and post it to the Greasemonkey script repository.

Perhaps, I'll even write a tutorial on how to modify this for other libraries as well...

In Projects, Technology and Software

Posted at 05:39 PM | Permanent link

August 29, 2005

Greasemonkey 0.5.1

I just noticed that Greasemonkey 0.5.1 Final has been released, with the much awaited security fix to the former gaping hole.

Great job, guys!

I get a fully functioning Emacs back last week, and a fully functioning Greasemonkey this week?

God's in his heaven and all's right with the world!

Technorati tags:

In Technology and Software

Posted at 11:49 PM | Permanent link

August 23, 2005

Google Talk - I'm on!

Might as well get the obligatory "I'm on Google Talk" post out of the way.

I'm signed on to Google Talk right now using the instructions described here.

I'm using Adium on the Mac to connect.

If you want to give it a shot, feel free to give me a holla:

joshstaiger@gmail.com

In Technology and Software

Posted at 10:34 PM | Permanent link

Keyboard Remapping Utilities for Mac OS X 10.4 (Tiger)

Michael Baltaks has released a beta of DoubleCommand for Mac OS X 10.4.

I've been using it for the past three days to remap the enter key on my Powerbook to ctrl with no problems. (The world is happiness and glee!)

Also, check out fKeys from Flynn at Kodachi 6 * 14. fKeys is in its very early stages of development, but we owe Flynn a debt of gratitude for discovering the first working technique for general keyboard remapping on 10.4.

Thus ends three months of Emacs frustration.

Technorati Tags:

In Technology and Software

Posted at 07:45 AM | Permanent link

August 05, 2005

Pretend Work

"The other problem with pretend work is that it often looks better than real work. When I'm writing or hacking I spend as much time just thinking as I do actually typing. Half the time I'm sitting drinking a cup of tea, or walking around the neighborhood. This is a critical phase-- this is where ideas come from-- and yet I'd feel guilty doing this in most offices, with everyone else looking busy."

-- Paul Graham

In Matters involving the art of avoiding sloth, Technology and Software

Posted at 06:52 PM | Permanent link

July 27, 2005

Fixing Garbage Characters in the Emacs Shell

In a recent entry, I mentioned that loading the default .bashrc file in Debian turns on terminal coloring. Unfortunately, if you ever use the the shell buffer in Emacs, this has the unfortunately concequence of outputting garbage characters any time you try to run ls:

wjstaige@joshstaiger:~$ ls ^[[0m^[[01;32m#.bash_profile#^[[0m ^[[01;34mMail^[[0m ^[[01;34mblosxom^[[0m ^[[01;34mdownloads^[[0m ^[[01;34mwebadmin^[[0m ^[[mwjstaige@joshstaiger:~$

The solution is to add the following to your .emacs file:

;;; Fix junk characters in shell mode
(add-hook 'shell-mode-hook
         'ansi-color-for-comint-mode-on)

In Technology and Software

Posted at 07:29 PM | Permanent link

July 25, 2005

Hitting the High Notes

"Five Antonio Salieris won't produce Mozart's Requiem. Ever. Not if they work for 100 years."

-- Joel Spolsky

Sweet Jesus, Joel has written a great article!

In Technology and Software

Posted at 11:01 PM | Permanent link

.bash_profile vs. .bashrc

One of the things I always have trouble remembering when working with linux is what is the correct ".profile" to edit when I want to automatically set environmental variables and such for my shell.

Included in Debian Woody are both .bash_profile, and .bashrc. I can never remember the difference between these two.

According to the bash man page, .bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.

What I take this to mean is that when I login when using a console, either physically at the machine or using ssh, .bash_profile is executed.

However, if I launch a terminal within a windowing system such as KDE, launch the Emacs *shell* mode, or execute /bin/bash from within another terminal then .bashrc is executed.

At any rate, the point is generally moot because most people edit the files so one calls the other anyway.

To do this under Debian Woody, we open .bash_profile and uncomment the following lines (under the comment # include .bashrc if it exists):

if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

Now when we login to our machine from a console, .bashrc will get called. As a bonus, in Debian Woody, the defualt .bashrc turns on coloring when running the ls command. Nice!

In Technology and Software

Posted at 07:13 PM | Permanent link | Comments (17)

July 17, 2005

Killing Amazon.com MouseOver Popovers

Tower of London Executioner's Block

It's a situation that's all too common. You're shopping Amazon.com, for the latest latest Harry Potter book. You try to position your mouse pointer in the search input box... but - oops! You overshoot by half an inch. Your pointer sadly finds its way into the "See all 31 Product Categories tab". Uh oh...why is this huge white box now covering the entire search input form?

Who's in charge here? Jeff Bezos, I'm looking at you.

OnMouseOver popovers (including mousover drop-down menus) are one of the worst UI design elements in use on the web today. What's more disturbing is their use seems to be on the rise for navigation elements of popular sites. I expect this behavior from advertising sleaze. I even expect it from ESPN.com. But Amazon? Say it ain't so.

Thanks to Greasemonkey, we no longer have to live with this affliction.

I've written a short greasemonkey script that removes the most annoying popovers from Amazon.com.

As always, head to the project page for downloads and details.

Technorati tags: ,

In Projects, Technology and Software

Posted at 01:07 PM | Permanent link

June 17, 2005

Dreamhost now on Rails!

Although this has not been officially announced yet, Dreamhost now has support for Ruby on Rails!

Thanks to wwight for alerting me of this by posting a comment in my Dreamhost Rails complaint.

See this discussion for the unofficial announcement.

Indeed, logging into my Dreamhost shell and running rails returns a friendly Rails usage message.

Thanks to all who pestered Dreamhost by requesting Rails and thanks to Dreamhost to being responsive to our whining :)

Technorati Tags: ,

In Technology and Software

Posted at 08:49 AM | Permanent link

May 29, 2005

Introducing Xanga RSS Links for Greasemonkey

Xanga RSS Links is a greasemonkey script for Firefox that adds visible RSS links to Xanga blogs and makes them RSS autodiscovery aware.

Head to the Xanga RSS Links project page for downloads, screenshots, and installation instructions.

In Blogging, Projects, Technology and Software

Posted at 05:48 PM | Permanent link

May 17, 2005

The 'big' IBM blog announcement

I'm a little bit late to the party on 'big' IBM blogging announcement. Being an IBMer and a blogger, I'm obliged to opine.

My reaction? "meh.."

So the 'big' announcement is that its 'OK' for IBMers to blog.

Very profound.

(although to be fair, the company never directly claimed this to be the "biggest corporate blogging initiative ever")

The new blogging guidelines are essentially common sense codified. They've drawn the line right around where I expected it to be. I no longer have to assume (when you assume, you...).

Is this better than having no line? Yes. Is it good to know that blogging is finally on the corporate radar? Yes. Is this hopefully a sign of bigger things to come? Yes. Am I ever so slightly more inclined to blog about work-related matters? Yes (case in point - this entry).

So what's the problem?

"If you see a snake, just kill it. Don't appoint a committee on snakes."
~ H. Ross Perot

Tends to touch a nerve with "younger generation" IBMers.

I'd say there's much to be gained by simply opening the floodgates and seeing what happens. Granted, I'm not personally responsible for $119B in shareholder value, but the risk seems to be somewhat mitigated when your competitors (Microsoft, Sun) are already doing this.

Until we get a more daring nudge from above, it doesn't look like we're going to get there.

Baby steps to Big Blue blogging...

As for me, I already use my real name, disclose that I work for IBM, and have had a disclaimer for a while now. Gold star?

Sam Ruby: "If you don’t get your hand slapped at least twice a year, you aren’t pushing the boundaries hard enough."

In Blogging, Technology and Software

Posted at 10:36 PM | Permanent link

May 08, 2005

Mac OS X Tiger Emacs Incompatibilities

I just upgraded to Mac OS X Tiger (10.4), and unfortunately this killed my Emacs setup.

Carbon Emacs has stopped working, as has DoubleCommand, which I had been using to remap my PowerBook's enter key to ctrl (I'm completely lost in Emacs without this).

To fix the general Emacs problem, I've replaced Carbon Emacs with John Wiseman's Aqua build of Emacs, available via Dan Moniz here. Looks pretty sexy.

Unfortunately at the time of writing there is no Tiger-compatible version of DoubleCommand, nor the equivalent uControl.

Emacs is dead to me without a right ctrl key, and I use Emacs a lot.

I read Technote TN2056, but it mentions nothing about how to remap modifier keys.

Does anyone know of a general way to remap modifier functions (ctrl, option, cmd, shift, etc.) to other keys under Mac OS X?

In the meantime I'm offering my services to both the uControl and DoubleCommand projects to help get them ported to Tiger. I just wish that I knew more about Mach Kernel hacking...

UPDATE 5/26/2005:

The MacOS X 10.4.1 update kills the Aqua Emacs build that I linked to above. Once again, Dan Moniz has an updated version.

As far as remapping the enter key goes, I've been been participating in the uControl mailing list. Owing to the fact that Apple has added the ability to remap the caps lock key to control in the OS, uControl's maintainer, Shane Cells, has retired. Development appears to have stopped for the foreseeable future.

Heiko Hellweg has instructions for remapping the enter key on ADB keyboards. Unfortunately this does not work with newer Powerbooks (like mine) which use a USB keyboard.

I recommend heading over to http://bugreport.apple.com to file a feature request for the ability to remap the enter key so that hopefully this problem will be officially solved in the future.

UPDATE 7/28/2005:

See my comment below for information on using Emacs under X11 with the enter key remapped.

UPDATE 8/23/2005:

We finally have keyboard remapping utilities for Mac OS X 10.4!

In Technology and Software

Posted at 04:37 PM | Permanent link

May 05, 2005

What is a buffer?

Today's question comes from Adam Steinbaugh of Wittier, California.

Adam writes:

hey Josh -- what, exactly, is a buffer?

Well, Adam, a buffer is an intermediary space in memory where data is stored before being processed and shuffled off to some place else.

What good is a buffer?

Lets say that you're continually gathering input from somewhere and writing it to disk. Writing to disk is an expensive operation - much more expensive than pushing bytes around in memory. Each time you receive a byte, it would be a waste of time to write it to disk immediately because then you're doing a lot of expensive operations.

Much better to first read the incoming bytes into a memory buffer and then flush the entire contents of the buffer (say 1024 bytes) to disk en mass when the buffer is full. This way, you can still process each byte as it comes in, but you minimize the number of disk writes that you have to perform.

Make sense?

Let's look at things another way.

Let's say that you're moving into a new apartment. You have to move all your stuff from your old apartment.

Unfortunately you made the mistake of investing in a 1969 VW bug for transportation, and in it, you can only carry one of your belongings at a time.

Instead of using your own wheels to drive back and forth to your new apartment twenty times, you get your buddy to bring over his VW bus. You pack all your shit in the bus at once and move everything in one trip. After you're finished moving, Natalie Portman comes over to your place, and you make out.

In this story, the VW bus is your buffer.

In Technology and Software

Posted at 11:39 PM | Permanent link

April 24, 2005

No Ruby on Rails for Dreamhost

Much as I've been very happy with Dreamhost, since I first started hosting with them, they don't currently support Ruby on Rails, a new technology that I'm itching to play with.

I recently sent an inquiry on to Dreamhost on their future plans for Rails support. Unfortunately, it doesn't look good:

From: support@dreamhost.com

To: josh@joshstaiger.org

Hello,

Currently we dont support Ruby on Rails and we really dont have any roadmap to upgrade our current version of Ruby as we receive very limited requests for it. However on our dedicated server offerings you would be able to run Rails as you would have complete control over the machine and could run system level applications that are unable on shared hosting setups. Let me know you if you have any more questions.

Thanks!

trey

I highly encourage any current or prospective Dreamhost customers to contact them (current customers contact form, prospective customers contact form) and request support for Ruby on Rails. As I've said, Dreamhost has been great, and I'd really like to stay with them, but unfortunately this is a sticking point that might cause me to get friendly with Textdrive.

Feel free to borrow from my form letter below:

From: josh@joshstaiger.org

(sent via form at https://panel.dreamhost.com/?tree=support.msg)

Hello,

I'm wondering if you are planning to add support for Ruby on Rails (http://www.rubyonrails.org/) any time soon?

This is a framework that I would really like to be able to use on my dreamhost site.

I have noticed that TextDrive (http://textdrive.com/) is offering this functionality (along with PostgreSQL support as well). As much as I have been thorougly satisfied with Dreamhost, this is a feature that would probably convince me to switch hosting services.

Thanks!

UPDATE 6/17/2005: Dreamhost has just added Ruby on Rails support! See my latest entry, Dreamhost now on Rails!

In General, Technology and Software

Posted at 11:06 PM | Permanent link

April 17, 2005

GNU Emacs Manual 15th Ed missing pages?

Recently sent to press at gnu.org:

I recently purchased a copy of the print edition of the GNU Emacs Manual 15th edition.

Unfortunately, I couldn't help but notice that in my copy, pages 307-404 seem to be missing. In otherwords, the book jumps from page 306 in chapter 24, directly to page 405 in chapter 31.

Unfortunately this leaves out some information on Dired that I was hoping to have handy.

Is this a common problem with all print editions of this book, or is my copy somehow unique? Is there any way that I can get a copy that does not have this defect?

UPDATE: 5/1/2005, No response from press at gnu.org. Resent to rms at stallman dot org.

In Technology and Software

Posted at 02:15 PM | Permanent link

April 12, 2005

Introducing Interchange 0.1 for Yahoo! Maps

US 540 / Hwy 70 interchange

Interchange is a greasemonkey script for Firefox that adds links to the Yahoo! Maps user interface, allowing you to view the current content of a Yahoo Map using Google Maps instead. Interchange works both for single locations and for routes.

Head to the Interchange project page for downloads, screenshots, and installation instructions.

In Projects, Technology and Software

Posted at 01:03 AM | Permanent link

April 07, 2005

Notes on the 4/5 Raleigh Meetup (the long version)

The latest Raleigh/Cary Bloggers meetup took place earlier this week. In attendance:

The only truly new face this week was Chris, who is an IBM Extreme Blue intern, and also a Senior at Case.

Owing to the beautiful weather, we decided to park ourselves outside at a sidewalk table in front of Cafe Cyclo.

Dave and I observed that there is currently a fairly clear contrast in the type of crowd that frequents the Raleigh meetup vs. the Chapel Hill meetup. Thus far the discussion our discussions in Raleigh have been almost exclusively technical, while those taking place in Chapel Hill tend to put a greater emphasis on journalism and social activism.

It's interesting to observe the different "cliques" that are attracted to blogging for different reasons, but why the clear split between the towns thus far? Most likely, we can simply chalk this up to luck of the draw with two techies primarily promoting the Raleigh meetup thus far...

Here are a few topics, and links that we discussed during the meetup:

  • Owing to Dave's recent dive into podcast listening, we talked briefly about podcasting.
  • Dave gives ITConversations a big thumbs up, as most techies do when they discover the site
  • As usual, Dave reports that he's been busy lately with Roller installations and his book
  • We also talked briefly about triangleblogs.com, registered by theshu, which will reportedly become a triangle blogs aggregator (similar to Dave's Planet Triangle experiment), along with a "community" site, running drupal.
  • When the Extreme Blue crew (Martin, Vincent, and Chris) decided to join use, they reported that they had just been go-carting at Funworks in Raleigh. Something that they highly recommended, as they apparently slick down the track somehow to give the feeling of driving a rally car (sounds kickass to me).
  • We spoke briefly about Yahoo 360. None of us had actually used it, but by the end of the meeting Chris had obtained and invite from one of his friends and sent out invites to the rest of us as well.
  • Vincent reports that after having questioned a Google developer at a recruitment event, internal blog usage at Google is surprisingly less common than one might expect.
  • Dave reports that judging from the error messages he has seen, Blogger is likely written in Java (I found this to be somewhat surprising).
  • Martin showed us a slick Firefox extension called GooglePreview that adds thumbnail images of webpages inline with Google search results.
  • We spoke briefly about the Robert Soble, Cory Doctorow autolink argument broadcast on ITConversations. This brought up the "moral" issues of tools such as autolink and greasemonky.
  • Dave reports that Mark Pilgrim has written a handful of new greasemonkey scripts, one of which "hijacks" Amazon.com affiliate links, allowing you to send proceeds to a "worthy charity partner" of your choice.
  • Martin reports that Jon Udell has written a bookmarklet that automatically links isbns for books appearing on webpages to an information lookup for the book at your local library.
  • Martin asked me how my own greasemonkey escapades were progressing, and I gave a quick overview of my experience developing Interchange, a greasemonkey scrip that adds links to view Yahoo Maps searches in Google Maps.
  • Dave reports that blogging has really caught fire at Sun, with Solaris developers mobbing OSNews to the point where OSNews had to push back to allow other viewpoints through.
  • The Wordpress scandal was briefly discussed, and it was also noted that wordpress.org now still shows up as the number 1 search result for "wordpress" on Google. Google must have given Matt Mullenweg a reprieve?
  • I mentioned having started an internal blog on my own server at IBM as an experiment to help me keep track of things I learn, and also help me to communicate information to my teammates. I'm running blosxom, having been attracted to it for it's simplicity.
  • Dave reports that there is a Java version of Blosxom available called Blosjom (which also happens to be his chief competitor to Roller).
  • On the topic of using blogs to help organize one's thoughts and remember things at work, Vince mentioned that he is currently reading a book called Getting Things Done: The Art of Stress-Free Productivity by David Allen, and was thinking about how he could write some software to facilitate the principles highlighted therein.
  • D pointed out that David Allen, himself, already puts out an Outlook plugin to help with this.
  • D also points out that an Emacs PlannerMode is available, that could also help (sounds really cool to me).
  • We discussed tagging a la Gmail and agreed that it is a much more natural way of organizing information than the traditional hierarchy structure.
  • D says that his aggregator, Gregarius now allows him to tag incoming items for alter retrieval
  • We talked about OurMedia.org, a new content management interface to Archive.org, though none of use had much experience with using it
  • We talked about Google's solicitation for home video uploadsfor analysis. Chris proposed that Google likely already has an abundance of commercial and otherwise processed video to work with, and are likely looking to balance out their sample pool with personal video (given that it obviously has a different style from commercial video).
  • Chris mentioned that HP is offering an incredibly interesting video editing research internship, where the idea is to develop software and algorithms for automated editing of video.
  • Speaking of cool internships, we talked briefly about Paul Graham's Summer Founders program, with different opinions on Paul Graham, himself.
  • Vince, talked about his Logitech io pen, a pen that automatically keeps a digital copy of things that you write, for later retreival.
  • Martin wondered whether there was a site that would extract only the photos from Engadget. None of us knew of such a script (even though it sounds trivial to write), however I mentioned LiveJournal Image Theft, a site which extracts the last 200 photos posted to Livejournal (may not be safe for work).

Please feel free to note any omissions or corrections in the comments.

Alternate Perspectives:

We will be meeting again in two weeks, same place, same time: Tuesday April 19th, 6:30pm @ Cafe Cyclo.

Stay tuned for an rsvp link.

In Blogging, Technology and Software

Posted at 10:24 PM | Permanent link

April 04, 2005

Fixing the right alt key for a Debian woody console

Without fail every time I install Linux (my preferred flavor being Debian), I run into the same pitfalls over and over. Every time I end up finding solutions for these...eventually, only to forget them again by the next time I install.

In order to break the cycle, I'm documenting some of my more common problems, along with their solutions here. The first problem I'm going to tackle involves the right alt key.

Early on in a Debian woody install, we select a qwerty map for our keyboard.

However, after our system has been set up, Emacs does not recognize the right alt key as being a meta key when we are using an extended keyboard (PC104+) and a plain old console (sitting at the actual machine, no ssh, no telnet, no X).

The Solution

The solution to this is to remap the the keyboard in the operating system. Looking online, there is plenty of documentation on how to fix this problem under X, but little mention of how to do so when just using a plain console.

Continue reading "Fixing the right alt key for a Debian woody console"

In Technology and Software

Posted at 12:26 AM | Permanent link

March 25, 2005

A lesson in caution on using the <pre> tag for wide-margined text

We have yet to develop a good method for displaying inline code in html documents, and as it turns out this is exactly what bit me with the previously mentioned IE6 problems with displaying this site.

The culprit was my previous entry: A tale of woe on dynamically building the Movable Type Individual Entry Archive template.

In that entry I cited a few snippets of perl code, inline with the rest of the html for the entry. Naturally, I surrounded this code with a <pre> tag, as this is the easiest way to preserve the spacing and indentation of a code snippet.

It just so happened that the pre-formated code that I had included for that particular entry happened to be quite wide - wider than the <div> it was enclosed in.

What happens when <pre> text overruns the boundaries of <div>'s and other enclosing tags that contain it?

As it turns out, the answer depends on the broswer.

In Firefox, the <pre> text simply runs through the boundary of the <div>:

Screenshot of pre overrun

This is ugly, but it does not catastrophically alter your page layout.

Internet Explorer 6 behaves differently, however. Instead of allowing the <pre> text to overrun the <div> as Firefox does, it expands the <div> outwards to contain the <pre> text:

Illustration of IE6 behavior on pre overrun

Unfortunately this can unexpectedly cause elements situated to the right of the enclosing <div> to be crowded out.

In my case, in IE the entire sidebar column of my page was crowded out and pushed all the way down the page, below all of my main page entries.

I've corrected this now by reformatting the <pre> text in the entry so that it isn't quite as wide, but the problem went unnoticed by me for weeks (I don't generally use IE6), and the fix wasn't especially obvious once it was pointed out to me that my page wasn't displaying correctly in IE6.

The moral of the story is to be careful not to place <pre> text on a page that has a high probability of overrunning the normal width of the <div> that contains it. Attempt to reformat <pre> text so that it will not surpass the boundaries of the element that contains it, and just to be safe, give your site a quick check in IE6 if you're using <pre> formated text.

In Technology and Software

Posted at 10:32 PM | Permanent link

March 23, 2005

A critique on the design of joshstaiger.org

As I've been meeting more and more bloggers in person, I've also been becoming more and more self-conscience of the design shortcomings of my site.

Here are some of my own criticisms of joshstaiger.org (in rough order of importance). Feel free to add your own in the comments.

  1. I have no about page explaining who I am, and no prominent photo of myself (this is always the first thing I look for when I happen upon a new blog).
  2. Entries are not categorized, making it difficult for regular readers to find things they may recall reading in the past, and also difficult for new readers to get an idea of what I tend to write about.
  3. I have no site map. Thus, for instance, it would be very difficult to find the most popular service of my site, the Xanga RSS Fixer, by entering through the front page or casual deep link.
  4. A search box only appears on the front page. It should appear on every page.
  5. Visited links do not have a distinct color, flaunting users' expectations of the common web interface.
  6. The calendar on my front page is a waste of space.
  7. The recent entries links on my front page are a waste of space. Readers need only scroll down the page to see recent entries.
  8. The light grey text coloring used in different portions of the site (such as "Posted by") does not have enough contrast with the white background.
  9. Permanent links for entries are currently represented using the time the entry was posted. These should instead be explicitly say "Permanent Link"
  10. The light blue that I'm using for links could be a bit darker to contrast better with a white background as well.
  11. My temporal archive list is getting somewhat long and ungainly. This could be consolidated on a separate page perhaps.
  12. It is not obvious to the casual user what my XML syndication feeds are supposed to be. It would be helpful to take a page from Blogger's book and apply a special stylesheet to feeds that says something to the effect of "This is an Atom formatted XML site feed. It is intended to be viewed in a Newsreader or syndicated to another site.".
  13. My site is not fully accessible.
  14. My photo.net snipits use html that does not validate

I just wanted to say publically that I am very much aware of these flaws. I hope to fix them soon, and will be documenting some of the fixes as I implement them.

UPDATE:

I have created a snapshot of this site's front page, circa March 2005:

/snapshot/march2005/

In Site News, Technology and Software

Posted at 02:24 AM | Permanent link

March 17, 2005

Using c-mode to edit Javascript in Emacs

As part of my foray into the Greasemonkey world, I've been on the lookout for a good environment for editing standalone Javascript files.

Emacs being the One True Editor, you'd think that there would be a decent major emacs mode for editing Javascript, and you'd be wrong.

I tried installing:

http://www.brigadoon.de/peter/javascript-mode.el

Using Emacs 21.3.50.2, I get the following message when trying to switch to javascript-mode:

File mode specification error: (file-error "Cannot open load file" "c-mode")

I tried a few things to fix this, but they only seemed to make things worse.

Just using straight c-mode with Javascript works fairly well, although for some reason c-mode in Emacs 21 out of the box has an irritating indentation offset of only two spaces.

We can fix that up right quick, however.

Add the following to your .emacs file to fix the indentation problem and associate .js files with c-mode:

; Indent c code four spaces

(setq c-basic-offset 4)

; Associate c-mode with the .js extension

(setq auto-mode-alist (append '(("\\.js$" . c-mode)) auto-mode-alist))

In Technology and Software

Posted at 12:14 AM | Permanent link

January 16, 2005

Venting PHP frustration

"By induction, the only programmers in a position to see all the differences in power between the various languages are those who understand the most powerful one. (This is probably what Eric Raymond meant about Lisp making you a better programmer.) You can't trust the opinions of the others, because of the Blub paradox: they're satisfied with whatever language they happen to use, because it dictates the way they think about programs."

-- Paul Graham, Beating the Averages

I'm currently pulling my hair out trying to write a web application in PHP. How do people get anything done in PHP? It doesn't have a toplevel. It doesn't support closures, packaging, method specialization, keyword parameters, or macros (!). I'm not even being strictly facetious here. Over the course of writing this app, at different times I've seen a need for each one of these features and have had to work around the lack of them in a less elegant fashion.

How retarded is it that the + operator doesn't actually concatenate two arrays, but instead does index-value replacement?

The only thing that PHP really offers is the built-in html templating system, but even this gets to be terribly convoluted due to the lack of an easy way to substitute expression values in your template, forcing you to sprinkle <? echo ... ?> tags throughout (which is awkward in the context of html attributes).

I wrote a mid-sized application in PHP around three years ago, and even at that time (as unenlightened as I was), I still remembered being somewhat frustrated by the lack of many full-blown Perl features.

I was hoping that things would have improved somewhat by now, but apparently I was wrong.

Whatever possessed people to to use this language over Perl? How the fuck did it get to be so popular?

I'm tempted to scrap all the code I've written so far and rewrite in Ruby.

In Technology and Software

Posted at 05:32 PM | Permanent link

December 22, 2004

Home for the Holidays with wi-fi

Tomorrow after work, I'll be catching a plane for Cleveland. I'll be in town until January 2nd, using the remainder of my vacation for the year.

Owing to the fact that my parents still haven't come into the 21st century with broadband, I have purchased a one-month subscription to T-Mobile wireless, which services most Starbucks and Borders locations nowadays (except, apparently, the new Southpointe Starbucks where I am typing this in right now). So, I'll be pulling an Adam Curry over the next week and a half.

"I need wi-fi; I need really good solid wi-fi; The wi-fi here is unbelievable. Of course, as I already posted on my blog, y'know, when it comes to me and connectivity...I mean, Jesus Christ, after four weeks of living on a modem, this is almost like, y'know, taking the first toke off of a joint after you haven't smoked for four weeks...which, of course...I can't really...talk about..."

-- Adam Curry, The Daily Sourcecode 12/20/2004

T-Mobile has a reasonable introductory rate of $9.99 for the first month, but I doubt that I'll be sticking with the service much longer than that. Their normal monthly rates are on par with what I'm already paying for regular broadband to my apartment - not to mention that their pay-as-you-go rate is more pricey than a long distance phone call.

With places such as Panera Bread now offering free wi-fi, I've got to imagine that this is going to change sooner rather than later.

As usually happens when I have time off, look for increased blogging activity.

In Technology and Software

Posted at 10:07 PM | Permanent link

December 15, 2004

Contrarian insight on web application design

Philip Greenspun says an internet service lives or dies by the datamodel one designs in an RDBMS, and that how one goes about implementing the individual pages is "intellectually uninteresting and also uninteresting from an engineering point of view":

http://philip.greenspun.com/seia/basics

Paul Graham, on the other hand, thinks that "It is a common mistake to think of Web-based apps as interfaces to databases. Desktop apps aren't just interfaces to databases; why should Web-based apps be any different? The hard part is not where you store the data, but what the software does." Incredibly (!) he claims that at Viaweb, they did not use an RDBMS at all!!

"We didn't use one. We just stored everything in files. The Unix file system is pretty good at not losing your data, especially if you put the files on a Netapp.":

http://www.paulgraham.com/vwfaq.html

This blows my mind.

Given a little thought, I can see the merits of both points of view. I can see how one can gain extra flexibility from shunning the RDBMS model, but at the same time, one gets so much core functionality for free with an RDBMS that it is hard to pass up... I suppose that it depends on the type of web application you are building, the amount of data involved, and how it relates to each other. I'm going to have to mull this over a bit more.

In Technology and Software

Posted at 01:27 AM | Permanent link

November 22, 2004

Some corrections for [the book] ANSI Common Lisp

Below is a letter, I recently wrote to Paul Graham.

Dear Mr. Graham,

I am gradually working my way through your book, ANSI Common Lisp, and I've noticed a few things, which you might like to note in your errata (and for possible future editions). These are noted below.

Appologies for the verbosity of this email. Hope you can find the time to make it all the way though.

I would also like to say that this is a fantastic book, and I have enjoyed reading it immensely, as I have with Hackers and Painters and many of your other essays.

Keep up the good work!

Take care,

Josh Staiger
http://www.joshstaiger.org

~~~~~

1. p. 97. In chapter five, problem four, you ask the reader to rewrite the num-month function located in Figure 5.1 (page 94). Unfortunately the num-month function does not appear in Figure 5.1, but rather in Figure 5.2 (page 96).

This leads to some confusion on whether you would like the num-month function in Figure 5.2 to be rewritten or the month-num function in Figure 5.1 to be rewritten. I assume that you mean month-num from figure 5.1, as it seems to make much more sense to rewrite using a case statement.

2. p. 127. There is a bug in the function buf-flush.

A (buf-reset b) call needs to be added as the first line of the body to output any characters that have already been read with buf-next.

 (defun buf-flush (b str)
   (buf-reset b) ; bug-fix  <------------
   (do ((i (1+ (buf-used b)) (1+ i)))
       ((> i (buf-end b)))
     (princ (bref b i) str)))

For example, without this fix using stream-subst to match the string "ec" on the string "ee" would leave a trailing 'e' in the buffer at the end which would be read by buf-next but would never be outputted with buf-flush.

 > (with-input-from-string (in "ee")
     (stream-subst "ec" "foo" in *standard-output*))
 e
 NIL

3. p. 141. There is a small bug in henley. When we read in a body of text using read-text, no following symbols will be associated with the very last word in the text in the *words* hash (unless it has already appeared previously in the text). This becomes a problem if we try to call random-next on this symbol, as the function will try to randomly pick a (non-existant) following choice.

 > (random-next '|lastsym|)

Yields the error:

 Argument is not a positive integer or a positive float: 0

My quick solution to this was simply to modify random-next to assume the '|.| symbol if we happen to hit the last symbol.

 (defun random-next (prev)
  (let ((choices (gethash prev *words*)))
    (if (null choices)
        '|.|
      (let ((i (random (reduce #'+ choices
                               :key #'cdr))))
        (dolist (pair choices)
          (if (minusp (decf i (cdr pair)))
              (return (car pair))))))))

In Technology and Software

Posted at 07:47 PM | Permanent link

November 17, 2004

The crime of the Mac OS X Software Updates restart dialog

Dear Apple,

Why do you insist on making the baby Jesus cry?

Why, oh why, do you not offer a "Restart Later" button in the dialog that appears after Software Update finishes its installations?

We are offered a choice of "Shut Down" or "Restart", both of which adversely impact all other operations that we happen to be performing with our computer at the time. Not only that, but Software Update runs at periodic intervals by itself in the background, increasing the chance that one *will* be doing something else in other applications at the time that Software Update issues it's edict that it is time to Shut Down or Restart.

Perhaps you would be interested in reading this book that I found. It's by a fellow named Inc. Apple Computer. Sounds like you would get along famously. Although, I'm told that he originally wrote this book in 1993, so perhaps you should attempt to locate him and ask him if there have been any advancements in UI design over the past ten odd years.

Love the PowerBook G4.

Tell Steve I said hi,

Josh

Update 11/18/04:

My desktop background is this photo, taken by Philip Geenspun in Malibu.

In Technology and Software

Posted at 08:03 AM | Permanent link

October 19, 2004

Jeff's visit to MIT

My conversation with Jeff last night from his Boston hotel room:

01:25:18 uncledirtae: oh yeah, GUESS WHAT, I saw Philip Greenspun's dog
01:25:26 joshstaiger: REALLY!!!?
01:25:33 joshstaiger: wow, I'm really jealous now
01:25:34 joshstaiger: Alex?
01:25:40 uncledirtae: yeah, Sean showed me Stallman's office
01:26:24 uncledirtae: and Hal Abelson's office is near Stallman
01:26:40 uncledirtae: Sean was going to introduce me, but Abelson was talking to someone
01:26:49 joshstaiger: damn...
01:26:59 uncledirtae: so we peeked around the corner and Alex was sitting there
01:27:07 uncledirtae: he was talking to Philip Greenspun

Going to school at MIT must be like going to school at...Disneyworld.

In Technology and Software

Posted at 09:19 PM | Permanent link

Podcasting

I first discovered Podcasting about a month back after seeing a link to the iPodder website in an ITConversations RSS feed. There has been a lot of noise about this in the blogging world as of late and for very good reason I think. In my opinion this is going to be *huge*.

I think that one of the most interesting things about Podcasting at the moment is that it *is* such uncharted territory and such rapid leap forward. It's awesome to listen the pioneers experimenting with what they can do with this new medium - both artistically and technologically to make that artistic expression possible. There is a feeling of genuine surprise and excitement that one rarely has the opportunity to witness in life. Just listen to an episode of Adam Curry's Daily Sourcecode or Dave Slusher's Evil Genius Chronicles to see what I mean.

I didn't get online until 1996. I was fourteen and, unfortunately, oblivious enough to the world around me to think that learning HTML was more important than learning how to pickup women...but I imagine that this had to be something like what the web felt like when it was still new.

There is just something about the material that is so refreshing and so down to earth. Where else can one listen to a show where the host gets interrupted by his daughter coming home from school momentarily and doesn't skip a beat, or another by a guy who is recording by speaking into his laptop while waiting for a plane at the airport? or pure hilarity like this?

No commercial pressures to produce content that appeals to the lowest common denominator, no FCC...

Ever since I got my Griffin iTrip, I've barely touched the actual radio. I almost wish I had a longer commute...

In Technology and Software

Posted at 01:07 AM | Permanent link

August 27, 2004

The new Mac

I received my PowerBook on Tuesday. It is...beautiful.

It's been nearly five years since I've used a Mac as my main computer. A lot has changes, and a lot has stayed the same - which is good on both accounts.

Unfortunately, I've been so busy that I've had very little time to play with it, but here are some of my impressions so far:

Firstly, the hardware design is very nice. I would say that from a purely utilitarian standpoint it is about on par with an IBM ThinkPad T40, but, of course much, much sexier.

Over the first few days I went through the panic of suddenly having the keys on my keyboard positioned in the wrong place, no second mouse button, my usual keyboard shortcuts no longer working (or doing funny things), having to specifically quit applications instead of just hitting the little X button. Argh. It's fairly disorienting at first, and I never thought that I would have to readjust myself back to the Mac paradigm (the top menubar with disparate windows, for instance, as opposed to the one monolithic window paradigm for Windows). However, at some point things just click...and now the machine is a pure pleasure to use.

My initial impression is that on average, Mac software is about 25% nicer than corresponding Windows software. This goes for everything from the operating system to little utilities (such as LaunchBar, which totally kicks ass). The machine just feels so much more responsive to me, and not because it's faster (in fact, I've noticed a slight lag here and there), but because the software seems to anticipate what I want to do so much better. It's beautiful to experience such good design. I really like the different perspective. It gives me ideas for things I would like to incorporate into my own work.

On a side note, I think that many lifetime Windows users are unable or unwilling to get past the momentary disorientation I felt. It is quite annoying at first, and if I didn't know any better I would conclude that Macs were terrible as well. Unfortunately they never get to appreciate the other side when things actually click.

I think I can forgive the average person for this. They just want to read their email.

However, I have much more trouble forgiving a software developer for this same fault (and sadly there are still quite a few out there who possess it). In order to do good work, I think that it is key to look at things from a different point of view. That is one of the things that I think is really cool about the Mac. It's different from the operating system, all the way up through the development APIs to the end user applications. It's like a species that got stranded on it's own island back in 1984 and since has evolved its own development culture.

In other words, it's like visiting another country. A lot of people will go to a place like Europe and come back god-blessing America all over the place. While for others...when you visit Europe, it changes you. The latter are the more interesting people to know.

Sorry, the Mac has a tendency to make me get philosophical ;)

In Technology and Software

Posted at 12:43 AM | Permanent link

August 22, 2004

Bitter Java - a book review

I just finished reading Bruce Tate's Bitter Java this weekend. It was *okay*.

Bruce makes a pretty compelling case for the study of antipatterns, and I also think that in aggregate the book provides a pretty good "bird's eye" view of a lot of the problems that one faces when doing server-side Java development.

The book does quite a good job of covering a lot of particularly troublesome Java-related topics. The Model View Controller sections, Java Memory leaks section, the caching section, and even the EJB section were all quite valuable. In each case he starts with a clear problem definition, or antipattern, provides a clear real-world example of an application that falls into the trap of using the antipattern, and then describes step-by-step how to refactor to eliminate the antipattern. When done right, this method of presentation is very effective.

Unfortunately, I think that his discussions of many of the other topics in the book, other than those mentioned above, leave a bit to be desired. In many cases, he does not provide enough contextual detail about the problem or the solution to convey a very good picture of what is going on.

Additionally, perhaps it is only because this was his first book, but Bruce Tate doesn't strike me as a terribly good writer. At certain times the book is a bit repetitive. At others, it is contradictory. For instance, he introduces the round-tripping antipattern multiple times throughout the book - each time treating it as though it were a semi-new topic. Early on he mentions the evils of pre-mature optimization, but then later on emphasizes the importance of considering performance early on in a project - without making a clear distinction as to when, specifically, this applies (a good software developer should be able to figure this out, but it still struck me as slightly annoying). In the code hygiene section, he states that one should almost never handle the raw Exception class, and yet he, himself, does this in almost every code example he presents throughout the book!

Additional small annoyances abound. Why the hell does he put (a rather incoherent, mind you) discussion of XML in the same chapter as database connection pooling. And for the love of god, why does he discuss CamelCase and Java interfaces in a book that should clearly be aimed at the (very least) intermediate Java developer!?

I get the feeling that the book originally began life as a loose collection of essays that the publisher tried to stitch together and pass off as one coherent book...and in some places the seams painfully show.

Still, these are mostly minor annoyances. In the end, I think that the positives of the book (the good sections) still outweigh the negatives, and any software developer worth his salt should be able to separate out the kruft from the cream. If you can do that, then Bitter Java is a fairly good book for getting up to speed on a wide variety of Java problems in a short period of time.

In Technology and Software

Posted at 09:29 PM | Permanent link

July 23, 2003

Bit Torrent!

I would like to give a great big shout-out to Bit Torrent. After three failed tries to download Redhat 9 using both the mirrors and the main site, my Torrent download worked on the very first try!

Please, if you haven't already, get Bit Torrent!

In Technology and Software

Posted at 08:43 AM | Permanent link