Archive for Programming

Controlling a 12x ShiftBrite Array with mbed

Last night I managed to get my mbed driving a shiftbrite array with some test patterns.

Next step is to improve the PC to mbed interface so that colours can be directly driven to the array at required locations rather than just starting test patterns hard coded on the mbed.


First Test of Silverlight in WordPress

I have recently been learning Silverlight for some work projects and decided to try and integrate .XAP files directly into WordPress blog posts using Silverlight for WordPress by Tim Heuer (of fame :-))

Simple enough install but had then ran into the issue with Silverlight cross domain web service calls. If the web service you are trying to call from Silverlight doesn’t have the crossdomain.xml file (Google it for specifics) at the web host root asynchronous Silverlight methods fail upon completion. As I wanted to call a weather API this was an issue. Instead I loaded the crossdomain.xml file onto my own web host and created a quick and dirty PHP page to parse the Secret Google weather web service. This was then called by the Silverlight .XAP as can be seen below (it tells you what the current temperature is in my home town of Cambridge, UK). Easy :-).

Public Sub New()
     Dim wc As New WebClient()
     Dim baseURI As String = ""
     AddHandler wc.DownloadStringCompleted, AddressOf completed
     wc.DownloadStringAsync(New Uri(baseURI))
End Sub
Private Sub completed(sender As Object, e As DownloadStringCompletedEventArgs)
     WeatherTextBlock.Text = "It is " & e.Result & "°C in Cambridge"
End Sub

Next up something more complicated……



Edit: Just noticed that the Silverlight for WordPress plugin by Tim Heuer only works if the posts are viewed on the front page not as a stand alone post. Changed the plugin to the Simply Silverlight plugin by DigitalWindFire. Everything now works again and it even has more fetures.