my2cents

28. March, 2009

Tell me when your web site requires cookies – please

Filed under: Web Authoring — frightanic @ 08:14

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

I recently started surfing the Internet with cookies disabled in my browser. You wouldn’t believe how many sites that require cookies to be enabled fail to tell me so. I would guess it’s about 90%. Most often I notice this when I try to log in to a site and simply can’t get past the login dialog. Sad if web developers don’t think that far…

I’ve long given up sending a friendly email to the respective webmasters – it’s just too time consuming.

25. January, 2009

GWT widget libraries, a market overview

Filed under: Java,Software Development,Web Authoring — frightanic @ 15:37

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

After many hours searching the Internet for GWT widget libraries, analyzing them, and taking notes I thought I might as well publish my findings here. Feel free to comment and point out inconsistencies.

At the moment the market seems to be split into two segements:
– a few small or medium-size, low-key libraries with little activity
– the whole “Ext” gang

However things change very quickly, in a matter of months, and the end of 2008 saw the advent of a new-kid-on-the-block: SmartGWT.

Small, or medium-sized libraries

  • GWT-SL/WL, a collection of server- and client-side tools. No real show case that demonstrates the power of the library is available. Last minor release in December 2008. Little SVN activity over the entire course of 2008.
  • GWT Tatami, based on the DOJO JS framework. Show case isn’t impressive, but project is active. Continuous SVN activity. Road map for first half of 2009 available.
  • GWTLib, continuous but little SVN activity. Offers hardly anything else but but table-centric widgets.
  • GWT Tk, tbd
  • Rocket GWT, tbd
  • “vanilla” GWT, Google’s on-board GWT widgets. Nothing fancy, but clean and slick.

The “Ext” corner
A long time ago (think Internet time ;-)) a guy called Jack Slocum built an extension to Yahoo’s YUI widget library named YUI-Ext. It evolved and became independent, Ext JS was born and with it a new company: http://extjs.com. The library quickly became very popular.
Once GWT was released people started writing widget libraries for it. Boston-based Sanjiv Jivan started GWT-Ext and based in on Ext JS. Darrell Meyer wrote MyGWT, a pure GWT widget library which shared the Ext JS l&f. It was voted #1 widget library one year ago.
In April 2008 things became very nasty an confusing when Jack Slocum changed the Ext JS license from LGPL to GPL thereby forcing GWT-Ext to stick with Ext JS 2.0.2 which was the last version available under LGPL. Furthermore, he hired Darrell Meyer who brought his MyGWT as a dower into the relationship. As a result, Ext JS published its own GWT widget library called Ext GWT. Now developers had the choice between GWT-Ext (full OSS with LGPL) and Ext GWT with a dual-licensing model. The GWT widget “war” (see references 1-5 below) turned many away from Jack Slocum’s Ext JS because they disliked the way the company treated the GWT community.
On November 26th, 2008, the game changed again when the GWT-Ext crew announced that they would no longer build major new features but instead be migrating to SmartGWT, a library created by GWT-Ext developer Sanjiv Jivan . SmartGWT 1.0 had been announced only two weeks earlier.

[1]http://www.jroller.com/sjivan/entry/my_response_to_jack_slocum
[2]http://pablotron.org/?cid=1556
[3]http://www.gwtsite.com/ext-gwt-gwt-ext-what-now/
[4]http://ajaxian.com/archives/to-gwt-ext-or-to-ext-gwt
[5]http://gwt-ext.com/license/

28. August, 2008

Flash, DHTML Menus and Accessibility

Filed under: Web Authoring — frightanic @ 14:51

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

Whenever I’m confused about the wmode parameter when embedding Flash objects into websites I turn to http://www.communitymx.com/content/article.cfm?cid=e5141. It describes the three modes “window”, “opaque”, and “transparent” with just the right degree of details and contains sensible demos. Of course, it’s helpful that the explanations are also related to DHTML menus because problems with those most often rise questions about Flash’s wmode parameter.

8. June, 2008

Greasemonkey: focus first input field

Filed under: Web Authoring — frightanic @ 10:21

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

I always get annoyed when I end up at sites where the developer (deliberately?) forgot to set the focus to the relevant input field if there is one. IMDB, as great as its content is, for example fails to give that hang-on-to-your-keyboard experience. I assume that usually you don’t want to switch from keyboard to mouse first in order to put the focus in the search field before you can start typing again.

As a remedy a wrote a little Greasemonkey script that focuses the first “text” input field (text, password, textarea) in the first form if the field is visible i.e. inside the view port.

You may ask yourself whether there are no other scripts available that solve this issue. Sure, there are, but their limits were not acceptable for my needs.

  • Search focus will put focus on the search field regardless of where on the page it is, i.e. the input field could be outside the view port and the page will be scrolled down to it. That’s even worse than using your mouse! Besides, it assumes the input field to be named “search”, “q”, or “keywords” in the HTML source code. How can you make such an assumption?
  • Focus on the search does address the view port issue quite nicely, but also falls short on considering all types of input fields.

Tracking scripts vs. Adblock Plus

Filed under: Web Authoring — frightanic @ 04:55

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

Being a software engineer I of course have both Firebug and Adblock Plus (ok, this has nothing to do with being a programmer ;-)) Firefox extensions installed on all systems.

As one of its tasks Firebug dutifully reports all script errors. For quite some time I wondered why so many sites using Google Analytics fail with a
“urchinTracker is not defined” error. Turns out Adblock by default blocks requests to http://www.google.com/analytics/*…
Furthermore, like millions of others I’ve subscribed to some recommended filter lists. Among them is the Adblock EasyList tracking list. This, however, I had long forgotten; that’s the flip side of such fire-and-forget list subscriptions. Turns out one entry in the tracking list blocks access to URLs containing /js/urchin.

So far, so good. It doesn’t really matter if a single “standalone” call to Google Analytics fails. It’s much worse if the calls to a tracker are embedded in a JavaScript function with some real business functionality. Firefox for example preempts script execution in a function when it encounters a script error.
The Union of European Football Associations, UEFA, offers pay-per-view live video streams of all games at the EURO 2008. However, when you click the “Pay” button Firebug reports “_hbSet is not defined” and nothing else happens. UEFA uses HitBox to track their web traffic. Not surprisingly, EasyList’s tracker list contains two entries that block such requests: /hbx*.js|$~other,~object-subrequest and /js/hitbox. Since UEFA’s invocation of the _hbSet() prototype function is embedded right in the middle of their business logic inside the openVideo() function this fails badly. openVideo() is called, goes about its business, fails to find _hbSet() and stops the further execution of the rest of the code.

Oh, and all you webmasters out there trying to track our surfing behavior, would you be so kind and check the existence of an external JavaScript function first before calling it. Thank you.
if (window.urchinTracker) {
urchinTracker();
}

Or at least place all the tracking code at the very end of the business logic.

28. April, 2008

IE: Could not get the visibility property. Invalid argument.

Filed under: Web Authoring — frightanic @ 22:55

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

Microsoft’s Internet Explorer never fails to amaze me – coding JavaScript and CSS for the IE is quite a challenge. The other day I tried to show/hide a table based on the value of a dropdown box.

function hideUnhideDateFields() {
	var tarifScheme = document.getElementById("dropdownTarifscheme");
	var dateTable = document.getElementById("dateTable");
	if (tarifScheme && tarifScheme.value == "") {
		dateTable.style.visibility = "collapse";
	} else {
		dateTable.style.visibility = "visible";
	}
}

While this works flawlessly with browsers, the script crashes in IE: it complains about “Could not get the visibility property. Invalid argument.” Hey IE, talk to me, what is your problem?
I couldn’t get behind it and switched stratey, therefore.

function hideUnhideDateFields() {
	var tarifScheme = document.getElementById("dropdownTarifscheme");
	var dateTable = document.getElementById("dateTable");
	if (tarifScheme && tarifScheme.value == "") {
		dateTable.style.display = "none";
	} else {
		dateTable.style.display = "";
	}
}

18. October, 2007

Generate PHP applications with PHPMaker

Filed under: Web Authoring — frightanic @ 00:57

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

You: Generating PHP applications? You mean developing?

I: No, I mean generating. As in using a GUI-controlled generator to define your application. As in no need to touch scripting code. For real.

If I were a software sales person you’d have to be reluctant taking my statements at face value. But I’m not; I’m a software engineer.

A few weeks ago I was on the hunt for PHP generators that can be fed with a MySQL data model. I found several – some even open source. I installed all of them and played around a bit with all of them. The only one that really impressed me was PHPMaker. The Hongkong-based company behind it really seems to understand the code-generation business. They offer a whole range of generators for various programming languages.

So, I started putting together a small intranet application for my brother with the almost fully functional PHPMaker evaluation version. The tool didn’t let me down; not at all. I kept discovering new features constantly. And the generated PHP code is of decent quality, not just some spaghetti rubbish. My brother was impressed how quickly I was able to produce the desired features. However, he was even more impressed how quickly I was able to respond to new requests. You want to see how the application looks if we change this or do that? Hang on…I change the setting…I generate the files…I upload them to the web server…go, give it a try. Feedback cycles are extremely short that way. It’s a matter of seconds or minutes.

The best of all? The tool only costs $99! That’s nothing compared to the hours of PHP hacking you’d have to invest otherwise. Check out the full feature catalog and the demo at http://www.hkvstore.com/phpmaker/.

As with most tools there are few issues and missing features. The issues with PHPMaker are tiny, it’s very mature. The major missing feature is a decent multi-language support for the generated application. The default language is English. If you need a different language you need to translate all labels in a XML file that is part of a ZIP file that contains the template and you need to generate the application separatly for each language/template. Others have complained about this before: http://download.hkvstore.com/forums/viewtopic.php?t=11021&highlight=language Mac users watch out, PHP maker only runs on Windows!

30. August, 2007

Fun with PHP form processing

Filed under: Web Authoring — frightanic @ 23:18

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

While debugging a PHP script tonight I came across an extremely annoying PHP “feature”: it does not allow HTML input field names to contain dots and spaces.

So, if you had a HTML form with an input field “do.it” <input name="do.it" id="do.it" type="text" /> and were to process this form with PHP, PHP would report a field named “do_it”. A field named “do it” would also be converted to “do_it”. While the behavior for the second case is totally sensible and in accordance with W3C’s HTML specification (space is not allowed in name/id fields), the first is just plain annoying.

The ‘.’ character is very special in PHP, so it cannot be used for variable scoping like in VB or Java. The PHP engine will automaticly translate any ‘.’ into a ‘_’ to make it PHP-safe. Why did the ‘.’ become such a special character in PHP? Heaven knows… I hate it. Or have you ever come across a developer who thinks it’s intuitive to concatenate strings with ‘.’s? That’s just awful.

Blog at WordPress.com.