DiscountASP is great!

January 20, 2010 in webhosting

As a Microsoft professional and trainer, I feel that I need to show the world that Microsoft’s technology is great (eat your own dog food kind of thing) and because of that I’m running DasBlog on Windows 2008 R2. After a year with DiscountASP, I must say I’m very pleased by their service and I would recommend DiscountASP to anyone who’s looking for a cheap, reliable, Microsoft only, web hosting.

 

  • First of all, they are reliable and have been out there for many years. I didn’t notice any downtime other than what they had planned.
  • They are always the first to provide the latest Microsoft technology (my production website runs on Windows 2008/.NET3.5 and DiscountASP has now started a Windows 2008/.NET4.0 sandbox).
  • I can control my web application though IIS7 Management Console, directly from my laptop.
  • I can use Cardspace to login to the control panel (I wish they had OpenID too)
  • They have plenty of modules I can use (URLRewrite for example)
  • They have SSL and private whois

 

The only thing that sucks with DiscountASP is their email service, but it doesn’t really matter because you can use Gmail instead by modifying your MX record.

 

For less than 10$a month, you get all of that.

For more information: http://www.discountasp.net/features.aspx

Access to modified closure

October 1, 2009 in C# | lambda | Resharper

Resharper is a fantastic tool and gives plenty of warnings that shouldn’t be neglected. One warning I want to describe here is “Access to modified closure”:

private void WriteString(string str)
{
  var newMsg=string.Format("New message: {0}", str);
  _syncContext.Post((param) => listBox1.Items.Add(newMsg), null);
  newMsg=String.Empty;
}

WriteString is called by a non UI Thread, hence the SynchronizationContext. The question I’ve been asking myself is: “Why can’t I access the variable newMsg from within my lambda?”

The answer to that question is that if the lambda refers to a variable defined outside of its scope, the variable may be changed while the lambda is running. If you execute the example above, you’ll see that an empty text is added to the listbox, which means that the variable newMsg is changed before the lambda runs (because the post method is asynchronous).

 

I need to pass newMsg as a parameter to solve the problem (actually, I should pass a copy of the object, but since a String is immutable it doesn’t matter for this example)

private void WriteString(string str)
{
  var newMsg=string.Format("New message: {0}",str); 
  _syncContext.Post((param) => listBox1.Items.Add(newMsg),newMsg); 
  newMsg = String.Empty; 
} 

No more warning!

Web application's startup delay resolved with ASP.NET4.0 and IIS7.5

September 16, 2009 in ASP.NET | IIS

One of the problems I experienced while developing ASP.NET/SharePoint applications is the warm-up latency. Every time the application pool is recycled, the first user to hit the website get a very slow response time or even a timeout. This is due to all the initialization code inside application_start() and it's worsen if there is set of backend WCF services.

 

The solution is to make a script that maintains the web applications up and running, or to only recycle the application pool once during the night (I really don't like this one).

 

Looks like IIS7.5/ASP.NET4.0 have solved the initialization delay quite nicely, by auto-starting the application pool as quickly as possible. I guess this is a good excuse to move from Windows Server 2003 to Windows Server 2008 :-)! Check out the whitepaper: http://www.asp.net/learn/whitepapers/aspnet40Beta1/#_Toc223325464

google vs bing

September 7, 2009 in Search Engines

I’ve tried hard to use Microsoft’s new search engine everyday at work. Unfortunately I had to switch back to Google because I was wasting too much time searching… Let me explain.

 

I’m pretty good at searching with Google, I always find what I need and even more. Google just works and it’s ranking algorithm amazes me. Few years ago I worked on building a search engine from scratch and I learned how the retrieval process works (thanks to Managing Gigabytes and Modern Information Retrieval). My point is that if you throw a crisp query to Google you will always get the right result.

 

Bing is a big improvement from Microsoft Live search, it’s really fast and returns much more relevant links. But unfortunately it’s not gone be enough to dethrone Google. I hope Microsoft will manage to fix it's ranking algorithm in the next upgrade, until then Google is king.

Just married…

September 1, 2009 in wedding

I've been off work for a month during which I got married and travelled to Canada and the USA. We managed to visit Banff, Calgary and Chicago in 15 days (we’ve been pleasantly surprised by Chicago, it’s big and beautiful).

Now its hard to get back to work after a long break, but I'm currently working on a really cool project and that helps a lot. Hopefully I'll be able to post more technical stuff on my blog in the coming weeks. I’m planning to install windows server 2008 R2 on a virtual hard disk and try the VHD boot. I’m looking forward to experiment with Visual Studio 2010 and the .Net 4.0.

All about ME

August 1, 2009 in Resume

 

Who am I?

I’m a senior consultant at Capgemini in Norway, I design and develop windows and web applications using in .NET. I believe that continuous learning is the key to stay competitive in the IT business. I’m on the ALT.NET track, I try to read as many blogs as possible, specially those related to design patterns, design principles and C#. My area of interest looks like this:

 

MyInterest 

I experienced many different programming languages (Delphi, C++, Visual Basic, Perl, Java), but since 2005 I decided to only focus on the .NET Framework and specially on enterprise applications. I’m currently an MCP Enterprise Application and I intend to become a MCT by the end of this year.

 

Unofficial resume 

m05As far as I can remember, the first computer I ever saw was a Thomson MO5 with 32KB of RAM and a 1MHz Motorola processor. I was about 10 years old and my school gave us access to these machine once a week to learned the Logo programming language. At that time I didn't realize it was programming:

COULEURCRAYON 255, 0, 0
X = 36
Y = 5
répète X [
	TOURNEDROITE 360/X
	répète X [
		TOURNEDROITE 360/X
		AVANCE Y 
	]
]

In the nineties, I kept on programming and after a degree in Physics and Chemistry I decided to study software engineering.  I was really fun and much easier than I thought, my favorite courses were:

  • The Unix operating system
  • Algorithms

 

From that point in time I became what I would call an IT professional.

 

Why .NET?

Before deciding to focus exclusively on Microsoft’s platform, I had to ask myself the question: “Why .NET and not Java?”.

In the consultancy business (system integration if you’d like) most of us have to choose one of these platforms and stick with it. Both of them are equally good, but I see many developers writing Java code using Windows XP and running that code on Windows Server. In my opinion, if I had chosen Java I would have had to embrace the entire open source stack (Linux, Apache etc…) and completely avoid Microsoft: That’s not possible, I have yet to see a company that doesn’t have at least one Microsoft product. For me, that’s the main reason for choosing the .NET platform, Microsoft provides all the components I need, from the operation system to the Internet Service Bus.

Finally MCPD .NEt 2.0

June 7, 2009 in Certification

MCPD(rgb)_506After more than 1 year and 6 months though the .NET 2.0 certification process, I finally made it. I started looking at the certification in the summer 2007 when I was planning to find another job, I thought it would be easy for someone with 2 years of experience… But it wasn't.

 

The first exam (70-536) was really long, I mean the book was more than 1000 pages and it covered things I had never heard of before. Everyone becomes a much better .NET developer just by reading this book, even without passing the exam.

 

The 3 MCTS exams (Web , Windows and Distributed applications) I passed afterwards were different, much more “practical” I would say. Many of the chapters are easy to read, if you have developed ASP.NET web applications, web services and Winform apps, it's quite easy. Again, there is so much in the book that you can learn.

 

In June 2008 I passed the last exam, Microsoft Certified Professional Developer (MCPD) and it was a relief. Again it was a “practical” exam, a lot of stuff that I use at work. I'm now working on the upgrade to .NET 3.5 and I hope I'll pass the first exam before the end of this year. It's pretty nice to be able to upgrade skills and to know that you have done the hardest part.

VirtualBox: Highly recommended!

March 13, 2009 in virtualization

I've been using VirtualBox for months now and it works pretty well. I’ve previously tried VirtualPC (too slow), Virtual Server (not user friendly), VMware (expensive) and HyperV (requires Windows 2008 x64). Then I discovered VirtualBox, it’s actively developed and has everything I need:

  • It's fast (fast enough for me).
  • It supports x64 hosts and guests.
  • It has plenty of options such as raw partitions.
  • It supports .vhd and .vmdk
  • It has NCQ support for SATA raw disks and partitions

 

The only thing that isn’t great is the seamless mode. When I first heard about VirtualBox’s seamless mode, I expected something like VMware fusion. Instead I got something not so useful and even buggy. I wonder why seamless desktop integration only works on Macs…

 

Anyway, try VirtualBox today! You won't be disappointed.