Recent Updates Page 2 RSS Hide threads | Keyboard Shortcuts

  • The ChristmasCrunch nearly real-time web event

    Phil Leggetter 10:07 pm on December 1, 2009 | 0 Permalink | Reply
    Tags: ChristmasCrunch, , , ,

    On the 15th of December I’m going to the ChristmasCrunch. It looks like a really good event with Iain Dodsworth and James Whittaker of TweetDeck giving the keynote on “Where the biggest realtime desktop application goes next” (I know where I’m hoping it goes. See below). Other presentations include Jenni Lees of Festbuzz, Marco Kaiser of Seesmic, Mario Menti of Twitterfeed, Mark Rock of AudioBoo, Nick Halstead of Tweetmeme, Daniel Tenner of Woobius, Willian Fischer of Twitter Jobsearch and Tim Morgan of Mint Digital. And if that’s not enough there’s also a startup pitch (startup pitches – grrrr…) and an after party.

    My main interest in this event is to see if anybody is going to start delivering a “truly real-time” experience to users. Will TweetDeck still be making polling requests to the various services it uses to check if any more data is available or will they move to using PUSH technology? Are other companies going to start adopting PUSH to give the user a truly real-time web experience?

    (More …)

     
  • Why Comet is key to the Truly Real-Time Web

    Phil Leggetter 9:01 pm on November 14, 2009 | 0 Permalink | Reply
    Tags: , http polling, http streaming, , , ,

    A lot of websites use HTTP Polling to update data on on their website or application without the need for the user refreshing the website. This is clearly better than a purely static page, but during the time between each poll the data on the page has the potential of being out of date (stale) so to make a decision based on the information on a potentially stale page can be a risky one.

    The normal example given to show the benefits of using Comet to achieve full HTTP streaming and the importance of non-stale data is of a trader making a trade on an out of date price. Another example is given where a person places a bet using odds that are on screen but do not match up with the odds in the betting system.

    I just read a post on Comet Daily about a company called Frozen Mountain who have just released a component that adds Comet Support for IIS. Along with this they’ve released a video which doesn’t cover the standard example.
    (More …)

     
  • Which Rich Internet Application Technology will dominate?

    Phil Leggetter 1:34 am on November 7, 2009 | 4 Permalink | Reply
    Tags: , , Flex, , , , , ,

    I’ve been a member of the RIA Developers Group on LinkedIn for a short while now and the other day Patrick Bay posted a link to an interesting article on Computer Weekly about the prominence of RIAs. A few comments were posted and then Patrick questioned which RIAs would “bubble to the top”.

    I think the UI revolution’s already here; now we see which ones bubble to the top!

    This got me thinking about the criteria that may determine which RIA technology would be most successful.

    I think there are a number of things that will determine which one will ultimately win, or at least become the dominant choice. At the moment I can think of three categories; Technology buy-in, Development environment and Data access capabilities and choice.
    (More …)

     
  • A Real Time Rich Internet Application (RTRIA) Example

    Phil Leggetter 8:12 pm on November 3, 2009 | 2 Permalink | Reply
    Tags: , , , , , ,

    I’ve just had an article published in the latest UK MSDN Flash newsletter on How to consume real-time data in a Silverlight RIA. As part of writing up the article I developed a sample Real-Time Rich Internet Application (RTRIA) that consumes real-time data from the Twitter real-time data feed. I also put together my first ever screencast. So, you can start by getting hold of the code or watching the screencast.

    The Code

    First, and this is Important:

    To get the sample application to stream real-time data from the Twitter real-time feed you will need to use Fiddler to trick Silverlight into allowing a crossdomain Web Request.

    Now that you are aware of that, you will also need the Silverlight development environment. You can get everything you need via the Silverlight Getting Started page.

    You’ve now got everything you need to run the RTRIA example. To run the sample application you should set the MSDNFlashRTRIAExample.Web project as the startup project and the MSDNFlashRTRIAExampleTestPage.html page as the startup page.

    Setting up the solution to run the application

    Setting up the solution to run the application

    If you’d like to find out a bit more about the code then read on. If you’d rather jump straight into the code you can download it from the TweetStreamer Google Code project.
    (More …)

     
  • Using Fiddler to trick Silverlight into allowing a crossdomain Web Request

    Phil Leggetter 11:06 am on October 30, 2009 | 3 Permalink | Reply
    Tags: , , , , ,

    If you are trying to make a web request from a Silverlight application the first thing the Silverlight runtime will do is request a security policy file (see Network Security Access Restrictions in Silverlight) from the root of the server you are making your web request to. This happens if you are making your request using the HttpWebRequest or WebClient class. If the Silverlight runtime fails to get a security policy file your web request will fail. If your Silverlight application relies on this web request then you are going to need to contact the server owner and get them to add a security file but until then you can use the Fiddler HTTP Proxy to trick the Silverlight runtime into believing that it does have permission to make the request.
    (More …)

     
  • Real-Time Rich Internet Applications (RTRIA)

    Phil Leggetter 10:15 am on October 29, 2009 | 2 Permalink | Reply
    Tags: , , , , , , rssCloud, ,

    Real-Time Rich Internet Applications (RTRIAs) are RIAs that consume and display real-time data. They have all the characteristics of an RIA with the added feature that data is being pushed to them in real-time as soon as it becomes available. This is in contrast to the current polling solution employed by most RIAs or other web applications that display updating data.

    I mentioned RTRIAs for the first time back in April 2009 in a post called “What is the real-time web” on the Caplin Systems Platformability blog, and since then there has been a real-time web explosion. The “real-time web” is now the buzz phrase around the Internet that everybody is jumping on. Back in April I set up a Google Alert for the term “real-time web”. Back then I got maybe one Google Alert a day for this term, probably less. Now, I get at least two dense emails a day from Google with people using the term for all sorts of things; real-time web stats, real-time analytics, real-time search, rssCloud, pubsubhubbub, the list goes on. This is not the real-time web! Whilst some of the things on this list will help  the web become truly real-time (rssCloud and pubsubhubbub may even form the back bone), none of these things give the user a truly real-time web experience.

    (More …)

     
  • How I approach problem solving in code?

    Phil Leggetter 6:44 pm on October 23, 2009 | 5 Permalink | Reply
    Tags: , Agile, , Coding,

    Recently I was posed the following question:

    Write a piece of code that prints all odd integer numbers between 1 and 99

    This really isn’t a difficult question but it still requires some thought. When I’m posed with any question I like to break things down into their constituent parts.

    Here’s the process I went through:

    Okay, so I’ll define two variables for a start and end value and there’s going to have to be a loop.

    int startValue = 1;
    int endValue = 99;
    for(int i = startValue;
         i <= endValue;
         i++)
    {
       // work out if "i" is an odd number
    }

    Now, for the odd number detection. And… after a few umms and errrs … I’m going to have to mod 2 (%2) the current value of i to work out if the value is odd. More … umms and errs. Okay, I’ve finally worked out that if something mod 2 is not equal to 0 it’s clearly an odd number. This took me longer than it should have but never mind. Once I’ve detected if i is an odd number I’ll then put the odd number into a list for use later.

    int startValue = 1;
    int endValue = 99;
    IList<int> oddValues = new List&lt;int&gt;();
    for(int i = startValue;
         i &lt;= endValue;
         i++)
    {
       if(i%2 != 0)
       {
          oddValues.Add(i);
       }
    }
    

    Those of you that are good at these little puzzles, or just think this is way too easy, might already be screaming at me about one of the following:

    • Why are you using a IList, why don’t you just print the value?
    • Odd numbers are always 2 apart so why aren’t you just increment i by 2 using i+=2?

    (More …)

     
  • Response.Redirect in Windows Azure

    Phil Leggetter 10:21 pm on October 6, 2009 | 0 Permalink | Reply

    I’ve recently created an application called GetGravatar that allows you to update your Twitter profile picture with your Gravatar. Once I’d set up my Windows Azure custom domain name I decided I wanted the web address for this new service site to be without “www” as seems to be all the rage (to keep the web address short). So, I looked at doing a Response.Redirect to catch any attempts to access my domain with “www” in it. I’m very sure that there are better ways of doing this but I added the following to my Site.master file:

        if (Request.Url.ToString().StartsWith("http://www."))
        {
            Response.StatusCode = (int)System.Net.HttpStatusCode.MovedPermanently;
            string responseUrl = Request.Url.ToString().Replace("http://www.", "http://");
            Response.Redirect(responseUrl, true);
        }
    

    So, if somebody types in http://www.getgravatar.com (see it works) or anything with a “www.” in the URL they will be redirected to a non-www page. However, the redirect seemed to go to the correct URL but with port 20000. I’ve no idea why this is so I had to add a special case in to remove the port.

        if (Request.Url.ToString().StartsWith("http://www."))
        {
            Response.StatusCode = (int)System.Net.HttpStatusCode.MovedPermanently;
            string responseUrl = Request.Url.ToString().Replace("http://www.", "http://");
            responseUrl = responseUrl.Replace(":20000", "");
            Response.Redirect(responseUrl, true);
        }
    

    I’ve not read up to see if this is expected but I thought it was quite unexpected and may be of use to somebody else in the future.

     
  • Windows Azure - 503 Service Unavailable

    Phil Leggetter 12:44 am on August 28, 2009 | 0 Permalink | Reply
    Tags: , , ,

    I finally got around to trying out ASP.NET MVC and while I was at it I thought I’d also give Windows Azure a whirl. Windows Azure doesn’t support ASP.NET MVC out of the box but Jim over on MSDN Blogs has written up the details of how to get ASP.Net MVC Projects running on Windows Azure.

    Problem

    So, I followed the instruction from the blog and uploaded the package and configuration file, waited for the staging application to get into a runnable state, and clicked on the staging link…

    Windows Azure – 503 Service Unavailable

    Clearly not a good thing! In addition to this error I occasionally got a random network error or a full-on connection error reported by the browser.

    I tried googling for this error but there was nothing about this problem after deploying to the real Windows Azure hosting (the cloud). As far as I can tell there’s no way of getting any debug information or logs to work out what’s going wrong. Maybe this is something that Microsoft will add later on?

    Solution

    Then it struck me that I hadn’t actually set up any kind of TableStorage on my Windows Azure hosting so I removed all mentions of storage and database connections from the MVC application. This included editing Web.config and removing the following.

    • The <section name=”authenticationService” type=”System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” /> section element.
    • The <connectionStrings> element
    • The <membership>element
    • The <authentication mode=”Forms”> element
    • The <profile> element
    • The <roleManager>element

    Update: I’ve found that without the <authentication>element I started getting the error below so you may want to instead replace it with :

    CCT: Role instances did not start within the time allowed. Please try again. If you continue to encounter this behavior please try shutting down the Development Fabric.

    I’m guessing that not all of these elements actually need to be removed but doing so resulted in the MVC ASP.NET application working in Windows Azure.

    Update 2: ServiceDefinition.csdef

    If you happen to get network timeouts or 404 network connection issues it’s worth checking your ServiceDefinition.csdef to make sure that you’ve got port 80 configured. I noticed that mine had updated to port 8080 so obviously I couldn’t access the staging site on port 80 like I was trying. If you do have the port set to something else other than port 80 you can use that port to access your application but the ServiceDefinition.csdef does have a comment in there telling you your application should be on port 80 so you are probably best to stick with that.

    <!– Must use port 80 for http and port 443 for https when running in the cloud –>
    <InputEndpoint name=”HttpIn” protocol=”http” port=”80″ />

     
  • System.Security.SecurityException: That assembly does not allow partially trusted callers

    Phil Leggetter 12:51 am on August 26, 2009 | 1 Permalink | Reply
    Tags: , , ,

    I was writing a Windows Azure ASP.NET MVC application and when making a call to a page I received the following exception:

    System.Security.SecurityException: That assembly does not allow partially trusted callers

    In my application I’m using Castle Windsor for dependency injection and when trying to resolve a service using:

    }

    IGravatar gravatar = MvcApplication.Container.Resolve<IGravatar>();

    I received this message. To solve things I needed to update the WebRole element in the ServiceDefinitions.csdef file so that enableNativeCodeExecution is enabled.

    <WebRole name=”TwitterGravatarMVC” enableNativeCodeExecution=”true”>

    I found the solution, detailed above, on the Azure Services Platform Developer Centre forum.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel