Friday Humor with Mr. T
I have already posted a Friday humor post today, but hey it's almost Christmas so consider it a present. Of course, being the holiday season you may not have time for the jibba jabba but this video is worth it.
...
It may not be quite as good but here is William Shatner doing his commercial for WOW.
That Mr. T vid almost makes me want to try World of Warcraft, but EQ2 is where I spend my online gaming time and I don't have much of it to give.
---
Special thanks to the Mr. T Jibba Jabba Archive
Flex Builder for Linux Alpha 2
Just checked adobe labs today and I'm a couple of days late. Flex Builder for Linux Alpha 2 was posted on December 18th. ...
What's New in This Release
The additions to this version of Flex Builder Linux Alpha are:
JSEclipse plugin installation
Datavisualization Trial
Automated Testing Trial
Flash Player 9 Update 3 (9.0.115.0)
Installer with better messages to help installation on a 64-bit machine
Bug fixes
Unsupported Flex Builder Features
This section lists unsupported Flex Builder features in Flex Builder Linux:
Design view
States view
Refactoring
AIR support
Data Wizards
Cold Fusion - Data Services Wizard
Web Services introspection
Profiler
Sick Kids and Christmas
My wife and I figured out last night that we haven't had one Christmas season go by since our oldest son was born where we didn't have to deal with sick kids. Specifically, sick kids who require antibiotics and are not sleeping through the night because of the sickness. Meaning we don't sleep through the night because of their sickness. This explains why I've had a tough time enjoying the holiday season that last 5 years. Oh well, hopefully I'll start sleeping better next year. At least only one person in the house is sick right now :)
Whoever coined the term sleeping like a baby must have been misquoted.
Hidden Gems - mouseFocusChange
Today I was working on a project using the Flex TileList component to make an icon bank for a project I'm working on. The problem I ran into was deselecting the items. Like other ListBase Components, when an item gets selected in a TileList it stays selected until you select another item. I needed to unselect the icons when I clicked anywhere but an icon. My first thought was to use the onFocusOut event but that only worked when you clicked somewhere that took focus. Scanning through the list of events for the TileList component I saw the mouseFocusChange event that is fired by all DisplayObjects. I used it to change the selectedIndex to -1 and it worked as required. ...
Here's a sample of my MXML code for the icon bank
<?xml version="1.0" encoding="utf-8"?><mx:TileList xmlns:mx="http://www.adobe.com/2006/mxml" itemRenderer="com.provismedia.dashboard.views.Icon" backgroundAlpha="0" dataProvider="{model.userIconData}" doubleClickEnabled="true" itemDoubleClick="this.selectedItem.event.dispatch()" mouseFocusChange="this.selectedIndex=-1" > <mx:Script> <![CDATA[ import mx.events.ListEvent; import com.provismedia.dashboard.model.DashboardModel; [Bindable] private var model:DashboardModel = DashboardModel.getInstance(); ]]> </mx:Script> </mx:TileList>
----
Daryl "Deacon" Ducharme is currently Director of Application Development for the Interactive Agency Provis Media Group, LLC which helps organizations enhance identity, connect with customers and increase productivity.
You've got Moxie - Flex Builder 3 Beta 3
Just this morning I found a bug in Flex Builder 3 Beta 2 and checked the bug database. The bug was there and labeled as fixed for the Beta 3 release. This got me wondering when beta 3 would be out, especially since my beta 2 version was about to expire. I didn't have to wonder long because as I was checking my feed from Adobe blogs I saw that it was released on labs this morning. So currently I am downloading and updating the new version for testing.
Unfortunately, Flex Builder for Linux didn't come out with a new alpha release at the same time. I'm thinking it will be soon though, because that version is set to expire in 18 days. Currently hoping for design view.
AMFPHP $_explicitType understood
I've been using AMFPHP for a while now. Up until recently I have been using dumb objects and simple NetConnections to pass things back and forth between Flex and PHP. Over time, the objects I was passing back and forth got more complex and strong typing of the objects looked like a better way to go, but there was a lot of code that would have to change in my libraries to make it happen so I kept putting it off. ...
Recently, a couple projects I was working on had me take a look at the Cairngorm micro-architecture to help speed up (re)development. After finding some great tutorials on getting starting with Cairngorm I decided it fit the bill for my needs.
Cairngorm would allow me to refactor some basic frameworks I was going to use for these and future projects while allowing for easier customization and modification. The architecture makes use of RemoteObjects to pass data back and forth instead of raw NetConnection objects. Between RemoteObjects and the ValueObject design (anti?)pattern I felt it was time to work on strong typing my variables, specifically the ones traveling from PHP to Flex.
Two important parts to making this work are the RemoteClass meta tag in Flex and the $_explicitType variable in PHP. The RemoteClass meta tag lets your application know the fully qualified name of an alias class on your server. It works the same for AMFPHP, ColdFusion, Java and others. It should look something like this:
package path.to.asClasses { [RemoteClass(alias="path.to.MyAliasClass")] public class MyASClass { public var id:uint; public var name:String; } }
My first thought about the $_explicit type variable was that it would be the inverse of the RemoteClass meta tag and point to the actionscript class. With that in mind I wrote something like this:
<?php class MyAliasClass { var $_explicitType = "path.to.asClasses.MyASClass"; var $id; var $name; public function MyAliasClass( ){} } ?>
Unfortunately, the data that got passed back to Flex was typed as an ObjectProxy object instead of as a MyASClass object as intended. I did all the basic troubleshooting. I made sure everything was spelled the same. I tried to do searches online and got mostly references passing VOs from Flex to PHP and/or Patrick Mineaults opinion that doing so is wasteful. Not many of the search results talked about going from PHP to Flex and those that did just said you needed to use $_explicitType. Unfortunately I can't find the posting again, but I came across a short post that said they had a similar problem and got it to work by changing $_explicitType to a string representing the fully qualified path of the PHP class. He didn't know why it worked, and neither did I, but I tried the following code and class typing occured as expected:
<?php class MyAliasClass { var $_explicitType = "path.to.MyAliasClass"; var $id; var $name; public function MyAliasClass( ){} } ?>
As usual, I got it working and now I needed to understand why. Not only why did it work but why did they use the term explicit type? It turns out the use of the RemoteClass meta tag takes care of mapping in both directions. When the Flex app encounters an alias object from remoting ( in this case path.to.MyAliasClass ) it knows what AS class is equivalent. As for explicitType, you just have to think about the full notation ( MyAliasClass::_explicitType ). In object oriented languages an object's properties should represent it's state. In this case it represents the explicit type of MyAliasClass. This is required due to the constraints of PHP. PHP is not case sensitive when it comes to class names. Also, PHP doesn't actually use classpaths. When you include a file there is no reference to the directory structure passed along with it. Though one could be derived, it isn't built into AMFPHP natively.
--
Some other good news related to AMFPHP. While looking for answers I see that AMFPHP now has a new lead who is working on getting version 2.0 out and ready to go. Supposedly he already got authentication working again. His name is Wade Arnold from T8Design. This is good news as it once again assured the future of the AMFPHP project.
----
Daryl "Deacon" Ducharme is currently Director of Application Development for the Interactive Agency Provis Media Group, LLC which helps organizations enhance identity, connect with customers and increase productivity.
More Rewatching of the Karate Kid
A little over a month ago I rewatched the Karate Kid in full. It is a great movie that stands the test of time. After watching the movie I posted an article that focused on Mr. Miyagi. In the interim, I've gotten to watch the movie again. This time with commentary. While we can still ask ourselves the question of how to be Mr. Miyagi, it is probably just as beneficial to ask ourselves the question of how to be Daniel Larusso. ...
My original post was based on the fact that many people who watch The Karate Kid say to themselves, "I wish I had a Mr. Miyagi." This time my post is going to focus on that same thought but with the perspective of how to get your own Mr. Miyagi.
To figure out how you to get something you want it can be helpful to find someone who has what you desire and figure out how they got it. The only person who got their very own Mr. Miyagi ( in the first parts anyway ) was Daniel Larusso. In rewatching the movie, with commentary, I saw that he had Mr. Miyagi in his life because of 2 things - he asked for help and he was coachable.
Asking For Help
In the movie, Daniel asks for help from Mr. Miyagi after he finds out that Miyagi knows enough karate to beat up 5 of the Cobrah Kai at once. I once heard someone sum up a book about getting what you want. He said it could have been written in one sentence that read, "Ask for it." Asking for help may not come easy to people with an independent nature but the act itself couldn't be any easier. By simply asking for help, by simply asking for a mentor you make your desires clear to people other than yourself. While you may not always get the results you desire, the benefits are usually positive.
Being Coachable
We make sacred pact. I promise teach karate to you, you promise learn. I say, you do, no questions.
It's very simple. If you want a mentor, if you want someone to coach you, you need to let yourself be coached. Normal human behavior has us put up walls when other people tell us to do something a different way. For many things in life this is okay. For some it may even be better. When you want someone to teach you something, it is time to be open and listen. In the karate kid Mr. Miyagi lays the ground rules at the beginning, as quoted above. In the commentary, Ralph Macchio talks about how he would never do all the work Daniel you did. Without doing the work, without taking the coaching he never would have learned wax on/wax off, sand the floor, paint the fence, side-side(paint the house) and those were just the first lessons.
So if you find yourself watching anything with Pat Morita and wishing you had a Mr. Miyagi know that you can have one. You might have to find a mentor first, but once you do just ask. Once you get a mentor it's time to surrender to their teachings - it is time to learn.
NPR Democratic Debate
I've posted about both CNN/YouTube debates for both the Democratic and Republican parties. This past Tuesday, the Democratic candidates did a radio debate. A little different than what we've been used to in the television age. Being different, it's a good listen. You can even download it as an MP3. I had to do a little searching to find the transcripts and audio to listen to it online but here you go:
http://www.npr.org/templates/story/story.php?storyId=16898435 ...
A nice quote from Denis Kucinich early on
See, when people say all options are on the table, as the three senators have, they actually encouraged President Bush and licensed his rhetoric.
And a later quote from Senator Christopher Dodd, that speaks to something I've written about several times in this blog:
We have so benefited as a result of people who have come here because of religious, political persecution, seeking a better life for their families. This has been a great source of strength for our country. We need to work with it, obviously be practical about it. But this is a source of pride in our country, not something to be talked about in negative terms.
Watch Republican YouTube Debate Online
Little old internet savvy me just learned about embedding YouTube Playlists. Enjoy:)