2011 Goals
- Finance
- Continue no consumer debt
- Be more frugal
- Buy a home in Logan
- Start putting away money missions, weddings, etc
- Work
- Be more involved in local developer groups
- Show my worth to the company and get a raise
- Respond quickly to all communications
- Go above and beyond to innovate and create
- Publish my git application successfully
- Family & Friends
- Surprise Lindsey with a special date, flowers, etc once a month
- Be patient with crying baby
- Spend time individually with each of my brother-in-laws
- Have weekly family planning meeting
- Mind
- Blog once a month
- Continue reading 2 books a month
- Set and review goals weekly
- Write down more of my ideas
- Read less fantasy novels, more business/historical novels
- Spirit
- Be involved in a charity somehow
- Daily Scriptures Study
- Study Book of Mormon
- Take notes in church meetings
- Read Elder Hales new book
- Daily couple prayer
- Focus on Charity
- 100% HT
- Body
- Drink no soda
- Regularly attend spin/rip60 classes at work
- Complete the Ragnar Relay
- Ride LOTOJA, Seattle to Portland, and 3 centuries
- Run a marathon
- 400 miles a month cycling (summer months)
I am on The Flex Show!

I did an interview with the guys over at The Flex Show last month about Analytics in Flex. It was a fun interview because those guys are fun guys to talk to. Go on over and give it a listen.
Flash Platform Analytics with Chase Brammer - The Flex Show Episode 114
AIR 2.0 – Going Native!
Wahoo! AIR 2.0.2 and Flash Player 10.1 have officially been released. These two releases have been a long time coming.
The AIR 2 update makes AIR a much more viable option as a desktop software platform.
Flash 10.1 seems like it is actually a whole new beginning for Flash because it has been cut up, optimized, and expanded on a ton. Exciting times in the Flash world.
With so much going on with the new releases and the cool features they have (multi-touch/gesture, mobile, networking, etc) it is easy to over look the Native Process. I definitely overlooked it when I was looking at the AIR 2 Beta 1 release notes. But since then I have been playing with Native Process in a few different projects. And it is FAST! In one project, Flex is calling a shell script and receiving/parsing 200k + line items in ... oh around 10 SECONDS!
So lets take a look at an examples of what I am talking about and a stumbling block that I came upon.
Example 1 - AIR to Shell Commands
For the last two years I have learned to love my favorite Application on my Mac -- Terminal. I love it because it is so powerful, and already has so much functionality built into it. And even if it doesn't do something, there is probably a Linux or OSX user out there that has created a script to do just what I am looking for. So being able to tap into shell commands directly is... well...really cool and opens up a lot of possibilities.
A great example of this is already pre-baked and packaged for us by Adobe. SearchCentral is an app that uses some native file listing and shell commands to search for files on your computer. Not a revolutionary app -- it basically just mimics Spotlight. But it does show some good examples of how to interact with a Native Process. If you want to tinker with NativeProcesses, that is the place to start.
The Stumbling Block - Chunked Up Data
A major issue came along when AIR started requesting large data sets over Standard In/Out. The issues is that the system only sends a chuck of data at a time. And this chunk may not be a complete object, line item, or whatever you are sending. For example, if we have a response with 300 characters, maybe only 200 of those will get put into the output. If so, the last one hundred will come across on the next event cycle. How do we know if we have a complete object? The solution I found was to separate each object with a defined separator and hold onto data until we have its full data-load. To you networking guru's this may sound very familiar, because it is the same concept as packet splitting on the OSI layer. Here is a simple way to handle this "chunked up" data on a STANDARD_OUTPUT_DATA event handler:
private function onOutput(e:ProgressEvent):void { // Read our bytes from the native process into the buffer np.standardOutput.readBytes(processBuffer, processBuffer.length); // Keep a remainingOutput class variable for orphaned data // append that to a temp holder and clear remainingOutput var tempOutput:String = remainingOutput + new String(processBuffer); remainingOutput = ""; // Orphaned data + whats new in our buffer var l:Number = tempOutput.length; // Look for our bufferSeperator class variable's last index in out output var lastIndex:Number = tempOutput.lastIndexOf(bufferSeperator) + bufferSeperator.length; // If the end of our buffer doesn't end on the end of our current buffer string // then we have some orphaned data that we need to hold onto if(lastIndex != tempOutput.length) { // Grab the orphaned data remainingOutput = tempOutput.slice(lastIndex + 1); // Grab everything before the orphaned data tempOutput = tempOutput.slice(0, tempOutput.lastIndexOf(bufferSeperator) + 1); } // Clear out our buffer so we don't get an overflow processBuffer.clear(); // the tempOutput var is our final set of data that includes any previously // orphaned data and the rest of what we could find in this latest buffer // load. So we can dispatch out an event or set a var to keep track of this // tmpOutput; // Do something with this }
In conclusion, AIR 2.0 is awesome. And Native Process, while not as sexy as some of the other new features, is a game changer for what AIR Developers can build!
360Flex Presentation Done!
360Flex Presentation - Omniture v Google on Prezi
The source code (what little there is) is here. It is a FXP file, which is an export Flash Builder Project
New Toy – Intel NAS (ss4200-e) with FreeNAS
Recently I got a gift from my wife's company Calculated Research and Technology, for helping them out with a few things. I was lucky enough to get an awesome Network Attached Storage (NAS) device! Toms Hardware says it's performance is the best in its class, and its price is about 1/3 of all the others on the market. I got the Intel ss4200-e NAS device, which is sometimes branded as Fujitsu Seimens Scaleo Home server . For those who don't know what a NAS is, it is a place for a a set of hard drives to act as one big fast hard drive (called a RAID), and have that data always be accessible to your home network.
Problem is, is that you need to have special hard drives from an approved list to get the machine to work. I didn't want to do that, and I didn't want to run the crappy (from what I have read) OS that the device ships with. So, I slapped four 2tb drives into this bad boy and now have an awesome NAS to store all of my media.
However, getting it all setup was a problem. Here are the things I tried, that failed:
- Booting to the default OS on the device. Failed because I don't have approved drives
- Booting to an Ubuntu live usb stick, I installed the image, but for some reason still unknown to me, I couldn't get the USB stick to persist the OS data between reboots
Finally, I installed FreeNAS on the system, and that has been working like a charm. I am running the whole OS from the USB stick so that the drives can all be dedicated to storing data.
Here is how I got it all to setup right
- Download the FreeNAS embeded install, for my it was the x86 architecture
- Follow this guide to format a USB stick to be bootable, and copy over the img. This is the OSX way of doing it.
- Put the USB stick into the NAS, then boot the NAS to USB by starting with the system shutdown, then holding down reset button then holding down the power button together for about two seconds. You will see the drive lights on the front light up, and the center light will go amber. Don't worry about the Amber, that means that it is booting from USB.
- point to your browswer to http://freenas.local or the default IP of 192.168.1.250 For me, the default IP didn't hold for some reason, but I was able to look on my Routers admin page to see what IP address had been assigned out and get to it that way.
- Once into Freenas, you just need to follow the guides on the freenas.org website to setup and install
The one thing that I would like to do, but don't know how, is move FreeNAS from the USB stick to the embedded DOS (Disk on Storage) on the device. If anyone knows how to do that (terminal?) let me know.
Speaking at 360Flex (again)!
Yup, the guys at 360Flex are cool, and not just because they put on the best Flex conference in the industry, but because they let me be a part of it!
I get to go hang out with a bunch of cool guys in my industry and in San Jose California, maybe see my Brother why I am out there, speak, and relax. All in the name of work! If you want to come hang out with some awesome people and attend a great conference, you should get yourself a ticket here
I will be presenting this:
Title: Flash Analytics Throwdown
Description: Clients will ask, and you will be forced to choose your analytics weapon. Learn about Adomniture's and Google's analytics tools and how you can use them to drive business. The session will be divided up into three sections. Firstly, the high level details about the qualities and business benefits of each. Second, a simple walk through of how to use the tools. And lastly, how to implement and deploy those tools in your applications.
A first date with Unit Testing in Flex 4
Unit testing is a topic that has creates a variety of opinions. For a lot of people it is like a first date, the first time they try to take out unit testing for a spin it seems like it is fat, slow, and impedes what you want to get done. For others, it is love at first sight.
To be honest, I still struggle to decide if I want to include unit uesting in my relationship with each new project I take on. I know that it is needed, and that it really is best practice, but then I get thoughts like
- "Is Unit Testing this really mission critical?"
- "This is just a small project, it really doesn't need it"
- "Crap, I don't like Test Driven Development"
Even though I murmur about the different times to use Unit Testing, as Flex and Flash move into become a bigger players in developing true business applications, the more we need to verify a applications functionality.
What is cool about Flash Builder 4 and unit testing, it that we finally have a unit testing solution that is actually built into the IDE. It seems that the wars between FlexUnit, FlexMonkey, Structured Log Testing, and AsUnit was won by Flex Unit when they were crowned by Adobe to be integrated in the IDE.
If you need a refresher in what unit tests are, and why they are important, check this out.
So let's take a first date with unit tests in Flash Builder 4.
1) Create a project and create a simple class that will do some business logic that we want to test. In this example the standard bank account example is used that makes deposits, and makes withdrawals.
package
{
public class Bank
{
public function Bank() { }
private var _balance:Number;
public function get balance():Number {
return _balance;
}
public function set balance(v:Number):void {
_balance = v;
}
/**
* Deposit some money into our bank
* @param ammount
* @return
*
*/
public function deposit(ammount:Number):Number {
_balance += ammount;
return balance;
}
/**
* Withdraw some money from our bank
* @param ammount
* @return
*
*/
public function withdraw(ammount:Number):Number {
_balance -= ammount;
return balance;
}
}
}2) Now it is really easy to create a test case, just right click the class you want to test, and create a new test case off of it

This will name the class what it should be named, in our case BankTest.as and insert all of your stub functions to setup/tear down the test case. You will also notice one extra file created in your directory, called flexUnitCompilerApplication. This just exists to be the application that runs when you execute the test cases, it will also show you a nice pretty dialogue when all your tests run successfully.
3) Configure your test case. Below is a sample.
package flexUnitTests
{
import flexunit.framework.TestCase;
public class BankTest extends TestCase
{
// please note that all test methods should start with 'test' and should be public
// Reference declaration for class to test
private var classToTestRef : Bank;
public function BankTest(methodName:String=null)
{
super(methodName);
}
//This method will be called before every test function
override public function setUp():void
{
super.setUp();
classToTestRef = new Bank();
}
//This method will be called after every test function
override public function tearDown():void
{
super.tearDown();
}
/* sample test method
public function testSampleMethod():void
{
// Add your test logic here
fail("Test method Not yet implemented");
}
*/
/**
* Do a test deposit
*
*/
public function testDesposit():void {
//Reset our balance to zero
classToTestRef.balance = 0;
//An ammount to deposit
var ammount:Number = 1000;
//Deposit the ammount
classToTestRef.deposit(ammount)
//Check to make sure that this deposit posts to the balance successfully
assertEquals(ammount, ammount);
}
/**
* Do a test on a withdrawal
*
*/
public function testWithdrawal():void {
//Reset our balance to zero
classToTestRef.balance = 1000;
//An ammount to withdraw
var ammount:Number = 400;
//What the end ammount of our withdrawal should be
var endAmmount:Number = 600;
//Withdraw the ammount
classToTestRef.withdraw(ammount);
//Check to make sure that this withdrawal posts to the balance successfully
assertEquals(endAmmount, endAmmount);
}
}
}Now just run your test! See, it is that easy!

If you are successfully you will see two screens where you can see the results of your tests. The first, will be in the browser, but the most usefully one will be right inside you IDE where you can see what test executed successfully and which ones didnt!

So there you go, that was a nice easy first date with unit tests in Flash Builder 4!
Proxy Debugger

Proxy debugger... sounds exciting right? Well, you are right my good sir! In all seriousness though, the most useful tool I use in conjunction with flex builder is easily Charles. If you are using AMF or getting data from a web server in any way and you want to see what you are getting back in an easy to read, easy to use way - then Charles is your man.
Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information).
Charles is especially useful for Adobe Flash developers as you can view the contents of LoadVariables, LoadMovie and XML loads. Charles also has native support for Flash Remoting (AMF0 and AMF3).
If you develop in flex, and don't use Charles, you should get to know him.
Speaking at 360|Flex
Rock on! I am speaking at the 360|Flex conference in Indiana! For those of you who don't know what 360|Flex is, it is a 3 day conference were nerds like me gather to talk about the new technical and business developments in our industry, Adobe Flex and building Rich Internet Apps.
I will be speaking on using RSL's (Remote Shared Libraries) in Flex. I will be speaking on the last day of the conference. Here is my session header:
Advantages of using adobe framework RSL's, creating and using custom/community driven RSL's, differences between Flex Framework RSL's (3.0.0.477, 3.2.0.3958), and bugs and problems presented by not using the right Flex Framework RSL.
I am slightly intimidated by the speakers list too! Renaun Erickson, Ben Stucki and Yakov Fain are just a few. Yikes! It should be a great conference.
If you’re thinking about going, you’ll want to register ASAP, as the tickets are cheaper on a first come, first serve basis. So register at http://360flex.eventbrite.com now to get the best possible price.

Alex Uhlmann on Agile Testing and Unit Testing in Flex
I got an email from Alex Uhlmann answering some questions about Flex Unit testing, and pointed me to a presentation he gave at max on the topic! I guess that he had to twist some fingers to get the people at Adobe TV to post it
Here is the link
And embedded for your viewing pleasure.