Blog

  • Silverlight on TV and in Startups

    I get exposed to a lot of girly TV shows. The reason is, my wife is one of those people who can leave the TV on for background noise, but not actually watch it. I’m the opposite. If a TV is on, I tune out everything else and get enraptured. During the working day when I’m at home, I’ll get up to get coffee or some food from the kitchen, and then return to my office to continue working. This path takes me past the living room where the Tivo has selected some weird show about modeling or some other celebrity thing.

    One particular show was Entertainment Tonight. Walking back to my office, I saw the Microsoft Silverlight logo. Naturally I slammed on the breaks, and stood there staring. This guy, one of the ET hosts, talking in all announcer voice went “Go to ET online where you can view other video content powered EXCLUSIVELY by Microsoft Silverlight”. Wow. I think I’d convulse on the ground like a 1980’s break dancer if they said that about Flash Player. If Ice-T wasn’t enough, now we have TV shows marketing it. Holy fish.

    Miles away from Adobe. Granted, both companies I think do a great job at engaging developers, but while the Adobe community makes their own banners, Microsoft fronts the bling for a media blitz.

    In other news, I got my first Silverlight 2 startup email. All through 2006, bit smaller amount in 2007, I’d get a least 3 new emails a week from startups looking to create some web app using X back-end with a Flex or Flash front end. It was really weird timing. I just told my CTO last week that we should hold off on any huge Silverlight endeavors that are greater than video players until at least Q1 2009. The reasons were Silverlight 2 is still in alpha, there are no official components yet, and we’re still at an early stage. For all of my positivity about Microsoft’s toolsets, Silverlight the plugin still needs to become ubiquitous in reality. Everyone can talk about how Microsoft can use Windows update, installation CD’s, etc., but it’s all talk and no action. Until I see numbers of successful installations and I can duplicate the ease of install on multiple computers, it’s not viable.

    Hopefully by Q3 of 2008, we’ll have all the toys ready to play with. At that point, we can start doing some serious investigation into the realities of porting some of our existing Windows Media content into a more Flash based realm; where video is dynamic and multimedia centric. Granted, we can do this now with all the alpha bits. Tons of people and companies did this with Adobe’s Flex 2 Alphas and Betas, building real-world projects, just waiting for the final release. They are doing the same thing now with Adobe AIR; in beta 3 and people are chomping at the bit to release on a final version with their already built products. I just mean actual development that isn’t considered skunk works and done off the company clock to make real progress with investigations.

    I can see how a company could perceive on how they could effectively build a product on alpha bits given both public videos such as Top Banana, and Adobe’s track record with usable beta’s. However, Silverlight doesn’t have a component framework out yet. If I’m wrong and it has an alpha version, then you’re good to go; if not, there is no point. Spending your time creating a List component vs. using a List component to build your product is a waste of time unless you plan on somehow monetizing your component work.

    Anyway, the tone of the email was the same as the rest I’ve seen in the past. Meaning, there will be more emails like this one. The Silverlight marketing is working.

  • Exception Handling in ActionScript 3 for AdBlock Plus

    I was reading Coldfused about AdBlock Plus, a Firefox plug-in that blocks ads and other elements of websites while you surf. I remembered that since upgrading to Firefox 2.0.0.11, my regular AdBlock plug-in is apparently not compatible. AdBlock Plus is.

    Upon installing and giving her a run, I noticed a video player application I’m writing for work started throwing an exception I hadn’t seen before. We’re using Dart for Publishers via a proxy company for one particular project, which still requires a URL request on the client to DoubleClick’s ad servers, ad.doubleclick.net, with 50 billion parameters on the URL. DoubleClick’s one of the biggest ad services on the net, one of the reasons Google bought ’em I’m sure. Therefore, they are also one of the filters that AdBlock Plus looks for and actively blocks. Any calls to doublelclick anything fail since it’s stopped at the browser level.

    This causes an IOError for URLLoader’s in ActionScript 3. I reckon this’ll throw a FaultEvent for HTTPService in Flex, but if you’re doing boiler-plate coding in either ActionScript only projects or Flash CS3 using URLLoader, you’ll need to write code to handle this in case any of your clients have ad blocking software installed. We already have a lot of exception handling on our own stuff since we develop on development & QA servers first and things can get wonky when the server guys update their stuff and something goes awry… or our client code is coded wrong. The only error’s we had seen in the Ad stuff was when the DoubleClick servers were configured wrong at a client site, and you’d get back a 1 pixel by 1 pixel transparent GIF in HTML instead of the XML you were expecting. In that case, we’d just dispatch a custom error event in the parsing function. This rarely happened and our error code was sound.

    …so I thought until I installed AdBlock Plus and re-tested our app. For the record, you should be doing at least this level of exception handling, if not more if you are doing any coding with classes that throw errors. In AS2 it was ok if things blew up; no one knew. Not the user, nor you. In AS3, however, the recovery isn’t always as good; a lot of times the code will just abort the whole stack. Since you can’t do this code on _root:

    try
    {
            runSWF();
    }
    catch(err:Error)
    {
            // something somewhere blew up good in my appz0r
            showErrorScreenMovieClip();
    }

    You need catch everything possible if you want to ensure your code has any hope of continuing. The whole point of exceptions, according to Java developers, is to catch the exception, and handle as best you can. Obviously, a lot of exceptions leave you with no options. If you own the code, you can show an error screen, and if your code is going into something else, you can dispatch an error event. That’s about it for some exceptions.

    For those creating applications that need to show ads inside their Flash & Flex apps, you need to assume you’re entering a hostile landscape where people are going to do everything they can to block your ads. If your policy is that ads drive the revenue of your business, you can abort everything when an exception is thrown. If your policy is to not trust 3rd party servers that cost 5 figures but don’t even allow you to do a test movie in the Flash IDE, then you log the error, and just dispatch an error so the rest of your code can move on with life.

    Below is some pseudo code that shows how you write near exception-proof code that hits some URL. The only thing missing is a timeout error. Writing a timer is complicated and controversial, so I’ll skip that part and assume if you get a timeout, you destroy the URLLoader, remove the listeners, and just dispatch a custom error indicating a timeout.

    // create our loader
    adLoader = new URLLoader();
    adLoader.addEventListener(Event.COMPLETE, onLoaded);
    adLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
    adLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);req = new URLRequest("ad.doubleclick.net/coldcrazyparams");
    
    // attempt to load
    try
    {
            adLoader.load(req);
    }
    catch(err:Error)
    {
            // Either HTTP Sniffer like Charles is running,
            // your VPN is offline, or your interwebs are silly.
            dispatchEvent(new Event("adError"));
    }
    
    // The host is ad-blocked or cannot be reached.
    protected function onIOError(event:IOErrorEvent):void
    {
            dispatchEvent(new Event("adError"));
    }
    
    // OT OT OT
    protected function onSecurityError(event:SecurityErrorEvent):void
    {
            dispatchEvent(new Event("adError"));
    }
    
    protected function onLoaded(event:Event):void
    {
            // all is well in the land of Hannah frikin' Lee
            // show ads, make bling, drink & celebrate
    }

    Don’t forget to put [Event] metadata tags at the top, so all people using your class (including you) get code hints in FlexBuilder for addEventListener. Usually, there should be at least 2 events in my opinion; complete and error. Since we don’t have throwable like Java, exceptions break the heck out of encapsulation, and events are both synchronous and asynchronous; events for the win.

    Side Rant

    Unfortunately, what the code above can’t do is dodge the dreaded VerifyError, aka invalid register accessed etc etc. You get this if your SWF gets corrupted in some way. I got one of these with Flex Builder 3 Beta 2. At first, I tracked it down do a nested XML namespace. Later, it turned out there was “magic funk” around the error function itself I routed exceptions to. I noticed that older CSS files had all of these errors for every style from a Flex 2 project. If I re-wrote them the exact same, letter for letter, they were fine. So, copied and pasted the whole thing to Notepad, and then back… and everything was fine. WTF? UTF-8 demon infestation? Anyway, tried same theory here; re-wrote function a good 5 blank lines away and low and behold, no more VerifyError. I’m hoping it was just a Beta 2 problem.

    Anyway, Flex Builder 3 Beta 3 rules so far.

  • Mix n Mash 2k7, Bill Gates, Web, Blend, and Silverlight

    I had the honor of being 1 of the lucky 10 invited to attend the Mix n Mash 2007 event held by Microsoft. This is the 2nd one. It’s an event where they invite you to Microsoft’s HQ to see what they are working on, give feedback, and meet Bill Gates.

    Here’s a picture of the Mix n Mash invited attendee’s getting their picture taken with Bill Gates (I somehow got in there, booya!)

    From left to right:

    Jonathan Snook, Julie Lerman, Kelly Goto, Rob Howard, Bill Gates, Molly Holzschlag, Kip Kniskern, Jesse Warden (me!), Keith Peters and Erik Natzke

    (more…)

  • Kindle Negative PR is BS

    Her majesty has read every single Amazon review comment on the Kindle since 2 weeks ago. That’s right, as of now the number of review comments stands at 861. She can verify qualitatively the quote from this article from Squidoo based on her reading it, and following up by reading some of the associated blogs.

    Out of 254 one star reviews, 251 of them are from people who haven’t actually bought a Kindle. Only 3 reviews of are from people who claim to have bought a Kindle, and at least one of those is decidedly dubious.

    At the opposite end of the spectrum half of the 214 5 star reviews come from people who own a Kindle or have used one.

    It gets worse. Some falsely tear apart features that are in direct conflict with the features stated on the same page. For example, complaining about the $600 price tag. At the top of the page, it clearly states it’s $399 with 2-day free shipping. Others say it doesn’t support Mac’s which is untrue as many Mac users report it works just fine. On and on… the ignorance and lack of research is astounding.

    …or is it? Conspiracy theorists co-workers seem to think competitors paid others to put false and/or negative reviews there. Quite plausible. If it were true, I’d contest it only constitutes 1% of the total posts there. People are dumb and do not read. When I worked as a Clerk (dude who takes your money when you pay for gas or lottery tickets at the convenience store) , we had all kinds of bold, bright signs on the door. No smoking, shoes required, no beer if you’re drunk, etc. People never read them.

    Not to pick on a demographic, I used to troll the blogs, correcting any comments made on Flash & Flex. Many un-educated articles were written by tech-journalists that needed facts correctly represented. Many developer blogs, some well known, had made incorrect statements wrapped in prose to make them hard to extricate and looked at fairly. After 4 months, I gave up. Even just staying within the Adobe blog sphere bubble was a full-time job. My point is, even “engineers” who do web & software development, touted for their technical knowledge, don’t read either and aren’t held accountable for the bs they spew on the interweb and put in the public record (findable by Google).

    People like JD constantly remind us how a lot of these people are not held accountable for what they say, and yet their words can influence multitudes of people. Therefore we must be extra careful to judge harshly the validity of what we read online. Systems are easy to game, and there is no accountability.

    In the end, this is also an effective PR tool. Although the Kindle is selling like hotcakes, selling out of stock within days, the liberal press here in the states reports that “it’s not doing so well”, “being received negatively”, “Based on the number of 2.5 star reviews, only half of Amazon’s customers seem to have a lukewarm reception”.

    Three lessons here. First, “public reaction” is different online. Aka, you cannot trust it being an accurate portrayal of those who matter in the reaction. There are a lot of people who are haters or greifers; people who manage to have time on their miserable hands and use that extra time to be negative towards others merely for the sake of being negative. The Kindle is selling well and being received well by those have actually received it and used it. Read the reviews that matter; read the blog posts that are relevant.

    Second, when researching things online, the amount of negative press is not always directly proportional to the level of suck of what you are researching. I bash Flash & Flex all the time, but that doesn’t mean they don’t rock they mic. They do, I love ’em both. I am just of the opinion that things can always be made better and so I use my bashing as a way to either provide hints at the troubles users may have with the products, and hopefully possible solutions.

    Third, no one does 1 and 2 (was that cynical?). Therefore, you can really affect public perception by posting negative PR about a product or service, even if untrue. The positive of it is, even in the negative, you can sometimes glean some good information about what specifically people don’t like; valid or not, and react on that hopefully to make things better.

    For the record, I don’t want a Kindle, and could care less. The common demographic is 42 years of age, on up.

    Via her majesty.