Michael Daum

Toronto Car vs. Bike
May 9, 2007, 12:28 pm
Filed under: gruntle, toronto

This could have been me…any day of the week. ‘Nuff said.

read more | digg story


Debt Slavery For Kids
May 8, 2007, 9:58 am
Filed under: gruntle, kids

Every time my bank offers me “cheques” to write against my Visa card I feel my blood pressure start to climb. So you can imagine how much I enjoyed hearing about the new Visa branded version of the game of “Life”. I used to play the original game when I was a kid, and as I recall, it was questionable even then. I suppose it would be impossible to prevent the game from validating certain life decisions and knocking others. But it was at least fun. The new version sounds less fun. In keeping with its backing from Visa, the new version rewards the children for acquiring credit card debt. No, I’m not kidding.

More Python Excitement
April 12, 2007, 8:53 pm
Filed under: geek, gruntle

Today’s fun was trying to figure out what the ‘==’ operator does in Python…and whether it’s in fact being used to implement the ‘in’ operator (i.e. if a in [1,2,3,4]). Seems like good stuff to know, but go try and find docs.

So we started with

>>> a = range(5)
>>> a
[0, 1, 2, 3, 4]
>>> b = [a,a,a,a]
>>> b
[[0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4]]
>>> c = a
>>> a == c
>>> c = a[:]
>>> a == c

Which seems like we’re checking for value equality. But wait…

>>> class MyInt:
... def __init__(self, i):
... self.i = i
>>> a = MyInt(5)
>>> a

>>> b = MyInt(5)
>>> b

>>> a == b
>>> a == a

How odd. When I made my own class, it used pointer equality to implement ‘==’. I should mention here that I verified that I can define MyInt.__eq__(self,other) to do the right ( return(self.i == other.i) ) thing. But the default checks pointers.

So I thought about it, and no matter how I slice it, the pointer equality check is wrong behaviour, which is to say that it is not what I want in the majority of cases. The C++ compiler also generates the ‘==’ operator if you don’t define it, but there the default is the sensible answer…member by member equality over all member variables. So why did the Guido in the Basement make this choice?

Well, in python I can add and delete instance attributes (or whatever made up terminology the pythonistas are using today) willy nilly. So it’s impossible for the runtime to deliver any sensible == operator based on the attributes, unless I explicitly tell it which ones to use by defining the operator myself. Guido was backed into a corner by his own free and easy, batteries included lifestyle. So he did what any sensible benevolent dictator would — he punted, and let me pay the debugging price once again.

Why I don’t like Dell
April 11, 2007, 11:45 am
Filed under: geek, gruntle

So my laptop is a Dell XPS M170.  It’s not my favorite thing, but it gets the job done.  Gets very hot though, and kind of exudes a certain cheapness which you wouldn’t expect from something which cost so much money.

One problem with the box is that the battery has been recalled as part of the kind of giant program which Dell would only engage in if people’s laptops were actually exploding; which they were.  I thought it would be a good idea to participate, so I ordered my new battery on the web like a good customer should.

Soon enough, a battery came to my house.  The address on the box even said it was for my house.  The name it was sent to was not mine though, and the battery did not fit in my laptop.

That was last August.

I admit that I should maybe have been more proactive.  Proactive in this case means sitting in the  help center down the hall  waiting on hold because my office doesn’t have a phone (‘nother story).  Didn’t really seem like fun.

Anyway, the battery subsequently died.  Really dead.  When the plug falls out of the computer it turns off like a light bulb.  Data loss often ensues.  Bad.  Worse is that the plug is actualy designed to fall out.  Good design — probably keeps lots of laptops on tables which would have otherwise been on the floor after someone trips on the power cord.

So today I was fed up, and figured I’d do the phone/help center/endless hold thing and try to get it sorted out.  My first call was to the recall people who noted thatthe stutus of my request was listed as “processing”.  Well that was good to know.  I also obtained the “request number” for my new battery.  Also good to know.  Finally, the man told me he’d be sure to expedite the request so that the battery would “get out the door”.

I hate to say it, but none of it seemed all that promising, so I thought I’d give the express service people a whirl — seeing as I’m paying for the express service.

One thing about the express service people is that that they take forever to answer the phone.  The battery people are much faster, but weren’t helpful.  So I went ahead and spend 90 minutes on hold scribbling in a notebook down the hall.  I talked to a gentleman who was able to look up my recall account.  I told him that the battery was now dead, and suggested that he put in a service request for a new battery, bypassing the recall madness.  He complied by putting me on hold for another 10 minutes.  Then he came back with the news that Dell’s policy is not to provide any service requests on recalled batteries.  He pointed me to a web page where I could follow the status of my recall request.  I mentioned that this tracking page didn’t work for me before, but he assured me that now that the tracking was straightened out everything would be fine.  He left me with the advice — “Just keep checking that page, and we’ll get the battery to you”

Downtrodden I walked back to my desk.  First thing, checked the page.  Still didn’t work.  Still no battery.  Try again in another 6 months.