Archive for the ‘Coding’ 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!

Twitterlex v1.0 beta

Sunday, January 21st, 2007

After my friend Chris introduced me to Twitter, and I discovered that many big names in the web industry are using it regularly, I’ve embraced the Twitter lifestyle. If you’ve not used Twitter yet, it’s a service that you can use to do ‘nano-blogging’ — updates shorter than ~140 characters — from nearly anywhere for free. You can update from the web, from your IM client, or from your phone via SMS text message. But the best part is when you find your friends or people you admire using the system, and receiving their update back through one of those methods mentioned. I’ve got several interesting people on my Twitter friends list — it’s always interesting receiving a text message from them!

Twitterlex 1.0beta Screenshot Front

You can now update from your Mac OS X Dashboard, with my first ever Dashboard Widget Twitterlex. It displays the latest status messages from your friends, and provides a quick access way for you to update your own status easily!

Download Twitterlex dashboard widget

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.

HTML Tags for the memories

Tuesday, January 16th, 2007

While Glutbook was waiting for it’s death knell to be pronounced upon it, I was using my windows desktop machine to re-launch my cousin Michelle’s popular website, Bunny Abandonware. We had worked on the site together before returning from vacation, redesigning the look and building it on a new back end (specifically, Word Press). Migration of the content was always going to be the hard part, but we put a Saturday and most of a Sunday aside to blitz the design, get the content in and migrated, and most of the hard work was done. A little more migration done by Michelle that week and it was ready for me to launch it.

So we did. And let me tell you, I’m really happy with how it turned out. It’s nothing revolutionary or taxing, but it was heaps of fun to redesign and make the templates as we went, with Michelle right there working with me.

This comment from The Abandonware Blog about Bunny Abandonware 4.0 really made me feel good:

Finally some nice scene news! Bunny from Bunny Abandonware has been mentioning is for quiet some time now but finally managed to get the new version of her website online and I must say (again) that it kicks ass! The unique colors used by only one abandonware site, the wonderfull [sic] navigation, the nice kinda web 2.0 style with all the gradients and big buttons ‘n stuff… damned pretty.

LOL, I did some Web 2.0 :rolleyes: ;) But I’m taking it all as a compliment. I believe that what Michelle does with her abandonware hobby is crucial for the survival, not just of the games, but of the memories. Abandonware, while legally dubious, is less a case of stealing and more the case of paying tribute. I keep telling Michelle she’s not just another retro gamer; she’s an archivist — the curator of her own museum. A museum where the exhibits remind her visitors of the way video games used to be, and where not only games, but ourselves as people have come since then, for better or for worse.

I think the best Christmas present I gave myself was when for Christmas I gave my brother a huge pack of water balloons . I had moved out of home to Wellington and I had come to realise that I missed him. We had fun in that back yard that one day, running around with the sole purpose of cooling off and having a blast. But I did it with the motive of having that memory to look back on — a careless, happier day in my history. It worked, and it’s one of the most cherished memories I have. It didn’t cost a lot.

Memories are worth gold, but the most valuable memories are the ones that cost the least.

Tag, I’m it.

Wednesday, January 10th, 2007

Gee, thanks Tim. You know, with all the big names who’ve been part of this meme, I never reckoned that I’d get tagged. I suck at tag. In fact, that’s the first of five things you never knew about me:

  1. I sucked at tag. Primary school was pretty hellish for me — I was unfit, I had no friends, and I could never catch anyone. It’s a part of my life that I like to forget. Because I had no-one who liked me or understood me (my parents admit to not really understanding me and my interests when I was young) I turned to reading books and learning. If I had to pick someone who I think understood me when I was young, I’d probably have to say my grandmother on my mother’s side, Lois, who unfortunately passed away while I was at Intermediate, or just starting, I can’t remember. She would buy books for me all the time, and it was her who I credit for getting me into computers and specifically programming. An Osbourne book on Basic for various computers like the Commodore 64 and the TRS-80, and the really simple game listings within it. I would spend hours staring at that code, trying to figure out what the game would do. I wouldn’t get any kind of computer until after she passed away, and then it was a 286 and no-one told me where GW-Basic was.

    Gosh, there’s a bit there. Does that count as only one?

  2. I love computer games, but in reality, I’m not a hardcore gamer. I like the games that I can pick up, play for 15 minutes, and then put to one side. To this end, I rarely finish a game. A mild case of ADD? It’s certainly not AD&D ;) I can count on one hand the games I’ve clocked without cheats:
    • Half-Life (PC)
    • Half-Life 2 (PC)
    • Half-Life 2: Episode 1 (PC) (but that barely counts)
    • Phoenix Wright (Nintendo DS) (but it’s mostly trial-and-error. Heh, trial, law game)
    • Doukutsu Monogatari (aka Cave Story) (PC)

    Yet recently I’ve bought so many DS and GBA games for my Nintendo DS Lite, and haven’t clocked any others

  3. I’m not allergic to anything, but I have had cancer. I have a giant scar on my back from where they removed a melanoma (skin cancer). Luckily it came back from the labs that it hadn’t spread, but I can’t give blood anymore. If they’d let me, I’d go every six months. So if you’re reading this, and you are able to give blood, you should go do it — it helps so many people out there, and only inconveniences you for a few hours; heck, most workplaces will let you go give blood on work time!
  4. When I want to chill out, the forest is my chill out space. I love to just go somewhere and listen, relax. Rivers are also very awesome. I was baby sitting a couple of my mum’s friend’s kids for the weekend one time in the middle of summer, and they had some really large inner tubes, so we took them out on the river out the back of their house, and had a ball and we all got so tired, we walked back, packed stuff away, and we all fell asleep in the lounge where we were sitting, totally unexpectedly. It was probably the quietest they ever were!
  5. I like chiptunes. Music made on old retro hardware that sounds like it could have come out of an old GameBoy or C64. I especially like the stuff that comes out of 8bitpeoples
  6. Bonus Fact: I don’t like peas. But that said, they are tolerable when mixed with other vegetables. But by themselves, blargh.

Bob Brown (Confessions of a Guru), Hamish MacEwan (self titled), Hillary (Kiwirose in Canada), Dan Milward (Mind of Mufasa) (fix your feeds, they’re broken), and Unbounded (self-titled), even though Unbounded is the kind of guy who would abhor this kinda meme; TAG – You’re it!