Tuesday 28 October 2008

One, Two, cha-cha-cha

We just got back from our first dance class: Cha-Cha and Waltz. It was lots of fun, ours shoes don't look too stepped on, and we definitely weren't the worst couple in the class. What more could you ask for?

I've been wanting to take ballroom lessons for years (at least since my first friend got married). We just need to practice enough to let muscle memory kick in; I think there's some worry from my better half that I'll be scheduling nightly drills so I'll have to control myself.

Sunday 26 October 2008

Notebook Shopping

So I'm in the market for a new laptop. This kind of annoys me because I don't actually want a laptop. Expensive, barely upgradeable, tiny keyboards, and (worst of the all) the temptation to sit awkwardly in front of the television with the thing precariously balanced on your knee, cooking and radiating your organs and destroying your body through poor ergonomics. But I'm traveling a fair bit, doing consulting, and there are occasions where a laptop is, if not essential, at least very very useful.

So here I am looking around at the options and, while I've been telling friends and colleagues for years to buy Mac laptops if they can afford them, I now find myself unsure. I was intending to get a MacBook Pro in September in order to get the free iPod Touch but decided to wait for the new Macs to be announced. I was underwhelmed: there's really not much new there despite the heavy sales pitch and I don't like the new look. Even with the education discount, the cheapest MacBook Pro would cost me over $2400 after tax.

The problem is that I really like Mac OS X and I really like that the freeware people write for it actually looks good (unlike for Linux or Windows, at least in general). I discovered over the last 9 months that, for the things I do, I can manage fine with Windows. And as a major plus, I don't spend hours endlessly "tweaking" my system like I do with Linux. Sure, every time Apple releases a software update, Mac owners everywhere cower in fear wondering what will be broken, but I'm still happier in OS X than in any other operating system.

I'm looking around at Dells and Compaqs and I can get a laptop that would probably serve my needs just fine for $700 or so plus tax. That makes the MacBook Pro something like three times as expensive! If Apple would sell me a copy of OS X to run on a PC, I would buy it in a flash but $1500 is a hefty tax to pay for it. Even refurbished old-model MacBook Pros are selling for $1449 plus tax but that's still double.

Now I just read Jeff Atwood's post about netbooks. Netbooks are an emerging category of small ultra-portable computers basically designed for running a web browser, checking email, and maybe doing some word processing. Their specs seem to be in the range of 1.5GHz processor, 1GB RAM, 160GB hard drive, and a 7"-9" screen. Aside from the screen, that's better than the computer I'm writing this post on. And the price? Under $500. Jeff says:
They still have a way to go, of course, but the $299 or $199 no-compromises, go-anywhere, zero-monthly-contract-fees web browser in the palm of your hand -- with the requisite 9" or larger screen -- is almost upon us. I guess I hadn't been paying enough attention, because that's a shocker to me.
And that's exactly how I feel. I've heard people talking about Netbooks for a while but hadn't really realized how far they'd come. I'm still considering this new laptop my primary machine so I can't handle the small screen but if I had a desktop computer I would seriously consider getting one of these (with an external keyboard) to cover those "useful-to-have-a-laptop" situations.

The social pressure to display an Apple logo is intense (do you have any idea what percentage of people at computer conferences have Macs?) and I would probably spend $200 or $300 more for the privelege. If I can find something with a comparably beautiful screen, though, I think I may have to make do without the metallic finish.


Monday 13 October 2008

Framing

After reading this article, I ordered a copy of George Lakoff's Don't Think of an Elephant. The book examines the use of language to "frame" arguments to your advantage. Take, for example, the phrase "tax relief". If there is relief to be had, tax is obviously a burden. How can anybody expect to succeed in arguing against something called "tax relief"? If you enter into the debate without reframing the issue, you lose.

Lakoff draws his examples largely from the context of the US political system and he makes no effort to conceal his Democratic leanings. Certainly not unbiased, the book is in fact a call to arms for Democrats, who Lakoff claims are decades behind Republicans in their understanding of these issues. All this means I take his words with a grain of salt.

Nonetheless, the discussion of mental framing and its effects fits with my observations of the world and seems broadly relevant. His analysis of the progressive and conservative movements themselves and their origins was also intriguing: I have no idea how accurate these theories are but I was able to look at conservative policy in a new light.

I was annoyed throughout by his repetition, both within and between chapters. In a few cases, I discovered several-paragraph-long sections that were taken almost verbatim from an earlier chapter. I discovered part way through that the book is a collection of essays and I have the impression they were thrown together quickly to get the book published in time for the last US election. This is partly to blame for the repetition but I think Lakoff is also overapplying one of his own messages: that mental frames are adopted through repetition.

That said, the book is short (100-and-some pages), cheap ($8 on Amazon), interesting, and a quick read so I recommend picking up a copy even if you only make it through the first two chapters.

Don't toss that margarine!

I grew up with butter. As a result, margarine just always seemed weird, even before the trans-fat scare (which, apparently, is no longer an issue with margarine).

Well, as of a couple of weeks ago, I have a reason to keep margarine in my fridge again: it takes tree sap out of clothing! Really. Rub margarine thoroughly into the clothing and use dish detergent to wash it out (no need to let it sit). Then run the clothes through the washing machine and you should have nothing but a pine-fresh scent remaining. It worked for me.

Friday 10 October 2008

Graph Theory

I'm not sure what happened. I don't remember finding graph theory particularly interesting in university but over the past month I've had two occasions of simple pleasure while figuring out (pretty basic) directed graph algorithms.

The first was at our last Seaside sprint, where Lukas and I were working out how to modify his Package Dependency tool to mark cycles on Seaside 2.9's dependency graph in red, so we could immediately spot problems. It's not like there aren't already algorithms for this but it was fun just trying to work one out for ourselves.

The other was this Tuesday. I woke up wondering whether I couldn't make the graph a little easier to look at by removing direct edges when we have another indirect path to the same node. In other words, if package A depends on B and package B depends on C, we could omit a dependency from package A to package C because that dependency is already implied through transitivity anyway. I pictured this as the opposite of a Transitive Closure.

It turns out that this operation is called a Transitive Reduction and there are algorithms for it but they don't seem to be very well documented online. I ended up just working something out myself using depth-first searching and path-length tracking to prune shorter paths to objects. I don't know if there's a faster way but it doesn't really need to be that fast in this context anyway. I currently abort if the graph is cyclic but I'm pretty sure you could do something like pick an arbitrary root for the cycle, treat everything within the cycle as being distance zero from each other, and you would get a reasonable (albeit non-deterministic) answer. In our case, we don't want cycles in our graph so, realistically, you would fix the cycle and rerun the dependency checker anyway. Here's the result.

This got me thinking... is there a good implementation of graph theory algorithms in Smalltalk? I would love to be able to create a Graph of my model objects (maybe implement #edges on each one or something) and then call: "graph isCyclic", "graph transitiveReduction", or "graph topologicalSortFrom: aNode". So many things can map to directed graphs and, if you could work out domain-specific solutions by really easily layering generic graphing algorithms, that would be really cool.

Sometimes solving simple problems with definable right answers is so satisfying.

Gartner on Seaside

Well... praise for Seaside from a Gartner analyst:
If you are BIG fan of dynamics languages (closures, meta programming, and all that cool stuff) then consider giving Smalltalk a look. You might like what you see. Its like Ruby but with bigger muscles. You think Rails is cool? Check out seaside.
His general comments about Smalltalk are in line with Gartner's changing position but the specific reference to Seaside adds another touch of legitimacy when selling a Seaside project to those who hold the purse strings. Very nice.

Saturday 4 October 2008

Vancouver Olympic Tickets on Sale

For those who haven't heard, tickets for Vancouver 2010 are on sale to Canadian residents.

For Round 1, you have until November 7 to put in a request for tickets. After that, events with too much demand will have a draw to determine who gets tickets.