blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

andyBlog [andy britcliffe]

My working life in an internet nutshell

  • Moving

    Just a brief note to say that I'm leaving the Conchango nest and hence this blog site - it's been a blast. I'll be moving in the meantime back to my dotnetjunkies blog which can be found here.

    Andy.

     

  • What Silverlight is up against - Flash at its best

  • Silverlight 1.0: Applying a Render transform dynamically

    Here is an interesting one. Typically with the Silverlight 1.0 object model you can access properties and methods directly through Javascript. Now given this you would expect that to dynamically set a Transform, for example a rotation on a TextBlock, you would do something along the lines of textblock.RenderTransform.TransformGroup.RotateTransform.Angle="45" or something to that effect. However this will error. To do this you actually have to create the Transform from XAML using the createFromXAML method.

    So to add RotateTransform to a TextBlock you need to do the following:

    var textblock = rootCanvas.findName('tb');
    var trans = control.content.createFromXaml('<TransformGroup><RotateTransform Angle=\"45\"/></TransformGroup>');
    textblock.renderTransform = trans;

    and that will dynamically add the rotation to the TextBlock.

  • CreateSilverlight.js and Silverlight.js

    When you starting using Silverlight you will quickly become aware of these magic javascript files called CreateSilverlight.js and Silverlight.js that are part of your projects. I've seen a number questions around why these scripts are there and how do you use them. There is a great article here are MSDN that can give you all the information you need.

  • Silverlight error codes

    When working with Silverlight you can often come across cryptic error messages.Fortunately Benjamin Nitschke has done a great job in attempting to document some of the more common ones that occur and made avaible on his blog. This can be a real time saver.
  • Deploying a Silverlight application to IIS and nothing shows up?

    I'm currently working in the depths of Silverlight and we've recently come across a interesting issue when trying to deploy to a test environment.

    As ever, everything was working fine locally, but when we deployed to a W2K3 box the Silverlight content of the site wasn't displaying. No errors, just nothing displayed. We checked the scripts and Xaml files were in place correctly and they were so we were a little puzzled.

    Anyway we decided to use fiddler to check the traffic and that told us that when Silverlight was trying to load our Xaml file it was getting a 404 error. We double checked that the Xaml file was there, and indeed it was so immediately this smelt like an IIS configuration issue.

    After some digging around the solution was to setup a MIME type in IIS for the Xaml being served. Big credit goes to Jim at Microsoft who has this blog post explaining the solution.

  • Good engineering practices breed good software

    Seems obvious when you state it out loud, however it is quite amazing how many companies seem to miss this crucial fact when trying to deliver software. To give some context to this topic I was going through my usual evening reading of blogs when I came across a post from Steve Yegge , a Googler titled:

    Good Agile, Bad Agile

    Now the title attracted me initially as we're certainly interested in the Agile arena. The post its self actually turns into something of a sales pitch about how great it is to work at Google and how they look dis-organised on the outside, but there is a method to their madness. All interesting stuff but hardly ground breaking. However I came across one paragraph which really resonated with me and is, in my opinion one of the major reasons why Google is so good at doing what it does:

    "Google is an exceptionally disciplined company, from a software-engineering perspective. They take things like unit testing, design documents and code reviews more seriously than any other company I've even heard about. They work hard to keep their house in order at all times, and there are strict rules and guidelines in place that prevent engineers and teams from doing things their own way. The result: the whole code base looks the same, so switching teams and sharing code are both far easier than they are at other places."

    You have to have the basic ingredients in place to make a good meal, and the basic ingredients that are vital to a good meal of software development are:


    I've previously written about Ruby on Rails on this blog, and I guess one of the areas that really appealed to me in RoR was the convention over configuration. Like in Steve's quote above, if you go to another Rails project you immediately feel at home in it, the directory structure looks the same, running unit tests is the same, configuration is the same. Now I'm not sure you can say that about all (or even the majority) of .Net projects YOU work on.

    As developers we have a professional responsibility to ensure that any project we work on adheres to the above, otherwise you WILL hit problems further down the road. Get the solid foundation in place, so the building doesn't collapse later on.
  • Flash phone home?

    I came across this today about a new VOIP flash component via Ryan and I have to say it is very, very interesting. Having lived out in the US for the last 12 months I've been heavily reliant on Skype for calls back to the UK to keep in touch with friends and family. Now while Skype works well (ahem apart from the last little incident) there is a setup cost attached to it in terms of it needs to be installed on your PC or MAC, and as I move more and more to an online ecosystem for my communication and applications I find myself less tolerant with being tied to my particular pc/mac for an application. Whether it be writing blog posts (I'm composing this in Google Docs), reading blog posts (I use Google reader), e-mail (Gmail and Hotmail), storing data (I use BingoDisk ) I find more and more that I will opt to use an online application that I can access from anywhere with an Internet connection.

    So hence my interest with a VOIP application that is deployed as flash, as to me this is not only incredibly powerful, but fits my criteria for roaming use. I think I have to agree with Ryan that this offering from Ribbit could well be a game changer, adding more cowbell to the VOIP market and Skype should certainly be looking over their shoulder (or looking to buy them).

    From a user standpoint, it means no more downloading setup files and going through the process of installing it, you have it available to you from any machine that has flash (think mobile as well). From a developer point of view, having the ability to add VOIP to your application as simply as embedding a flex application holds all manner of new powerful communication options.

    I look forward to having a play with it when it's released. Now my question is who's going to build the Silverlight version?
  • JoR - Javascript on Rails. Is it April 1st?

    I'm not sure what to make of this one from the Googleplex, it's certainly food for thought but it seems that Steve Yegge at Google has been working on a RoR port to Javascript called Rhino on Rails. Yup you read that right, Javascript on Rails!!

    More details here...

    Steve has actually written a follow up post on the article here...

    I'd need to see this in action to make a rational judgement, but from a practical standpoint if he can get it into byte code and using the JVM, perf shouldn't be an issue, and the language is certainly dynamic. It seems a little pie in the sky at the moment, but hey you never know, especially when the Googlers are involved.

    Could YOU see yourself building server applications in Javascript? Anyone know of any projects to get Javascript running on the DLR?

    Edit: Actually I was reading Jim Hugunin's blog and re-read this post. Seems Javascript is supported on the DLR which I didn't realise in Silverlight 1.1(I think I was too excited about the c# support to notice).

    Further Edit: My interest was peeked by this and some further googling reveled this post by Michael Schwartz which quotes Jim who alludes to poor peformance in 1.1.

  • Understand your verbs when creating actions in your web applications.

    Recently, I've been doing a fair amount of reading around RESTFul web services and applications. Ruby on Rails has made it silly easy for you to create applications that offer a REST api out of the box. When dealing with a REST web service it is vitally important you understand the verbs of the HTTP protocol. Now I'm not going to delve into this deeply here (you can find a full description here), but I did want to raise the use of GET Vs POST when creating actions in your web applications.

    Now in essence, GET is used to "fetch" a resource - be it a html page, a JavaScript file, an image etc. GET is often misused in web applications, you will often find that a button to, for example a "delete" action, is actually created in the html as an <a> tag. Now you may be wondering why this is an issue. Well the issue arises because the <a> tag, when clicked, makes a GET request to the server but actually actions a change of data on the server. This is what the POST verb was created for, to action changes to state on the server, most commonly changes to the state of data (edit/delete/etc).
    This problem can cause strange issues with sites when tools, like a search engine crawler for example, follow a link that causes a GET request which alters state on the server. They can, in some extreme cases, cause security holes. This was highlighted by the Google Accelerator application, which caused numerous problems to websites that followed the above technique. If you use the correct verb POST for actions, this will be avoided.

    Now one of the big reasons for using <a> tags for actions is that the <input> tag is extremely limited in terms of how you can style it, and in a lot of cases this was a show stopper for using <input> and alas using POST for the actions. Well hopefully this blocker can be removed as I've come across a great article at Particle Tree that covers this very topic and shows how using the <button> tag can transfer the way you style you action buttons, and it's certainly something I wasn't aware of.

    I'd urge any developer/designer looking to build more RESTful applications to check this article out.
  • Javascript is not suitable for complex computation m'kay! Silverlight and the CLR is. Please use the right tool for the job in hand.

    Catchy title eh! Oh well at least it describes the post ;-). Anyway following my trip to the Google Developer Day in San Jose,  I noticed a worrying trend. Obviously people were very focused on Google Gears and how it can be used to "on a plane" enable web applications. Fine, that's all very nice, and I can definitely see where it can be used, with Google Reader being the shining example. No what worried me more was the addition of the worker thread pool.

    Now don't get me wrong, I can see why they've built it, Javascript runs in the browser thread and hence any long running Javascript hangs the browser until it has completed execution, this functionality in essence gives you multi-threaded Javascript.

    However my gripe is that the general advice that seemed to be emerging from the speakers is that with this "worker thread pool" you can now perform complex computation on the client using Javascript. The short of it is that Javascript is dog slow when doing computation, so to me it's using the wrong tool for the job, just because you can do it doesn't mean you should. In the upcoming Dojo Toolkit release with Gears integration it was announced at the Google Developer Day that they will have local Javascript encryption going on.....that just doesn't sit right with me. Javascript's strength is manipulating the DOM and I don't think it should be misused for other purposes, as misuse generally has consequences.

    Now I think there is a solution to be able to do efficient client side computation and this is where Silverlight can step into the fray and TimS has a great post here pointing out that Silverlight isn't just about presentation.I can definately see the scenario where I have a small Silverlight application on the page that's sole job is to handle intensive computation I require thanks to the CLR. A Silverlight computation component maybe a suitable name for it....probably not as I am rubbish with names, but I hope you get the idea.

    Now that to me is using the right tool for the job.

  • Live from Google Developer Day 2007 @ San Jose

    I'll be posting updates here:

     

  • RIA: Offline toolkit announced from Google

    Ahead of tomorrows Google Developer Day (which I'm attending) Google have announced the arrival of Google Gears.

    From their site:

    " Google Gears (BETA) is an open source browser extension that enables web applications to provide offline functionality using following JavaScript APIs:"

    Will be interesting to see what the reaction is to this at the Dev day tomorrow. More possibilities for RIA's it seems.

    I wonder if it will play nicely with Silverlight...now that would be cool!
  • Silverlight: Layout system and controls framework.

    So you eagerly download the Silverlight 1.1 Alpha all set to build the next big RIA saying goodbye to evil Javascript and hello to the CLR....and you then quickly realise.....ahhhhh where's the textbox control, hang on, how the hell do I build a layout...

    well it's Alpha so tough luck ;-)

    No not really, Dave Relyea (who's on the Silverlight team no less) has been hard at work building these for you and can be found here.

    Nice job Dave. 

  • Clever use of Twitter for a mashup

    Check it out MoniTwitter

    Use it to monitor your websites uptime using the Twitter engine. Clever idea.

More Posts Next page »
Powered by Community Server (Personal Edition), by Telligent Systems