Archive for January, 2007

Greek God Vs Sumerian Spirit

Yesterday, Tech Crunch ran a PR fluff piece on Adobe’s new framework Apollo. I felt somewhat compelled to comment on it, because of my well documented views on Flex. The gist of the article is that Apollo, Adobe’s pre-alpha but soon to be released web container, will change the space of Rich Internet Applications and make every early adopter extremely rich.

This claim is simply absurd. There isn’t going to be a “bonanza” and a “gold-rush like mentality” around this technology. The reason is mentioned in the article. When people think Rich Internet Applications, they think AJAX and occasionally Flash. Despite Adobe’s best PR efforts, I don’t see this changing. Flash has never been able to supplant HTML as the interactive medium of the web. With a little thought, it’s extremely easy to see why. It doesn’t $500 per developer seat and $20,000 per server cpu to build an application. The LAMP stack is completely free and it can run on commodity hardware. The java stack has an equally low cost of entry. There are numerous open source javascript frameworks that make AJAX easier and cleaner. Unless Adobe changes the pricing of their server components, at $20k a pop, there will be little left in the budget for somebody to create the RIA at most places. The only people that will ever get rich of this are Adobe’s astro-turfing squad and the sites that accept the paid ads.

None of this is to say that the idea behind RIA’s is flawed or that there isn’t a need for an internet application to interact with the desktop in a more thick client fashion. If this is something you really need, well there’s already a cross-platform, open-source, free and almost production ready way to do it: XUL (named after the Sumerian deity ghost from Ghostbusters). For a good example of what XUL can do, you need to look no further than Firefox and Thunderbird. The choice seems pretty easy to me, millions of users and results over a bunch of made up hype.

  • Share/Bookmark

Using Spring Web Controllers with Dojo Dialogs

Now getting back to some real blog content, and to clear out some of the backlog…….

Not too long ago, at work, I ran into the problem of using a url backed by a Spring SimpleFormController inside of a Dojo modal dialog widget. The modal dialog was intended to modifiy the properties of some object on the parent page. The goal was to have the dojo dialog open, populate the dialog with the contents of the url, submit the form and if successful, close the dialog and update the parent; otherwise show the errors.

Our solution was to use Prototype’s Ajax.Updater to populate the div and submit the form.

The first step was to import the two javascript libraries we need to use, the aforementioned dojo and

<script type="text/javascript" src="dojo.js"> </script>
<script type="text/javascript" src="prototype.js"> </script>

After that, we needed to write the script to actually open the dialog, populate it, and submit the results.

<script type="text/javascript">
    dojo.require("dojo.widget.Dialog");

    var popupDialog;
    var dialogFormUrl;
    var parentFormId;

    dojo.addOnLoad(function() {
        popupDialog = dojo.widget.byId("dialog_id");
    });

    function hideDialog() {
        popupDialog.hide();
    }

    function _showDialog() {
        popupDialog.show();
    }

    function showDialog(formUrl, outerFormId, modelId) {
        var params = {};
        if(typeof modelId != 'undefined') {
            params = {id: modelId};
        }
        parentFormId = outerFormId;
        dialogFormUrl = formUrl;
        new Ajax.Updater( 'dialogForm',
                dialogFormUrl,
                {method: 'get',
                parameters: $H(params).toQueryString(),
                asynchronous: true,
                onSuccess: _showDialog});
    }

    function submit() {
        /* Submit the parent form to save any state changes */
        new Ajax.Updater( 'dialogForm',
                dialogFormUrl,
                {method: 'post',
                parameters: Form.serialize('dialogForm'),
                onComplete: processResult,
                asynchronous: true});
    }

    function processResult() {
        var elems = document.getElementsByClassName("errors");
        if(elems.length == 0) {
            refreshWindow();
        }
    }

    function refreshWindow() {
        if(typeof refreshParentPanel != 'undefined') {
            refreshParentPanel();
        } else {
            $(parentFormId).submit();
        }
    }

</script>

The method showDialog() is the entry point into the widget. It’s function is to initialize some global variables and then call Ajax.Updater. The parameters for the function are formUrl (the url for Ajax.Updater to retrieve), outerFormId (the form id of the parent), and modelId (the id of the model object we are attempting to modify).

Calling Ajax.Updater using the ‘get’ method triggers the show initial view path in the spring controller. This is exactly as if the user had navigated to the url manually. However, instead of the contents replacing the contents of the browser window, they are placed into a previously hidden div on the parent page.

Our dialog in this case has two buttons: cancel and save. The cancel button calls the hideDialog function, which simply re-hids the dialog. The save button presents a few more challenges. Simply sumitting the form will not work, since it will cause the whole page to refresh, and not only the dialog. Therefore, the submit action is wrapped with a call to the Ajax.Updater. ‘post’ is specified here to cause the SimpleFormController to use it’s onSubmit methods.

The one remaining hurdle is that the controller returns the http success status code, regardless of validation errors. Therefore, we must use an additional javascript check. By our convention, all error messages have the element class “errors.” Initially, this was so that we could easily make them all red, but it serves a dual purpose of signaling to our method whether or not the popup needs to be hidden, or if the validation errors need to be displayed.

It took a little work but it should be clear to see how you can adapt almost any existing Spring controller to be used inside a modal dojo dialog.

  • Share/Bookmark

The Secret is don’t watch “The Secret”

In the last few months, I’ve mostly thought about the things that I normally think about. Things like being a competent and interesting writer, the Porsche Cayman, java development and an OS X sub-notebook. At no point did thoughts of self-help babble float across my cerebral cortex. This makes me highly skeptical of The Secret’s premise: the “Law” of Attraction. This law explains that human thought is so powerful, that it attracts the objects and states of being that one thinks about. If you have a lot of debt, or are stricken with cancer, you can change this simply by thinking of yourself as debt free or cured.

Well my writing is average at best, the garage does not contain a Cayman, I’m not really even sure I know what java is anymore, and I’m writing this on a 3.5 year old Linux box, yet I didn’t think about self-help nonesense and have gotten it twice recently. Hrm, it doesn’t look too good for the law of attraction. Perhaps there’s a reason it’s such a secret.

The Secret is like anything else that promises easy solutions to hard problems: it’s total bunk. (Ruby on Rails excepted of course). The fact is that you can always prove something anecdotally. There are over 6 billion people in this world. It’s almost a statistical certainty that you’ll be able to find a handful of cranks and crackpots to not only prove whatever point you’re trying to make, but also are foolish enough to get on camera and look ridiculous. Like all other works in this genre, “The Secret” includes it’s fair share of lying by omission. One of the prime examples was the woman who was diagnosed with breast cancer, who “cured” it by using the law of attraction (ie believing she was cured) and watching comedies. She is now cancer free, although she has never had a dose of chemotherapy or radiation (note how surgery was omitted from that list). Needless to say, the needles of sense in the haystack of hogwash will be touted as proof by whichever impressionable friend advised you to watch this video.

At the end of the day, no amount of thinking that I have the hour and a half of my life back will lead to me getting that time back. All I can hope for is if some new-age influenced acquaintance of yours attempts to show you “The Secret,” you’d be well off to leave the room. If you are really desperate for entertainment, go watch grass grow or paint dry. Both activities are far more exciting and educational. Consider yourselves warned.

  • Share/Bookmark

Xfce 4.4.0 Review

The Xfce project has just announced the release of Xfce 4.4.0. For those who are unfamiliar with the project, Xfce is known for two things. First, it’s built on the GTK toolkit, but is extremely light-weight. It takes a fraction of the required memory that a full Gnome install takes. Therefore, it’s been dubbed by the Slackware folks as the “Cholesterol Free Desktop Environment.” The second is that it was the first desktop environment to have a solid and non-buggy composting manager. Since Gnome runs dog slow on this laptop, I decided to give it a spin.

There weren’t any pre-compiled SuSE 10.2 binaries that I could find, so I just downloaded the graphical installer. One thing you might want to note when compiling and installing on older hardware is the full requirement list. The graphical installer has a dependency check, but it doesn’t seem to check for everything correctly. For instance, I had ALSA installed, but not alsa-devel, causing the installer to fail due to compile errors. This probably isn’t a big deal on newer hardware, but compiling takes a very long time on this slower box.

Once I resolved the dependency problems, installing was a breeze. The process was: sudo to root, run the installer, hit next a few times, take a (long) break, log-out and when I logged in again, I was in my shiny new Xfce desktop.

There are a few subtle differences between 4.2 and 4.4. The default theme is a little snazzier, and the default panel doesn’t invoke memories of CDE anymore. Out of the box, it feels a little more like Gnome than the older version did. Since I’m running Xfce with as much as I can turned off, my personal screen-shots aren’t that exciting. The official ones are pretty neat looking.

Thankfully, this release also addresses what I disliked the most about previous versions of Xfce: the file manager: xffm. Not only was it useless, but it was ugly as well. All my attempts to try and make sense of it failed, and I resorted to switching back to Nautilus for my file browsing needs. Of course, this somewhat defeated the point of not running Gnome.

Thankfully, the new file manager Thunar is much better. It looks like a file browser, works like a file browser, but doesn’t take up 100% of the CPU and crash all the time. Which means that I might actually use it over the command line on occasion.

Xfce also comes with it’s down Terminal emulator, which is similar to gnome-terminal, but less bloated and a iCal capable calendar app. There are other projects which provide more goodies for the environment, and these are also available from the xfce project site.

Since Xfce 4.2 I’ve been a big fan of Xfce and this version is no different. It’s very light-weight and runs well on older hardware. However, it’s not for everyone. Another word for light-weight is bare-bones and Xfce does not do everything that Gnome and KDE do. If you want something that’s clean and simple, Xfce is an excellent alternative to the more traditional choices, such as FVWM95 and WindowMaker.

  • Share/Bookmark

Now, Learn how to Write

In a karma-based approach to making up for all the work I managed to get out of while younger, I’ve decided to start writing book reviews on this blog. This is good timing, since it coincides with my renewed interest in reading books.

The first book up for evaluation is the instant-classic Now, Discover Your strengths. Or rather, a potential instant-classic, had the author thought to discover his own strengths and realized that he is in severe need of a decent editor.

The book has only one gem of wisdom: you will be happier and more successful if you emphasize your talents, instead of compensating for your weaknesses. I didn’t find this revelation to be all that revolutionary. Even worse, is that this revelation is a few paragraphs on page 2. Therefore, the rest of the book is nothing but useless fluff.

The next 90 or so pages are worthwhile only for the unintended humor of reading the author expand on this this simple concept in some very odd ways, including waxing eloquent on the eloquence of Colin Powell and an extended analogy involving T1 lines. The inclusion of the latter makes even less sense, considering how unlikely it is that the target audience knows what a T1 line is.

The rest of the book describes in detail what all the different strengths that you can find in yourself mean. It’s almost like design-patterns, but for emotions. Part of the deal with the book is that you can take the on-line test that will tell you want your strengths are. The test is almost as long as the one advertised for eHarmony, but it will not help you get a date. The first 5 strengths are included with the purchase of the book, but in order to see the relative rankings of the remaining 30, you will have to shell out additional cash. Author’s strength score card: writing (not check), making money (check!). Tallying the results of the strength finder test did make for some office fun, but it was no more insightful than the Super Hero Quiz.

Obviously, elitist and mildly arrogant computer professionals are not the target audience for self-help books. I just don’t see how anybody would benefit from spending $18 and 3-8 hours to be told that you should focus on doing what you do well. It’s hardly a novel idea. Instead of reading the book and taking the quiz, you’ll be much better off just thinking about what you like to do, then going out and doing it.

  • Share/Bookmark

Return of the Fujitsu

One thing that I’ve noticed that in 2007 our laptops are as big as they were in 2003. It’s been almost 4 years since I got my Fujitsu, and now that I’ve taken it back, I still haven’t come across a laptop that I like more. I’m very impressed with the build of this little machine. Even after a tour of duty with my technology destroying younger brother, it still works like a charm (once I cleaned the toothpaste off the keyboard).

I love my new MacBook for it’s speed and operating system. However, for chilling out on the couch and interneting, give me the Fujitsu any day. It’s small, light, quiet, and doesn’t pose a fire hazard. As long as Opera remains fast, this computer should remain useable.

It’s somewhat upsetting that it’s no easier or cheaper to get a tiny laptop now than it was when I bought this one. There’s tons of laptops with 15″ screens that weight 8lbs, but almost none with screens smaller than 12″ and feather-weight. Those that do cost more than my MacBook and come with the computer virus known as Windows. Hopefully, one day Apple will introduce an ultra slim OS X tablet. After the iPhone, they’ll have the technological expertise. Until then, I think I’m going to hold on to this one.

  • Share/Bookmark

Nokia N800

Nokia has finally released the successor to the somewhat underpowered 770 by releasing the N800. As far as specs go, it looks like it’s a minor upgrade. I’m sure the software boasts improvement too. I would give a more complete technical analysis, but the N800 page does not seem to render correctly in Opera on my underpowered laptop. That fact is either very ironic or very telling.

Still, even though I can’t see all the details, it’s worth blogging about since the real news here is that Nokia didn’t cancel the project. It’s validation of the notion that there’s market for a small, open-sourced based convergent devices. I belive one of the major things holding the mylo back is the locked down nature of it’s firmware. There’s hardly any community support for the device.

I also find it somewhat amusing that a cell phone company (Nokia) is making a convergent device without cellphone capabilities and a device maker (Apple) is making a cell phone. I think both the N800 and the iPhone (tm cisco) are cool, but the only device I’m buying anytime soon is a 30gb iPod. I have high hopes that by the time it’s due to retire in 18 months, the device I really want will be available.

  • Share/Bookmark

iPhone (but not my phone)

Yesterday, apple made a big splash with their announcement of iPhone. Despite my generally favorable feelings towards Apple, I wasn’t really all that impressed. Frequent readers of this blog might relate this to my recent purchase of the Sony Mylo, which has many of the features of the iPhone, but lacks a touch-screen interface, bluetooth, and cellphone capabilities. Granted, that might have a little to do with it, but the vast majority is that the iPhone sufferes from the major problem that faces all convergent devices available on the market. It’s too expensive ($500-$600 w/ 2-yr service agreement) and it doesn’t reduce the number of devices I have to carry with me in my pocket.

When you add in the service agreement, the phone really costs about $750, or almost the price of an entry level laptop. Sure the iPhone is much smaller, is a phone, etc, but that doesn’t change the fact that I can get a lot more power at the same price. This leads directly to the second point.

The iPhone does not replace every device in my travel kit. On my recent trip to India, I carried the mylo, an mp3 player, the Nintendo DS, an 6mp camera, and a cellphone. The iPhone will merges the mylo and cell phone, but leaves the other devices intact. It’s not going to be as good at games and with at most 8gb of internal storage, won’t replace the mp3 player or camera. Even after buying the iPhone, I’m still carrying a bag full of devices to keep myself entertained on long trips.

One final grip is the touchscreen with out a stylus. One of the major problems with touchscreens is that I have to put my grubby hands on them. Which means they get smudged and hard to read very quickly. Since I’m a little particular about the cleanliness of my screens, I think this device would drive me nuts.

While I don’t particularly care for the device in the current incarnation, I have to say that I do like Apple’s move. I like the trend towards convergance and I think Apple’s presence is going to force the other technology providers to either lower prices or build better devices, much like what happene din the jukebox space after the announcement of the iPod. Eventually we’ll have a good, inexpensive convergant device. Apple’s entry just means we’ll get there faster.

  • Share/Bookmark
Return top

About

This is my blog about programming. For random stuff, checkout my Twitter or Tumblr