Tim's Blog

Page 3 of 7

Fu*k getting older

My birthday is just around the corner.  As such I think it appropriate that I remind people just how much you physicllay change as you age.  I submit for evidence before and after videos of Billy Joel performing Just The Way You Are.

Before:

After:

As an aside.  This song gets interesting if you listen to it and imagine that he is singing it to himself.

Player

Just for the heck of it I typed “player” in to you tube and this was the first result that came back.

I prefer to use the word player as an adjective. For example, “that’s rather player”. Many people prefer to use it as a noun synonymous with the word “womanizer”. For example, “that fellow courts a lot of women. Perhaps he is a player”. The point is however you choose to use the word youtube got it right on this one.

Michael Jackson mediates 50 cent and game beef?

I ran across this video on youtube and thought it was very interesting.  Here is the summary that accompanied the video.

The Game has come forward to say he got a call from the King Of Pop during the height of his beef with 50 Cent. Game says that Jackson contacted him to be the mediator in his beef with the G-Unit general.

Motion Detection Revisited

About 2 years ago I did some experiments with ActionScript 3 and motion detection.  Looking back I had no idea what what the ActionScript I pieced together was doing.  I have since gained a better understanding of some of the low level bitmap data functions available in AS3.  I threw this together last night and am quite pleased with the result.  It is a virtual drum game.  The game works best if you get out of you chair and position yourself such that your hand is the same size as a drum.  I have separated the motion detection logic so that it can be reused on any DisplayObject.  Also it is not nearly as memory intensive as the first implementation.  I took the sounds from http://www.themaninblue.com/experiment/JS-909/ (thanks Cameron Adams).  Here is a demo.  Here is the source.  This is a proof of concept and certainly not the first AS3 web cam motion detection experiment.  I am curious to hear what you think of my implementation.

Swagger…

Merriam-webster provides the following information with reguard to “swagger’
Inflected Form(s):
swag·gered; swag·ger·ing
Etymology:
probably from 1swag + -er (as in chatter)
Date:
circa 1596
intransitive verb1: to conduct oneself in an arrogant or superciliously pompous manner ; especially : to walk with an air of overbearing self-confidence2: boast, brag


Seven-Year Old Kid Can Dance – Watch more Funny Videos

Congrats Dad

Congrats on your promotion Dad.

The spices

One day found this gem in my voicemail.  I don’t know if it is a prank call from one of my buddies or if this guy really dialed the wrong number, but I do know it’s super funny.

My first sand sculpture

I went to Pismo beach this weekend.  It was a lot of fun.  While I was there I started “playing” (insert cheap joke here) with the sand.  Here is what came out of it.

I will miss you.

In memory of Michael Jackson.

Flex Module with in a Module Bug (Fixed in Gumbo)

I know I am not the first to encounter this, but I thought it worth a mention anyway.  I ran in to an issue loading a module from with in a module using flex.  The module would load, but the ModuleEvent.READY would not fire.  The instance of the module was ready and setup was true.  WTF!!! why!  After searching the net I came across this bug https://bugs.adobe.com/jira/browse/SDK-14669.  It said a workaround is to load all the modules sequentially.  Now I know this sucks because 1 by 1 is not exactly a model of efficiency.  Anyhoo…I threw the following class together and thought it would help:


/**
* this class is to get around this bug
* https://bugs.adobe.com/jira/browse/SDK-14669
* when we move to gumbo (flex 4) the bug will be fixed
* */

package com.timothyhuertas.utils
{
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import flash.system.ApplicationDomain;
import flash.system.SecurityDomain;
import flash.utils.ByteArray;

import mx.events.ModuleEvent;
import mx.modules.IModuleInfo;

public class SequentialModuleLoader extends EventDispatcher
{
private static var _instance:SequentialModuleLoader;
private var _pool:Array;
private var _current:IModuleInfo;

public function SequentialModuleLoader(value:SingletonEnforcer)
{
_pool = new Array();
}

public static function get instance() : SequentialModuleLoader
{
if(!_instance)
{
_instance = new SequentialModuleLoader(new SingletonEnforcer());
}
return _instance;
}

public function load(info:IModuleInfo, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null) : void
{
var queued:Object = new Object;
queued.info = info;
queued.applicationDomain = applicationDomain;
queued.securityDomain = securityDomain;
queued.bytes = bytes;
_pool.push(queued);
processPool();
}

protected function processPool() : void
{
if(_pool.length && _current==null)
{
var queued:Object = _pool[0];
_pool.splice(0,1);
_current = queued.info as IModuleInfo;
_current.addEventListener(ModuleEvent.READY, handleModuleResponse, false,0,true);
_current.addEventListener(ModuleEvent.ERROR, handleModuleResponse, false,0,true);
_current.load(queued.applicationDomain, queued.securityDomain, queued.bytes);
}
}

protected function handleModuleResponse(e:ModuleEvent) : void
{
IEventDispatcher(e.target).removeEventListener(e.type, handleModuleResponse);
_current = null;
processPool();
}

}
}
class SingletonEnforcer{}

An example of its usage is as follows:


var m:IModuleInfo = ModuleManager.getModule("Mod1.swf");
m.addEventListener(ModuleEvent.READY, modLoaded);
SequentialModuleLoader.instance.load(m,ApplicationDomain.currentDomain);

protected function modLoaded(e:ModuleEvent):void
{
IEventDispatcher(e.target).removeEventListener(e.type, modLoaded);
IModuleInfo(e.target).factory.create();
}

I hope this helps

« Older posts Newer posts »