Skip to main content

Posts

Showing posts with the label Humor

I Remember...

I remember when Java first came out surfing the Internet on my 28k dial-up connection and hitting a page with a Java applet ; either Netscape would come crashing down or my computer would lock up... I remember schoolmates telling me Java was "the future" because it ran on a virtual machine which meant it was cross platform, and then being ostracized by them when I pointed out that QBasic would be considered cross platform , too... I remember reading Java programming books before I understood OOP and wondering why I had to write a hundred lines of code just to output "Hello World" ... I remember reading Java programming books after I understood OOP and still wondering why I had to write a hundred lines of code just to output "Hello World"... I remember trying to convince myself every time I started Eclipse and watched my P4 run slower than a 486 that I just hadn't given Java a fair shake and I needed to embrace it with an open heart and mind....

Null Pointer Exception

This is why I don't program in Java: import java.util.ArrayList; class Program { class Person { public Person partner; } class Prostitute extends Person { } class Eunuch extends Person { } private Prostitute prostitute; private Eunuch eunuch; public static void main(String[] args) { Program p = new Program(); p.run(); } public void run() { eunuch.partner = prostitute; } } > Exception in thread "main" java.lang.NullPointerException But if you do, you should check out the nifty online JXXX Compiler Service .

Pop Quiz

Here's a little test to separate the serious coders from the cut-and-paste script kiddies. Given the need to generate an arbitrarily long string consisting of random alpha-numeric characters, which solution is best? Solution A: function randomString($len) { $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" . "abcdefghijklmnopqrstuvwxyz" . "0123456789"; $rndMax = strlen($chars) - 1; $str = ""; while ($len-- != 0) { $str .= $chars[rand(0, $rndMax)]; } return $str; } $str = randomString(8); echo "$str\n"; Solution B: class RandomSequenceIterator implements Iterator { protected $seqMembers; protected $key; protected $limit; public function __construct() { $this->setMembers(null) ->setLimit(0) ->rewind(); } protected function setMembers($strValue) { $this->seqMembers = $strValue; return $this; }...

Certification Failure

Some employers look favorably on certifications, or even require them; other employers could care less. Some people are certified in something but clueless when it comes to actually using the technology. Some people get certifications like they're going out of style just because they can. Some people cheat on the exam . So how much stock should one put in certifications? I'm not sure I know the answer to that. I guess it depends on the certification, what the testing environment is like, who runs the certification program, etc. Today I ran across PHP-Rocks during my daily web-surfing. It's a small site that offers a set of tutorials ranging from beginner up to advanced, and a PHP "certification" exam. The exam piqued my interest. It was free to take, and I was curious as to what type of questions it asked, so I signed up. Of course I often sign up a dummy account and fake email address when I do such things because I don't intend on becoming a regu...

Motivational Posters

I've been having a hell of a time fighting with some Perl code at work lately. I tossed together a humorous Perl demotivational poster to release some of my frustration, and thought others might appreciate it. But why stop there? There are other languages worth making fun of besides Perl! So, I tossed together some more snarky posters to be fair.