I'm starting a new video series, with a tutorial on how to create a Sports Tipping application using ASP.NET MVC 3. The tutorial will be posted in a number of parts over the next few weeks. Full source code for each part will be published following the video.

 

Lease signed off today, big thanks for Tony Boothroyd from Tony Boothroyd Real Estate for being great throughout the entire process. Anyone who is either looking for a commerical lease, or prehaps looking for a new agent, I recommend you get in contact with them.

The new office location is in the Stanhil building on Queens Road Melbourne. It's a great location with heaps of parking on Hanna Road and literally 50m from the corner of St Kilda Road and Commerical Road.

We move in next month, now time to organise all the services, signwriting and fitout!

There is something fun about the excitement of moving to a new office. Ok, there is ALOT of fun about moving to a new location; everything from dreaming about different physical partitioning layouts, to discovering the best place to grab lunch locally. It's an adventure that can inspire and cause euporia, even within an existing fun and highly motivated web development company.

So on that theme, suprise surpise..............my company has found a new Melbourne-based office on Queens Road. Lease signoff is monday, so I can't give share the address or photos till then (rest assured I will however), but definately excited. Presently we are based a considerable of distance out of the city of Melbourne, however this move will place us in a beautiful location opposite Albert Park.

The Queens Road and St Kilda Road strips are some of the best business locations in Melbourne in my opinion, for business networking opportunities. The company I work for prides itself on it's business focus in its software and web design, the new office will have a large dedicated meeting area focused on our client interactions, the majority of whom are Melbourne-based and have offices within the same vicinity.

Hopefully this exciting new location will help us network with the local finance industry companies to engage in Melbourne web development business opportunties.

Please check back again on Monday for all the photos and maps of our new location.

If anyone has any recommendations for great places to eat on St Kilda Road/Queens Road I'm all ears!

For people located in Australia, sites hosted outside of Australia often suffer poor performance due to an issue called latency.

Latency is the time taken for a round trip of information over a specific distance; it cannot be reduced as it’s a limitation of the speed of light. Within Australia latency is typically 10-40ms, whereas from the US to Australia it is typically 200-300ms. Therefore unless one has discovered a way to increase the speed of light (I would be interested in speaking to you if you have!), the only way to improve latency is to reduce the distance between the web server and those accessing it.

While at first it appears that a user won’t notice the difference between 10ms and 200ms as the values are small, there is a little known side effect that has a large bearing. The latency applies at least once to each request (typically 1 request = 1 file/resource), and a typical webpage may require 10-20 requests in order to display a page the first time it is visited.

Gross Simplificiation, but Practical Example

Doing some calculations on a sample site with 15 files (we will assume they are 10KB) which are required to render the first page and assume a typical 1.5Mbit (150KB/s) ADSL Connection:
@10ms latency, 15 requests would take at least 150ms + 15 * (10/150) = 375ms
@300ms latency, 15 requests would take at least 4500ms + 15 * (10/150) = 4735ms

The reason that this is a gross simplification is that many browsers will download files in parallel, which means that the effect of latency isn't perfectly linear. The type of file in some browsers can also block these parallel downloads. Using different hostnames can increase the degree of parallelism.

Still, in the 'simple case', less than half a second, compared to a page load that takes almost 5 seconds, all due to utilising local (Australian based for me and my clients) hosting is compelling enough reason for me (and them).

Global Implications

Many local sites are geotargetted to their local region, particularly those whom are clients of my company. However not every website is intended to be viewed only in one small local area. For US visitors to sites hosted in Australia (like this blog), the same latency issues apply unfortunately.

Chose a location closest to their target customer base, use separate local datacentres at each location (very expensive and complicated), or use a CDN (Content Delivery Network) for static resources.

The latter option, using a CDN, allows you to push many of the static files onto a network which will automatically minimise latency to wherever your clients are located. So instead of every request having 300ms latency, maybe only 3 out of 15 requests will need to travel across the globe to the remote datacentre, and 12 out of 15 requests could be delivered by a local CDN network.

Even just utilising a shared CDN resources for things like JQuery (which is available on many free CDNs), is a step in the right direction, and if the user has already visited a site that accessed the shared resource, it will be in their cache and save the request completely!


The Url.Action and Url.Content routing methods are extremely useful methods of avoiding hardcoding content and action urls into your code. This Url is actually a property of the View and Controller of type UrlHelper.

One annoyance is that once you get outside of the controller and view, you no longer have an instance of UrlHelper available. While its fairly trivial to create an instance of UrlHelper, its a little frustrating to constantly have to write the same code over and over again. Plus the DRY (Don't Repeat Yourself) principle, says we should be creating a method instead of copy'pasting

So I created a VERY simple static factory class that will create an instance. Because extension methods require an instance of an object to work, an extension method isn't suitable in this case.

 

Factory Code

 

public static class UrlHelperFactory
    {
        public static UrlHelper GetInstance()
        {
            var httpContextWrapper = new HttpContextWrapper
(HttpContext.Current);
              return new UrlHelper(new RequestContext(httpContextWrapper,
RouteTable.Routes.GetRouteData(httpContextWrapper))); } }


Usage

UrlHelper url = UrlHelperFactory.GetInstance();
string fileNameUrl=url.Content("~/Content/MyFile.txt");

 

Hopefully this will be of use for someone pulling their hair out working why they can't use Url.Action in their code

Like almost everyone who has used the internet, I read peoples blogs.

I Should Start a Blog

Very regularly I ask myself a very pertinent question; why don't I have my own blog yet?

It's a good question, a very good question.
The answer might actually surprise some people, but I imagine it's actually probably a familiar situation to those of you who are software developers.

Paralysed by Pointless Procrastination

I've found that every time I considered getting started, I became consumed by the one single aspect of the blog, the platform. Complicating this further, as all good developers have considered themselves, I ponder "surely I can just write myself some great blog engine instead of using an off the shelf solution".

Well I certainly could, but ultimately, what would I be actually achieving?

Wordpress, SubText, dasBlog, BlogEngine.Net ..... What Readers Care About

Are you more interested in reading my blog if I built the engine from scratch? Do you decide to only read blogs that are built using your favourite WordPress, BlogEngine.NET or Subtext? Do you even know what platform powers most of the blogs you read?

Of course not! All a reader is actually going to care about is what the blog has to say!

So instead of more hours painfully procrastinating on existing products vs. "rolling your own", I finally selected Subtext, and was done with my decision. While WordPress is a powerful platform, its colourful (yes that is the correct spelling here in Australia) security history leaves too sour a taste in my mouth.

Onwards...

The mission now shifts to ensuring I have interesting topics to write about on a regular basis. As I live in what I regard as the greatest city in the world, Melbourne in Victoria, Australia, I anticipate (hope) that will be effortless!