Sunday, March 30, 2008

It's all YOUR fault Mr. Martin!!!


IMG_0950.JPG, originally uploaded by thecat16.

So I managed to get a copy of the NNWKA program err... application from Em by pointing out that having a pop-up file chooser is possible in around 8 or 10 lines, depending on where you put the curly braces.

Anyway, I started to look at where I would put the code (somewhere in one of the custom FileReader files) and, well... I think I was going through that code at around 30 WTF/min :P

So I asked him if I could rewrite it since, well, the code just bothered me and it seemed well within my abilities.

And so I trudged. Two weeks later and I only have two bugs to fix. One being a "java.lang.OutOfMemoryError: Java heap space" and the other with exporting the contents of the HashMap to a readable (sort of :P) CSV in a timely manner (read: FAST).

The first one is easily fixed, conceptually anyway, by increasing the buffer size. But that will only let you get away with so much so the real solution would be to make it a loop in order to handle the amount of data...

The second one though.... I dunno. I've been at it for the past 4 days with no solution to the bottleneck.
Seriously, that's the only different between his code and mine. The speed.

And it's driving me nuts.

If it wasn't for the fact that this needs to be closed source I'd write it in PERL!!! YOU HEAR ME MARTIN?!!! PERL!!!

On the bright side, the code looks like code now, and acts like Object Oriented code should. Which means I ran into the problem of Generics. I really though I'd never have this problem up until I had to rearrange how stuff was getting read off the HashMap which mind you, is getting read out 3 objects deep ~\(-_-).

So yeah, my first productive contribution to a program not developed for a class -no class I'm in anyway- and I feel a bit happy about that. Just the notion that yes, I CAN code albeit in just one language, but it's the logic that counts.

I really like the concept that Em thought up for this and its purpose so I'm gonna develop this app for the time being. It'd be easier to know which way it was going if I had the dev notes that Em though up so I would know what to plan ahead for, or at least start working on. He was supposed to gimme a copy of it last week or so but he's been busy making the new PSA for HNAP along with the presence at ITP's Winter Show

I think the next part that I'll edit, once it's up and running properly, is to change the way stuff if being read in. ByteBuffer is nice and all, but Scanner is all the rage these days and ever so useful for adding in stuff from files. But then again, I've never dealt with having to read in data in these large quantities.



But yeah... I'm gonna write a Perl version.

Then a GUI for it.

Then a C++ version of just for kicks :D