6/27/2008

A quick note.

I was trying to determine a way to sort an array without all the for loops and that sort of business when I ran across this post

Granted it's a little specific to what you want to sort but I'm sure with a little change you could sort based on the function call maybe. I implemented it for my map stuff and it worked out great for plucking out regions that items are on.

private function makeRegionList(myMapItemsArr:Array = null):Array {
   var tempArr:Array = myMapItemsArr;
   var keys:Object = {};
   var tempArr2:Array = tempArr.filter(function(item:Object, idx:uint, arr:Array):Boolean {
                        if (keys.hasOwnProperty(item.regionCode)) {
                                        /* If the keys Object already has this property, return false and discard this item. */
                                        return false;
                                    } else {
                                        /* Else the keys Object does *NOT* already have this key, so add this item to the new data provider. */
                                        keys[item.regionCode] = item;
                                        return true;
                    
                                    }
                        })
    return tempArr2
}

6/21/2008

Helping out around Visions Camp for the blind

So today we went to our NYCares thing at Visions camp somewhere an hour outside of the city. It was awesome. Just helping out and getting everything ready for the camp to come for the summer. All in all, it's been a very fulfilling day.

6/15/2008

NY Cares









Wow, so next Saturday is my first ever New York Cares volunteer work. I kept putting it off for forever but now I'm sticking with it. 
I'll be helping to prep a camp for blind kids called Visions camp. It's great because it involves things like painting and cleaning up the grounds and since I used to paint houses back in the day I got the mad paintin' skills.

Flash to PDF

I was reading back to some of my blogs and noticed I forgot to look into embedding swf files into pdf documents. Here is a link to a tutorial for it.

http://www.adobe.com/designcenter/tutorials/flashpdf/

Check it out.

6/07/2008

Charles Rangel

When the bill was trying to be passed to increase the amount of money children get for insurance (or something to that effect) I wanted to watch the process in which it was pushed through. 

So I tuned into C-Span and tried to keep tabs on what was going on. Unfortunately, bush vetoed this since I suppose he doesn't like children having insurance or something.  None-the-less, I discovered that my city has the most awesome representative.
His name is Charles Rangel
Now I could go on about him but intead I'll give you the link to his wikipedia page . 
He's been arrested three times, that I can see, for various human rights protesting causes. That alone tells me he should be where he is. But watching him on C-Span is the real kicker. The way he responds to certain situations is hilarious. He IS New York. I feel that during Senate meetings he should be sitting in front of a checkered table eating spaghetti and meatballs whilst dealing blows to the republican party.

6/06/2008

an update on my FirebugLogger class

I decided to tweak the class a bit more so I figured I'd throw it up here.

 
import flash.external.ExternalInterface;


public class FireBugLogger
{
private static var _enabled:Boolean = false;

public function FireBugLogger(singleton:SingletonEnforcer){}

public static function set enabled(t:Boolean):void{ _enabled = t; }
public static function get enabled():Boolean{ return _enabled }
public static function log(s:String):void { if(enabled)call('log', s); }
public static function debug(s:String):void { if(enabled)call('debug', s); }
public static function info(s:String):void { if(enabled)call('info', s); }
public static function warn(s:String):void { if(enabled)call('warn', s); }
public static function error(s:String):void { if(enabled)call('error', s); }

private static function call(func:String, param:String):void
{
trace(func+' :: '+param)
ExternalInterface.call("console."+func , param)
}

}
class SingletonEnforcer{}