Saturday, April 4, 2009

Flex, Emacs, Linux, and Irony

I don't like Adobe. Their software is overpriced, bloated, and often difficult to for me to use. I wouldn't be able to derive $999 of worth from Photoshop, though there are pieces in it I would enjoy working with. Flash has made a lot of bad websites worse, while helping the Browser community ignore some of their past glaring inadequacies in adhering to standardization.

This said, I love working with Flex.

This also said, I refuse to pay for Flex Builder. Though it's not a bad IDE (hey, it's built on Eclipse, my personal favorite), it has a few glaring flaws which I won't go into (for those curious, they lie mostly in the debugger and profiler). I also don't like how little support there is for Linux. I spend 95% of my time at home working in Linux, and I don't particularly appreciate their dumbed-down version of the IDE. It's lacking many of the features I do enjoy (e.g. their WYSIWYG for rapid prototyping), while making certain tasks harder. It took me several hours to get a project assembled, after which I still couldn't create anything but .as files (it kept complaining about the project association).

So, I decided to see if I could create a customized Emacs environment for Flex in Linux. I haven't been too worried about certain features (e.g. debugging, file browsing, and intense code-completion). My primary focus is on syntax-highlighting, template generation, and easy compilation. Obviously, I'm keeping my expectations low for now. Hey, it's either this or log into Windows and use FlashDevelop which is really good, but not good enough to log into Windows.

Anyway, I found two great .el files for integration with Emacs, providing some level of syntax-highlighting and code-completion. Both can be found here: EmacsWiki. The two files are as follows:
1. actionscript-mode: provides a custom ActionScript mode (as it says)
2. nxml-mode: a bundle of files which provide extensive XML support (including MXML)

I was also able to integrate a third .el file which provides customizable templates using hotkey-esque strings: snippet.el.

All of these are searchable on the Emacs Wiki.

Anyway, I got these libraries integrated into Emacs (I also setup ECB, but I haven't used it much yet) and used this great tutorial for creating a "Makefile" for a project: . After this, the coding was pretty easy.

I attached a few screenshots for the basic view of the Bible verse memorization tool I'm developing. It's rudimentary at best, but this mock-up should show a decent view.


This first shot is a simple login screen:


The second is the main GUI with a left-side Accordion control for displaying verse references associated with different Leitner piles (I call them "buckets").


Interestingly, I wrote a similar GUI using PyQT4, which took me about 3 days. The Flex GUI shown in the screenshots took about 20 minutes. I wrote it while watching a movie on TV with my wife, and I bet her I could have it pounded out before a commercial break.

Anyway, I have the data-retrieval code written in Python. I'd like to use the ESV Web Service site as the data-source. I haven't heard back from them on licensing. We'll see how that goes.

So, here's the irony. As I mentioned before, I'm terrible at memorizing verses. Hence, I'm writing this app. Unfortunately, the application is taking more of my time away from memorizing verses...

Go figure...

No comments: