Tuesday, February 07, 2012

UsbHost.USBDriveConnected

Had a little problem with the Gadgeteer yesterday. I was using the UsbHost to read files from a pendrive and after copying files to the drive, verifying that the files were present and plugging it into the Gadgeteer I discovered that the event which is supposed to fire (USBDriveConnected) never did!

After a lot of head scratching I discovered that the pendrive was formatted in NTFS. The UsbHost software only recognises FAT format drives so be sure to get that bit right when you transfer files to your gadgeteer.

Monday, February 06, 2012

Gadgeteer

Simple, brilliant, works... When you can find any information at-all. I can't find a single example of how to use the usbHost.USBDriveConnected event which doesn't seem to fire anyway.

Hey Microsoft. The documentation could do with looking at!!

Software Passion 2012 in Göteborg Sweden

Come along to the Software Passion Summit in Göteborg Sweden on 19th and 20th of March 2012. I'll be speaking on Tuesday the 20th.

You can get a 10% discount by booking through this link and using the promo code "BOB" when you book.

See you there!

Thursday, February 02, 2012

I am the proud owner of a Macbook Air

Its sooo thin!!! I'm just installing Windows 7 and Visual Studio in a VirtualBox VM ready for Techdays Paris next week.

I'm rather hoping that putting the apple devtools, mono, monotouch and monodroid as well as VS and WP7 SDKs wont overload it.


- Posted using BlogPress from my iPhone

Thursday, January 19, 2012

Kodak, a case of the Xerox's

When Bill Gates was a young programmer he worked for Steve Jobs and Apple. This was when Apple had begun work on the Macintosh and the first commercially available GUI.
Apple didn't however invent the Windows, Icons, Mouse and Pointer WIMP system. Xerox did at their PARC facility in Palo Alto where a young Steve Jobs was mooching around seeing what the big boys were doing.

The truth was that the bosses at Xerox didn't think much of WIMPS and thought it was a stupid gimmick. Certainly no good for real computers so they basically let Jobs walk out with the ideas for free. Later, after Microsoft had developed Windows 1.0 Jobs let fly at Gates, accusing him of robbing ideas from Apple whereupon the shrewd Gates replied along the lines of: "We both went into our neighbor's house to rob him. You got the television and I got the stereo"

Kodak were one of the first companies to develop digital imaging. The bosses of the company however were confident in the fact that film emulsions would always be higher resolutions and richer color than digital sensors could produce. Oh how wrong they were and how much that lack of foresight cost them.

There must be a moral to this story somewhere. Perhaps it is that no boss should ever let go of his options when it comes to an interesting but seemingly unpromising technology.

ASP.NET button mouseover image change in javascript

The story so far: I wanted to do something very simple. I have a web-site that needs multi language capabilities so, I store all my site text in a database and pull it out using the country code of the client browser. This means for example that I could have a button with "About" in English and "A Propos" in French. I also wanted a mouseover effect for my buttons to provide a little bit of visual feedback so I created button background slices with appropriate blank backgrounds with the intention of updating the button text in the manner mentioned above.


Well. An ASP.Net image button does the mouseover just fine but not the text. It can't have text. With a little bit of cajoling one can make the ASP.net Button control have a background so that one can indeed update the text. The problem was that there seems to be no way in the world to make the mouseover behaviour work with the Button control. Not using Framework 4.0 anyways.


Microsoft recently modified the way attribute encoding is done in Framework 4.0. This means that if you if you put something like:

onmouseover="alert('boo!')

The 4.0 framework however encodes this as:

onmouseover="alert(&#39boo!&#39)"

I have no clue why but if you start the web project as framework 4.0 and use javascript inline, the server falls over at the encoded apostrophes. If however you switch to framework 3.5 and then back to 4.0 again, something magic happens and the javascript sees the &#39 as an apostrophe.

In order to make my ASP.Net Button control with image background mouseover behaviour work correctly, here's what I did:

#1 Switch the project to framework 3.5 then back to Framework 4.0 
#2 Declare your button:
<asp:Button ID="AboutButton"

Style="background-image:url('images/aboutoff1.jpg'); text-align:left; background-color:Transparent; cursor:hand; background-repeat:no-repeat; background-position:left; font-family:Verdana, Sans-Serif; font-size:28pt; font-weight:bolder;"

Runat="server"

Height="53px"

BorderStyle="None"

Text="About"

Width="352px"

#3 declare your mouseover behaviour in javascript
onmouseover="document.getElementById('ctl00_AboutButton').style.backgroundImage='url(images/aboutover.jpg)';"
onmouseout="document.getElementById('ctl00_AboutButton').style.backgroundImage='url(images/aboutoff.jpg)';"/>

Summary
Traditionally, asp.net controls have been a bit closed but relatively easy to coerce. A bit of wc3 compliant Javascript helps out enormously when the ASP control of choice needs a tweak. Ok, one could roll up one's sleeves and write an ASP.net custom control and render the HTML yourself with no problem but it so much easier to mix and match ASP and javascript.

Sunday, January 15, 2012

Star Trek X-Prize

Well, it had to happen. Strangely I was just expounding the possibilities of such a device to my wife, Chrissy, just a few days ago. Qualcom and the X-Prize organisation have put up a ten-million dollar prize for the team who succeeds in creating a "Medical Tricorder" similar to the type used by Doctor Leonard McCoy in the original Star Trek series.

The device should weigh no more than 2.2 kilos so bulkier than that of the good doctor, should be able to scan and analyse a patients vital signs and to diagnose fifteen conditions over a short period of use.

My own view is that this sort of device is well within reach without a vast amount of research. Given that modern smartphones sport multi-processor CPU's, huge memory, internet connectivity and are already packed with peripherals I see no problem in adding to the range of peripherals available and getting the prize.

I would begin with a normal smartphone architecture, add an infra-red camera, an ultrasound that could do scanning using the accelerometers for position referencing. I would interface in an add-on wrist sphygmomanometer (blood pressure doohickey)  via a bluetooth connection, similarly a blood-oxygen clip to go on an earlobe. A super sensitive microphone and a nice DSP for listening to lungs and heartbeat with decent frequency analysis software for listening to heart valve noises, gas analysis and a set of really good macro lenses for looking into eyes that  could even double as a microscope.

Imagine all that in a SIRI style relationship with a back-end system capable of doing differential diagnosis based on the experiences of a nice fat medical database and you're done!

Hey, somebody give me a job running the team and I'll snag the prize for you!

(Seriously!)

Saturday, January 14, 2012

Virtual Box VM portability

I am researching possibilities for my new portable development setup that I will be installing on my new laptop. Experience has shown me that weight and battery life are more important than processor power for laptops I use in demos and presentations so I have ordered a Macbook Air 13" system.

I will be leaving OSX intact on the machine and probably dual-booting Windows 7 too but as an experiment I looked into the issues of using virtual machines copied between the two OS's by copying my Windows 8 Developer Preview VM from the PC to my recently upgraded Mac Mini to see if Virtual Box could indeed run a straight copy on both systems.

I can happily report that it does, however there is a small problem of keyboard interaction inasmuch as the VirtualBox VM running on the Mac doesen't seem to be getting the same scan codes from the keyboard via the Mac as it does via the PC. The VM on the Mac will not respond to the Start key for example and so it can be problematic switching applications in Metro on the Mac based VM.

I'll continue to do more on this as time goes on but if you have any experience in theese matters please feel free to comment here or to send me a friend request on the facebook link seen on this page where we can discuss your experiences in more detail.

Thursday, January 12, 2012

The shame of Apollo

There are ten billion earth-like planets in our galaxy and we haven't even got a moon-base! The US have dropped the ball by doing ultra-safe ultra-expensive space exploration and have lost thirty years of initiative that we could have had to safeguard and enrich our species.

Great Mango video tutorials here:

http://channel9.msdn.com/Series/Mango-Jump-Start/Mango-Jump-Start-01-Building-Windows-Phone-Apps-with-Visual-Studio-2010