Archive for August, 2007

Some bizzare dropdown firefox rendering

August 9, 2007

So I am playing around with the Comment creation system in Online Marking Tool, the weeks are winding down, but if theres one thing I want to push personally, is to make the comment creation system a bit simplier; since beside the nifty UI changes, speeding up the system. I feel that pushing back the File Body had to be done, but that also meant not touching the comment creation system which most of the TA’s werent as happy about. So what am I going to do? I’m going to add a dropdown box and adding a file creation box.

I’m still (even after 3 months ish) consider myself an expert with HTML; but I do say I’m comfortable enough to augument things. So when I was adding a dropdown box, I forgot to enclose it within a form. Needless to say, it gave me some bizzare rendering with firefox.

picture-1.png

All seems fine, it displays properly.. but If I were to select any item with a length of greater than the first element…

picture-2.png

It gets cut off.. some of the options would show up as a blank string. Now, I’m scratching my head wondering.. what in the world?! I popped the same thing into Opera and surprise, it works. I didn’t try Safari since the current version of TurboGears I’m using has some unicode issues that causes it not to render properly (the newer TurboGears fixes this, but messes up with some of the Alchemy behavior and fails our tests because of it). I guess I’m lucky it didn’t take me more than 20 minutes to figure this one out, or else I’d be scratching my head for so long, hair would start falling off.

copying unicode files?!

August 5, 2007

So i thought I had it all planned out with the copying of my iTunes Migration Tool, I was going to use the built-in library shutil and they have a pretty nifty copy command. then I tried using it… couldn’t find my unicode files… I’m stumped, how the heck am I suppose to copy these files over? copyfile only takes a string, not unicode >.<

iTunes parsing and Unicode characters

August 5, 2007

Ok, so this maybe not work related; but something I’ve had in mind for a while.

My situation is, I’m going to pick up an iMac as soon as Steve Jobs annonce the new update to the already 331+ days old current iMac (only apple can get away with selling almost 1 year old hardware for the same price as when it first came out). I’m migrating from Windows to OS X and really want to keep my copy of iTunes (50 gb of music and junk, and all the work I’ve placed into organizing it); Luckily for me, iTunes is managed by an XML file. Sure.. I could do a search and replace on the xml file and call it a day, but what fun would that be?

So I’m writing as a iTunes xml parser, I figure it wouldn’t be very hard at all, seeing as I’ve done a ton of xml parsing and testing for Online Marking Tool already.

PyXML
for OLM, we used a package called PyXML to handle our XML parsing, so thats what I did, used PyXML and  try parsing it through that route… unfortunately for me, I didn’t realized that PyXML is not being updated anymore, and worse of all,  its SLOOOOW….. I guess for OLM, it doesn’t matter as much as we don’t really handle really large XML files (My iTunes Library file is 4 mb btw). Parsing my iTunes library took an amazing 6 minutes, and the python thread took up over 1 gb of ram to do it… thats pretty dam inefficient.

I got about 3 hours of playing around and I realized, I better figure out a way to setup SVN on my macbook or else I’m going to be hating myself later on (seeing as version control saved my butt many times when working with OLM).

I stumbled upon this: http://www.systhread.net/texts/200607subver.php

Which was a very useful guide to helping me work my way around setting up my SVN repository, 10 minutes later, version 1 of ‘iTunes Migration Tool’ has been created!

So it was lost, PyXML route lead me to a dead end, but I’m not one to give u easily, so I searched up another library. Python has a built in python xml library which is much… MUCH better I found out. parsing my macbook’s file took 4 seconds, much happier.

I also ran into another issue, changing the paths of the xml file, most of my tracks are in chinese. Lucky for me, the python library already does things in Unicode, all i had to do, was find out what encoding OS X uses to read chinese characters. The answer is UTF-16.

So now, I think i’m already done, just need to write the part of the code that will copy the files over to my external hard drive :), I’ll probably touch up and finish up on it and post it somewhere sometime 🙂

Tony