Archive for the ‘Work’ Category

Firebug goes 1.0 and out of beta!

Friday, January 26th, 2007

Congratulations to Joe Hewitt, developer of Firebug, the best of breed “console / inspector / debugger / monitor for HTTP / JavaScript / DOM / CSS / AJAX“.

The extension for Firefox just went 1.0 final (heh, a Web 2.0 tool coming out of beta), and that’s a big deal. Joe has been working on Firebug for just over a year, and it has become a tool more indispensible than even Chris Pederick’s Web Developer extension!

What? You don’t have either of these?! You call yourself a web developer? Let me guess, you still think IE is the only browser worth developing for, and heck, you probably believe that developing to Web Standards is just elitist acadamia… get with the program. Why leave the interpretation of your code to tag-souped chance?

… Eh-erm. Sorry about that monkey I had to get off my back. I heard a rumor yesterday and my anger has found its vent.

But seriously, all those IE die-hards that are still out there today should be amazed at what tools our industry-standard (as opposed to the de-facto-standard) web browser we call Firefox makes available, let alone makes possible.

Since Mozilla 0.7, I’ve found it’s more time-efficient to develop in a Gecko-based browser, then bug-fix for everything else — because it’s much harder and stressy to start in IE and bugfix to Gecko. I’ve found this true for all the technologies: CSS, JavaScript, XSL, AJAX, and now SVG

Viva la revolución! Viva la web standards!

Loading JSON in ActionScript 2

Thursday, January 18th, 2007

Because I blew a few hours trying to figure this out the last few days, and finally cracking it, here’s how to fetch some JSON from a web service and have it processed into an object in ActionScript 2.

import JSON; // http://www.theorganization.net/work/jos/JSON.as

var jsonFetcher:LoadVars = new LoadVars();
jsonFetcher.onLoad = function(success:Boolean) {
	if (!success) {
		trace("Error connecting to server.");
	}
};
jsonFetcher.onData = function(thedata) {

	// ...
	// if writing a desktop app or widget, string manip or regexp
	// the JSON data packet out of the JS source provided by many
	// web services at this point..
	// ...

	try {
		var o:Object = JSON.parse(thedata);
		//mytrace(print_r(o));
		trace(print_a(o));
	} catch (ex) {
		trace(ex.name+":"+ex.message+":"+ex.at+":"+ex.text);
	}
};

// get the feed
jsonFetcher.load("url-to-json-feed.php");

// from: http://textsnippets.com/posts/show/633
// recursive function to print out the contents of an array similar to the PHP print_r() function
//
function print_a(obj, indent) {
	if (indent == null) {
		indent = "";
	}
	var out = "";
	for (item in obj) {
		if (typeof (obj[item]) == "object") {
			out += indent+"["+item+"] => Objectn";
		} else {
			out += indent+"["+item+"] => "+obj[item]+"n";
		}
		out += print_a(obj[item], indent+"   ");
	}
	return out;
}

BTW, what’s up with these JSON feeds that serve up JS that’s JSON plus some more code? That’s annoying — you gotta strip it out before you run the JSON converter :P .

Update: here’s the actionscript 2.0 JSON.as file people were looking for.

Life and Fitness in Karori

Tuesday, January 16th, 2007

Life Update.

I haven’t blogged this yet, but I’ve been working at Natcoll Design Technology for over a year now. I started as a part-time Multimedia tutor, and now I’m the Diploma of Web Development Course Coordinator for the Wellington campus. I teach on average 18 hours a week, with the rest in prep, paperwork and management. Really fun job, besides the paperwork ;) I even get to help out with the tech support sometimes… but eh, what ya gonna do?

. . .

Mid last year, I moved from downtown Cuba St to the boxed valley suburb of Karori (said to be the largest suburb in the southern hemisphere) with the intention of eating better and getting fit.

I’ve got the getting fit thing working somewhat: Mountain Biking. Karori has a world renowned mountain bike park running up, and most importantly, down, the back of it. I got my bike at the start of December, a nice GT Avalanche 3.0, and I’ve been slowly discovering the many tracks it holds. It’s really a beautiful place, and with summer turning up finally, I’m going to make the most of it.

I originally got the bike to commute to and from work every day. Karori is up in the hills, and the city, where I work, is at sea-level. It takes me 15 minutes door-to-door every morning, and depending on my route, 30-50 minutes coming home uphill. I don’t really enjoy exercise, but at least I know I’ll have achieved something every day, no matter how my day might have been.

Giant Scottish Robot

Wednesday, December 20th, 2006

My workmates and their students created this short 3D animated film called Amiganaut, and got me to star in it. I’m the giant scottish mech suit guy, dubbed the HGU — Heavy Ginger Unit. Awesome eh?

WellRailed’s “Getting started with Ruby on Rails”

Tuesday, October 10th, 2006

Tim Haines writes:

Tomek, Nahum, and I are organising a Rails session for newbies this month. We aim to make it the best Rails session yet. We’ve organised some books to give away, a discount for O’Rielly, and will be putting on Pizza (and hopefully beer if we find a sponser. ;-) The session will be about building a basic blog app, but the overriding theme will be to get the uninitiated but curious, and the beginners along, and give them a taste of the good stuff. We aim to nuture their curiousity into a love of Rails – which will benefit the entire Wgtn software development scene.

What: Getting started with Ruby on Rails – a community based approach
When: 6:30pm, Tuesday, 31st October 2006
Where: CreativeHQ, 25a Marion Street, Te Aro, Wellington (behind Resene Paint)
Presented by: Nahum Wild
Intended audience: Anyone interested in Ruby on Rails.
Prerequisites: Interest in Ruby on Rails. Knowledge of programming in any language will be useful during the live demo.
Refreshments: Hell pizza
Cost: Free. It’s a community event. It is our turn to give back.

The format will be as follows:

  • Arrive between 6:30 and 7pm.
  • Start at 7pm: Welcome and introduction
  • Quick overview of Ruby on Rails and its main underlying design pattern: Model-View-Controller
  • An end to end demonstration of how to build a simple blog application in Rails.
  • Q&A time.

Interested? Only 12 places left… Find out more about this event! I’m looking forward to this one…