Saturday, March 22, 2014

Use EitherMouse for managing multiple mice

I get bored of using the mouse with my right hand so I switch the mouse over to the left hand and prefer to mirror the buttons - i.e. use the left button as right-click and the right button as left-click! I also prefer to have the cursors to be left-handed to complete the whole experience so I use left-handed mouse cursors. After a lot of search, I found the best possible lefty cursors on the MSDN archive site.

This creates hilarious situations when a colleague comes over to my desk and tries to use the left-handed mouse with the right hand. So I was desperately looking for a program that would allow me to have multiple mice with their own settings so that I could have one left-handed mouse for me on the left of the keyboard. And then setup another mouse with the regular settings on my right hand side.

I was not able to find any program that would allow me to do this with any success - till I stumbled upon a very good program - EitherMouse - and the best part - it is absolutely free! It allows individual settings for each connected mouse. Apart from the detailed settings for each mouse, it also very conveniently mirrors the cursors so that you don't need to install special left-handed cursors. After using the program for a few months, I am totally impressed with the way it handles two mice. My setup is very convenient with a lefty mouse and a regular mouse allowing me to switch mouse hands instantly!

The mystery of the missing WhiteSpace in XML Attribute values

My expectation when testing the component that handles the import & export of xml data for the system, was that the input & output xml data should be the same if the component works properly. However, I noticed minor whitespace differences in attribute values between the two xml files and I couldn't find any code that was trimming attribute values during either the import nor the export of xml. A closer look showed that the spaces in attribute values were being trimmed and multiple occurrences of space replaced by a single space when the attribute values were being read in!

This was very intriguing so digging around in the XML Specs, says that in the canonical form of an XML document, attribute values are normalized by the XML processor. The Attribute Value Normalization section further lists out the exact algorithm to be used by the XML processor where-in all occurrences of whitespace are replaced by a space. Furthermore, if the attribute type is not CDATA, then the XML processor must further process the normalized attribute value by trimming leading and trailing space and by replacing sequences of spaces by a single space. Also, there is a separate section to handle new line characters which states that all line-breaks or occurrences of CR & LF must be replaced by a LF character.


Related Posts Plugin for WordPress, Blogger...