ohmygoodnessihatejavascript

February 24, 2009 at 09:13 PM | Uncategorized | View Comments

Ug.

>>> x = new Object();
>>> x["a"] = 42;
>>> "a" in x
true
>>> x["a"]
42
>>>

Ok, good and sane so far...

>>> y = new Object();
>>> x[y] = 42
>>> y in x
true
>>> x[y]
42
>>>

Alright, that's still pretty sane...

>>> y.name = 'Joe';
>>> y.toString = function () { return this.name; };
>>> x[y] = 42
>>> y in x
true
>>> y.name = 'Bob'
>>> y in x
false

Wait... WHAT?!

Yes, you have it folks... Javascript can't actually hash objects into dictionaries -- it uses their toString function. Pretty unique and immutable, 'eh?

>>> y.name = 'Bob'
>>> y.toString = function () { return this.name; };
>>> x[y] = 42
>>> x['Bob'] = 16
>>> x[y]
16

Ug. Javascript loses. Hard :-(

Permalink + Comments

Seven Things

February 16, 2009 at 12:28 AM | Uncategorized | View Comments

Seven Things You Probably Didn't Know About Me

Well, Andrew has finally convinced me to start using Twitter, so I guess the next logical step is to get on with being part on an Internet Meme!

So, seven things you may or may not know about me:

  1. I have a habit of zero-indexing my lists (although it's not my über-programmer brain coming out... Mostly I do it to annoy the unenlightened)
  2. I have been typing Dvorak for almost two years now (although I have yet to be convinced that it is *really* as fast as the stacked studies make it out to be... Maybe I'll give Colemak a try and REALLY confuse people!)
  3. I love helicopters (I got a mini remote controlled one for Christmas and I play with it almost every day)
  4. My oldest memory involving a computer is watching my dad make DOS count to 100 -- it was amazing (my second oldest memory involves playing a game where I had to help Daffy Duck organize a party for Mickey...)
  5. I first learned to program using QBASIC an old 386 sitting below a table in my grade six classroom (pretty soon I'd "fixed" the included snake game to give you 9999 lives) (actually, this was also my first experience with software privacy: I asked my teacher for a floppy disk so I could bring the game home, but she wouldn't give me one... It wasn't until recently that I figured out why)
  6. I love meat, but I prefer to cook veggies (maybe they are harder to get wrong?)
  7. I took gymnastics for almost a year when I was 14 or 15 (but I stopped when I realized that everyone else was in it for the competitions -- I couldn't care less about them)

And, hhmm... Friends with blogs...

Permalink + Comments

Apple Migration Assistant: Thanks for the fonts!

February 14, 2009 at 06:23 PM | Uncategorized | View Comments

It turns out that Apple's Migration Assistant ALSO breaks fonts!

After migrating, Hex Fiend started crashing on launch... And when I downloaded the source and ran it through gdb, I noticed it was crashing because it couldn't load a font.

So I downloaded the font again and double-clicked it to install it... But, nope -- Font Book started crashing too! Hurra!

Even the font selection dialog (apple-t) was crashing! Hurra for error checking!

Anyway, it turns out that the culprit lay in ~/Library/FontCollections -- all my old font collections, which (for whatever reason) make my new laptop very unhappy.

After cleaning out those, though, everything seems to be happy... For now...

Permalink + Comments

Thanks Apple Migration!

February 12, 2009 at 03:42 PM | Uncategorized | View Comments

The situation: I've just bought a new computer. Sweet. I want to migrate all the "stuff" from my other computer. Cool. They even have a tool for that!

But... Crap. If you've already got an account on the new machine, you can't migrate an account with the same name from the old machine (because, hey, who uses the same name on two machines?).

Ok, re-install, try again...

But... Crap. Can't mount my encrypted backup from the install environment. Ok, create another account with a new name, migrate, trash new account, use old account.

And everything is happy.

Except... Not quite. Apparently not only does it migrate my home directory, but everything! Yea, all those old, broken, Power-PC only libraries? Yup, here to muck up my new machine :-(

Ug.

Apple migration assistant, you suck :-(

Permalink + Comments

Fix Apple's no-good-very-bad Trackpad Acceleration

February 12, 2009 at 09:22 AM | Uncategorized | View Comments

Ug, Apple doesn't quite seem to be able to get it right with their touch pads.

Alright, I feel a rant coming on, so I'll get to the point, then rant.

iMouseFix fixes Apple mouse acceleration.

Ok, that's it. Now for the rant.

If you've ever used an Apple computer, you've doubtless noticed the brain dead mouse acceleration model. And it's even worse when you're using a laptop. I frequently need to two or three times before I can successfully click text.

When I was on my (beautiful, lovely, wonderful) 12" PowerBook, I used a great little piece of software called SideTrack to give me side scrolling, right clicking and everything else I wanted.

But now that I'm on a very mediocre 13" MacBook, I have to live with crappy Apple drivers, silly two-finger scrolling (which can't do continuous scrolling) and the aforementioned acceleration issues.

Oh well... I've got the accelleration stuff (mostly) fixed now... Maybe I'll figure out how to fix the scrolling at some point two...

PS: I wonder if Fitt's Law takes acceleration into account?

Permalink + Comments