Why Can't You Code?
The highest form of ignorance is when you reject something you don't know anything about.
The highest form of ignorance is when you reject something you don't know anything about.
This user hasn't shared any biographical information
February 25, 2010 - 10:28 am
Tags: performance, t4, yslow
Posted in .NET, Performance Optimization, Web Development | No comments
If you care about your website performance, I’m sure you must know about the YSlow addin for Firebug.
One of its recommendations is to add an Expires header with a far future expiration date for your static content. You can read more about it here.
If you use CSS for your layout (which you should) you are [...]
November 25, 2009 - 3:25 pm
Tags: ria services, Silverlight
Posted in .NET, C#, Silverlight, ria services | 10 comments
These are the steps I had to go through to migrate a Silverlight application that was running on the .NET RIA Services preview released in July 09, to the new WCF RIA Services released during PDC 09:
Delete all HttpHandler references to DataService.axd from your web.config. Basically, these two need to go:
<system.webServer>
…
<handlers>
[...]
November 25, 2009 - 8:07 am
Tags: C#, ria services, Silverlight, workaround
Posted in .NET, C#, Silverlight | 2 comments
While working on a Silverlight application. I discovered that all the dates displayed in my DataGrid were skewed by a few hours from the real date stored in the database. Upon a closer look I noticed this skew was closely correlated to the time difference between the server’s time zone and the UTC date.
I needed [...]
November 18, 2009 - 7:20 am
Tags: csharp, delegate, disposable, dotnet, extension method, functional programming, using
Posted in .NET, C#, Code Snippets | No comments
Linq-to-SQL is our ORM of choice until the Entity Framework matures – and in our projects we use a factory method to get a new reference to our database data context. Here’s what I mean:
var db = Database.GetDataContext();
The DataContext class implements IDisposable, which means that (usually) it should be wrapped in an using [...]
November 14, 2009 - 9:19 am
Posted in Uncategorized | No comments
Although every neuron in my brain is trying to fight me from writing this post, I realized that in our company, the websites we produce are not necessarily for computer literate people.
A huge chunk of our visitors still use IE6 and we need to provide them with a decent experience. We do have some [...]
November 13, 2009 - 10:43 am
Tags: C#, elegant, enumerable, foreach
Posted in .NET, C#, Code Snippets | No comments
I’ve seen various ways of handling the lack of support for an index in the foreach () construct over the years.
By far the most used strategy is to declare an index yourself and increment it at the end of every loop iteration. Let me demonstrate:
static void Main(string[] args)
{
var range = Enumerable.Range(0, [...]
November 12, 2009 - 9:42 am
Tags: .NET, .net 4, C#, delegate, lambda, lazy
Posted in .NET, .NET 4.0, C#, Code Snippets | 1 comment
The System.Lazy<T> type in the new .NET 4.0 framework came to my attention recently. This type is not at all revolutionary. In fact, everyone could have written it themselves in under 10 lines of code going as far back as the .NET 2.0 framework.
Some less experienced programmers won’t realize however, that deferring the call to [...]
November 12, 2009 - 9:39 am
Posted in Misc | No comments
Welcome to our blog. *yawn*
Please head over to the About page to see more about what this blog is about.
This post is not too exciting, but the About page is! So head over there now!
Do it!
Come on, Do it!
Do it!