Skip to content

All posts by moore - 87. page

Cross browser javascript/css development issues

I’m working on an application that needs to be supported on a wide variety of browsers, and unfortunately includes some interesting javascript and css. There are three problems we’ve encountered so far.

1. Finding Browser share

When you want to support most users, you have to try to figure out what they’re using. There are at least three or four different sites which give you their browser share, but I think you have to pay if you want really accurate, detailed information; here’s one source, here’s another, and here’s one last site. Update, 11/3: here are stats for the www.bbc.co.uk homepage.

2. Javascript specifications

Perhaps it’s just me, but I’ve had a devil of a time finding a list of javascript events supported by various browsers. I’ll give it to Microsoft, they have some documentation on supported events; I couldn’t find a similar list of events anywhere on the mozilla site. Here’s the Mozilla Javascript page but I don’t see anything resembling an API there. (All I want is a javascript javadoc!) Here is the best comparison of event support on modern browsers that I found. Update 10/31: here is a list of events that Gecko recognizes.

3. Getting ahold of old browsers and older operating systems, so you can test

Luckily, this is fairly easy to solve. VMWare (which I’ve written about previously) takes care of the various operating systems (well, that and a mac mini) that we need to test under. And a simple google search turned up a fantastic archive of old browsers: browsers.evolt.org, which has many different browsers going all the way back to NCSA Mosaic!.

JBoss at Work ships

JBoss at Work by Thomas Marrs and Scott Davis and a book I technically reviewed, is shipping. Having read all of it, I’d say it’s worth a look both for the technical content–the authors take the reader all the way through a standard J2EE application, pointing out all the JBoss specific configurations and gotchas–and for the slightly whimsical and easy to read style. Sometimes it was a be repetitive, but that’s not bad for a book aimed at getting folks without much experience up and running. Read the sample chapter on ear building and deployment and see if it fits with your needs.

A quick survey of online map generation options

I have a client who wants to put some maps on his commercial website. I’ve done a bit of looking around, and it’s not clear to me what the best way to do it is. There are really two types of mapping services out there. One depends on URL creation, like MapQuest, MapBlast, Yahoo and Google–you don’t register or do much coding at all, you just create a GET string with the address encoded in it. The other is a web service where you register for a key and use an API to generate a map, like Yahoo, Google and MapPoint. You’ll note that Yahoo and Google appear on both of those lists–that’s because they provide both a URL interface and a more formal API.

Now, even though I am not a lawyer, it seems to me, via looking around at the various Terms Of Service (TOS), that commercial use of any of the URL interfaces is not an option. The Yahoo Maps TOS says

The data included in Yahoo! Maps, including but not limited to maps, routes, and/or directions (“Data”), is provided for your personal use only…

while the MapQuest TOS says

…MapQuest grants you a nonexclusive, non-transferable license to view and print the Materials solely for your own personal non-commercial use.

Google Maps, which has been extensively mashed up with other sorts of data, appears to abide by the general Google TOS which say

The Google Services are made available for your personal, non-commercial use only. You may not use the Google Services to sell a product or service, or to increase traffic to your Web site for commercial reasons, such as advertising sales.

To be fair, you may contact Google about commercial services: [i]f you want to make commercial use of the Google Services, you must enter into an agreement with Google to do so in advance. Updated, 10/30: apparently the maps API is governed by a different TOS, which apparently allows commercial use “as long your site is generally accessible to consumers without charge”. My apologies. I didn’t look at MapBlast too carefully, because it’s built on the MapPoint web service, which has a noncommercial provision.

Luckily, at least for those of us in the United States of America, there are two services provided by the Census Bureau (see, those taxes you’re paying are worth something!) which provide mapping data. As far as I could find, these services have no limits on commercial or non commercial use, but they are a bit hokier than the ones I laid out above. (Here are the Tiger TOS and the general Census position of resale.) The Tiger site was the preferable of the two, because it actually gives you a marker for your location. Of course, you have to geocode your address to find your lat/long, but Geocoder.us makes this easy, and even provides instructions on making your own service. The data for Tiger is from 1998, however. If you’re looking for more recent data, FactFinder is worth looking at. It didn’t work for my client because it provided no way to pinpoint a particular address, though it did allow you to recenter on one without geocoding it.

Neither of these provide directions, as far as I could see, so if you’re looking for that, as well as if you want the cooler interfaces of the private sector, you need to look to the web services.

MapPoint, which is a Microsoft service, explicitly denies external commercial use in its TOS:

MapPoint Web Service is for your individual use, solely for internal use by you for your business, or for your own personal use.

Yahoo and Google, however, take a bit more flexible position. For each of these services, according to their TOS, you need to contact them to use the web service they provide in a commercial context. (Yahoo Maps Web Service TOS, and the Google TOS for the web service which is the same as that for the URL interface service.) I have no idea what kind of licensing agreement will emerge from talks with these companies, but, from reading their TOSes, it appears to me that if you want to use their data in a commercial manner, you need to have that conversation.

I’ve covered all the services that provide maps that I know of. Please let me know if there are any that I’ve missed or anything I’ve misinterpreted.

Set your priorities

Joel has a new article out, on the topic of setting your priorities for new development. I am mostly in the consultingware business, and love his characterization of it. Most companies I’ve worked for want to get in the shrinkware business, but for various reasons it’s hard to do (mostly because you have to invest time and money up front–I have seen several attempts to build a product on top of work done for a customer, but never a success)–whereas selling your labor is easy. However, I think that his fast and loose prioritization scheme would work well for custom software development too.

CU Talk: Supporting the Software Revolution

Last Thursday, I went to a talk (one of the CU CS Colloquia) about software and the problems it faces today at the University of Colorado called “Supporting the Software Revolution”. Amer Diwan gave a talk about some of his research and how it deals with modern software programs, which are becoming larger and larger, with the following ramifications:

they are
1. harder to write–more collaborative.
2. harder to understand
3. more resource intensive

He talked about some of his research in the educational sphere, where he was working against the traditional engineering bias against collaboration by training students to work in teams. Amer also mentioned his research into tools to help discover documentation to increase understanding of large programs. But the meat of his research, as well as the focus of this talk, was on technologies to improve performance, including hardware aware software and visualization.

Amer primarily discussed vertical profiling, which stated that because of the multilayered nature of todays applications (application on top of framework on top of virtual machine on top of hardware) it is not enough to simply profile the application and the hardware, since each level can interact with each other level in non intuitive ways.

The answer is vertical profiling, where you instrument each layer appropriately. (Some layers, such as the jikes JVM, are pre-instrumented.) Find a target metric, like instructions per cycle. Instrument different all the different metrics (for example, new object allocations is one thing could be instrumented for the virtual machine level). Then, align all these metrics with one common metric to combat nondeterministic behavior.

(This is where I get a bit fuzzy–I believe that they used some kind of algorithm to match up the instructions per cycle with other interesting metrics. He mentioned some kind of algorithm that had previously been used for speech recognition. Not sure how to align three variables [time, instructions per cycle, and one other interesting metric] on one chart.)

Then, after all the metrics have been aligned in time, look for interesting and disturbing patterns–this is where the humans come in and rank the graphs by similarity. Then see if one metric depends on another–you can then discard the dependent metric, since you’re looking for the root issue. After you think you have found the root issue, make a change to that, and profile the stack again. If the pattern of interest is gone, you are validated and have addressed the root issue–otherwise back to the drawing board.

This was interesting because of the alignment in time of different metrics (which is, unfortunately, the piece I understand and remember the least). Other than that, it was pretty much a well thought out and methodical explication of common knowledge of profiling. Change one thing at a time, look for dependencies, validate your suppositions, be aware of interactions between the layers of your application. It is nice to see someone trying to turn the black art of performance tuning a bit more into a science.

So, if you’re ever on a project that has the time and budget to deal with performance issues in a methodical manner, vertical profiling is worth a look. More here:

Performance explorer: understanding java application behavior

One of Diwan’s student’s research pages

InstallAnywhere Impressions

I helped write a java program a few months ago, a product designed to run on mail servers. Now, we had the program packaged up as a zip file (for windows) and a tarball (for unix). That wasn’t my decision, but it makes sense to me–if you are deploying a program on a mail server, you should know how to unzip files and edit configuration files.

But, that’s not what the client wanted. They came back recently with a few changes, and a desire to install via InstallAnywhere. I am no expert at InstallAnywhere, but the client didn’t have the engineering cycles to repackage the program, so they paid me to do it. What follows is my overall impression of InstallAnywhere, and a few tips and tricks.

Overall, I like InstallAnywhere. This program makes it easy to build java program installers for a variety of different platforms (most of the unices, Macs and Windows), execute sundry actions pre and post install, and grab user input while installing. It supports both GUI and console installation procedures. In particular, the Windows installer was a snap, and I didn’t have to learn the first thing about the registry–InstallAnywhere took care of that, even to the point of having the program show up on the ‘Add/Remove Programs’ Control Panel.

On the downside, there are a bevy of options and the help file wasn’t exactly the best. They have a free trial version, but it complains every time you install from a file built with the trial version; such installers stop working around 10 days after you build with the trial version as well–but the trial version doesn’t tell you about the future failure.

A few tips:

* It’s possible to keep the install configuration file in CVS, except for the fact that it hardcodes paths to resources that it includes in the install file. I was able to work around that by using ant’s replace task.

* When you start up the program (on unix), you can’t kill it normally, via either cntrl-c or backgrounding it and running the kill command on the process. I believe this is because the default behavior of a launcher is to listen to the console for stdin. You can change this easily enough, but the default really should be correct.

* The installer builder doesn’t default to generating a log, even though many of the default log messages point you to the install log file. You have to click a checkbox on the Project Info Pane in the Advance Installer.

* The console installer insisted that there were errors in the installation process even though the program, post install, worked fine and there were no errors written in the installer log. I think this is due to the fact that I’m using the trial version, but am not sure.

* There doesn’t seem to be any way in the InstallAnywhere GUI to specify that if the DISPLAY variable is set (on unix systems), the GUI installer should run, otherwise the console installer should run. If you want, you can edit the generated install.bin installer script–search for ‘FAILSAFE’ and use a modern editor capable of long lines–but I couldn’t figure out a way to automate this change. This is my biggest gripe, since this is a very typical demand. If you don’t run install.bin -i console to specify a console installation, you get a lovely exception:

Stack Trace:
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
        at java.awt.Window.(Window.java:317)
        at java.awt.Frame.(Frame.java:419)
        at java.awt.Frame.(Frame.java:384)
        at javax.swing.JFrame.(JFrame.java:150)
        at com.zerog.ia.installer.LifeCycleManager.f(DashoA8113)
        at com.zerog.ia.installer.LifeCycleManager.g(DashoA8113)
        at com.zerog.ia.installer.LifeCycleManager.a(DashoA8113)
        at com.zerog.ia.installer.Main.main(DashoA8113)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.zerog.lax.LAX.launch(DashoA8113)
        at com.zerog.lax.LAX.main(DashoA8113)
This Application has Unexpectedly Quit: Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX)

Overall, I’d say if you’re delivering a java based product to typical users, InstallAnywhere is a good choice. I don’t know how much it costs, but the experience for the users is as seamless as you want it to be, the width and breadth of installer customization is impressive, and it didn’t take too long to get up to speed.

Yahoo IM and VOIP

I just installed the latest version of Yahoo Messenger. That and a 20 dollar headset lets me make free phone calls to anyone else on my messenger list (though they have to have the correct version of the software and a headset as well–and Yahoo reserves the right to start charging for the service.)

I may be a bit behind the wagon, since eBay just bought Skype and I have a friend who has been using vonage for over two years, but I was quite impressed witht he ease of install and the sound quality. I’ll be interested to see where Yahoo takes this. They already allow you to make calls to external phone numbers, though you do have to pay 2 cents a minute.

Why is this any different than Skype or Vonage? Because:
1) it leverages the investment most folks have in their IM address books
2) when you’re on IM, you sometimes want to have phone conversations to supplement the quick questions that IM is so good at conveying
3) yahoo is a fairly well known name (as is google, who is also getting into the business of VOIP). I don’t have any numbers on relative bases, but from personal experience, the number of folks who IM is greater than the number of folks who use VOIP.

Remember the days when there was such a business as carrying long distance voice traffic? There are rapidly coming to a close, driven by VOIP and cellular phone usage, I think.

Update: The Economist has an article on Skype and VOIP in general.

Webtop customizations and a java.lang.NoClassDefFoundError

So, a few weeks back, I was working with a webtop customization (webtop is a web interface to Documentum). We were getting a weird error whenever we tried to access it. When I showed details, I saw this message:

com/documentum/web/formext/action/IActionPrecondition

After closing this window, press the Refresh or Reload button on your browser to continue.

Hide Details

Stack Trace:

java.lang.NoClassDefFoundError: com/documentum/web/formext/action/IActionPrecondition at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source)
at java.security.SecureClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.CodeSource;)Ljava.lang.Class;(SecureClassLoader.java:123)
...

We spent the better part of the day debugging it. The IActionPrecondition class was in the WEB-INF/classes directory of the webtop web app. It looked just the same as it had before (no recent modifications). When we commented out the Precondition, we didn’t see this error, but still couldn’t use the customization. It happened on Unix and on Windows.

We were msytified, and ended up having to go back to a system that worked, then move forward very slowly until the system didn’t work, then focus on those changes (all hail CVS).

What we found suprised the heck out of me. Basically, we have a jar file of all the TBOs and documentum utilities that we have to put in the system classpath, because it needs to be loaded when the dfc.jar is loaded. (These are the words of the documentum experts I was working with.) The webtop custom classes were inadvertantly included in this jar file, and were loaded by the system classloader. But some of these classes depended on classes in the webtop web apps classes directly, loaded by that descendant classloader. Hence, the custom classes were couldn’t find their super classes and were invalid. Once we moved the custom webtop classes out of the TBO jar files, everything was good as gold.

I once worked with a colleague who said, rather than calling her a senior software developer, she sometimes felt she should be called a senior classpath debugger. Indeed.