25th June 2008, 08:27 am
I’ve recently been introducing the Spring Framework into an existing Java application, using it to speed up adding new features, while making the existing JDBC code more maintainable. One tricky area has been time handling: the application uses an older SQL Server version, so cannot take advantage of the implementation of timestamp with time zone in SQL Server 2008. All the time fields are kept in UTC, and the application must be careful that all the times are converted to and from UTC correctly. With pure JDBC this is handled explicitly, but with Spring JDBC access this is implicit.
Continue reading ‘UTC, SQL Server, and Spring’ »
20th March 2008, 08:05 pm
Many mobile data services implement a forced cache on access to port 80. These caches often have the unfortunate assumption that the access comes from a web browser, and that a human being will look at the page. Vodafone completely reformats page content, while T-Mobile simply recompresses images at a lower quality. For a human user, this can be a nuisance. For an embedded application, content transformation can be far more serious.
There are several workarounds possible:
- Use SSL. This completely avoids the problem, at the cost of extra data transfer and a longer setup time.
- Arrange with your mobile data provider to turn off content transformation for your SIMs, or for accesses to your server. It can take a long time to find the right person to arrange this, and the process has to be repeated for every network you use in every country.
- Add a Cache-Control header to your http requests, and set a meaningful User-Agent header.
Continue reading ‘Mobile Proxy Servers’ »
28th April 2006, 10:54 am
Every so often I see someone attempting to run the Linux kernel on a PCI add-in card. I’ve done this myself, but there are a lot of complications. This article covers the hardware, and a second article will cover software. Don’t take this as chipset selection advice: before you commit to hardware double-check both the errata and the availability of the silicon.
Continue reading ‘Running Linux on a PCI Add-in Card: Hardware’ »
3rd March 2006, 11:05 am
If you’re designing an application where devices communicate with a server over a mobile network, there are trade-offs between implementation effort and data transfer. This may not apply to a consumer application, where the application developer doesn’t have to pay the data charges. But if the application is M2M these trade-offs matter.
Continue reading ‘SSL Handshake Overhead for Mobile Devices’ »
15th February 2006, 09:29 pm
I have now seen my first ever year 2038 bug. An embedded Linux system that was installed two years ago became unable to acquire a network address by DHCP. The machine did not require an accurate clock, and nobody had initialised its battery-backed real-time clock. Once installed, it had started counting forward from 1st January 1900.
32 bit Unix time covers a range from December 13th 1901 to January 19th 2038. As the real-time clock value was outside this range, Linux wrapped the time round to the year 2036. After the machine had been running for nearly two years, it passed through the 2038 rollover and jumped back to 1901.
This would have been harmless in itself if all the applications on the machine used a monotonic clock, such as the uptime counter returned from the sysinfo function. But the machine in question used an older version of Busybox, and the udhcpc DHCP client in that release failed when faced with a time in the negative number range before 1st January 1970.
The moral of the story? Even though a machine doesn’t need a real-time clock function, it may not be immune to clock related bugs.