Iphone Data CaseLately I’ve been teaching a 5 week crash course in ActionScript 3. The first few classes were pretty basic stuff, so ad libbing the whole thing wasn’t too much of a problem. However, as the students got ready for increasingly advanced stuff I had to come up with increasingly advanced projects, and in order to ensure a smooth flow through the allotted three hours of each session, I inevitably had to start bringing notes.

I loathe having to print out anything and for some reason it feels particularly dumb to print out code. Luckily I found DataCase, a $6.99 iPhone app which easily lets you transfer any file to your phone, and lets you view it right there in the application, so you can quickly swap between files. I know there are several apps that has similar functionality, but DataCase seemed to me to be by far the cream of the crop. I wish TextGuru was a tad less buggy and sluggish as it supports a large number of formats, but until then I’ll be using DataCase whenever I need to bring notes with me for any reason. iTunes link.

This is possibly the most uplifting news I’ve heard from a tech-company in a long while. Google has openly stated in a blog post that they oppose a certain proposition that would eliminate the right of same-sex couples to marry.

Snipped:

it is the chilling and discriminatory effect of the proposition on many of our employees that brings Google to publicly oppose Proposition 8. While we respect the strongly-held beliefs that people have on both sides of this argument, we see this fundamentally as an issue of equality. We hope that California voters will vote no on Proposition 8 — we should not eliminate anyone’s fundamental rights, whatever their sexuality, to marry the person they love.

I think it’s a bold move for Google to take, but one I think every right-thinking company should take. After all, you don’t find many companies saying they are neutral on segregation between black and white people, do you?

Edit: So has Apple, Adobe, Yahoo and several others! Sanity at last!

25 Sep 2008

Sold out

So if it’s a girl she won’t be named after her mother I suppose…

I realize that I’m late to the party with this, but so far all the examples I’ve seen have been a bit overkill for my needs, so I’m putting this out there in case someone else might have some use for it.

Of course, trace(); is a Flash developers best friend. Hell, I sometimes feel I’d be happier if I never had to go beyond the output panel, but that’s neither here nor there. The trace statement however, as beautiful as it may be, doesn’t help you a lot when you’re debugging the project in the browser, and therefore Adobe created ExternalInterface to let you output the traces to Firebug. But calling ExternalInterface.call("console.log", args); every time you want to output something is a pain in the ass, and going through your code to change all your trace calls to ExternalInterface calls is an even bigger pain in the ass, and therefore developers created various methods to ease the pain. Here is the very lightweight solution I use myself.

package no.martinjacobsen.utils {
 
	import flash.external.ExternalInterface;
 
	public class XTrace {
 
	public static var enabled:Boolean = true;	
 
	public function XTrace(){ /*...*/  }
 
	public static function log(...args:*) : void {
 
	if(enabled == true) {
		if(ExternalInterface.available){
			trace("ExternalInterface is available")
			for (var i:uint = 0; i< args.length; i++){
			ExternalInterface.call("console.log", args[i]);	
			trace(args[i]);
			}
 
		} else {
			trace("ExternalInterface is not available")			
			for (var j:uint = 0; j< args.length; j++){
			trace(args[j]);
			}
		}
	} else {
		trace("Set 'XTRace.enabled = true;' to enable traces.");
	}
		}
	}
}

As you see this class simply checks whether ExternalInterface is available, and if so traces the output to the console. If ExternalInterface is not available the statement will just be traced. As a bonus you can also set XTrace.enabled = false to disable all traces if you don’t want to go through your code to remove traces, or go into the publish settings to strip them out.

Usage is extremely simplistic:

import no.martinjacobsen.utils.XTrace;
 
XTrace.log("Hello World", 42, false, myObject);
 
XTrace.enabled = false; //Disable all traces
13 Sep 2008

Kudos

Every once in a while in between loads of spam 1 someone adds a thoughtful comment on a blog. Nothing particularly interesting to other readers perhaps, just a “Good job”, “Well put” or “Thanks for sharing”. It’s a wonderful thing to anyone that ever puts a bit of heart into a post and if you’re anything like me (and why wouldn’t you be?) you treasure these comments. We raise our voice, sadly, more often in disapproval than support, and the friendly nod or encouraging smile that is so inexpensive to give and so valuable to receive in meatspace is fraught with barriers on the internet. You may agree with someone in a heated discussion but not wish to get involved or publicly make a stand in the matter. You may not want to register or leave your email or you may just feel that wording your approval is too much of a hassle.

Call me a sucker for praise or an insecure sissy if you will, but there’s no denying the basic human need of positive feedback from your peers. Don’t take my word for it, take Maslows.

Read More »

  1. Call me legion, for we are many.