Utterances of a Zimboe

Programming the Internet.

Archive for October 2007

Pattern Matching

with one comment

Hm, I’m kind of starting to notice a repeating pattern in writing Scala code. It’s a very simple pattern: after the size of a source file reaches some notable size (like 100 lines or so, corresponding to some 500 lines of Java — or 5000, while at it…) I’m spending more time admiring the existing code than actually writing more of it. :) (… just being bluntly honest.) (Certainly, this has never happened with Java, in case you were thinking.) But, I’m still living the initial crush, so I must beg your forgiveness for my utter narcissism

Plus, beer & listening to Antony and the Johnsons may have something to do with this. Life’s good at times.

(And hey, despite the slacking, I’m still 250% more productive compared to Java; although, that figure is probably something like 1k due to increased happiness. (Non-leaky) Abstractions rule.)

I am very happy
So please hit me
I am very very happy
So come on hurt me

I’ll grow back like a Starfish
I’ll grow back like a Starfish
I’ll grow back like a Starfish
I’ll grow back like a Starfish

— in “Cripple and the Starfish

Written by Janne Savukoski

October 31, 2007 at 8:01 pm

Posted in Programming

XO link-local

leave a comment »

Peter notes in his presentation Jabber, the Real-Time Internet, and You [via] that the XO-1 (OLPC) uses XMPP for link-local messaging. I could of course state something like way cool!, but that would only implicate that it was something unexpected, which it definitely isn’t. Reasonable options are getting slim, fortunately! :)

Written by Janne Savukoski

October 18, 2007 at 11:46 pm

Posted in Internet

Unstable identifier

leave a comment »

In case you had missed this teeny bit of Scala spec [v2.6, 8.1.4 Stable Identifier Patterns]:

Example 8.1.2 Consider the following function definition:

def f(x: Int, y: Int) = x match {
case y => ...
}

Here, y is a variable pattern, which matches any value. If we wanted to turn the pattern into a stable identifier pattern, this can be achieved as follows:

def f(x: Int, y: Int) = x match {
case ‘y‘ => ...
}

Now, the pattern matches the y parameter of the enclosing function f. That is, the match succeeds only if the x argument and the y argument of f are equal.

And, a little earlier:

A variable pattern x is a simple identifier which starts with a lower case letter.

I was trying to match a type with a lowercase name and it took me a moment to figure out why it didn’t work.. :)

Btw., I don’t like this syntax-by-convention a bit, and it was a major surprise to bump into such here (with Scala, that is). I guess I need to question this at the forum.

Update (a better look): Ok, backquoting an id is an established syntax for denoting a stable identifier. Oh so novice for not knowing. But still, “identifier which starts with a lower case letter”.

Tags:

Written by Janne Savukoski

October 17, 2007 at 12:38 am

Posted in Programming

Exit strategy

with one comment

If you want to get acquired by Google, use python. :)

Written by Janne Savukoski

October 13, 2007 at 12:51 am

Posted in Technology

My Musical Taste

with one comment

Well, less open than age average, but at least more open than finnish average, 103 vs. 98 vs. 93…

Written by Janne Savukoski

October 11, 2007 at 12:22 am

Posted in Diary

Joined Jaiku

with 2 comments

Eventually. Contacts welcome.

The IM interface is the killerest, thanks guys. It feels like the way Jaiku should be used, 140 char input really doesn’t need a web page.

Update 10/09: And at the very last time: Jaiku got bought by Google, and they’re invite-only currently.

Congratulations, guys! That’s awesome!

Written by Janne Savukoski

October 7, 2007 at 5:21 pm

Posted in Diary, Internet

Facebook the spam attracter

leave a comment »

Duh! The morons of stalkbook printed out my Jabber address in plain text, which naturally is the same as my personal email address. (And my phone number, if I just managed to collect myself and configure Asterisk; PBXes didn’t let you use your own domain last time I checked.)

stalkbook n00bsters

(Fixed it already.)

ps. spammers would be unbelievably stupid not to use some very simple OCR to read addresses out of those pics…

Written by Janne Savukoski

October 6, 2007 at 6:53 pm

Posted in Internet