Differentiating between Apple mobile devices programmatically

It is fairly well known that Apple gives very little information away in the User Agent. All it really surrenders is the device family (e.g. iPhone, iPad, iPod) and the iOS version.

There is an ongoing argument about whether it is appropriate to use device detection to modify the appearance of your website – many argue that feature detection is far superior, and any site intended for a mobile/tablet audience in particular should be responsive. To be perfectly honest, it’s not an argument I really want to get involved in. There are reasons why you may still wish to identify which physical device a visitor is using, rather than just which iOS version and device family.

For example, not all iPhones are equal – if nothing else, the performance of the iPhone 3G is very poor when compared to the iPhone 5. If you are developing a site which is CPU intensive then optimising the site for the iPhone 3G may be a costly and time consuming exercise. If only a small percentage of your customer base uses the iPhone 3G, then the business case for optimising the site may not stack up.

That is just one example of why it may be valuable to know which physical devices your customers use – there are plenty of others. Regardless of why you want to detect it, the method detailed here may help you to do it.

Continue reading

Sparx Enterprise Architect – Exposing the Repository

Enterprise Architect by Sparx Systems is a UML design and business analysis tool. As well as being a very powerful tool in its own right, Enterprise Architect has a couple of really features to allow it to be extended. Firstly, it has a set of APIs that can be used to interrogate the repository. Secondly, is direct database access.

By default, Enterprise Architect stores its repository data in a .eap file. This mystically named file is actually just a Microsoft Access database in disguise. But EA also supports other database engines – for our installation, we have elected to use MySQL. Regardless of which engine you have chosen, the schema is the same though.

Continue reading

Dynamic DNS IP updating with node.js

My situation isn’t an unusual one – I’ve got a server at home that I want to expose to the internet, but my ISP provides me with a dynamic IP address that changes every time my router reconnects. This doesn’t happen often (maybe once a month or so), but if it does change I still want to be able to access my machine remotely.

The usual course of action is to use a free service such as DynDNS – you choose a subdomain on one of the many domain names they have, and using any one of a number of software tools, you ping them whenever your IP changes. This works pretty well – in fact, my router (like many) has built-in support for DynDNS so the router itself will notify DynDNS when the IP address changes. Continue reading