Injured by Integer

Posted by Nicholas Sat, 05 Apr 2008 02:35:00 GMT

It’s been a very long time since I’ve used Kernel#Integer, but to my recollection it was simply coercion that raised an error if necessary, as an alternative to things like String#to_i which would simply return the first digits in a string, or 0 if the string did not contain a valid integer.

Since the program I was writing was receiving amounts in the form of strings representing cents, I figured it would be a natural fit. Leading zeros would be stripped off of anything under a buck, and I could simply rescue any ArgumentError and handle them appropriately....


finish reading 'Injured by Integer'

Posted in tips, ruby | no comments

Little man finally rocketed

Posted by Nicholas Fri, 04 Apr 2008 04:15:00 GMT

I’ve finally gotten around to playing and beating Half-life 2 episode 2.

I knew before I even began playing the game that I absolutely had to snag that Gnome achievement during my first play through....


finish reading 'Little man finally rocketed'

Posted in ridiculous, gaming | 1 comment