Wednesday 11 January 2012

Using Modinizer

Modinizer is a great new javascript library for detecting browser features without having to write too much unnecessary code for abstracting cross-browser compatibilities. For example rounded corners is a feature that was desired for many UX (user experience) developers and before CSS3 could only be accomplished with javascript hackery. Now with modinizer it is possible to detect using the library whether the feature is enabled and code corresponding classes appropriately. When modinizer is included on a page it dynamically updates the HTML class attribute with a set of classes that identify what that browser understands, e.g. multiplebgs = multiple backgrounds, or no-multiplebgs meaning doesn't support multiple backgrounds. Allowing you the developer to code accordingly for both scenarios and thus future proof your web application. The same also applies to new HTML5 elements such as video, and localstorage. A quick Modiziner.localStorage test will reveal whether or not the browser supports that.

Tuesday 10 January 2012

Reading Files Across Servers

There are many ways to access data across servers that are shared on the same network. Depending on your setup will determine what is the best approach. It is possible to use the COM model to access the UNC as and authenticated user of that machine, i.e. machine name = CPU123, user = CPU123\user.whoever. The problem with this is approach is that if your servers are on different domains then is will be a huge headache to maintain all of those users, configuration file sounds like the best approach, but that will still yield a huge file. One app setting for each user. The approach I adopted was to use MSMQ and created a WCF service for sending messages to that queue and reading the state of the particular file using a FileWatcher. Worked well!