Archive for the 'geek' Category

Optimus Prime Loses His Lips

Posted by mikedaum on June 16th, 2007

 Optimus Poster

Just saw a Transformers  story on digg.   Following the link I was treated to a quite nice poster for the upcoming movie.  But that’s not really important.  What’s important, and clear from the image on the poster (also above, is that Optimus looks cool.  And by cool, I mean that he has no lips.  Think giant robot that transforms into an ass-kicking 18-wheeler, rather than “kinda like a parrot”.

LOLcademia’s Ivory Tower

Posted by mikedaum on May 10th, 2007

LOLcat

I loves me my LOLcats, and those who know me know I loves me the austere halls of learning as well. So you can imagine my glee when I discovered that they are being given the serious treatment which they deserve! The envelope is pushed yet again.

Digg revolt — and victory?

Posted by mikedaum on May 2nd, 2007

In a direct response to the censorship I previously wrote about, users mounted an incredible attack on Digg last night. They relentlessly posted the numbers on Digg in as many ways as possible. Meanwhile, Digg responded by nuking the stories and banning the users as fast as it could. But it was not fast enough. At the height of the attack, all stories on the Digg front page contained the numbers. Then, at 9pm, Digg’s Kevin Rose capitulated and agreed to stop fighting the posts and end the censorship. Yay.

A good description of these events was posted today on Boing Boing.

Update: BBC is actually running this story on its front page!  Nice to see that the MSM is clueing in to this issue’s broad relevance.

More Python Excitement

Posted by mikedaum on April 12th, 2007

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
True
>>> c = a[:]
>>> a == c
True

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
False
>>> a == a
True

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

Posted by mikedaum on April 11th, 2007

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.

Various programming language notes

Posted by mikedaum on March 25th, 2007

So for my entire time in industry, the issue of whether a particular language was better than any other lay for the most part dormant within me. Every product had already made its decisions and every problem seemed to indicate a particular solution.

Or something.

At any rate it’s been a while since I picked up a new language, or even thought in terms of the relative merits of the ones I already new.

But now that I’m safely inside of the ivory tower, these kind of rumblings are arumblin’ once again, and I find myself learning not one but two languages.

The first of these is Python, which I figured I’d learn because it’s the foundation of scons, the build system I use. Plus I need it for Software Carpentry, a course I’m taking. So what could go wrong. Well, I mean, let’s start with:

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

Yucky, no? Now the Pythonistas will tell me that I should have used

>>>b = a[:]

To get the deep copy I wanted. Clear as mud, boys. But if I play your game, then why don’t you tell me about:

>>> a = [1]
>>> a[1:1] = [2,3,4,5]
>>> print a
[1, 2, 3, 4, 5]

Now were you gonna tell me that the semantics of the ‘:’ slicing operator depend on whether they’re being applied in an lvalue or rvalue context? No, I guess not. In fact, my best guess is you haven’t really thought about it that much. Then again, how much do you really expect one guy in his basement (sorry…Google’s basement) to be able to do? It’s not like there’s an ANSI standard or committee for Python. Funny, that.