I Have the Best Roommate and Here’s Why

July 11th, 2010

This week, I arrived safely, albeit slight jetlagged, home from my Denver trip. I hadn’t seen my roommate Kathryn in about a week so we played catch-up in the kitchen right before bedtime. We reciprocated stories about our forth of July weekends when, throughout our conversation, we were interrupted by a periodic and faint yelp-squeal.

It sounded like it was coming from the inside of our stove. I crouched down to confirm that it was, in fact, coming from that general vicinity. Kathryn grabbed a headlamp from her room and we both crouched down with one eye to the floor. It was clear that among the thicket of dust balls was a tiny mouse caught in not one, but two traps.

Kathryn removed the drawer from underneath the oven so that we could get a better look at the mouse situation. Awhile ago, our landlord had placed sticky traps under our oven in combination with these black plastic clamp traps. Somehow the mouse had managed to find the only sticky spot not covered in pillowy gray dust while having its hind parts crushed in the clamp.

The terms of Kathryn and I’s contract for what was going to happen next were agreed upon before proceeding. It can be summarized by the following: I was going to owe her one. My role would be to stand with one foot in the kitchen and one in the hallway with a clenched fist near my mouth. Humans have long and tumultuous relationship with mice, so I felt that evolution was clearly defending my cowardice.

While Kathryn and I discussed the soundest course of action she should take, the mouse started chewing its leg in some desperate, last ditch effort to spread vermin blood all over our kitchen floor. We were clearly wasting time. Kathryn found some gloves, a brown paper bag, and a broom. She brushed the mouse and attached traps into the bag, rolled up the top and scurried out the front door. My sigh of relief was interrupted when seconds later she returned with the unopened brown bag.

Kathryn felt guilty for just leaving the yelp-squealing mouse in the trash can. The only decent thing to do was a mercy killing and the cleanest solution was drowning. Kathryn filled a large yogurt container with water and went to the back porch where she apologized profusely before committing our furry foe to a Stoneyfield Farm grave. As the unqualified medical examiner, I came to the back porch to see that there was no movement of the sticky paper.

Kathryn, you are a brave and courageous individual. Thank you. And yes, I owe you one.

Unequivocally Cold

June 17th, 2010

We all live on a silent island. It’s freezing and I shut the windows, but I’m still unequivocally cold. When I feel cold, I hear the reverberating sound of a maternal voice telling me to “put on a sweater”. I don’t even own a sweater.

The mornings are challenging. Someone throwing an iced bucket of pain on my face, and I’m instantly wide awake unable to think about anything except the things I’d soon forget. My mind grasps for a resting spot where I can watch those other memories storm by.

This morning’s restful spot was about how my friend recently said that what I’m feeling “is human”. If being human is what this is, natural selection is a cruel beast. Yet, it’s comforting to think that my genes are controlling me more than my irrational free will.

What is the evolutionary advantage to heartbreak? Does it make sure that we learn to not take love for granted? Does it force us to relentlessly pursue someone who’s not in our best interest? Does it make us hyper-sensitive to the relationships that are undoubtedly meaningful?

Hattie’s Cupcakes

May 18th, 2010

He was already running ten minutes late. His stubble and hair were the worst combination of terrifying and unsightly. If Charlie was going to make it to Hattie’s birthday then he needed to finish piping the red buttercream frosting. Red was Hattie’s favorite color and he promised hand-crafted pastries weeks ago.

He was fifteen minutes late when the last bit of frosting was on. This is getting ridiculous. He surgically placed all of the little treats into a semi-opaque shallow box designed for the singular purpose of hosting a dozen cupcakes. He placed the container inside his bag, careful not to disturb the architecture of the frosting.

In order to not be late, Charlie needed to rush four blocks as fast as he could without running. He clutched the bag to his chest speed-walking while smuggling a confectionery sleeping baby.

Charlie cracked the door to the subway station with one finger and used his right foot for the rest. His frantic, sweaty face looked around for a conveniently absent clock. Keeping the bag level with one hand, he reached for the subway pass in his back pocket. He is interrupted with a stern and deliberate, “Stop!”

A shiny badge and pleated uniform repeats the single word instruction again. In the distance, a chorus of mechanical voices says, “The train is approaching.” Charlie says, “I need to… just… if I could please… my train…” Unaffected, the badge says, “I’m going to have to take a look in your bag.”

Charlie sighs while gingerly extending his bag. The officer snatches the package and drops it onto a white plastic table. The officer shamelessly separates the zipper to reveal a frosting massacre inside the plastic box. Then, in the background Charlie hears, “The doors are about to close.”

Creating and Seamless Audio Stream in AS3

February 18th, 2010

I was frustrated that there was no ActionScript3 equivalent for setting an audio clip to Stream as you can inside of Flash. I wanted to create a seamless audio loop that was synced with a corresponding looping MovieClip. Because the audio never quite lined up on the last frame of the MovieClip inside Flash CS4, there was always an audible seam. I created a class called AudioStreamController which takes a MovieClip and a Sound object as parameters. On ENTER_FRAME the playback of the MovieClip seeks to the frame of the corresponding Sound position (assuming that the MovieClip is roughly the length of your Sound).

package
{
    import flash.events.*;
    import flash.media.*;
    import flash.display.*;
   
    public class AudioStreamController extends EventDispatcher
    {
        /** The sound channel to control sound playback */
        private var __channel:SoundChannel;
       
        /** The sound object */
        private var __sound:Sound;
       
        /** The number of times to loop the animation */
        public var loops:int = 1;
       
        /** The animatino to sync to audio */
        public var __clip:MovieClip;
       
        /** The total number of frames */
        public var __frames:int;
       
        /** The last paused position */
        public var __lastPosition:int;
       
        /**
        *   The purpose of this class is to replicate the syncing that
        *   you can do in Flash using the audio "Stream" setting
        *   @param clip The animation you want to sync
        *   @param sound The sound object you want to play
        */

        public function AudioStreamController(clip:MovieClip, sound:Sound): void
        {
            __sound = sound;
            __clip = clip;
            __frames = clip.totalFrames;
           
            stop();
        }
       
        /**
        *   Start the playback of the audio and listen for new frame enter
        *   to seek to the correct frame of the animation
        */

        public function play(): void
        {
            __channel = __sound(__lastPosition, loops);
            __clip.addEventListener(Event.ENTER_FRAME, update);
        }
       
        /**
        *   Stop and return to the beginning
        */

        public function stop(): void
        {
            if (__channel)
            {
                __channel.stop();
            }
            __lastPosition = 0;
            __clip.gotoAndStop(1);
            __clip.removeEventListener(Event.ENTER_FRAME, update);
        }
       
        /**
        *   Pause the playback and save the current position
        */

        public function pause(): void
        {
            __clip.removeEventListener(Event.ENTER_FRAME, update);
            __lastPosition = __channel.position;
            __channel.stop();
        }
       
        /**
        *   Update event called on entering new frame of the animation
        *   @param ev Enter frame event
        */

        protected function update(ev:Event): void
        {
            // This is the percentage of progress of all the loops
            var percent:Number = __channel.position / (__sound.length * loops);
           
            // The current frame over all the loops
            var f:int = Math.round((__frames - 1) * loops * percent) + 1;
           
            // The current frame gets converted into a frame on a single loop
            f = f - int(f / __frames) * __frames;

            __clip.gotoAndStop(f);

            if (percent > 0.999)
            {
                __clip.removeEventListener(Event.ENTER_FRAME, update);
                __clip.gotoAndStop(__frames);
               
                dispatchEvent(new Event(Event.COMPLETE));
            }
        }
       
        /**
        *   Destroy this controller object
        *   don't use after this point
        */

        public function destroy(): void
        {
            __clip.removeEventListener(Event.ENTER_FRAME, update);
           
            stop();
           
            __clip = null;
            __sound = null;
            __channel = null;
        }
    }
}

Exporting Layers as Separate SWFs

November 16th, 2009

Here’s another JSFL tool I created. This one will save each layer  on the current timeline (there’s also an option to export selected layers) as a separate SWFs. I find this useful for doing a batch process of transparent PNGs into SWFs. I originally made this for my co-worker Evan who uses this to export layers of animation so that he can assemble them in After Effects and manipulate the layers independently (useful for doing things like depth of field, parallax, or setting up 3D scenes). The SWFs that are generated are named according to the layer name (e.g., “my-circle” layer is exported as “my-circle.swf”).

This is Flash CS4-only. Download the extension here and run with the Adobe Extension Manager to install. Restart Flash and run under Commands > Exporting > Export All Layers or Export Selected Layers. This tool is licensed under the MIT license.

Library and Layer Renamer Tool for Flash

November 15th, 2009

I occasionally need to do a lot of renaming in Flash. For instance, you bring in a bunch of PNGs into Flash, distribute them to layers, but want to remove “.png” from their name on each layer. Or, maybe more practically,  you want to rename all your library class names from the package “com.domain.” to “com.anotherdomain.”. Well you’re in luck, because I just created a tool that does just that.

Library and Layer Renamer is a JSFL tool for Flash CS4 only. This tool has two functions (which can be found under the Commands > Utilities menu in Flash). First choose a selection type–for the Library Renamer, you can choose all items, only selected items, or build a selection based on a regular expression (e.g. to match all items with the string “.png” you would type in “\.png” in the text field below “Match Pattern”).

Next, if you’re using the Library Renamer, you can choose what to rename: the base class, the class name, or the library item name. For the Layer Renamer, only the layer name is affected.

Based on the selection, you can add a prefix, suffix, or do a pattern replace.  For instance, if you have five library items ["my clip", "my ball animation", "my graphic", "my button", and "my special something"] and you want to replace the word “my” with “sam’s” in each of those item names, the pattern would be “my” and the replace would be “sam’s”.

Where can you get this wonderful tool? You can download the latest from here. You can install this with the CS4 Extension Manager (a restart of Flash is required). This tool is licensed under the MIT license.

Library Renamer UI Screenshot

Layer Renamer UI Screenshot

Regular Status

July 30th, 2009

Regular status means upon entering a point of service (restaurant, coffee shop) your exact order can be anticipated without any verbal or physical prompting.

My friend Dave Schlafman is the professional at regular status. He has more regular status in the metro Boston-area than anyone I know–probably dozens of restaurants and coffee shops. I’ve known this about him since we were at college together. I believe I have distilled down what exactly are the qualities that make regular status possible using Dave as a test case.

  1. You need to be memorable to the staff who probably sees hundreds of people each day. Options include being: very friendly, neurotic, funny, eccentric.  A consistent visual cue, like wearing the same jacket or hat, certainly would help to make you recognizable.
  2. You need to be original with your order.  Maybe even get something that no one else would order. For instance, at Starbucks Dave’s order goes something like this: “Soy chai latte, five pumps of chai, no water, extra extra extra hot”.
  3. You need to be consistent and order the same thing each time even if it means settling for monotony. Dave is so habitual that he rarely deviates from the one thing he likes.

If you do these three things time after time, I believe you will be able to attain regular status (but probably not as much as Dave).

Unofficial, Uncut LA Bucket List

July 11th, 2009

Much of this list was generated with the help of Katie Diane Ricketts. She says, “Let LA surprise you with all kinds of adventures not even on this list!! You will be amazed!! :) !”

Alarm Clock Free Since 2008

May 22nd, 2009

In the past year, I have stopped using an alarm clock (or my phone’s alarm clock) to wake up in the morning.  In addition to my technophobic refusal to be ruled by machines, alarm clocks create unnecessarily stress starting my day and make it difficult for me to remember my dreams.  The challenge of being alarm clock free, however, was that I didn’t want to be as disciplined about the time I went to bed.  It took me some experimenting and research to figure out the alarm clock’s Achilles’ heel:

To wake at a consistent time–even with variable to-bed times–is to eat something as soon as you get up in the morning.   Your body will  respect this eating schedule and wake you up at the same time each day.  The only downside it makes it really hard to sleep late on weekends–but afternoon napping is fair game!

Cloud Kid Logo Development

May 11th, 2009

Worked on this logo project this weekend with Dave and Evan.  Went through several rounds of exploration until we finally settled on the last logo design.  We wanted something that was fun, playful and simple .  The first round was decidedly too cartoony.

round01

Round two was a little more serious, a little more iconic. Tried some different type faces and imagery that was slightly less illustrative. I also had the idea of a kid on a swinging trying to swing really really high. I think it was an interesting idea but started to get a little too whimsical and poetic.

round02

The rocket ship seemed like the more interesting silhouette.  Tried two more figures to see if I could come up with something that was a little less nostalgic than the kid on the swing. Jet packs and climbing seemed slightly more adventurous.  Although I think the execution never really got there. Also, with this round, I tried to de-emphasis the “kid”.  I really wanted the focus to be on clouds, flying, imagination than kid. Even when you say “cloud kid” the emphasis is on the first word.

round03

The forth round was an attempt to take all the comments, and make some initial choices about direction. All three designs used a rocket ship, all three had two words with different text emphasis.  The rocket ship was a much more interesting item to focus on because it has a really strong silhouette value but also could look really great illustrated in full color.

round04

With the fifth round I really wanted to show a high detail and low detail version of the logo to see where the strengths and weaknesses were. I also wanted to make one last attempt at the figure logo. There was something that was really interesting about the swinging kid, jet pack kid. In this forth one, which I anticipated would be a throw away, I decided to add a kite to the climber from the other round.   However, it kept reminding me Dreamworks’ boy fishing.  The first option was by far the strongest. I got rid of the de-emphasized text for “kid” because it was hard to read the tail of the jet with the skinny ‘k’.  I could, however, accomplish the same effect with color or grayscale.

round05

This is getting pretty close to the final branding. After tweaking the rocket for the full color version, I decided that the black and white version needed to match for cohesiveness.  I’m pretty satisfied with the result. It accomplished all of the things we were looking for. The full color version on the white background needs some color help, but we may end up favoring the reverse logo anyways.
cloudkid_final
We decided the logo needed a little warmer color–overall it was looking a little too cold.  I also added a few highlights on the ship to make it appear a little shinier.  
cloudkid_final_02

cloudkid_final_02_detail