Tags: | Posted by Admin on 8/23/2007 4:06 AM | Comments (0)

Everyone knows Silverlight is an object embedded in the browser.  Therefore, it has the same nuances as other plugins like Flash.

What nuances?  Good question.

Nuance #1 - Displaying HTML over Silverlight

I added an autocomplete extender to the airport name text box at www.airportwait.com.  It worked great, except that the dropdown selections don't display over the Silverlight control on the page.  This has always been an issue with plugins, and even with select controls (thankfully, the select control issue is fixed in IE7). 

To fix it, I redesigned the page to hide the Silverlight control during airport name entry.

Nuance #2 - Silverlight object timing issues

I have a javascript method called ProcessResults that calls a method on my Silverlight object, which in turn displays the airport wait times.  I tried this:

createSilverlight();
ProcessResults();

No good. There's a certain amount of time after createSilverlight() is called when the object isn't yet available. 

So, I had to do this:

createSilverlight();
StartResultsDisplay();

function StartResultsDisplay()
{
    setTimeout("ProcessResults()", 500);
}

function ProcessResults()
{
...
}

This way, I wait half a second before beginning to display the data.  Problem solved.

Oops.  As soon as I wrote this, I remembered I could just specify an onLoad event handler for the Silverlight plugin.  I thought about deleting this part, but it's still good info if someone else is dealing with the same thing.

Silverlight.createObjectEx({
...
    },
    events: {onLoad:ProcessResults}
});

UPDATE: I changed this again.  Because the Silverlight control was immediately calling the ProcessResults method after loading, the page didn't render fully until the loading was complete.  This is because it takes a second or two to retrieve data for some airports, and during this time Silverlight "hangs" browser events. 

Now, I still use the Silverlight onload event handler, but I wait a quarter-second to give the browser time to finish rendering.

events: {onLoad:function() {setTimeout("ProcessResults()", 250)}}

Summary

Again, these aren't uncommon issues.  Still, they're the types of things that just continue to remind me that, while I love the deployment model and reach of the web, it will always be inelegant compared to smart client development!

Tags: , | Posted by admin on 8/14/2007 4:06 AM | Comments (0)

I like to think that I'm smarter than the phishers out there on the net.  However, I almost got tricked today.  I have a Roku Soundbridge for sale on Ebay.  I got this question today...

image

It's a real message received through ebay itself.  So, I did what anyone else would do.  I pasted the stores.ebay.com/W4QQZ150147339995Q url into my browser.  I got the ebay logon prompt, which was odd, since I had just logged in.  I took a look at the URL in the browser, and it was site.voila.fr!

image

I was *that* close to entering my logon details!  This random store has javascript to redirect the user to the site in France.  Very simple, yet very effective.  Hopefully, ebay will take notice and prevent javascript on the page in the future!

Tags: | Posted by admin on 8/13/2007 4:05 AM | Comments (0)

I have a separate Microsoft VirtualPC machine for each client.  I have worked with VMWare in the past, and know they do things better (performance, multiple CPUs, USB, etc), but I never thought it justified paying for VMWare Workstation.  Until now, that is... What grand feature could have made me want to switch?  16 terabyte RAM support, 40,000 CPUs, solid-state like access times?  No to all of the above.  What was it then???

VMWare 6 has multiple monitor support!!!

I can't tell you how exciting that is for me!  I'm a huge advocate of multiple monitors.  I've seen studies that show a 10% productivity increase with multiple monitors, and I absolutely believe it.  I have multiple monitors in my home office, and set them up when I have long-term client engagements.  It's always been frustrating having to revert to a single monitor with VPC.  Well, no more.  Now, with a click of a VMWare button, I have my VMWare machine using both monitors.  It really is a beautiful thing.

So far, the only problem I've had with VMWare is that the VMWare Mouse driver isn't working right.  It won't accept mouse button clicks.  Actually, it does weird stuff.  Right-clicking always pulls up the Taskbar menu.  Odd... anyway, I fixed it by going to My Computer | Manage | Device Manager, and deleting the VMWare mouse driver.  A generic one was installed in its place after a reboot, and that one seems to work OK.

One gotcha to converting VPC to VMWare
There's one gotcha when you want to convert a VPC image to VMWare.  You have to run the VMWare Converter software on an OS that is similar to the one being converted.  I run Vista on my workstation, and Server 2003 on most of my VPCs.  It failed every time I tried to run the converter on Vista, something about "Can't find guest operating system".  I just couldn't figure out why.  After finding many posts on the net where people had this problem and couldn't solve it, I finally saw on an obscure post somewhere that you had to use a server OS to convert a server OS.  So, I ran the converter on a Server 2003 VPC to convert another 2003 VPC to VMWare.  Bingo.  Problem solved!

Another tip is that the converter I ran installed VMWare 5 hardware specs on the virtual machine.  You can't use multiple monitors, however, without VMWare 6 hardware specs.  It's any easy fix.  From VMWare Workstation, choose VM | Upgrade or Change Version.  I ran it and had no issues whatsoever.

Multiple monitor software
One additional note.  If you move around to many different environments, and you use different monitor configurations, or, you use multiple monitors and want to do things like move maximized windows from one monitor to another, or set up hotkeys, etc., check out http://www.realtimesoft.com/ultramon/.  For $39.95, it's more than worth it.

Tags: , | Posted by admin on 8/12/2007 4:04 AM | Comments (0)

Home automation software
So, I'm using Homeseer (www.homeseer.com) software to do my home automation.  Its interface is web-based, and it's written using .NET.  Because of this, it's (theoretically) easy to add custom pages and the like.  One of the things I've wanted to do is have LCD panels distributed throughout the house to use to control my devices.  Here's a sample screen.

image

Thermostat control
Specifically, my first goal has been to control any of the three x10 thermostats in my house from any panel.  Now, there are lots of panels on the market.  However, they're all insanely expensive, and use proprietary interfaces.  So, I've explored the idea of using PCs with touchscreens.  This gets cumbersome, though, because you have to buy a touchscreen, and you also have to store the PC somewhere out of sight, while still having it close enough to the mounted screen.

Nokia 770
Well, last week I saw that buy.com (I buy most tech stuff there) was having a deal on the Nokia 770 Tablet.  It was $143.  That's not much for a device with an 800x480 screen that has wifi and Bluetooth, and runs opera.  I thought to myself, "Self, you could run the Homeseer interface right from that device!".  So, I ordered one. 

Ajax on the Nokia
Sure enough, the 770 handles the Homeseer interface with ease.  You might be asking why it wouldn't.  Well, the thermostat plug-in uses AJAX, so I was worried.  Fortunately, since the 770 uses Opera 7, it does a great job with it!  Here's a screenshot:

image

Nokia 770 and internet radio (Orb to the rescue)

Now, in addition to handling my home automation software, the 770 can also play internet radio, which was another need I had.  Well, it sort of can.  Unfortunately, it doesn't support asx feeds, so I thought I was out of luck with one of my favorite stations.  Fortunately, though, I saw another site that mentioned streaming it through Orb.  Since I have Orb installed on my Media Center PC, I gave it a shot.  It worked great!  I just had to set Orb to stream content in .pls format, which the 770 can handle, and I was set!  I connected the 770 to my home theater, and the music sounded really clear.  I was surprised, since I was restreaming the internet radio stream through Orb.  Anyhow, now I can walk up to my touchpad and control my music selection as well as my home automation!  Of course, since I was accessing Orb, I could play a photo gallery on it, since my pics are all stored on the Media Center PC as well.  Here's a screenshot of Orb on the 770:

image

Nokia 770 limitations
I wish I could say that the 770 was a panacea.  Alas, I cannot.  While it does have Opera, it's an old version.  Flash is also old (only version 6).  If it had a newer version of Flash, I could have run a third-party Homeseer plug-in called Maestro, which is a really slick Flash interface.  Also, the 770 doesn't have a lot of codec support, as mentioned earlier.  The 770 supports a memory format that's hard to find, so, unless you do buy another card, expect to have issues if you run more than a couple of things at the same time. 

Conclusion
The Nokia 770 solved my home automation need nicely!  And, since it also did Internet radio, I was able to sell my Soundbridge Radio I had been using, which could pay for two of the 770s!  Life is good!

Tags: | Posted by admin on 8/1/2007 4:04 AM | Comments (0)


The need

So, I've been playing with Silverlight 1.1.  I'm coauthoring an upcoming Silverlight 1.1 book, so it's kind of important that I know this stuff ;).  I was looking for some kind of real-world app I could sink my teeth into. 

Genesis of an idea

Around the same time, I was getting ready to fly down to Jacksonville to help out a client.  I went to TSA's web site to check wait times at the security checkpoints.  I got the data back, but it wasn't as useful  as I thought it could be.  Here's an example of the results:

image

I looked a little further down the page, and, lo and behold, there was a link to the data in XML format.  An idea was born!

From concept to reality

I'm not a graphics guy.  However, it didn't take a rocket scientist to realize that the TSA data could be presented in such a way that a user could immediately decide the best time to go through security.  I came up with a pie chart-like clock metaphor, where a glance at the chart gave you both average (outer colors) and max (inner colors) times for the entire day.  Here's a screenshot:

image 

Finally, I extended the UI to display the whole week for each checkpoint on one screen. 

image 

With the TSA web site, you can't get a feel for traffic patterns, or what the busiest times are.  On the other hand, by using Silverlight, it becomes immediately apparent when you DON'T want to be at the airport!

Architecture

I wrote a web service in .NET to provide the data.  The Silverlight app has three controls, the Clockgrid control, the Clock control, and the Slice control.  The Clock control is made up of Slice controls, and the Clockgrid control is used to position the Clock controls on the page.  The Clock and Slice controls were designed in Blend.  It's all hosted on an asp.net page that's used to provide the airport selection capability.

<shamelessplug>
If you want to learn more, you'll have to pick up the upcoming Silverlight book I'm working on :)!
</shamelessplug>

What I learned

Silverlight 1.1 is incredibly powerful!  I've been doing ajax-like apps since Microsoft's first xmlhttp implementation.  I've always thought it was incredibly fragile.  On the DOM side, you have to worry about browser-specific idiosyncrasies.  On the web service side, you have to worry about data formats, async callbacks, etc.  Yes, I know there are libraries like ajax.net that wrap the hard work for you, but that doesn't mean the problems don't still exist.  Well, with Silverlight, it's so much easier in comparison!  There is one UI, the Silverlight UI.  No worries about incompatibilities.  On the web service side, you can add a reference to a web service just like you can within a traditional .NET app.  Everything gets wired up for you.  And best of all, it's all in managed code!!!  Life is good!

Try it for yourself

Ok.  I hesitate to throw a URL out there, but since this is my first blog post, and no one reads this :), why not?  If you want to try the app above, go to http://www.airportwait.com.  You'll need the latest Silverlight 1.1 refresh in order for it to work.  I still need to clean up some things, and some airport codes don't work like they should (MSP, for example), but you should get the idea.  And hey, since the data is updated as of a week ago, you might actually find it useful if you're flying somewhere!

Left undone

Here's what I want to do when I have more time.

  • Make it prettier.  It needs the standard web page treatment (menus, header, etc).
  • Add a scale animation when you mouseover a clock chart.  This way, the clock would zoom in and out as it was selected and unselected.
  • Fix 0am to be 12am :).
  • Fix the airports that don't work.  I think the reason is because Silverlight limits the returned web service data size to 120,400 bytes.  I know how to change this in asp.net, but I have not found a setting in Silverlight.  This is one of the reasons it takes a few seconds to display an airport.  Instead of making one call to the web service to get the data for an airport, I had to break it into seven calls, one for each day.  While slower, this enabled larger airports to work.
  • More data!  I'd love to show flight on-time statuses and other significant airline-related data.  Ah, one day...

Final thoughts

I've heard a lot of people wonder how useful Silverlight's going to be for anything other than playing video.  Well, hopefully this example gives you a little taste of how Silverlight can make any application that has data more useful.  Download the SDK and get started today!