Friday, October 17, 2008

Python, Closures, map and filter

Closures are probably one of the greatest tools a dev can have in his toolbox. I used to use them a lot when I did assembly programming where they were called "macros". According to Martin Fowler they were called "Blocks" in Smalltalk. Ruby has them, Lisp is pretty much nothing but closures. They're freaking great. I mean really, really, really freaking great. If you don't use them you should learn how. Like now. Really. Unfortunately, if you're a Java programmer you're pretty much out of luck. I remember seeing a write up about somehow, kinda, sorta making closures work in Java but it seemed like a clusterfuck. But whatever. Just start using python (or maybe jython). They come with the box and they're drop dead easy to use. If you want some examples see this: click me

With closures map() and filter() become nectar of the gods. This is the magic combination:

closure+map|filter|<other-iterator-func>

With this combination all kinds of code can be squished down into near non-existance. I like to think of it as the neutron star of python: compacting code down to miniscule levels. It's not everyday that I come across a case that needs the neutron star pattern but when I do the day always seems a little brighter.

Thursday, October 16, 2008

Yearning to Game

I've played a lot (A LOT) of games in my life. Board games, card games, video arcade, consoles, rpgs, mmos, you name it. There are two that stand out in my mind: Ultima Online and Everquest.

I started playing Ultima Online in summer of 1997. When I first heard about UO I poo-pooed it. But as it got closer to release I started reading more about it and it sounded just incredible. I really wanted to be in the beta but the due date for sign ups had long past. So one day I'm telling my buddy Jim Cullen about it and he says, "oh yeah, I signed you up for the beta like a year ago." Huh?! Surer than hell when beta started I got a shiney CD in the mail. Holy shit! I could have kissed that guy.

My first experience with UO was a lesson in patience. The servers would crash constantly (like every hour or less) and the lag would often be horrendous. But let me tell you -- I did not give a shit. I LOVED IT!! I created a newbie and found myself on the docks in Vesper. I was in heaven. I proceeded to waste the entire summer of 1997 exploring Britannia. Release came at the end of September and for roughly 2 years I canvased the land learning all of the ins-and-outs of the game, amassing a fortune, PKing the poor souls who crossed my path and generally having a blast. I had some great friends (CoconutMonkey, Desmodus/Batticus, Uber and host of others I can't remember). If you're reading this and want to know if you ran into me I played on Atlantic and had the following characters: Sunchaser, Kafka (PK), Lia. If I PKed you, well, sorry. But rest assured I took a few hits myself.

I've gone back to UO a few times since I left. Unfortunately, I sold my user account so I could never revist my old characters. But I did enjoy once again running from Vesper to Minoc to Britain and down to Trinsic. The music still haunts me. Last time I logged in, perhaps a year ago, I was shocked to see the game was still laggy. 10 years and still they hadn't fixed the lag. That's the software biz for you, I guess.

Everquest was my second mmo and real love. I had actually been in the EQ beta but I wasn't sure it was for me. I started working at HomeAccount in summer 1999 and a friend of mine, Curtis, had been playing since release. I would often go over to his desk and see what new places he had visted and admire the great trinkets he had picked up along the way. So one night I called my friend Deon and convinced him to ride to the store with me to pickup the game. The next day or so my friend Kevin also bought the game and the three of us spent about 3 months adventuring all over the place. At around level 30 my friend Deon bid us farewell but Kevin and I and my friend Jim (living in Detroit at the time) kept at it until we reached the "end game" content.

If you've only played WoW but never EQ then you can't really appreciate the level of dedication that goes into getting a character from 1 to 50 during the early years of EQ. We're not talking a little work here. We're talking a freaking fulltime job. You could have easily spent 8 hours per day, everyday working on your character and would still take you the better part of a year to reach the end game. But once you got there it was a different game. Everyone had gone through the same shit you had gone through. There were always the uber-guild clicks that exluded everyone (I guess that was the thing to do) but most people appreciated their fellow masochists and gladly welcomed them to a party in Lower Guk, Sol B or the occassional Vox or Naggy raid.

I guess I played EQ off and on until WoW was released. So roughly August 1999 to November 2004. I still think about how much I enjoyed my time in EQ. I think I actually hated-loved every minute. I so wanted to rocket up to uber but I would spend a week (or more) learning every nook and cranny of a zone. I guess what I did in EQ is what I did in UO: enjoyed the journey. WoW, bah, "let's just level already".

So there is all of that. Now I'm tinkering around with Project EQ. It's basically old school EQ using the EQemu emulator. I'm curious to see how long I last before I toss up my hands in frustration.

Wednesday, October 15, 2008

Twitter, FriendFeed and Streams

I like Twitter. The signal-to-noise ratio can be low sometimes but there are work arounds for that (eg filter tweets through friendfeed). More people need to use it and the people that do use it need to do so more often -- well, except for @timoreilly who i'm convinced is actually a front for a team of overworked researchers.

FriendFeed is nice too. I like to think of it as Twitter on steroids. I'm in the process of reshaping the way data flows into my feeds there. For example, I want lots of data from devs. Amitp is a fantastic dev and any insight I can gain into the way he views the world invariably helps me. There are other devs I follow there for similar reasons. One problem I do see is that I may have a problem filtering out enough information. For example, if someone I'm following comments on (or likes) someone else's post then I get the post and (maybe) their comment. Often the post is not something I would be interested in. It would be nice if I could somehow massage my feeds so that this extraneous data is invisible. It could be that FriendFeed has facilities for this already and I haven't found them. I'll look into that.

The emerging pattern here is that more and more I find myself in the middle of streams of data. FriendFeed and Twitter, yes, but also Reddit, Slashdot, Facebook, all of the feeds running into Google Reader, Blue Yak message boards, etc. These things can suck up the better part of the afternoon during which time I'm doing no dev or dev research. I'm going to need to 1) schedule times for stream reading and 2) better manage/filter my streams. A social rating/ranking system would be nice. "Here is a stream of data rated for you." Is that what FriendFeed is up to? Probably.

Wednesday, October 8, 2008

Social Graphs Gone Wild

Social graphs have been around for a while. IM buddies, email lists and address books (old school black books) are forms of social graphs. While the idea is not new only recently have Myspace and Facebook brought the social graph into the larger public consciousness (Friendster and a few others were around even before them). Today there are many apps that try to tap into the "power" of the social graph: Twitter, FriendFeed, Orkut, etc. My goal is to figure out the best combination of these apps to "improve" my life. It's the entire thing isn't a net plus than I intend to dump. My current setup:

Facebook (profile pretty well filled out, modest number of friends added)
Twitter (integrated into Facebook now so will update more often)
FriendFeed (pulling in Flickr, Twitter, Delicious and YouTube)

Not yet integrated:
Blue Yak (group and message board)
AIM/ICQ
Email (this one seems iffy)

I'm sure I'm missing a few. I'll cogitate on this and write up my analysis.

Sunday, October 5, 2008

Visual TODO: Organize the Garage

My first visual todo task is to organize the garage. I have family coming for Thanksgiving dinner and I would like for them to be able to navigate the garage without fear of getting lost (it's pretty bad in there). Images coming soon.

(20 minutes later) Images have arrived:

Garage Panorama IMG_0998 IMG_0997

It's a mess in there. Let's see how this goes.

And 11 hours later... I didn't get to spend as much time in the garage as I would like but I managed to square away about 30-40% of the task. Here is the before and after:

Garage Before and After

A few things I need to consider:
- hooks for hanging the kayaks and bikes
- a bit more wire shelving near the freezer

The Visual TODO

Note: This is little more than a brain dump at the moment. I have mulled it over a bit so it's beyond the "brainstorm" phase but it is far from a polished idea. I think it's a great idea so I want to post it up (even as raw as it is) so that I begin testing it.

I'm going to try a new strategy designed to make me more productive (especially with regard to house chores). I'm going to call it "visual todo". The idea is that I will integrate my camera into my todo list. First I will take "before" photos of whatever it is that I'm placing on my todo list, begin work on the task and take "after" photos once complete. If I'm unable to complete the task in a short period of time then I will take "status" photos instead. I also intend to ball up the entire process as a dumpstuffhere blog post so that I can better track what I am doing and (just as importantly) what I should doing. Let's see how it goes.