Archive for May, 2008

My first AIR application

Posted by Daniel on May 31, 2008
Programming / 2 Comments

A while ago I made my first Adobe AIR application. It is a “desktop version” of a web-based markbook (gradebook) that I wrote for the INGOTs.

Go to the application web page. You can login using the guest account “Guest 1″. The password is “zepplin2″.

Comments

Converting my existing Ajax application into an Adobe AIR application was very easy. I only had to make minor modifications. I had to upgrade to the current version of Dojo and I had to modify a few files that used PHP (AIR doesn’t include PHP).

Actually, what took me the longest was figuring out how to self-sign a application. It’s in the manual, but it took me a long time to see it.

Hint: go to the manual and select AIR development tools > Creating an AIR application using the command line tools > Creating a self-signed certificate with ADT.

Adobe AIR vs Mozilla XULRunner

Posted by Daniel on May 24, 2008
Open Source / Open Standards, Programming / No Comments

In a previous post I said that Mozilla Prism is not an alternative to Adobe AIR. Thinking about it a little bit more, I think XULRunner is a more likely contender against Prism on its own. Like AIR, XULRunner is a tool for developers to use “web technologies” to make desktop applications. So I’ll just go ahead and make a table comparing the two:

XULRunner AIR
Provider Mozilla Adobe
License Open source Some components are open (the VM, SQLite, WebKit) but the runtime is proprietary.
Cross platform Yes Yes
Stable? Not yet, it needs work. I’ve had problems with the Mac version. Linux version is alpha. The others are stable.
HTML engine Gecko
– Memory hog
WebKit
– Uses less memory
JavaScript engine SpiderMonkey
– Reasonable speed
Tamarin
Fast (JIT compiler).
SpiderMonkey will use Tamarin starting with Firefox 4.
API Primarily XUL, JavaScript and XPCOM. You can replace XUL by HTML. I don’t believe that you can use most Ajax toolkits. In any case, the application structure is different enough that porting an existing web application to run on XULRunner would be difficult. I don’t believe that porting web apps is a design goal of XULRunner. Ajax and Flash. You can probably keep your existing Ajax or Flash application mostly unchanged. If you are using Dojo you need to upgrade to version 1.1.0. AIR does provide an additional API, but you only need it if you want to use functionality that Ajax and Flash do not normally have, like accessing the file system. Porting web apps to AIR is definitely a design goal.
Personally I find XPCOM complicated and hard to work with. AIR is much easier. 95% is just doing whatever you’d normally do on your web app. The rest (e.g. read/write files) looks simple to me.

Example: Create a “file” object that you can use to read/write files:

XPCOM:

var contractId = "@mozilla.org/file/local;1";
var interface = Components.interfaces.nsILocalFile;
var fileClass = Components.classes[contractId];
var file = fileClass.createInstance(interface);
file.initWithPath("/home/daniel/hello.txt");

Adobe AIR:

var file = new air.File();
file.nativePath = "/home/daniel/hello.txt";
Deployment The developer must make his own packages and must include XULRunner in the package (the situation might later improve on Linux). Thus, the package size is quite large and you have to maintain multiple packages for each platform you are targeting. Easy. Adobe AIR takes care of the distribution, and the user only has to download Adobe AIR once. If installing from a web page, Adobe AIR is downloaded at the same time as your application, so the user doesn’t have to go to some other website like with Java.
Security Nothing in particular. No different than downloading any other application from the internet and installing it. All AIR apps are digitally signed. Though apps can be self-signed. What’s the point of self-signing an app? Well, at a minimum it provides an integrity check.


To learn how to self sign packages : go to the manual and select AIR development tools > Creating an AIR application using the command line tools > Creating a self-signed certificate with ADT.
Documentation I’ve had a hard time figuring out XULRunner’s documentation. I had to pull bits and pieces from various places and often had a hard time finding what I needed. I am very happy with Adobe’s documentation. Though no documentation is every perfect, I think this one is very good.
Other features - Multithreaded.
- Call external libraries.
- I believe you have pretty much full access to the computer but I’m not sure.
- Read/write access to the file system.
- Access to the clipboard.
- It comes with a database (SQLite) that you can use.
- Drag and drop support.
- Having Flash available means you can have fancy graphics and multimedia.
With AIR you don’t get full access to the computer (e.g. can’t run system libraries) but it has many great features that XULRunner lacks (SQL, easy multimedia, etc).

Interlingua

Posted by Daniel on May 18, 2008
Miscellaneous / No Comments

Interlingua es un lingua natural e musical de parolas international e un grammatica minimal. Es comprensibile facilemente per personas intelligente e es un medio de communication adequate e ideal pro le solution del confusion linguistic international.

Recently I’ve been reading about Interlingua. It is an international auxiliary language (IAL), in some ways similar to Esperanto. An IAL is a language meant for communication between people with different native languages. A Spaniard and a German could both learn Interlingua and use it to communicate.

Why don’t we all just learn English?

Well, English does get used a lot as an auxiliary language, but natural languages are very difficult to learn and master. IALs are designed to be easy. You can reasonably learn Interlingua or Esperanto 4 times faster than a natural language.

What makes Interlingua interesting

The way Interlingua is designed is actually quite interesting: It starts by looking at 7 European languages: English, French, Italian, Spanish, Portuguese, German and Russian. A word that is present in several of these languages becomes a word in Interlingua.

For example, the word “hospital” looks almost the same in Spanish, English, French, Portuguese and Italian. So “hospital” is a word in Interlingua. Other words include: natural, musical, international, etc. And all of those words mean exactly what you expect. Some times you find words that are not exactly the same, but look very similar (grammar, Grammatik, grammaire, gramática, grammatica). In this case, Interlingua tries to pick the form that is most recognizable to everyone.

The end result is a language that is mostly just the vocabulary that we already agree on. It turns out that we already largely agree on a huge amount of vocabulary, and that’s what goes into Interlingua.

Interlingua vs Esperanto

It is worth comparing Interlingua and Esperanto:

1. Esperanto is the IAL spoken by most people, but Interlingua is the IAL understood by most people. Speakers of Romance languages, and educated speakers of Germanic languages can mostly figure it out.

2. Both languages have a very simple grammar and vocabulary. Interlingua definitely has the simpler grammar. Building words is easier in Esperanto, but Interlingua’s words are more recognizable. Esperanto is more regular.

3. In Esperanto, each sound corresponds to a letter. So there is no “sh” or “ch”, but there are other entirely new letters for those sounds. Esperanto has 6 new letters unique to Esperanto. Interlingua, on the other hand, uses only the standard 26 Latin letters and makes use of “sh”, “ch” and the like, in the ways that most European languages already use them.

4. I can’t figure out the pronunciation of some Esperanto letters, and some times I can’t see the distinctions it makes. For example, here it says that the Esperanto ĵ (j^) sounds like the “s” in pleasure and ŝ (s^) sounds like the “s” in sugar… forgive me, but to me those two sound the same

Interlingua isn’t like that. No new letters, no picky distinctions. Everything sounds the way you’d expect with the exception that vowels sound like in continental languages (Spanish, German, etc). You know, “a” as in “papa”, “e” ans in “Fred”, i as in “in”, o as in “no” and u sounds like “too”.


In summary, I would say that Esperanto tries to go close to the theoretical ideal for a language, whereas Interlingua tries to build a language based on the things that we already agree on. The difference can be exemplified with this table:

Esperanto Interlingua English Italian
sana san healthy sani
sano sanitate health salute
malsana malade sick malato
malsano maladia disease malattia
malsanulejo hospital hospital ospedale
saniĝi recovrar to recover recuperare
sanigi curar to cure curare

It may be logical to derive the word for hospital from the word for “healthy”, but I think that tomorrow you are more likely to remember that the Interlingua word for hospital is hospital than that the Esperanto word word for hospital is malsanulejo.

Mozilla Prism vs Adobe AIR

Posted by Daniel on May 16, 2008
Open Source / Open Standards, Programming / No Comments

I’ve seen several blog posts saying that Mozilla Prism is an open source alternative to Adobe AIR, or that the two products do more or less the same thing. Even Michael Chambers said something along those lines in his blog:

So, I guess the thing I found odd was Mozilla appears to be building something very similar to Adobe AIR (which is fine and cool), but somehow it is inherently good when Mozilla does it, and inherently evil when Adobe does it.

But I have to say that Adobe AIR and Prism are definitely not the same thing. Yes, they both can run a web app “outside” the browser. That sounds like it should make them very similar, but it doesn’t:

  1. Who is it for?

    AIR is for developers. It lets you package a web application to deliver it to the user as a stand-alone app. Prism doesn’t.

    Prism is for users, and it resembles bookmarks more than anything else. Except that the bookmark is an icon on your computer and when you click on it, the browser doesn’t have any toolbars.

  2. Functionality:

    AIR provides some desktop-like functionality like local file access, SQL storage, etc. In this, it resembles Google Gears a bit. AIR provides some additional tools that Gears lacks.

    Prism provides nothing more than what any web browser provides.

    As a result, AIR supports web apps that can be used offline and Prism doesn’t.

As I said in my last post, if you were to combine Prism and Gears you could get something a more like an AIR alternative (but with fewer features).

If we hired like we vote

Posted by Daniel on May 12, 2008
Miscellaneous / No Comments



The problem with Wikipedia

Posted by Daniel on May 11, 2008
Miscellaneous / No Comments

A comic from xkcd.


Google Gears + Mozilla Prism?

Posted by Daniel on May 09, 2008
Open Source / Open Standards, Programming / No Comments

I was recently asked if I could write a Windows GUI program. I replied that it’d be tricky since I don’t have experience making Windows GUIs. This got me thinking: “boy, I really wish I could use JavaScript and HTML for this“.

You know, there are a lot of people who would love to use web technologies to make desktop-type applications (things like being able to save files locally and not requiring a server). There are several efforts in this direction. Sadly, they are largely immature. Let me comment quickly on a few of them:

XULRunner

XULRunner is a runtime that lets you make applications using XUL (so you code the GUI using XML), SVG, XSLT and you can use the Gecko HTML rendering engine. I tried it last year to make an OpenDocument Viewer, but that didn’t go well. The technology is interesting, but it has some major bugs.

Mozilla Prism

Mozilla calls it a “Site-Specific Browser”. Imagine a browser that has no location bar, no navigation buttons, no tabs, no menus, no nothing. When you start it, it always goes to the same web page. If that page is Gmail, you can pretend that Gmail is a desktop app.

Personally I find Prism boring, but I introduce it because I’ll talk about it later.

Google Gears

Google Gears is very cool. It is a web browser plugin that lets you store files locally (HTML, JS, images) and gives you a local SQL database. For example, there is a Gears version of Google Docs, so you can go on an airplane and use Google Docs just as if it were a desktop app. The only thing is that it’s inside a web browser, so it doesn’t feel like a desktop app.

Adobe AIR

From my point of view (and limited knowledge) this looks like the most advanced platform. It gives you a local store and database like Google Gears, you program in ECMAScript, and it gives you an HTML rendering engine like XULRunner or Prism. Indeed, it seems to have many features that none of the others have.

The problem with Adobe AIR? Well, it’s not open source, and I would really like to only use open source tools. But from what I can see, Adobe AIR appears to be just better. :-(

Google Gears + Mozilla Prism?

This takes me to the real point that I wanted to make in this post: What if we combine Google Gears and Mozilla Prism? Gears gives us a local store for files and a database. Prism puts it all inside a single window with its own little icon. The result? Something that feels a lot more like a desktop application and is a more even match against Adobe AIR.

Now, there’s much more to Adobe AIR than just Gears + Prism. AIR provides PDF rendering, Flash output, zip file support, clipboard access, digitally signed applications, etc. But perhaps marrying Gears and Prism might be a step toward competing with AIR.

Protect your laptop from spying eyes

Posted by Daniel on May 03, 2008
Miscellaneous / No Comments



purchase software