« May 2006 | Main | July 2006 »

June 30, 2006

This is the end

Well not really. I've been doing daily updates to this blog since the beginning of this year. I don't really have enough to write about to really keep that up, so this blog will now return to its regular infrequent cycle.

Tags: blog life

June 29, 2006

AS3 Code Coverage

Note A code coverage tool is now available at http://code.google.com/p/flexcover/.

This maybe a little crazy but I'm going to throw it out there. I've been thinking about a way to get code coverage reports for Actionscript 3. We make heavy use of FlexUnit at work, but I'm always curious just how much of our code is really covered with the tests. I've not found anything about code coverage tools with the few Google searches that I've run hence my search for other solutions.

My current idea is to leverage the Flex debugger. Something along the lines of creating a break point on every line in ever file that you want to check coverage of. As the break points get hit, remove them. Once all of the test code is done running, see if there are any break points that haven't been hit.

This isn't elegant by any means but it should be possible to test the theory with a few hours work. If someone knows of a tool that already does this I'd love to hear about it. Otherwise I'll see how my hacking goes.

Tags: as3 fdb flex testing

June 28, 2006

Regular Expression Tester Updated

With the public release of Flash player 9, I've updated the regular expression tester to use the latest version.

I also fixed a bug with the display of optional groups.

NOTE: If the screen is blank, that probably means that you don't have the correct Flash version. Stop by the Flash version page and make sure you have at least 9.0.15.0 installed. If you don't you can easily download it.

Launch RegExp Tester!

Tags: flex regexp

Flex 2 / Flash 9 Released

Adobe is now shipping Flex 2 and Flash 9. Get them now!

The best part is that the Flex 2 SDK is FREE.

Check out the new Flex.org site for everything about Flex.

Tags: flex links

June 27, 2006

Zuma

In the beginning there was the song "Dragosteta din Tei" by Romanian boy band O-Zone.

Next came a man called Gary Brolsma who posted a video of himself dancing and lip-syncing to the song.

This made news.

Along came Brooker.

She posted a spoof of Gary's video on YouTube.

This along with her other videos created a growing fan base.

Then Carson Daly found her stuff and is going to sign her up.

I love the Internet!

Tags: links

June 26, 2006

One of those days

Today is one of those days where about half way to work a tremendous sense of relief flows through your body when you realize that yes in fact you did remember to put clothes on before leaving the house that morning.

Tags: life

June 25, 2006

Adventures in Camping

I took a long weekend and drove down to Princeton, New Jersey to attend David and Sharon's wedding. I didn't stay in the Princeton area, instead I decided to camp at Cheesequake State Park over in Matawan, about a 40 minute drive northeast of Princeton. This plan would have worked out well expect for the fact that it decided to rain. Some of you long time readers may remember my last camping adventure and have similar bad flashbacks. One vital piece has changed since last time and that is the fact that I bought a new tent.

A former coworker pointed me at Nikwax as a possible way to restore my old tent. The lack of water proof wasn't the only issue that my old tent had. It also had a couple of patched holes in the floor and the frame poll elastics were shot, not to mention prone to leaving a metallic residue on your hands. Needless to say the tent didn't owe me anything else. A random trip to REI brought me in touch with the Lighting from Sierra Designs. A similar profile free standing two person tent. After this weekend I can safely say that 1) this tent is water proof and 2) it was a great buy. I love the added breathability of the tent and the under cover but outside the tent protected area by the door made a great place for storing my boots (helping keep the sand and muck outside the tent). I got the optional ground mat which I only suspect helped with the overall water withstanding that the tent did.

Now I did say that I was also going down for a wedding. I especially chose Cheesequake since it had shower facilities. I didn't think anyone would really like me showing up to the wedding a day of grime and wearing the clothes I had slept in :) I can only imagine that I surprised the couple that was standing outside of the showers when I walked out in a full suit and tie. I was in a hurry at the time so I didn't get a chance to chat with them but I could see some confusion registered on their faces.

Since it was raining almost the entire time I was at the state park I didn't explore as much as I had hoped. They do have an extensive set of nature trails with many interruptive signs and some great views. The walk I did go on was primarily around the Hook's Lake area. They have a couple of osprey nesting posts in a part of the area. Unfortunately the nests are set way back and you would really need a set of binoculars to see anything. The zoom on my camera didn't help at all. Being that it was very humid and drizzly during my walk the bugs were also out in full force. I managed to avoid most of them by being covered up in rain gear and having thrown on some Ben's. Alas, a couple still found bare spots and I ended up with a couple of now very itchy bites.

The wedding was in the Princeton Chapel. I think this is something of a misnomer as it is more like a cathedral. I'm sure if I went digging I could find out exactly why it's called that but frankly I'm not that curious about it. The stained glass in the building is a beautiful blue and very hard to take pictures of. About the only pictures I have that turned out well were some shots of the outside of the church. This is the second indoor wedding I've gone to in which I've had almost no luck getting any pictures. I'm sure there are some settings I could tweak on my camera to get better shots. In any case a couple of them didn't turn out that bad.

And since this post is kind of rambling all over the place, instead of being broken up into three posts, I'll just stick in a complain about traffic around NYC. AFAIK no navigation system is supporting real time traffic rerouting for the northeast, because I sure would love to have one of those systems. All told I think I spent about two hours crawling along at about 10 MPH around NYC. Some of that may have been avoided if I didn't just plug my final address into my GPS. One humorous piece was at some point a Peter Pan bus tried to merge into the tractor trailer that was in front of me. The truck lost part of its front left wheel cover. Now keep it mind that this all happened at about 8 MPH.

Killing time between the ceremony and the reception I headed out with David's cousins to an ice cream shop near Princeton called the Halo Pub. Very yummy stuff. I also learned some Princeton lore while eating the ice cream since one of his cousins had gone to graduate school there. The best bit was that it is bad luck for a freshman to walk through the main gate.

Oh yeah, I have some pictures from the weekend.

Tags: camping wedding

June 22, 2006

Missing Link

I can't believe I never linked to this. Must see. Although most of you that read this blog probably already have, multiple times.

Tags: flash funny

June 21, 2006

Blah

This blog seems to have distinct moods to it. Sometimes it is much more of a helpful blog, but other times it is much more of a random crap that it coming out of my head blog (dare one might say something more like an online diary). Well sorry to disappoint anyone that might be looking for a helpful blog entry, I've just not had the time to put those together. A good helpful blog entry I find usually takes about an hour to write. From putting together examples, doing some proofreading, and in general trying to make it a little more polished than an more drivel oriented post like this one.

Why am I ranting today? I woke up with that back of the throat scratchy feeling. Unlike the symptoms from a few months ago which never really amounted to anything, this time I think its for real. I've already used up a third of a new box of tissues an on my second cold relief shot and have been going through cough drops like there is no tomorrow. I've drank half of the Nile today in fluids and have had pretty much nothing but mushy food (heavily soaked grape nuts for breakfast and soup for lunch and supper). Why do I mention all of this? Please refer to the earlier comment about drivel.

Since I've have a habit of writing about this every time it happens, since it annoys the hell out of me, I also get a record of its frequency. Maybe someday I'll look back on this and figure out what the root cause of these mostly mild cold like symptoms are. Also I also get mild hypochondria when I get sick like this and think I've got some bigger issue, because why should I be getting sick?

Tags: life sick

June 20, 2006

Behind the Scenes at Blue Man Group

On June 1st I found out that I was the lucky winner of the first "Behind the Scenes at Blue Man Group" promotion. This was a contest which was part of the new BMG Boston's New Mobile Community. I got a back stage tour of what goes into making the show happen from the sound, light, and manager's perspectives. I also got to sit through the sound check and prepatory work before the show begins. During the show I got my name in lights and got to keep the spin art from the show. Overall an even more incredable experience than I've had seeing the Blue Man Group in the past. Sign up, I have a feeling that they will be doing other cool events like this in the future.

While most of the photos that I was allowed to take I can't put online, I do have a picture of me with the Blue Man Group and the spin art from the show.

Tags: bmg

June 19, 2006

Pictures

I finally posted some pictures for the events over the weekend. I was too busy having fun at both events to really take that many pictures.

Tags: pictures

June 18, 2006

BBQ Wedding

Went to a BBQ themed wedding today. It was wonderful. A short and loving ceremony followed by BBQ and lots of playing in the sun. Thank you New England for not raining today. You may now resume your normal wet ways. I should have pictures later this week. Too tired to say much else now.

Tags: gilmanmanor life

June 17, 2006

Kimball Farms

Today I went out to Kimball Farms in Westford to play some miniature golf. While there I also went for a spin on the bumper boats and had lots of yummy ice cream. The mini-golf course was well put together with some challenging holes but nothing too easy or troublesome. There was an informal competition between the twenty or so people that were there. I managed to win coming in just two over par. I skimmed in under the next competitor who was at three under par. Overall a great course to play on and the other activities at the site make for easy distractions if mini-golf isn't your thing.

Tags: life

June 16, 2006

Interface Constants

Since it has come up a couple of times these past two days, I'm a little disappointed that AS3 interfaces don't support constants. I guess I'm too used to Java's interfaces and really wish AS3 interfaces were as versatile. I've ended up using a class which just has static constants in it to simulate the constants that I would normally have applied to the interface.

If I'm missing some syntax or a better way around this issue, please let me know.

Tags: actionscript as3 flex interfaces

June 15, 2006

Blue Man Group

I saw the Blue Man Group tonight. It was incredible. I hope to be able to say more later.

Tags: bmg

June 14, 2006

Flag Day

Urgent Action: Free Speech at Risk!

As Secretary Powell wrote in 1999, “The First Amendment exists to insure that freedom of speech and expression applies not just to that with which we agree or disagree, but also that which we find outrageous. I would not amend that great shield of democracy to hammer a few miscreants. The flag will be flying proudly long after they have slunk away.”

Tell your senators that the flag amendment would betray the very principles the flag represents.

Tags: aclu

June 13, 2006

Dynamic Interface

I would like a way in AS3 to define an interface as being dynamic. In some cases I want all classes that implement an interface to also have to be dynamic. Why might this be useful? I find the chained property accessors much nicer to deal with. I'm not as concerned about adding new methods to the interface and some of the other stuff that you can do with a dynamic class, I just want easy access to unspecified attributes. The fact that you can still use the associative array style lookup on an interface to get the same result only strengthens my belief that you should be able to mark an interface as dynamic.

Since you can't apply the dynamic keyword to an interface and there doesn't seem to be a system interface that endows dynamicness on an interface, you are forced to either use looser typing or use the alternative syntax. I think this calls for an example.

Say I have this interface defined:


package com.example {
public interface ISample {}
}

In another class I have a method that uses that interface:


package com.example {
public class UseSample {
public function displayProp(sample:ISample):void {
trace(sample.prop);
}
}
}

That generates the lovely compiler error:
1119: Access of possibly undefined property prop through a reference with static type com.example:ISample.

If you change the code to use array syntax it will compile:


package com.example {
public class UseSample {
public function displayProp(sample:ISample):void {
trace(sample["prop"]);
}
}
}

In my mind the array syntax is much more obtuse. Oh well, I can always hope :)

Tags: actionscript as3 flex programming

June 12, 2006

Regular Expressions

I've been playing around with Flex 2 for some time at work. One of the neat things that Actionscript 3 adds is native regular expressions. As part of an ongoing effort to share knowledge I volunteered to give an informal talk about regular expressions. To help with the talk I created this visual regular expression viewer. It helps show you what matched along with any groupings and other standard stuff. Additionally it can also perform a regular expression replace operation or a simple split operation.

You will need the Flash 9 in order to run the application.

Launch RegExp Tester!

If you find any bugs, have comments, etc. please leave me a comment.

Tags: actionscript as3 programming regexp regularexpression

June 11, 2006

Looks like June might be here

I saw the sun today. I saw the sun a lot today. I had almost forgotten what it looked like. It's been so rainy and dreary for most of June I thought it was still April. It even looks like it will be clear and in the 70s all week. I'm not sure I'll know what to do with that much sunshine in a row!

Tags: life sun

June 10, 2006

Grilling

I tried grilling some salmon with a cedar plank for dinner tonight. I didn't have things quite right since the plank really never started smoking. I'm not sure if it was the heat, how long I soaked it or what have you. In any case the salmon still turned out great. The good part is that I just need to try this again another week which just means more yummy grilled fish.

Tags: gilmanmanor grill salmon

June 9, 2006

When and How Will I Die?

No real morbidity in this, just playing around on the web:

You Will Die at Age 76
You're pretty average when it comes to how you live...
And how you'll die as well.

Or the The Death Clock(TM) says that I'll live to be 73. That and my personal day of death is... Sunday, October 16, 2050.

When I do die, I'm just going to disappear:

You scored as Disappear. Your death will be by disappearing, probably a camping trip gone wrong or an evening hike you never returned from. Always remember that one guy who was hiking alone and got in a rock slide. He could have died, but he cut his own hand off to save himself. Don't end up like him (or worse, dead).

Natural Causes

67%

Disappear

67%

Posion

60%

Bomb

53%

Gunshot

47%

Suicide

47%

Cut Throat

40%

Accident

27%

Drowning

27%

Disease

20%

Stabbed

20%

Suffocated

20%

Eaten

13%

How Will You Die??
created with QuizFarm.com

Lastly Ok Cupid says that according to their research, I'll be dead by May 2060 at age 83 most likely due to cancer.

Tags: death quiz

June 8, 2006

Dazed

This week has been blurry. Nothing has felt quite right. Maybe sitting through the entire 4400 marathon on Sunday wasn't as good an idea as it seemed. It was great to see all of the episodes again and it got me even more excited about the new season, but 11 hours is a lot of time to spend in front of a TV all at once. Thankfully having them all on DVR let me skip the commercials, but even so that was many more hours than I should have spent in front of the tube. Now I'm paranoid that I've gotten the arrival date/time of my mom's flight messed up. Blah. As a friend recently said, there are too many good things going on in our lives to dwell on the negative.

Tags: 4400 life tv

June 7, 2006

Return of the Rain

It rained again today. Enough rain to get more water in our basement. This is getting, no this is already old. Time to figure out what can be done to prevent this from being an issue in the future...

Tags: gilmanmanor life rain

June 6, 2006

The Circus is Coming to Town

Cirque du Soleil's latest touring show is coming to Boston (Sept. 8 to Oct. 8). I saw Corteo when it debuted in Montreal and loved it. Get your tickets now, they are on sale for Cirque Club members and the good seats always sell out fast.

Also if you want to borrow it, I just got a promotional CD-ROM in the mail about the show.

Tags: cds cirquedusoleil corteo

June 5, 2006

Events in Flex 2

Today I got a familiar error while working with some event code:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@35f04c1 to com.neophi.events.CustomEvent.

The short answer is that this error results from failing to implement a clone() method on a custom event class. The long answer is that most of the time not implementing a clone() method won't hurt you, based on how you use your custom events, but you really should create one. In fact the Actionscript 3 (AS3) documentation is pretty clear about this:

When creating your own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class.

This is a time that I wish AS3 had abstract methods.

Why I say you don't really need a clone() method is that it only becomes an issue if you relay an event. The follow code is an example of event relaying:

private function relay(customEvent:CustomEvent):void
{
    dispatchEvent(customEvent);
}

In this case an event listener redispatches the event that it got. When this happens the event framework behind the scenes calls the clone() method to create a new instance of the event. If you don't have a clone() method and the next listener in the chain is expecting an instance of CustomEvent, the error from above happens. If instead that same listener was only expecting an instance of the Event class, it would work, but any additional information contained in CustomEvent class would be lost, including the ability to cast it to an instance of CustomEvent.

In most cases the clone() method is simple to implement; just transfer any constructor arguments to a new instance of the class. Something like:

override public function clone():Event
{
    return new CustomEvent(_message);
}

Based on the type of event you will probably have more arguments including the all important type and often the other standard event variables for bubbling and cancelability.

While I'm on the subject of events I'll also talk about Event metadata or annotations that you can apply to classes. Often if you have an AS3 class that can emit custom events you will add metadata like this at the top:

package com.neophi {
    import com.neophi.events.CustomEvent;

    import flash.events.EventDispatcher;

    [Event(name="customChange", type="com.neophi.events.CustomEvent")]

    public class EventSource extends EventDispatcher {
        // class code removed 
    }
}

The thing to keep in mind is that depending on how this class will be used you probably don't need that metadata. If this AS3 class isn't used in MXML you can skip the metadata. The metadata is only used to inform the compiler how to translate an MXML event attribute into the appropriate code.

For example with the above class and metadata you could use it in MXML like this:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:neophi="com.neophi.*">
<mx:Script>
<![CDATA[
import com.neophi.events.CustomEvent;

private function customChanged(customEvent:CustomEvent):void
{
    output.text += "EventTest: " + customEvent + "\n";
}
]]>
</mx:Script>
<neophi:EventSource id="eventSource" customChange="customChanged(event);" />
<mx:Button label="Go" click="eventSource.source();"/>
<mx:TextArea id="output" width="100%" height="400"/>
</mx:Application>

Because cutomChange is defined in the metadata for the EventSource class, in MXML you can now assign a handler to that event. In this case the method customChanged will be called whenever our instance of EventSource dispatches that event.

The method the button is calling to cause eventSource to fire the event is:

public function source():void
{
    var customEvent:CustomEvent = new CustomEvent("Event Message");
    dispatchEvent(customEvent);
}

This code is part of the EventSource class listed above. A new instance of CustomEvent is created and then dispatched. At this point all listeners will get called.

If you tried instead to assign the customChange handler in MXML without the metadata in EventSource you would get a compile error like this:

Cannot resolve attribute 'customChange' for component type com.neophi.events.EventSource.

For events then the two rules of thumb are:

  1. always create a clone() method in any custom event class
  2. add event metadata if you will need to setup handlers for that event in MXML

Tags: actionscript3 as3 events flex programming

June 4, 2006

No Entry Today

Tags: life tv

June 3, 2006

A Sense of the Mysterious

A sense of the Mysterious by Alan Lightman is primarily a collection of his essays that have previously appeared in various other magazines and publications. The essays cover a wide range of topics and range from his personal observations about being a scientist to short biographies about other scientists. Overall I didn't find the book that engaging. While the essays were organized well, I didn't find themes that followed through all of them to really tie the book together. They felt just like a collection that had been repackaged together.

In many of the essays I found the author's frequent digressions to be distracting and superfluous as they didn't offer any support of the main topic. With all of that said there are nuggets of reflection buried throughout the book that I found myself agreeing with and broadening my own perceptions. The concept of the "creative moment" isn't something I have felt to the same degree as Mr. Lightman I have briefly touched its outer edge and agree with his description. His "Prisoner of the Wired World" reflects many of the same feelings as the ceaseless society talk. Overall the book's short essay format makes for quick reading with one or two small nuggets to be gleamed from each piece.

Tags: books science

June 2, 2006

Gin

The Gilman Manor liquor closets are reasonably well stocked. I have tended to go on kicks of certain alcohol types. Last year it was sake. This year it has been gin. Tonight I decided to do a little blind taste testing of the gins that I had. I usually drink gin with tonic but tonight it was all straight gin. I had John randomize the six gins we have into shot glasses from which I sampled. I scored two out six in matching the gins. For the other four I swapped them, in what I consider similar categories of gin. I'm not a super taster by any means but I was happy enough to detect differences in them to make educated guesses. The six gins I tasted were:

  • Bombay Sapphire
  • Tanqueray
  • Van Gogh
  • Seagram's Distiller's Reserve
  • Hendrick's
  • Miller's Reformed

I swapped Bombay with Tanqueray, Van Gogh with Segram's, and got the last two correct. Overall I'm fairly far gone and I still like gin :)

Tags: gilmanmanor gin

June 1, 2006

4400

The vein is tapped. I'm all caught up. 4400 seasons one and two are in the bag. I haven't been this excited about a show in awhile. The show has elements of The X-Files and Taken but with a greater focus on the drama and characters versus the science fiction. The second season started off a little slow but boy did it pick up steam fast. A couple of phenomenal episodes thrown in with some great story advancement and enough material to kick off what I can only imagine will be an incredible third season.

I can tell you right now I'll be a couch potato most of this Sunday as USA is running a 4400 marathon of key episodes. If you haven't watched the show, this might not be for you as there are a lot of good episodes they are leaving out. This marathon is timed to kick off the third season which starts June 11th! Awwww yeah!

Tags: 4400 tv