DWR with “Reverse AJAX”

In a previous article I already mentioned Direct Web Remoting (DWR), the best AJAX-library I encountered up to now. I just had the time to re-discover it, as I sought something to get back to my Java skills. This library really keeps one promise: it really starts making fun to develop web-applications with AJAX. A short summary: DWR provides a very easy means for calling server-side methods which are hosted in a Java Servlet Container like Tomcat or Jetty. It masks the communication effort by providing client-side abstraction to the method calls of exported Java methods, so remote calls look local to the developer.

The new version 2.0 (release-candidate) introduces a new concept, which they call “reverse AJAX“. Reverse AJAX allows the server to asynchronously send data to its clients. It works by either polling, persistent connection or additional information on your next AJAX call. It means, that the server at any time can push data to the client, without the client’s request. In “persistent connection” this works almost “real-time”, while polling takes at least a poll-interval to notice the new information and additionally increases load on the server.

This feature allows highly interactive applications where new information can be published right away, in best case without noticeable delay. Developing a simple chat-application becomes the matter of just a few lines of server-side code.

For an example of what you can easily do now, look at this example (fake) stock ticker, which updates the data on the client without the client being required to poll for changes. Also note the simple, yet cool, inclusion of script.aculo.us effects during the update. (Hint: you need to move the mouse over the table for the application to start.)

The downside is, the feature is still in an early stage of development, it still has some problems. On my Gentoo Linux box, I can reproducibly increase my CPU load to 100% by duplicating a tab with an open persistent connection in Opera. In Firefox, duplicating the tab leads to normal AJAX calls to no longer function with about 50% chance. If Firefox enters this mode, it will queue up XMLHttpRequest causing a “normal” call to be queued behind the persistent call which will be kept open for around 60 seconds if no data is pushed from the server or even longer, if there is data. This of course makes it almost unusable at the moment, unless you can be sure, users won’t hit your site twice within the same session and/or are not using tab-duplication.

I’m really looking forward to this feature becoming stable, this is so cool and you can do so much awesome stuff with it. Thanks to all developers for their great work!

Keep-Alive Post

This is just a keep-alive post. As my last article has been published over three months ago now, I thought it would be time to at least write something in order to mark this blog as “not dead”. Well, I know I have no readers, so finally I’m just telling myself that I intend to write something again soon 😉 But in opinion an abandoned website is worse than no website at all. So, this website is now officially no longer “out-dated”, as there is an up-to-date article. Thanks for reading 😉

Update: Ok, now I got into writing and already published an article with a little bit more appropriate content for this blog 😉

Microsft Vista x64 Mandatory Driver Signing (Update)

In an earlier article I made a mistake. I told that Microsoft Vista x64 will only work with signed drivers and assumed (wrongly) that this means every driver has to go through the WHQL program for getting a signature of Microsoft’s driver quality program, which would be a quite costly process.

I now discovered an older (German) blog-article by Daniel Melanchton, in which he points out that only a digital signature with a certificate from a trusted CA is required. It seems that it is not required to go through the WHQL process, you just need a certificate. The trusted CAs seem to comprise most root authorities also accepted by Internet Explorer by default, so driver developers are not dependent on Microsoft for getting a signature.

While this still might be a problem for some established Open Source drivers, it is still an affordable and in my opinion useful approach, as digital signatures at least in most ways make the originator of a software known. Of course, this does not tell anything about the quality of the software nor if it is benign or malware. Microsoft’s approach seems to be that without force hardly any publisher will sign their drivers. Unfortunately, they might be true…

Update 2007-02-21: It seems that I still missed one point. The “Secure Media Path” depends on a valid Microsoft signature. Without this signature, drivers are supposed to disable the “Secure Media Path”, so that high-quality (e.g. HDTV, Dolby 7.1) multimedia content is rendered to lower quality.

phpMyAdmin with mod_fcgid

I am currently migrating my server configuration away from mod_php towards mod_fcgid (the successor of mod_fastcgi), as this allows me to use different users for executing scripts in different directories. I use this to have every hosted virtual domain using its own system user. This should (in theory) prevent one buggy application to take over all other hosted domains as well.

I though faced one problem: I could not get phpMyAdmin working and this was a requirement of one of my clients. phpMyAdmin kept popping up the authentication dialog over and over again when using HTTP Basic Authentication.

After searching some time, I noticed that, when using PHP in CGI mode, the authentication data is not passed over to the script by default. A FAQ entry of phpMyAdmin brought the solution to this issue: a ReWrite Rule was needed for the directory containing phpMyAdmin:

RewriteEngine On
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]

Suddenly phpMyAdmin worked 😉

andLinux – Using Linux on Windows

I’m a passionate Gentoo Linux user, but on my notebook I use primarily Windows XP. I always missed some applications, mostly GnuCash, which has not been ported to Windows right now.

Some time ago I came around andLinux, a virtual Linux for Windows. andLinux is based on coLinux and uses the Ubuntu package repository. It is currently in beta stage, because it is still missing an installer. The download is about 130MB and extracts around 2GB to the HDD. Main advantage of coLinux is (unlike VMWare) that memory for the started processes is only allocated as required, as it is not run in a virtual machine but every started process is a real process on the host system.
Continue reading “andLinux – Using Linux on Windows”

tag2find out!

After working very hard for the last several weeks, I’m proud to announce that my colleagues and I managed to get the first public preview version of our product “tag2find” out readily for X-mas this year.

We managed to keep our scheduled release date by 2006-12-21 after a 44h non-stop programming marathon. Actually, that was quite some fun…

After all the stress of the last weeks, I’m now out for holidays. I wish you all a nice X-mas and a Happy New Year! See you in January 😉

A Small “Patch” for Scuttle

Yesterday I realized, that our internal office installation of Scuttle (SF project page) suffered a minor bug: it kept on sorting all bookmarks by date, but in ascending order, i.e. the oldest bookmark was displayed first.

After doing some research, I quickly found out that this seems to be a “bug” (well the devs say it isn’t but one can argue…) of MySQL, caused by an optimization of a SELECT DISTINCT queries.

So I patched services/bookmarkservice.php and removed the DISTINCT keyword in the SQL-query of getBookmarks() (line 249, version 0.7.2).

Up to now, I did not experience any duplicate lines caused by this. I think, I’m going to report this minor issue upstream.

Update: hmm, ups, when searching, you will most certainly get duplicate results… I’ll check in the evening.

Update 2: Ok, so I wrote a litte more extensive patch, by wrapping the original SELECT DISTINCT statement as a subselect and ordering the result as such. This now really works. The patch for 0.7.2 can be downloaded here. You have to apply it to services/bookmarkservice.php.

Update 3: Ok, I somehow managed to delete the patch file. I am sorry. I will look if I can find it in any of the old backups, but I am not too convinced about this.

Terminal-Server NX 2.0 “Free-Forever” Released

NoMachine has announced the release of version 2.0 of thei terminal-server product NX, codenamed “Free-Forever”.

They have released more of their products under GPL and provide now a restricted version under the codename “NX Desktop Server free-forever”:

NoMachine provides a free-for-download and free-forever NX Desktop Server which allows 2 user sessions providing access to any desktop or any network type.

The 2-user sessions should be quite sufficient for many purposes.

[Source: Golem.de]

WinXP: How to Deactivate the “Windows Genuine Advantage Tool”

To remove Microsoft’s new “Windows Genuine Advantage-Tool”, which in the current version will check the system’s license every day against a Microsoft database, simply remove the registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\ CurrentVersion\WinLogon\Notify\WGALogon