Oct 13 2009

From http://nz2.php.net/manual/en/language.types.integer.php

"An integer is a number of the set Z = {..., -2, -1, 0, 1, 2, ...}."

Yes, that's nice. Except, this definition of integers does not seem to apply in PHP land. I respectfully request you change this definition to the following:

"In PHP, an integer is a number of the set Z = {-2^32, ... , -1, 0, 1, ..., 2^32-1}. This is markedly smaller than the mathematical definition of integers. Beware!"

All kidding aside, I don't care how big the underlying C datatype is. I want my integers to behave like actual, mathematically defined integers. Which means that a number > 2GB is not actually some horribly large negative number.

Oh coding god in the sky, why didn't python catch on as the newb language of choice? [1]

Edit: Benny Baumann pointed out to me that the size is 2^64 on a 64 bit system, which I grant is larger, but is still retarded. It so happens that many people are running 32 bit web servers for whatever reason. He also found this gem in the PHP source code:

#ifndef LONG_MAX
#define LONG_MAX 2147483647L
#endif
#ifndef LONG_MIN
#define LONG_MIN (- LONG_MAX - 1)
#endif

Ahem.

[1]I feel at pains to point out that I don't choose to code in PHP because I'm a newb. Far from it, in fact. I'm coding in php because Mahara is written in PHP, and as an OSS webapp, it makes sense to code these things in PHP so newbs can hack on it and install it on annoying shared hosting.

Like this post? Subscribe to my RSS feed and follow me on twitter to hear about new posts early.

Want to share this post?

Dec 29 2008

Stuff came up with another totally awesome poll today:

"Do motorcyclists take more risks when driving than other road users?"

And you're asking the general public to answer that? I think a village in Auckland is looking for its idiot reporter.

Just for funzies, they could have used these for answers:

  1. What is the difference between a duck?
  2. Yes they do, I'm a perfect driver by the way.
  3. No they don't, and if I vote this option it is therefore true!
  4. Who cares? Put some more nudity pictures up so I can go back to slacking off at work
  5. Timmeh. Timmay! Limmehlaw!
  6. I'm going to misread the question as "Is Stuff the Daily Mail of NZ news" and vote "yes"

Like this post? Subscribe to my RSS feed and follow me on twitter to hear about new posts early.

Want to share this post?

Dec 27 2008

So there was this guy. And he bought a really nice motorbike with his hard earned money. And everything was good, until Boxing Day 2008, a couple of weeks after he bought it, when a guy in a Chubb security van decided to attempt to reverse over it.

Now this guy has a bike with a broken mudguard and an unknown mechanical condition. Also, a wait until EVERYTHING FUCKING OPENS AGAIN so the insurance people can start hassling the other insurance people and some lucky bike shop can do a second-rate repair job.

This guy is pissed, as you may understand. So be nice to him. OR ELSE.

Like this post? Subscribe to my RSS feed and follow me on twitter to hear about new posts early.

Want to share this post?