Saturday, July 12, 2008

something about closing and reopening a SQLite connection in AIR

Recently, we had a 'strange' problem in an AIR application that I am working on.

Here's the scenario:
The application already had a SQLConnection open to a SQLite database, and it was open syncronously in READ mode. I wanted to write some data into the same database, so decided to close the connection, reopen it, now in UPDATE mode. That way, I can write data, and keep the connection open so that the rest of the code can continue using the connection as well.

This is what I did:
  • I issued a conn.close();
  • I did a trace(conn.connected) //to check if the connection is closed
  • And finally, a conn = null; // just in case ;)
And then, went on to create a new SQLConnection object into the same variable. And on the connection open event handler, created a SQLStatement object with the UPDATE table SQL text and executed it. Everything looked fine, and I tested the code, only to see a runtime error stating something like "operation cannot be performed on a closed connection" :-/

Now let me get it straight. I was executing the command in the SQLConnection open event handler. And the error said the connection is closed ??

After spending a good chunk of time trying to investigate it, adding a responder to the conn.close() call, and creating a new connection object after that responder was triggered, solved the problem.

Wonder why, being a synchronous connection still had something running in the background, when my code had moved on to create the new connection, and open it as well.

Guess its one of those things...

Tuesday, July 01, 2008

Flash content to be indexed better by google and yahoo

[UPDATE]: Looks like Peter Elst have almost similar reaction to this news and posted a better worded post here

There is a lot of news today about Flash files being indexed better by google and yahoo thanks to some new 'Adobe Flash player technology'. The 'new Flash player technology' will enable search engine crawlers to crawl deeper into swfs and hence index areas of the swf that were previously inaccessible.

If adobe has developed a specialized flash player for search engines to crawl, how about that version of Flash player be released to individual developers as well? A flash player like that will help testing professionals develop automated tests for Flash based applications. Currently Flex application testing can be automated, but that requires developers to add hooks into their Flex applications to let testing software (QTP etc) talk to their application. This new Flash player build might help developers achieve the same for Flash IDE based applications too, without any extra effort.

While the news as a whole seems to be interesting, I have a few concerns.

Both google and adobe say that there will be no change required from developers or companies to 'enable' their content to be searchable. Any text that appears in the SWF becomes searchable tag now. Though on a high level this sounds great, it also rings an alarms. In google's own blogpost about the news, Google says
If you prefer Google to ignore your less informative content, such as a "copyright" or "loading" message, consider replacing the text within an image, which will make it effectively invisible to us.
Umm... Really? Now how is that gonna be practical? Its not just 'loading' and 'copy right'. You'll have to hide text like 'first name', 'last name' etc, if you have a form, and will we have to create images for all of those?? Wouldn't that add a lot of unnecessary hassle to developers now? And if developers were lazy and didn't do this, wouldn't we start seeing a lot of results like this one?

There seems to be some confusion between google and adobe, when adobe says
"As a result, millions of pre-existing RIAs and dynamic Web experiences that utilize Adobe Flash technology, including content that loads at runtime, are immediately searchable ..."

and google says
"We currently do not attach content from external resources that are loaded by your Flash files. If your Flash file loads an HTML file, an XML file, another SWF file, etc., Google will separately index that resource.."

Secondly, if a XML file that a SWF file loads is indexed separately, the XML file will appear in search results, not the SWF. What benefit would that give users now? ( of course google says that they are working on this, so probably this will be fixed)

If google tried indexing an RIA application that has a Java backend, will the spider try hitting the service directly? ( thats what the above statement seems to imply) And if it did really do that, and the service returns a different results each time, how and what will google add to the index? Kinda confusing...

I'd prefer that SWF's text content being searchable should be an opt-in feature. If developers can choose to let search engines see some portion of the text that they need it to index, wouldn't that be better?

Of course the search engines being able to traverse through different paths of navigation within a SWF and being able to find content there is all a good thing, but how will search engines be able to take the user directly to a particular state? ( flex apps have deep linking feature, but not many people use it - and in many places, it might not make sense to use it in a flash app.)

Finally, is it only me who sees that both adobe and Google are trying to say how smart they are by themself? [UPDATE: Jack Schofield of guardian.co.uk did see that the google page dint have any credits to adobe. Umm, they did link adobe's press release though :P ] Adobe's press release says "Adobe Flash Technology Enhances Search Results for Dynamic Content and Rich Internet Applications" and Google goes "Google's ... new algorithm for indexing textual content in Flash files of all kinds" hmm..

http://www.flexjobs.in - A new Flex jobs portal

Finding the right people for Flex developer positions has become a major headache for most of the companies out there. I've seen companies resort to other technologies when they can't find people to work on their Flex projects. Being a relatively new technology, finding Flex developers through consultants has also become a hassle. At times, I get calls from job consultants who have absolutely no idea about what it is that they are wanting to hire me for!

Flexjobs.in is a new job site for Flex ( and Flash platform in general) jobs. Though the domain name ends with a .in the site covers international job openings as well. ( talk about finding a domain name)

Posting jobs on the site is free. There is also a premium account for job posters, where they can employ flexjobs.in to do the first round of screening processes for candidates. Having been experienced Flash platform application architects, who have also built successful development teams, the guys behind flexjobs.in can sure do a good job in that area.

The site also lets developers put up their profile, so that prospective employers can 'choose' developers and contact them. Also, developers can choose to subscribe themselves to newer job postings via email.

Check it out: www.flexjobs.in

Monday, June 30, 2008

OT - Bangalore's first Gay pride parade

Read about it here: http://tinyurl.com/67mude

Glad to see India opening up to such issues.

Saturday, June 14, 2008

Don’t forget to be part of Firefox’s Download Day!

Updated: Thanks to prakaz, for bringing it up to me that I had the date wrong in here. Its June 17th, not July!!

Firefox 3 is set to be released on June 17th.

Go add yourself to the list of people who have pledged to download FF3 on that day, and you'll be notified on the release day, by Mozilla.

Download Day 2008

Wednesday, June 11, 2008

Greenbox - from the godfathers of Flash

Greenbox™ enables households to save money on their energy bills and reduce their carbon footprint.
Greenbox is the domestic energy saving utility product from SoftwareAsArt Inc, the company that Jon Gay, Robert Tatsumi, Gary Grossman, and Pete Santangeli (- in short, the founders of Adobe Flash & Actionscript) founded a while ago.

They are 'currently in the process of conducting in-home trials' and the product is expected end of 2008/ early 2009.

Oh, and Jonathan Gay is listed as one of the 25 people who ditched InfoTech to CleanTech. Congrats Jon!

CNN Money knows how Apple is gonna end the standoff with Adobe-By putting Flash memory on iphone!

A couple of weeks ago, John Dowdell, Peter Elst, Mrinal Wadhwa, and Brajeshwar Oinam posted about how 'geek' bloggers are writing silly posts about Silverlight vs AIR.

Today, someone passed me a link to this post on CNN Money, which beats every other blogger hands down:

" Just how will Apple meet expectations? Using the patent application as a guide, Apple appears to be making room on the iPhone for flash memory, which means an end to Apple's standoff with Adobe (ADBE) that's kept iPhones from easily viewing a plethora of Internet videos."

Now this dude thinks that Flash memory and Adobe's Flash media player are the same. Beat that people!

The entire post is a joke. Check it out!

Monday, June 09, 2008

Apple store browser - Be the first to know ;)

I know a lot of you out there are constantly refreshing ur browser windows pointing at apple.com, in an attempt to see when the new set of pages go up with the new products.

At the time of writing this post, the store displays a note saying that the store is being updated. So go on apple fans, start hitting the page, and be the first to see the new page!

So I just put up this mini apple store browser, which keeps doing the refresh page, for you. And thought I'd as well pass it out to others who want to do the same :P

If you already have the AIR runtime installed, just download the appleStoreBrowser.air file and install.
If you don't have AIR runtime installed, get it here

Go, go!

Wednesday, May 28, 2008

Sichuan, China - earthquake - do your part, help people rebuild their lives

Details of the quake available on wikipedia.

By now, reports say that over 65,080 people have lost their lives and over 23,150 are reported missing.

Came across this video yesterday. Real cute ones, those panda babies:



The description of the video says it was shot in Chengdu, which happens to be about 80 kms away from the epi-centre of the quake. It would be a miracle if those pandas are still around...

Saw a CNN report today stating that a lake (that was formed by a landslide blocking a river) is about to overflow sometime today/tomorrow, and that's gonna bring in more havoc. NYT report on that here.

Sandy, a friend made this post today collecting various videos from chinese websites. This particular video, I think is is gonna haunt me for a long time to come..



The man was stuck under that big pile of concrete for 73 hrs and still held on, and died when after he was rescued. Thats really sickening!

Reports say that more than 5 million people have been rendered homeless. I can't imagine what a humongous task rebuilding their lives and homes is gonna be. And even after more than a week since it hit, the aftershocks still keep killing people and bringing down buildings.

If you'd like to contribute money to supporting the victims, look for some options

If you are in Singapore, and would like to contribute via red cross, check out the details here

Thursday, April 17, 2008

Actionscript 3.0 coding conventions and best practices

Read about this first at Keith Peters blog.

http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions


Looks like the document has been put up by adobe for Flex SDK contributors' reference. Nevertheless, it can be adopted by any Flash/Flex developer writing Actionscript code.