Categories
Programming

Flex and Google App Engine are working together for me !

After using Flex for a bit, and blogging here that the backend is not so extensive, I discovered that Google has brought out the Google App Engine (GAE) sometime this year. It allows you to write the backend in Python and the frontend in html or ajax or even flex ! It even comes with a templating engine, is currently in beta, and is free !

It should be the best of both worlds, if I can get it work together.

There’s actually not that many examples floating on the net that go into much detail into how to set this up. Lots of references to PyAMF (Python with Action Messaging Format so that it can talk Flash), but I find the examples are almost all from people in the know, and for a ‘script’ programmer like me I sure could use some (very) detailed explanations !

I finally found a good example of a simple Flex client that connected to a python Google App Engine on this site. After two nights of puttering around, I finally got my modified example to work and understood what was happening (I’m still learning flex, actionscript3 and now GAE – it’s a bit much sometimes). I actually write the xml back via a python hack where I do a loop and write the tags one by one… tss, I’m sure there’s a better way (pyAMF ?).

Now I still need to get my head around what PyAMF actually does and how it integrates between Flex and GAE. This seems to be a nice example from the PyAMF wiki.

Categories
Apple

iPhone upgrade : note to self

If you upgrade or restore an iPhone to any firmware version using iTunes (wether using Pwnage tool or not is irrelevant I think) you *must* have a phone sim card inserted or the upgrade will fail.
There were some scary moments before I figured that out…

Oh, and here are 10 tips for the iphone… there were a few I didn’t know about !

Categories
Programming

Just finished my first flex application !

I just made a demo form entry in Flex to show to some mates of mine.

They are receiving emails and take their work orders from them, but I find this rather insecure, so the demo form is to show them what is possible with a form to be filled in on a website, in order to avoid all the hassles that happen with mail (arriving late or never, not all information filled in, etcetera).

The original demo page has been ready for about a week, but I had gotten stuck on some combo box controls where I couldn’t retrieve the data from when entered – I finally sussed it out by going to the online help instead of reading the flex3 book, and sure enough, an example was given how to retrieve the data. I have to admit that the flexbuilder documentation is topnotch.

I’m quite happy with that proof of concept page. Enough to finally go to bed now and get some sleep…

Categories
Blog News

Upgrade of WordPress to 2.7

I just did an upgrade to WordPress 2.7. Woooooh, the admin interface has received a totally new look which I really like, you can install plugins from the admin interface, the upgrade process from now on is supposed to be just one click and no need to delete files and upload new ones… All in all a big upgrade.
Hopefully there will be no big security bugs with all these changes…

Categories
Blog News

Tour de Flex is not working for me [update: it works !!]

[UPDATE : Andre in the comments below was nice enough to let me know a solution : uninstalling Adblock for Safari solves the problem. Apparently Tour de flex uses Webkit, and Adblock thinks it’s Safari so want to do it’s magic on it, and crashes the application. So the downside for Safari users is they don’t have Adblock. I use Firefox almost exlusively, so this is not really a problem for me.]

Tour de Flex, the so-called showcasing of all things that you can do with Flex, is not working for me.

It installs fine, and starts up fine, but when I want to click on an example it crashes. Every single time. No need to tell you that this is peeing me off.

Tour de Flex error message
Tour de Flex error message

So far I scoured the web, but haven’t found anything like a solution, perhaps because this problem only happens to a small amount of people (maybe just only me ?).

Grrrr. Google in it’s Google Maps API code page for Flex pointed me to a possible solution for a similar problem, but it’s apparently not the exact same problem, as it still crashes.

🙁

Categories
Programming

Busy learning flex3 and actionscript

Quite busy learning howto program using flex builder 3 in mxml and actionscript3.
It’s like learning 2 languages at the same time! Add to that that you can deploy your app to both the web and the desktop (which has its own specific API’s to access the local filesystem) and it starts getting complicated.
Mxml is quite cool and the help in FB3 is quite good. Still haven’t written a decent application though. Although I have some good ideas already, my knowledge of the languages is not yet sufficient… Grrr.

Categories
Blog News

The Singing Dog

Categories
Programming

Flex and Python and PHP : a first comparison

After two weeks of so of looking into Flex, MXML and ActionScript, the key differences between the two languages are for me that Flex is first most oriented to the ‘front’ as opposed to python, that is more oriented to the ‘backend’.

With front I mean that everything so far that I discovered in Flex is oriented to presentation to the web client. There’s heaps of stuff in Flex that you can use to easily develop and present quality stuff to the web visitor (or even to the desktop, if you develop in Flex for AIR, Adobe’s desktop runtime solution that uses the same code as your web application).

But to get to the data from the backend, you cannot simply write an SQL query in your code; since flex code is compiled to flash, anybody with a flash decompiler could read the credentials you are using (as opposed to php or python code on a webserver, which is executed and where only the results are shown to the client; code is never shown).

So that means that to connect to a database, you need an intermediary solution; a php script to talk to or a coldfusion server, or a java scriptlet thingey; anything else really that can talk to a data server without giving away the keys to the kingdom aka the credentials to the db server.

Python on the other hand is very good at connecting to just about anything : from csv files to xml to SQL in Oracle, Access or Mysql database servers : it all works. However, presentation wise, there is a lack of an easy presentation framework that works as in Flex. There are several ways to present your results in Python, but they are not baked in; you have to go and search them. QT, PythonCard, Tkinter and others are all there, but all have differences. All require an extended time to learn.

PHP is a mixture of both : it can connect to just about everything, but my personal opinion is that development is slightly more convoluted than Flex, plus you really need to take care not to mix code and presentation.

Using the various MVC frameworks around (Symphony is nice, but biiiiig to learn as it involves writing parts in YAML, yet another (markup) language) you can do this, but my personal opinion is that it’s a lot to learn if you just develop a few web pages. There’s Django for the pythonistas, which I’m partial to and keep returning to, but haven’t actually made anything usefull with.

It’s all good and well to have ‘flash and bang’ for your web customer, but you need to show them your data as well – unless it’s an arty type, he’s there  on your site for a reason : to get informed about something.

My hope is that the next flash version or flex version will have data binding implemented via another easier way; Adobe wants to make this big, it’s the reason why they open sourced flex in the first place…

Categories
Programming

Adobe Flex Builder 3

I went a bit out on a limb last weekend and purchased Adobe Flex Builder (standard edition). It lets you create in an easy way a layout for your flash-based application and then add some code to your elements using the open-source eclipse editor it’s based on.

Of course, it means learning a whole new programming language, actually two : ‘mxml’ for the layout and ‘Actionscript’ for the more codey bits. If you don’t see me or hear from me, that’s what I’m currently trying to do…
🙂

Actionscript and mxml are as much class and object oriented as Python, and where I could get away in Python with just writing some functions and calling them, here I definitely need to use classes, extend them, etc… something I never until now had to get my brain around. Ouch. Sometimes it hurts.

Another difference is that the language is much more strongly typed, you need to identify as much as possible the type of variable you are defining, while Python is much more loose about that.

Still, my first essay so far is a generic form page for telenet in Flash, and works fine. Now busy adding a captcha to it, for which I reused an actionscript component on the intaaaarrrnet.

Categories
Blog News

Twitter no longer

I just deleted Twitter from my iPhone – I was no longer using it to check up on my friends let alone post any new tweets.
Funny how I found it so cool in the beginning. It has certain advantages over blogging (speed, location awareness, quickly catch up with other people) but I just found it too ephemeral for my tastes.
You type a message somebody else responds but an hour later the text has already been replaced by other messages.
I need to know that what I write will stay, not evaporate – and anyway, I have facebook for posting quick status updates onto.
So goodbye twitter it was nice while it lasted.