July 27, 2006 at 12:42 pm
· Filed under Java
I’ve been writing things in Java for a hell of a lot years now and few things come up in the base language that surprise me or mess me up - usually the only new things are external libraries and APIs. But today something caught me. There was a method I was responsible for that essentially converts database query results into XML. One of the fields was for money, and represented as a double (with varying amounts of decimal places due to it being the aggregate of other data). Normally using Double.toString() would give a normal number like “958725.48″. For some results though (larger ones) the string given by the toString() method was in scientific notation with an exponent, like “9.5872548E5″. So I checked the documentation for the method and sure enough the behaviour is documented:
If m is less than 10-3 or greater than or equal to 107, then it is represented in so-called “computerized scientific notation.”…
I can deal with things like this, but I just don’t get the rationale behind it - if you’re converting a double to a String representation, it’s not going to overflow since it returns a new String object. So in the end I had code like this:
NumberFormat nf = NumberFormat.getInstance();
nf.setGroupingUsed(false);
columnValue = nf.format(double);
I guess I learned something new, but it was still kind of a waste of time and if I was personally responsible for that method’s behaviour I would have made the conversion to scientific notation an option and not a conditional.
Permalink
July 11, 2006 at 7:05 pm
· Filed under Games
We went for dinner with a cousin of mine last night and he was half-bitching about how there’s been no “really new” games out recently (specifically for the PC since that’s what he has). At first I didn’t think much about it, but later I did put more consideration into the issue.
Don’t get me wrong - I’m not saying that new games suck. I happen to enjoy most of my last few years of purchases, but he’s right - none of them are new or innovative. Everything seems to be pretty evolutionary instead of revolutionary. Like even looking at the last few games we’ve bought:
- Guitar Hero - great, but totally derivative of every other beat- and music-game before it. It’s really really good though, but doesn’t really bring anything actually new to the table.
- Battlefield 2, Metal Gear Solid 3, Half Life 2, Civilization 4, Resident Evil 4, Gran Turismo 4, The Elder Scrolls 4 - anything with a number after it is almost always by definition not innovative. Granted I loved the shit out of most of these games (and I still play Battlefield quite a bit).
- Prey - now I just got this, but I’ve played the demo. It’s a hell of a lot of fun, but again nothing new. The lone badass in some s.f. environment killing aliens is a very old formula. The engine has neat “portal” technology so it does get points for that.
- Titan Quest - I’m enjoying this one, but Blizzard would probably win if they sued these guys for plagiarism. I’m only half serious.
- God of War - another PS2 one from last year. Really good action game, but beat-em-ups have been around forever.
So what recently have I played that’s fresh and innovative? Katamari Damacy comes immediately to mind (of course). Then the creators followed it up immediately with two sequels that while enjoyable added very little to the main idea.
There’s at least Spore in the future that’s pretty innovative. And the Nintendo DS has some games that are - off the top of my head I’d say Phoenix Wright and Trauma Center. And I’m not pining away for innovation and claiming things suck. I’m just wondering where it is right now.
Anyone have suggestions for games that are innovative and fun? Not just one or the other :-)
Permalink
July 9, 2006 at 9:24 pm
· Filed under Misc
We’ve been promoted from being tentative science fiction television geeks to actual ones. Today we attended our first, ahem, s.f. convention (Toronto Trek). I have admit it was pretty awesome. The question and answer sessions were great, we got a bunch of autographs and posed with people and browsed collectibles and shit for hours. This feels like a confession!
Some of the people were (obviously) George Takei - who Chie bonded with via shared language - Michael Shanks, Lexa Doig, Garret Wang and Richard Hatch. They were all fairly normal (as far as we could tell). We’ll probably go next year too :-)
Permalink