explorers’ club


Neato: Lego Combination Safe
Thursday, July 2, 2009, 3:28 pm
Filed under: Uncategorized

If someone asked me, ” as a child, what was your favorite toy?”, I would have to respond, “my Legos”.  Legos are the coolest toys.  I probably logged thousands of hours over my childhood making cranes with my dad or spaceships or giant robots.  In fact, being in my thirties, I still utilize my legos to make prototype designs and to get an idea about scale.

Anyway here is a video and an instructable on how do build a lego combination safe.

instructable – link



Objective-C & ActionScript 3 translation notes
Friday, June 5, 2009, 5:56 am
Filed under: Uncategorized | Tags: , , , , , , , ,

[note to self]

Just some things I am learning along the way while teaching myself Objective-C and iPhone development.   Seeing existing code is rather easy to understand in a general sense but the syntax is a tad whacky looking at this point.  I will continue to add to this as I find more translations.

variables:

NSString * someString = @"foo";
=
var someString:String = "foo";

casting:

NSObject *someObject = //pretend I know how to say new();
NSString *castedAsString = (NSString *)someObject;
=
var someObject:Object = {};
var castedAsString:String = String(someObject);

strings:

Strings come in several varieties in Objective-C.  There are NSString, NSMutableString and then the C varient char.  There are probably others I have yet to discover (CSString?).  Since most of what I have seen utilizes NSString, I will stick to that unless otherwise noted.

combining string values

NSString *firstString = @"foo";
NSString *secondString = @"bar";
firstString = [firstString stringByAppendingString:secondString]; //should trace out as "foobar"
=
var firstString:String = "foo";
var secondString:String = "bar";
firstString = firstString + secondString; //wow AS3 is very simple when working with strings

class & instance methods:

+someMethodDefinition = static public function
-someMethodDefinition = public function (instance function)

method calling:

NSString * someString = @"foo";
NSArray * someArray = [someString someNSStringMethodThatReturnsAnArray];
=
var someString:String = "foo";
var someArray:Array = someString.someStringFunctionThatReturnsAnArray();
//kinda made this up since I don't understand method arguments in Objective-C yet.

more to come…



what’s after Flex?
Thursday, June 4, 2009, 7:52 pm
Filed under: Uncategorized | Tags: , , , , , ,

Given that the hype over Flex has kind of reached its apex I think its high time I start broadening my skill sets.  I am not saying the Flex is a “done” technology, I am simply stating that Flex has reached a satisfying market share for RIA development and that the honeymoon is over.

So what does a Sr. Flex Developer decide to pick?  Well iPhone development is all the rage so that’s a no-brainer.  But then again that is just another client-side technology.  Java and ColdFusion are still hot technologies.  Going with either one would be a good choice (or both for that matter).  I know some PHP and MySQL but I am not sure what the opportunity costs are for continuing to develop those skills are.  I don’t really see myself doing too much in the way of web design nor do I see myself as a DBA.  I might still tackle those when I can do so without incurring significant opportunity costs.

This post is simply to post my thoughts and maybe get some community feedback.  Thoughts, comments, questions, concerns?  Let’s hear ‘em.



resume update 2009.06.01
Monday, June 1, 2009, 5:46 pm
Filed under: Uncategorized | Tags: , , , , , , , , , ,

posted an update to my resume – http://jwopitz.wordpress.com/resume

Comments Off


Note to Self: Odds, Evens, -1 & 1
Sunday, May 10, 2009, 7:11 am
Filed under: Uncategorized | Tags: , , , ,

[BEST]

*however it does throw a compiler warning 3590: int used where a Boolean value was expected.  The expression will be type coerced to Boolean.

var isOdd:Boolean = numberToCheck & 1;

[BETTER]

Math.round( Math.random() ) == 0 ? 1 : -1;

[GOOD]

odd or even  = Math.round(Math.random() * 100) % 2 == 0 ? "even" : "odd";
-1 or 1 = Math.round(Math.random() * 100) % 2 == 0 ? 1 :- 1;


Cool Find: Combining a Cairngorm-ish Command with Maté’s EventMap
Friday, May 8, 2009, 5:14 pm
Filed under: actionScript, cairngorm, development, flex, frameworks | Tags: , , , , , ,

So I am on the quest to create a hybrid MVC mini-framework that combines some of the best elements of Cairngorm, PureMVC and Maté.  The idea is to use the Command pattern from Cairngorm (because I like all my service/UX logic to be placed there and the EventMap’s dependencies on binding and MXML seem limiting), the Mediator pattern from PureMVC (which unclutters and decouples the views) and the EventMap and Injection logic from Maté (which will help to further decouple some of the command=>model logic).

Keep in mind I have only really been working with Maté for a couple of months and have only dived into actually understanding it in the last week or so.  So if you know of a better way of doing what I am trying to accomplish, please let me know and I can update the article.

This will mostly address how to decouple some of that command => model logic.  This means we are striving to get the command classes as model-agnostic as possible.  It also means there needs to be a slight modification to the current CairngormCommand structure.  We will keep the CairngormEvent in use because its data payload is useful in sending data back and forth from the event dispatchers/listeners.   In order for a command to send info back to a listener, it will need to extend EventDispatcher.  Then depending on the result or fault logic, it can dispatch an appropriate event with a data payload.  Here is some stub code:

public class SampleMateFriendlyCommand extends EventDispatcher implements IResponder
{
 public function execute (evt:Event):void
 {
    //the function signature could be anything including execute (... args)
    //notice I am not implementing the ICommand interface as I want to have more flexibility
 }

 public function result (data:Object):void
 {
   //parse data object if needed.

   var evt:CairngormEvent = new CairngormEvent("success");
   evt.data = parsedResultDataObject;
   dispatchEvent(evt);
 }

 public function fault (info:Object):void
 {
    //parse info object if needed.

    var evt:CairngormEvent = new CairngormEvent("fault");
    evt.data = parsedFaultInfoObject;
    dispatchEvent(evt);
 }
}

I like the Command pattern because I think of it in a military sense.  You issue a command to a soldier and that soldier executes the command, then generally reports back.  So this is akin to that analogy.  Next we need to see how to get the data back to the EventMap in order to wire the result/fault data into the appropriate places.  I tinkered with this for quite some time before stumbling upon this solution.  The Maté API docs are decent but fail to cover much beyond explaining the self explanatory.  I really hope they work on their API docs and really flesh out the information.

<mate:EventHandlers id="applicationCompleteHandler" type="{AppEvent.SAMPLE_MATE_COMMAND}" debug="true">
      <mate:AsyncCommandInvoker generator="{SampleMateFriendlyCommand}" successType="result">
           <mate:successHandlers>
                <mate:PropertySetter generator="{SomeModelObject}" targetKey="data" source="{scope.currentEvent.data}"/>
           </mate:successHandlers>
      </mate:AsyncCommandInvoker>
</mate:EventHandlers>

The AsyncCommandInvoker allows you to specify the event type that will trigger the successHandlers or the faultHandlers.  Accessing the data payload for the result or success event is done using scope.currentEvent.data.  Again I must reiterate that I stumbled upon this find because there was no documentation that I could find to support what I was trying to do.

The cool thing about this is that you have now freed up your commands so that they needn’t know about any specific model objects.  That is unless you really want to strongly type your result data objects.  This freedom allows for better testing as you can simply wire up a testing event map if you want to unit test.

Next up will be trying to wire mediators and their respective views into the event map.



Quick hint: Complex Component Development in MXML
Thursday, April 23, 2009, 6:36 pm
Filed under: actionScript, components, development, flex, tutorial | Tags: , , , , ,

Assume that you are creating a component in MXML such as some multi-state cell renderer or something that implements IDataRenderer.

All mx.core.Container subclasses have a convenient little event hook called dataChange.  Anytime you set a value to the data property, the component dispatches an event of type FlexEvent.DATA_CHANGE.  To hook into this you simple access it in MXML like so:

<mx:VBox dataChange="do something"/>

With this in mind I suggest that those wishing to do more complex visual changes to their component that {binding} cannot address do the following:

  • create a flag to indicate a data change has occured:
    private var bDataChange:Boolean = false;
  • connect the dataChange hook to the flag:
    <mx:VBox dataChange="bDataChange = true;"/>
  • address the data change in the call to update the display list:
    override protected function updateDisplayList (unscaledWidth:Number, unscaledHeight:Number):void
    {
        super.updateDisplayList(unscaledWidth, unscaledHeight);
        if (bDataChange)
        {
            bDataChange = false;
            //do your custom logic here
         }
    }

The nice bit about this is that you are doing the necessary logic to update the display list when it makes sense to do so (via the already established update framework in the Flex API).  It also reduces the need to override the getter/setter for the data property.



Another hunt begins
Friday, April 10, 2009, 7:59 pm
Filed under: Uncategorized | Tags: , , , , , , , , , , ,

I just got finished polishing off my shiny new resume.  I have successfully wrapped up a stint working on a really cool game project for MTV called Neopets which should be releasing an open beta very soon.

So begins a new hunt to bring home the bacon.  So what am I looking for?  Well I have 35-40 hrs per week open.  I live in the Boston, MA area so if you have an in-house gig in downtown Boston or on the South Shore somewhere, then I might be your man.  Also any telecommuting gigs I am open to hearing about since I have been doing the telecommuting thing almost exclusively for the last year and a half.  Anyway here is a link to my resume with more details on what I am looking for – link



jwolib:Pod – title bar children MXML visibility bug fix
Thursday, April 2, 2009, 8:10 pm
Filed under: actionScript, client side, components, flex, jwo_lib, projects | Tags: , , , , ,

For those of you who use the Pod component I fixed the annoying issue of where title bar children’s visibile properties being set in MXML did not stick.  Anyway revision 122 addresses this issue.

bug detail



The future is here: sixth sense technology
Wednesday, March 25, 2009, 12:11 pm
Filed under: Uncategorized | Tags:

As portrayed in movies such as Minority Report, Lost in Space and many others, the concept of digital content and user experience projected on almost any surface is no longer science fiction but a reality.

  • video post – link
  • home page – link
  • home page too – link

The folks at MIT have once again brought science fiction into the realm of science reality.  They have combined everyday technology (a digital camera, projector, mobile computer device and some multi colored tape) to create a wearable and portable user interface.  I won’t bore you with the long laundry list of possibilities in which this is potentially useful (as the video gives plenty of examples) but I will reiterate that this type of cheap yet practical and assistive technology brings us much closer to what many science fiction writers have envisions for our near future.

Given Moore’s Law coupled with ever shrinking camera technology, the demand for ubiquitous multi touch interfaces and a general demand for goofy gadgetry such as all this jazz, you can expect a more practical and inconspicuous setup in the very near future.