Updated AS3 Yahoo! Search API library and CoilGallery Search Mashup premiere

The latest flash Beta bits, and a programmer named firdosh both illustrate the fact that my YahooAPI classes had a few problems.

I have addressed those issues, and everything works fine now.

In order to exemplify this, i actually decided to mashup the CoilGallery code senocular released.

The app is definitely a prototype, and there are at least 3 known issues w/ the search implementation:

  1. i am not properly handling image load failures, so in the event of an image load failure, the app basically stops loading images
  2. there is some debug output, but ignore that for now
  3. the search term (“jamaica”) is hard coded

I will address all of these issues when i have time .. for now, just consider it a proof-of-concept.

http://caleb.org/coilgallerysearch.html

The source for the above code may be found here:

Thanks Senocular, your code whips the llama’s ass :-D

As always, any additional feedback is appreciated :-)

Halloween @ Yahoo! Research Berkeley


the real costumes.

This is just a quick pic of myself, Gina, and Peter from YRB being silly on halloween. My mother (a.k.a. the sweetest, most kind-hearted woman in the world… and my hero) worked pretty hard getting my Akhenaten costume ready. She actually hand-made it from scratch; she is such a genius . She even went as far as to provide my girlfriend a Nefertiti costume to match my own.

Thanks Mom! I absolutely love you more than anything in the world.
(I know Halloween isn’t usually the chosen day for giving praise to one’s mother, but she certainly deserves it. )

If you have the time, feel free to check out my Flickr photostream.

Happy Halloween!

the real costumes” Originally uploaded by meandmybadself.


Flash Remoting: Error-proofing the Connection class

We all love Flash Remoting (and in particular AMFPHP). We ambitiously defend this new paradigm of RIA communication, emphasizing it’s numerous advantages and the significant, immediate benefits we can achieve by introducing remoting techniques into our code.

However, as Jeffery Bennett recently pointed out to me, the Connection class does not dispatch onStatus events if the gateway is inaccessable for whatever reason. This posting shows you have to add this capability with a few simple lines of ActionScript, giving you the ability to elegantly handle such errors.

This is how you would typically construct a simple method call using AMFPHP:


import mx.remoting.*;
import mx.rpc.*;
import mx.remoting.debug.NetDebug;
var gatewayUrl:String = "http://dev.caleb.org/amfphp/gateway.php"
var service:Service = new Service(gatewayUrl, null, 'HelloWorld');
var pc:PendingCall = service.say("Hello world!");
pc.responder = new RelayResponder(this, "handleResult", "handleError");
function handleResult(re:ResultEvent)
{
trace('The result is: ' + re.result);
}
function handleError(fe:FaultEvent)
{
trace('There has been an error');
}

The Connection class is typically employed by the Service class. If you inspect the signature of the Service class constructor, you’ll notice that the 5th [optional] parameter is the responder.

Service ( gatewayURI, logger, serviceName, conn, resp)

The first example doesn’t employ that handler, and even if one where to pass a responder, it wouldn’t receive error event dispatches. The Service class documentation states, “The resp parameter allows you to specify the responder object that contains the result and fault handling methods that receive control when the service returns a result or a fault condition.”

The problem is, the Service class doesn’t receive a fault condition if the Connection‘s gateway creation fails. The Service class assumes that the Connection class has a gateway that is online. Of course, there is no guarantee that this can happen; it’s obviously a potentially erroneous assumption.

In order to error-proof the call, we need to make 2 simple changes to the Connection class, and 1 simple change to the Service class (in addition to passing a valid responder in as the 5th arugment to the Service class).

Changes to the Connection class:

Change to the Service class:

Following is the actual code we had to modify:

Connection class:

  1. Added 1 line to constructor
  2. AsBroadcaster.initialize(this);

  3. Added onStatus method which dispatches onStatus events using ASBroadcaster

  4. public function onStatus( status ):Void
    {
    trace('[Connection Class] onStatus invoked');
    this.broadcastMessage('onStatus');
    }

Service class:

  1. Added 2 lines @ Line 73

  2. __conn.addListener(this);
    __conn.addListener(__responder);

The “error-proof” example below shows you how to modify both the Service class and the Connection class (Note: I intentionally broke the following code in order to ensure that the onStatus method is invoked. If you want to see it work properly, change the “pdhp” to “php” in the gatewayUrl variable declaration):


import mx.remoting.*;
import mx.rpc.*;
import mx.remoting.debug.NetDebug;
var gatewayUrl:String = "http://dev.caleb.org/amfphp/gateway.pdhp"
var service:Service = new Service(gatewayUrl, null, 'HelloWorld', null, this);
var pc:PendingCall = service.say("Hello world!");
pc.responder = new RelayResponder(this, "handleResult", "handleError");
function handleResult(re:ResultEvent)
{
txtFeedback.text = 'The result is: ' + re.result;
}
function handleError(fe:FaultEvent)
{
trace('error');
txtFeedback.text = 'There has been an error';
}
function onStatus( status ):Void
{
trace('onStatus invoked')
}

The files are available for download here: http://dev.caleb.org/download/code/ErrorProofRemotingConnection.zip

I would love to hear any feedback anyone might have :-)

Now hosting on DreamHost (thank you SourceForge)

DreamHost gives you 200 gigs of storage, 2 terabytes (!) of bandwidth, unlimited subdomain hosting, and a plethora of other useful services for less than $10/month. Hard to beat that.

I have been hosting caleb.org on SourceForge since April 26, 2001. Sourceforge has been, and will continue to be an integral element of my development paradigm. However, as of late the webservers have been lagging a bit (it’s understandable, considering how fast they grow) and thus I have switched over to DreamHost, which has proven to be an amazingly affordable and reliable webhosting company.

The DreamHost offices are located in the same building (i.e. datacenter) as some other very high profile hosting companies, including MediaTemple and MySpace, so they have a nice redundancy plan in place in case of an emergency.

Also, I’ve set up a special promo code that will allow you to set up a new hosting account with them at a substatially discounted price; the promo code is: caleb__yahoo

FITC Report Back

Last week I had the opportunity to join Yahoo! Maps’ Charles Freedman in presenting at the Flash in the can festival (FITC). We were presenting at the same time as Joshua Davis, so attendance at our presentation was minimal. However, we had fun talking with the people that managed to show up :-)

Chuck spoke about marketing concept using the Yahoo! Maps Flash API, and I pitched in by talking about some of the things Yahoo! is doing with Flash, including our FLV Video Remixer, Stats tracking applications, Finance Charts, and of course the Yahoo! Developer Network Flash Center which uses Yahoo! APIs from various Yahoo! properties.

I had the chance to hang out with some cool people, like Daniel Dura (it turns out his brother works at Yahoo! too, go figure), the guys from Metaliq, some people from Goodby, Silverstein & Partners, and the authors of Red5, a kick-ass open source Flash streaming server.

Honestly, I didn’t get the chance to see any really interesting presentations. I was only there for Thursday, and it was a Thurs-Sat conference, so I missed most of the fun stuff. I wasn’t there for Mario’s, but I heard he rocked. Chuck and I spoke at the same time as Joshua Davis, so I missed his too… but I heard he was great. At any rate, I’m still looking forward to the next one.

On that note … I also spoke to Shawn, the FITC conference organizer about potentially presenting at FITC in the future … so stay tuned ;-)

Yahoo! Maps @ Silicon Valley Flex Users Group Meeting Tonight

Yahoo! Maps’ Chuck Freedman (author of Wrox’s Yahoo! Maps Mashups … coming soon) will be speaking at the SILVAFUG meeting tonight in San Jose

The meetings are from 7:00 to 9:30 and alternate each month between SF and San Jose. Last month there was a good presence of Adobe Flex 2 folks on hand to answer questions. Chuck will speaking about maps and other Yahoo! APIs.

Here is a link to the location from the Yahoo! Maps Flash Beta.

Show up and represent!

Want to be a Flickr product manager?

Yahoo! is looking for a qualified individual to take the reigns of our Flickr product.

Following is a brief job description, contact me for further details.


Company: Yahoo!, Inc.
Job Title: Product Manager, Flickr
Location: San Francisco, CA

Description:
Flickr’s vision is to be the eyes of the world and we are looking for an individual who can share and drive forward our goal by helping grow a key new aspect of the product.

Specifically, we are looking for someone who can harness the potential of Flickr’s large and growing commercial eco-system to drive product richness as well as increased monetization for Flickr, Flickr’s users, and Flickr partners. If you’ve been thinking about these ideas we want to talk to you.

Some key responsibilities of the position:

  • Build a strategy and product requirements for next generation Flickr services
  • Help communicate the strategy vis-a-vis the Flickr and Yahoo product portfolio
  • Develop a strong understanding of specific sub-sector of the existing Flickr user base as well as a new set of incoming users
  • Identify and drive key (internal and external) partnerships to execute against the strategy
  • Drive product development and project mange the product implementation
  • Provide direction to outbound marketing through existing and new channels (virally, via eco system, etc)

Basic Qualifications:

  • BS in Computer Science preferred

Preferred Qualifications:

  • MBA or strong business/entrepreneurial preferred
  • Marketing, journalism, photography, photo acquisition or editorial experience all strong plusses
  • Web technology savvy
  • Determination to execute
  • Strong relationship building skills
  • Skilled communicator
  • Understanding of online communities
  • A proven track record in product management

Yahoo! Hackday Puppetron Video

Yahoo! really came through with some awesome entertainment, including the Puppetron team which created “Team America”. They gave us a live puppetshow as another element of Beck’s performance.

Yahoo! Hackday ’06 was Amazing!

Wow! What a blast. Hackday (a.k.a. Nerding Man) turned out to be everything that we hoped it would and more. We had an awesome turnout of “hackers”, some rockin’ music provided by Beck, and free food and beer … hard to complain about that.

I was fortunate enough to help contribute to the winning hack, details of which can be read here: http://developer.yahoo.net/hackday/2006/10/the_hack_day_winners_list.html

The Ladies of Black Box Nation are phenomenal. Please do yourselves a favor and check out their site: http://blogginginmotion.com/

All I really did was give them an interesting view of the photos their blogging purse captured. In order to achieve the flipbook effect, I simply modified the code available at http://www.iparigrafika.hu/pageflip/ to:
1- take a generic xml schema I defined as an input format
2- take flickr xml as an input format

I’ve heard rumors that it’s a bit CPU intensive, but hey it’s a hack. I need to queue the image loading, right now it’s tries to load all 10 at once, heh. It works fine for me, and the girls seemed to like it (it even made it into their demo), so I can’t complain.

Here is the result: http://blogginginmotion.com/Flipr/

Of course I will update the effect and publish the source when I find time (don’t hold your breath), and all updates will be available at http://caleb.org/Flipr/, but for now it’s just the same code as the Ladies of Black Box Nation have hosted on their site.

I will post more about hackday later, and there are some interesting changes regarding the Yahoo API’s available on developer network, so stay tuned.

Ruben’s Tube: by Jared Ficklin of Frog Design

This is the fire visualization I referred to in my FlashForward ’06 post, how awesome is this?