Thoughts on technology, computer science, mathematics, and programming. And not necessarily in that order!

The trouble with URL shorteners

Lately I've been spending some time thinking about URL shorteners. The interest arose over a recent weekend as I sent someone shortened URLs to a couple of sites, that I had bookmarked a few years ago. I'd inadvertently bookmarked the shortend links rather than the long URLs, and my reciepient complained that they couldn't read the content I'd sent them. Some investigation later, I realized that their mail system may have been blocking the URL. In addtion, one of my other shortened links had 'expired'. The short URL no longer worked. That sparked off a series of technical explorations that are now the subject of these blog posts. (Full article)

Sampling from a Bivariate Normal Distribution

Most math libraries have a random number generator that generates samples from a normal distribution. Many libraries, like Apache Commons Math have random number generators that generate normally distributed scalar variables (i.e. samples from univariate normal distribution.) The task of generating random samples from a bivariate normal distribution, given a univariate normal random number generator is a little more complex. This is the subject of this post. (Full article)

Series: Using Java applets and applications portably

Part 1: Applets that are also applications

Java applets on web pages create some problems, the biggest of which is that the default way of launching them is unfriendly to users. Furthermore, the default launch techniques are not very browser friendly. Finally, there are annoying differences between UI initialization code for applets and applications. This article is the first in a three part series that describes solutions to these problems. (Full article)

Part 2: Javascript techniques to control Java applet deployment

Oracle provides a piece of Javascript that automatically installs the Java runtime on the users browser when a page containing an applet is loaded. The Javascript also handles differences between browsers. However, the problem with this script is that it redirects users to Oracle's Java download page when it detects that the required Java runtime is not installed. This is not a user fiendly experience, as it does not give the reader a chance to examine the original page to decide whether on not to install Java to launch the applet. This article describes how to use a modified form of Oracle's Javascript framwork to launch Java applets and applications only when the reader initiates the action. This is the second part of the series. (Full article)