Books for dummies

by Jason on April 14, 2009

I was in a local book store today searching for a good iphone development book when I came across the most pathetic computer section I’ve ever seen.

Nearly every book is an [insert topic here] for dummies book.

MooFlow Firefox Uncaught Exception Fix

by Jason on March 23, 2009

I am using MooFlow for a project at work and it is absolutely fantastic. Nothing else gives the ease of use and nice look like MooFlow. However, it kept throwing an uncaught exception in Firefox:

Error: uncaught exception: [Exception… “Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage]” nsresult: “0x80040111 (NS_ERROR_NOT_AVAILABLE)” location: “JS frame :: http://your-server/MooFlow.js :: anonymous :: line 423” data: no]

I have figured out a simple fix for this.

In the file MooFlow.js look for the following line of code:

ctx.drawImage(i, 0, 0, arg.width, arg.height);

And change it to this:

try {
ctx.drawImage(i, 0, 0, arg.width, arg.height);
} catch(err) {}

And that will do it!

Note: this “fix” will disable refllections in the firefox browser.

Slicehost CentOS RMagick Install

by Jason on February 20, 2009

I feel your pain.

The problem is that if you install ImageMagick and ImageMagick-devel from yum you end up with version 6.2.x instead of the required 6.3.x or higher that RMagick requires.

Just install from source.  Follow these steps.

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz

cd ImageMagick-6-??

./configure

make

make install

gem install rmagick

Relax with a beer.

Antipodr

by Jason on October 29, 2008

Antipodr is a simple little tool I created with Jake Rutter that allows you to calculate the exact spot on the other side of the planet from any location you enter.  A complete waste of time, yes, but fun!

Antipodr utilizes Google Maps and the Google Geocoding Web Service to bring you the end result.  Once the system determines the coordinates, a simple calculation determines the antipodal point (hence the domain name) and displays the map of that area.

On a side note, it turns out you’d have to live in Chile or Argentina in order to dig to China.  Lies!

Antipodr - Find the other side of the world!

Antipodr - Find the other side of the world!

Check out Antipodr now!

New Microsoft Ads

by Jason on September 18, 2008

I can’t help but realize that the new ads from Microsoft are totally useless, unconvincing, and uninformative.  The basic message behind the three major ads are:

  • Windows Mohave – “Don’t listen to the millions of people who’ve experienced debilitating issues with Vista.  Instead, look how polished and slick the interface looks.  Kind of like a Mac – I MEAN.. doh!”  Does anyone notice that they never show you what the people are looking at?  Makes you wonder.
  • Seinfeld – “We’re funny?  “.  So you wasted tens of millions of dollars and NOT give anyone a good reason to use your product?
  • I’m a PC – “A lot of people use Windows, so you should too?”  This reminds me of a famous quote, “Any fool can use a computer.  Many do.”  I mean, seriously, “Windows.  Life without walls.”  That’s your slogan?!  I guess Microsoft doesn’t consider devices not working, spyware constantly infecting machines, a browser (conveniently labeled “Internet” for all the ignorant) that is not standards compliant, and a slew of other deal breakers walls.  Apparently Microsoft has an entirely different take on what a wall is than the rest of the world…

Microsoft, I’d like to help.  I’m not a fan, personally, but I’d like to help.  Your Operating System comes pre-installed on 90%+ computers.  You DON’T NEED TO MARKET as aggresively as you are!  Second, instead of trying to make everyone think you’re hip & cool, why don’t you actually focus on making better software and better user interfaces?  I can give a million reasons why I’m a Mac user, but the one reason that I tell everyone, regardless of their level of expertise in computing, is “Everyday, I wake up my Mac, do what I need to do, and then put it back to sleep.  It just works everytime, the same way it did all the times before, and it will continue to work exactly as it does until I replace it with a new model.  I don’t have to worry about scanning for spyware, cleaning up the registry, etc.  I never have to figure out why my computer is suddenly running slow.  It just works, everytime.”

PHP Autoload Issue

by Jason on September 11, 2008

On a recent project, I couldn’t figure out why the following block of code worked on OSX but not Red Hat Linux.


function __autoload($class_name) {
require_once 'lib/' . $class_name . '.class.php';
}

I had a class named ‘bank.class.php’ which autoload was attempting to find.  It worked properly on OSX, however on Linux it wouldn’t work.  I quickly discovered that Linux required the file to be renamed to ‘Bank.class.php’.  Alternatively I could have changed the autoload to:


function __autoload($class_name) {
require_once 'lib/' . strtolower($class_name) . '.class.php';
}

jQuery Plugin – Form Field Default Value

by Jason on August 24, 2008

Note: find the latest version of this plugin on Github!

So I just finished writing my first jQuery plugin!  The idea behind it is simple – provide a dead simple way to apply a default value to any text-based form field.

In it’s current state, my plugin accomplishes the following:

  1. Provides a simple way to apply a default value to any text-based form field.
  2. Only shows default value for EMPTY form fields.
  3. Default value returns to an empty form field when it’s lost focus.
  4. Upon submitting the form, fields which still contain the default value are set to empty

Example Usage:

$(“#myfield”).DefaultValue(“My Default Value..”);

View Demo

Download

I’m sure there are other plugins that satisfy these requirements and I’m not claiming that this is the best in the world, but it satisfies all my requirements and gave me the opportunity to develop my first jQuery Plugin!

I may enhance the plugin soon to incorporate styling to form fields.

IMG Default Image

by Jason on June 28, 2008

Do you find it a hassle to manage external images? One day all your images show up just fine, and the next you see the infamous red x in it’s place, signifying that the image is no longer available. Frustrating!

With this quick fix, you can say goodbye to that problem. With a quick javascript event function, you can easily replace broken images with a default image of your choosing without any crazy server-side file existence checks.

The way to accomplish this is to reset the img tags src attribute on the OnError event. This event is fired when an image cannot be loaded for whatever reason. Perfect time to replace the image with the default image!

Example:

<img src=”http://www.somedomain.com/someimage.jpg” onerror=’this.src=”/images/default.gif”‘ />

With this one JavaScript event function, you no longer have to worry about whether images will show up, and best of all, viewers of your site won’t think you are a slacker 😉

If a programming language was a boat – a continuation

by Jason on April 4, 2008

Continuing Tony’s Article

Erlang

It floats, and might even perform relatively fast, but what’s with the syntax?

ColdFusion

The picture says it all…

CShell

Seemed convenient at the time, but turned out to be entirely inadequate.

Ok, my brain hurts. More to come!

New Blog

by Jason on April 4, 2008

As you may have noticed, I just recently upgraded to WordPress 2.5!  I’m currently in the process of porting over all previous posts/comments.

This sites main objectives are simple:

  • Provide opinionated, geeky programming goodness
  • Work as an outlet for my unique humor
  • That is all.

I invite everyone to comment, yell at me, disagree with me, and give me your perspective on the topics I choose to write about.

Enjoy!