The Code Trip?

Posted by brandonthedeveloper at November 23rd, 2007

[Update : this is not a Microsoft sponsored event. Tim Heuer's reply below explains that this is being put together by Microsoft Evangelists]

Wow. I gotta say. I got caught on the announcement of the Adobe On Air Bus Tour I mean Microsoft’s Code Trip. My mouth full of hot coffee went everywhere.

Everyone that went to the On Air Events knows that Adobe does not skimp on a good party. Great schwag, great talks, great food, great beer (and those ice cream cookies from S.F.) .. heck, everything was great. If Microsoft is going to copy that idea you would think they would be trying to ‘one up’ Adobe from the start and show that their event would kick On Air Bus Tour Event ass but there are subtle differences already that lead me to believe ‘The Code Trip’ is gonna blow.

I’ve been to Microsoft developer events and they were pretty lame. Schwag consisted of a giant plastic bag or a ‘man purse’ with a cheap VS.net shirt inside. Listen Microsoft, if Adobe can afford to hand out nice Hanes Beefy Tees, so can you. No one likes cheap schwag. The talks usually were centered around VB programmers in panic mode asking embarrassing questions. And bowls of M & Ms and soda do not make a catered event.

Second, The Code Trip site. Seriously. That’s the site to kick things off? Code Trip folks, if you are going to copy the tour, atleast try to copy the On Air Bus Tour site. BTW, the javascript popUps on the learn-more page throw errors in Firefox 2.0.0.9 on OS X 10.4 and IE7 on XP. I won’t mention how typical it is to see no form validation on submissions from the front page. Yeah, form validation is hard work these days. I know you all are in planning stages but the On Air Bus Tour site had way more stuff coming out of the gate.

Last, what’s with the RV? And (not to nitpick), that’s barely an RV. That looks like a big camper. I mean if you really wanted to copy the On Air Bus Tour bus, you would get a double decker bus. And what’s with sticking with only one section of the U.S.? [Again, not an MS event so it makes more since after talking to Tim Heuer that they stick to one section of the country]

Last thing. This bit of copy from the ‘learn more page’ (to me) really encapsulates that Microsoft wants these events to be like the On Air events – “One RV, bunch of geeks, lots o’ code. Hop on the bus!“. Oh man… what is it? An RV or a bus?

Anyone want to place bets on someone at Microsoft claiming they had the tour idea first? Or, saying “It’s not like Adobe invented the touring idea”. No they didn’t but once again, Microsoft did it after someone else. Coming in second has become a bad habit for Microsoft.

Maybe it’s not even a real Microsoft promo. Maybe it’s just a satirical commentary on Microsoft ‘pulling up the rear’ for the last few years.

Scratch that, if you ‘view-source’, that’s definitely an MS site.

Posted in Adobe, Air, Code, Microsoft, Silverlight| 3 Comments | 

Simple filterFunction Example

Posted by brandonthedeveloper at November 10th, 2007

I’ve been meaning to knock out a bunch of quick Flex examples based on functions I use quite a bit in my day to day Flex coding.

Using the mx.collections.filterFunction is really easy but seems to throw off a lot of devs new to Flex. It sounds way harder than it is. :)

Here’s an example:

The filterFunction is used to filter an Array Collection to only show the items that match certain criteria. In this example, the user makes a selection from the ‘Radio Button Group’ and that fires off the Event Handler ( bandRBGClickHandler ).

private function bandRBGClickHandler(evt:Event):void {
// call the filter function
bandAryCol.filterFunction = bandFilterFunction;
// refresh the array collection
bandAryCol.refresh();
}

Inside the Event Handler, the Array Collection has a filterFunction property that gets set to the filterFunction we want to use ( bandFilterFunction ). Internally, the bandAryCol.filterFunction is iterating through the objects in the collection to find which object’s ‘band’ property match the radio button’s selected value.

private function bandFilterFunction(obj:Object):Boolean {
// return whether or not the current bandAryCol index meets the filter criteria
return (obj.band == bandRBG.selectedValue);
}

After the filterFunction has run, the refresh() method is called to reset the Array Collection’s current items. This does not actually remove any items from the collection, just does not show the items that did not match the filterFunction conditions.

That’s about it. Not hard at all and very handy. :)

Here’s the source file

Posted in Code, Flex| 7 Comments | 

AIR/Leopard Gotcha

Posted by brandonthedeveloper at November 8th, 2007

An AIR app I’m currently working on started having problems with downloading files but only on Leopard.

Here’s what I figured out – AIR applications that download files on Leopard only work if there are no spaces in the file name or the spaces have been ‘URL Encoded’ ( like: file%20name%20with%20spaces.jpg ).

Here’s my test case to see what I mean – DownloadTest.air

In my test case on XP, Vista and Tiger, either file will download as expected. On Leopard, “hungoversanta.jpg” will download successfully, while “hung over santa.jpg” will not. The tricky part is, a file with the name does get saved but it contains no data.

If you click the ‘Encode URLs’ button in the test case, it will do just that, encode the spaces in the url. Now both files will successfully download.

Here’s the quick work around I used – do a regex replace to encode the url strings like this:

var regex:RegExp = / /g;
var urlString:String = “my file with spaces.jpg”;
urlString = urlString.replace(regex,’%20′);
// returns “my%20file%20with%20spaces.jpg”

I hope this saves others from the few hours I spent trying to figure out this problem. If anyone knows of a ‘URL Encode’ utilty method, please let me know. I know that you can encode using the URLVariables class but that seems to be more geared at querystrings and not so much on entire URL Strings.

I’d love to hear if others have had this problem and if my theory/solution works for you.

Thanks! :)

Posted in Adobe, Air, Apple, Crap that doesn't work, Leopard| 1 Comment |