Archive for the ‘Uncategorized’ Category

Culture ‘en’ is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread’s current culture.

Ran into this one today after a couple of Mac users reported a bug.

The application was having problems converting DateTime values.

When I looked at it I noticed that the users browser language was set to ‘en’.

I drilled down to the offending code:

public CultureInfo VisitorsCultureInfo
{
   get {
     return CultureInfo.GetCultureInfo(
        HttpContext.Current.Request.UserLanguages[0]
     );
   }
}

The developer has used the browser setting which equates to the CurrentUICulture, which as Peter Ritchie explains is incorrect.

.NET has the concept of a UI culture (for localization of resources) and an application culture (for the globalization of data).

Since we are working with dates (data) we should be using the CurrentCulture property.

The following article demonstrates a better approach.

So the bug has been resolved, and I can have a worry free weekend!

Here’s the fix:

public CultureInfo VisitorsCultureInfo
{
  get { return System.Threading.Thread.CurrentThread.CurrentCulture; }
}

At the coalface

Gartner, the world’s leading information technology research and advisory company have revealed the top 10 technologies that they believe will change the world over the next four years:

1. Multicore and hybrid processors
2. Virtualization and fabric computing
3. Social networks and social software
4. Cloud computing and cloud/Web platforms
5. Web mashups
6. User Interface
7. Ubiquitous computing
8. Contextual computing
9. Augmented reality
10. Semantics

Right up there at number 3 – Social networks and social software.

I consider myself very lucky to be working in this area today and I really enjoy it. I remember working for an e-commerce start up at the turn of the decade and it’s got the same exciting feel to it – like we’re building the platforms today that people will be using for a good few years to come.

It was a really exciting time but the bubble did eventually burst and I moved on to more mundane business related activities which eventually bored me to death. This time, however, I’ve got a nice little salary protection plan and much clearer long term goals if things do go pear-shaped, suffice it to say I’m making hay whilst the sun shines!!!

Another commitment

As if I haven’t got enough to keep me exceptionally busy, I’ve now decided that I should start blogging.

Well I was kind of blogging anyway (if you count around 5 or 6 articles over the space of about 18 months entirely devoted to generating adsense revenue, the outcome of which was one of those “I can’t be arsed” type of lethargies after I made only $7) but this time I’m doing it for real and by that I mean I’m not in it for the readies, I’m just talking about what I love doing which, fortunately enough is also what I do for a living.

But wait, before you withdraw muttering about “another techie blog” , didn’t you notice the title? Well, the point is that although I shall indeed use my blog to post about my software development activities, there shall also be some (hopefully) interesting tidbits about my observations in and around the colourful and creative Soho area in the West End of London, where I am based, anecdotes about life in general and possibly some shockingly revealing insights into what it is like to be me (well, what it is like to be an extremely busy Dad, anyway!).

So lets hope that somehow, somewhere out there, somebody might just stumble across my blog and take a smidgin of pleasure out of reading what I have to say. If that does indeed happen, then I shall be delighted to count this endeavour as having been worthwhile.

TNT!

P :)