XUL tutorial

Mozilla platform provides framework and components to develop crossplatform rich client applications. Mozilla platform contains various technologiy implementations like AJAx, CSS, HTML, DOM,JavaScript, XML, RDF, RSS, XUL, XSLT and XML.

Mozilla provides XPFE (Cross Platfrom Front End) Framework to build the rich cross platform applications. The XPFE contains three basic parts: XUL, JavaScript and CSS. XUL defines the interface, JavaScript is used to attach the behaviour and logic to the interface. CSS does similar part as with HTML, it provides styles and varaiations of the interfaces.

XUL is the XML User interface Language, which lets the developer build rich cross platform applications, that can be run online or offline. Since the behaviour, interface and locale&skin are completely disconnected, they can be very easily customized and localized. XUL is based on XML, so its very easy to learn and get started. In these series of articles I’ll try to explain how I’m developing a small application using Mozilla platform.


Mozilla Developer Wiki
XUL Planet

Google Talk: Can't Talk

Google Talk was announced last week. Its an instant messaging program similar to Yahoo Messenger.
I always admired Google a lot, and loved their products .. except for Google Desktop. I’ll come back to that later.

Talking about Google Talk, I can say only this “It doesn’t work”. I still can’t figure out reason. First I tried at my work place which uses Windows Internet Acceleration Server. My Yahoo! messenger works without any problems. I tried to key in the proxy values under the settings, but still didn’t work, Just gives me an error “Can’t authenticate to server”. I thought proxy might be the reason.

So I tried to give Google Talk another shot at my home, its on dial-up. To my surprise it doesn’t work there either. Then I tried to search the FAQ and troubleshooting center at Google Talk, and couldn’t find the solution to my problem, so I sent a mail to the Google guys telling about the problem. And they replied me that they know about the problem, and working “diligently” to fix it.
Since the launch of Google Talk, I was able to connect to the server only once, and it never worked again. I agree that its still in pre-beta, but if its not at all working then it’s not finished yet, and not even qualified for pre-alpha.

Another wonderful product from google is the Google Desktop2. Loaded with good set of features (RSS reader, gmail integration, search, latest news, stock quotes and weather) to threat microsoft owned desktop horizon. Kind of advanced version of annoying active desktop. But if you are having less than 512MB of RAM and never cared about all the programs that just sit in your system tray and eat up your memory, don’t even think of installing it. The exceptional speed and features google desktop 2 provides are available at the exceptional usage of the memroy. But there’s certainly a good and good-looking alternative to use to get all the information that is provded by google desktop.

It’s Konfabulator. It’s really useful and pretty. Konfabulator is a widget engine which runs small programs/scripts called widgets. Widgets provide various information fetched from web as well as from your computer. Konfabulator has been acquired by Yahoo! recently. Excellent program worth a look, and its free.

Abou Ben Adhem

Abou Ben Adhem (may his tribe increase!)
Awoke one night from a deep dream of peace,
And saw, within the moonlight in his room,
Making it rich, and like a lily in bloom,
An Angel writing in a book of gold:

Exceeding peace had made Ben Adhem bold,
And to the Presence in the room he said,
“What writest thou?” The Vision raised its head,
And with a look made of all sweet accord
Answered, “The names of those who love the Lord.”

“And is mine one?” said Abou. “Nay, not so,”
Replied the Angel. Abou spoke more low,
But cheerily still; and said, “I pray thee, then,
Write me as one who loves his fellow men.”

The Angel wrote, and vanished. The next night
It came again with a great wakening light,
And showed the names whom love of God had blessed,
And, lo! Ben Adhem’s name led all the rest!

— James Leigh Hunt


After reading the Bruce Eckel’s blog after a long time, I found an interesting and entertaining link to a book on ruby: Why’s (poignant) guide to Ruby . Being an extremely influence by Bruce, I got some conviction that there are only four REAL computer languages in the world other than Perl: C++, Java and Python. But this book seems to be re-orienting my views. I am going to download Ruby and let me check how far I can understand the real philosophy of the language.

Talking about learning a language, I feel that one should understand what the language is good for? Learning a new computer language gives me a new perspective to look at the problems. Besides learning the syntax, which is also essential part of the learning, one should understand the philosophy behind it. The way the language provides the abstraction of the solution space so that problems in the real world can be solved. The essential feature of any programmer is to map and abstract the problem space to the solution space. The problem space is the subset of the real world. It mightbe a domain (vertical) or any particular set of problems in one field. The solution space in the programmer’s perspective is composed of computers (Workstations, Servers, Network, and Memory). The basic purpose of the computer language is to provide tools for abstracting the solution space so that the real world or the entities of the problem space can be represented. And that’s why we have the Object Oriented programming.

Consider a problem space of manufacturing company’s one particular department: Accounts. In the problem space (Accounts department) we might have the following entities: Account, Accountant, Accounts Manager etc. But the solution space (software for accounts department) we are developing for the Accounts department will contain the computers/networks and memory. So the language we are going to use should be able to give us the facility to create the entities of account, accountant and manager. And it should take care of the essential conversion of the accountant (properties and behavior) into the computer’s memory. This is what essentially all the OO programming languages do.

I am going to start learn Ruby, will post more code here.

Coming to work place: I am working on design of three new prototypes to test feasibility. One of which is the protocol switching. I am currently writing some proof of concept coding.

More soon…..

Web Application Development using Perl

Perl is one of my favorite languages, especially because of its versatility. Perl is everywhere: CGI, GUI, Application Development, XML Processing, Database Accesss and of course System administration tasks.

The main challenge in developing a web-application is proper design. The decoupling of the static content from the dynamic content inside the individual pages is the trickiest part. I’ve used HTML::Template and Templete Toolkit modules for providing the templates. And the templates are filled in with real data using a Perl script. The HTML::Template module provides good flexibility of separating the dynamic parts of the page from the static content. But as far as the application is small, and there’s a harmony between the application-developer and the UI-designer of the web-app, everything seems to be perfect. But as far as the UI designer is concerned he/she must know how exactly the dynamic parts are being replaced by the application logic. Otherwise, it’s going to be a big mess.Particularly for large web-applications this doesn’t work. I guess same is the case with other template mechanisms. Unless the webpage designer knows how the templates and Perl work, it’s really hard to produce good web-application.

Perl is supported by major web-servers: Apache, IIS etc. Apache has also mod_perl (kind of embedded Perl interpreter) which provides fast, in fact very fast execution of Perl Script. The main idea of using mod_perl is to get access to the Apache API itself, and extend the web-server to provide our we-app functionality, that means: essentially turning your web-servers into web-app-server. The mod_perl can do wonders for large web-sites or web-applications. With all the power of Perl and the super stable Apache, completely reliable applications can be built.