Flex Diaper

I ran a smack into possibly serious problem with AIR on Sunday. The problem was that a closed Window (mx.core.Window) was not GCing because there were about 100 references (according to Flex Builder 3 even after forced GC) to the window instance after it closed, none explicitly by my code btw. There were all references from within (children of or owned by the window) or bindings from parts of the window (all too easy to do with MXML magic like an online jailbait dating service) to my model layer.
Looking at Window.close method, all it does is tell its native window to close and remove itself from the system manager it belongs to. Hmm. Supposedly, child controls are smart enough to recognize when it's taken off the 'stage' and removing references but, apparently, it's not happening. And looking at binding implementation and generated glue code, I don't see how anyone can avoid memory leak problems with even moderately complex application lifecycle scenarios.
But then, by the time you find yourself in serious need of a diaper, you would have invested enough time to write a small mound of code and paid $700 (for FB3) to see a nice table of leaks. Gosh, all this is making me happy enough to wet my pants. What a Sunday.

Advertisements

Broken Back Mountain

Unless I am mistaken, US stock market's about to break it's back. All the charts I've read just smells wrong and I fear this leg will be a long one, could be longer if China's crazy stock market shatters as result. Oy. I hope I am wrong.

APML

Looked at APML (Attention Profiling Mark-up Language) spec this morning. First impressions are that it's doesn't offer enough and unnecessarily verbose. Essentially, APML models a person's attention with an open set of 'concepts', name/value pairs where name is subject of interest and value is degree of interest or disinterest (-1.0 to +1.0).
Their model for attention seem to simple. For example, time factor has strong influence on what a person is interested in. How do you represent duration and immediacy of interest? Also, interest is often goal-driven and expire as soon as associated goal is met. For example, I was interested in Prius when I was looking for a car for my wife but now I am not. Note that time and goal are related factors.

Anyway, I've joined APML mailing list. 

Facebook Stalling?

I don't know if Facebook traffic is tanking or not but I do know that I haven't been visiting Facebook as often as before and noticing more spam-like notifications from Facebook in my mailbox. And it's pretty difficult to find even a handful of Facebook apps I can point to as being really useful.

I doubt MySpace will fare better with their upcoming upgrade. Silos just don't make great application platform and mashups are just windows bound to be closed. Something has to give here and now.

Client-side Ads

Appily will show ads in the final version (maybe even sooner to test various approaches). Frankly, I dislike inline ads like Pownce displays because mixing ads with messages from friends is just plain icky. Maybe others feel differently but I think the most boring approach, AIM, is the best way.

While the format is likely to be old-fashion, content will be very different. More on this later. I would like to talk to interested ad networks to discuss ways to integrate new types of ads.

Comment Gardening

Whether comment support is essential for blogs or not, I think blog comments can be improved on. Simple list of comments is just too flat and boring. And best comments tend to be buried in a pile of me toos, silly jokes, and troll craps.

I think post writer should be able to highlight comments they like so they stand out. Post writer should also be able to exile comments they don't like to a secondary unindexed comment page where comments from unverified commenters can go as well.

I also think post readers should also be able to 'favorite' comments, digg-in-a-bucket like.

Just dumping ideas to reduce brain fart before starting work. ;-p

AIR b2

I am happy to see AIR b2 released but the tailwind it caused some minor migration head scratching. Change list in AIR release notes was helpful so don't miss that. The main problems I had were:

  1. Getting adt to work again because code signing is now required. Solution: generate a self-signed cert (see below).
  2. Embedded WebKit browser wasn't firing event handlers injected dynamically using innerHTML. Solution: hook them using DOM methods. JQuery comes in handy for this.

A common hassle is routing hyperlinks in DHTML to default browser. I haven't found a way to do this automatically so I am marking all external links with 'xlink' CSS style and injecting click event handler that block default behavior and route href to air.navigateToURL, messy but easy with jQuery.

Generate self-signed cert:

adt -certificate -cn Foo [-ou org_unit][-o org_name][-c country] ("1024-RSA"|"2048-RSA") {pfx_file_name} {password}

Sign AIR file using the cert:

adt -package -certificate foo.pfx -password 123456 …