source code bean

04 Mar, 2011

How bad is your tweeting disorder?

Posted by: Peter In: Stupidity

For the last week the news that Nokia has chosen Windows Phone 7 as their main operating system for all their new smart phones has been all over the news. A lot of people are very upset and say that Nokia should have gone with Android instead, or that they should have invested more in their own linux os Meego. Personally, looking at the options Nokia had, I think this is might be the best move Nokia could have done. Let me explain why. Read the rest of this entry »

Recently I decided to switch hosting provider from a shared server to a VPS. My choice of linux is Ubuntu so i installed the latest version, Ubuntu 10.10 server. Instead of using Apache as webserver, which has been my choice of webserver for years, I decided to go for Nginx. Nginx is known for its great performance, but what really caught my attention (and the main reason to why I picked it) is that it is so easy to install and configure.

Read the rest of this entry »

When Rails 3 was released a coworker was very excited about it and he convinced me to give it a try. I have tried different version of Rails 1 and version 2, but at the time something about it didn’t really feel right to me, so I decided to stick to PHP for my own web projects and .NET for my professional work.

My coworker recommended to read the tutorial on http://railstutorial.org. After giving it a try and playing around with some applications for about 2 months now, I must say that I am really impressed. Everything in Rails is super streamlined for developing web applications.

Setting up your development environment is actually quite easy, no matter what OS you are on. I have tried both on my Mac and on my Windows 7 machine. Let me show you how to set it up on Windows:
Read the rest of this entry »

07 Dec, 2010

How to backout a merge in Merciural

Posted by: Peter In: Version control

Recently we ran into a problem when a coworker accidentally merged the wrong branches and pushed this onto our main repository. Everyone on the team is relatively new to Mercurial (this is the first bigger project we are using it for), so i asked the guys on Stackoverflow how to backout the merge from the repository.

Several people contributed with some really good solutions, read more here if you are interested.

Two weeks ago I went to the EPiServer Meetup where Bartek Tatkowski talked about EPiServer and CI. This got me inspired to write about how we do CI and deployment in my current project. The site we are building is an EPiServer 6 CMS Enterprise site based on .NET 4.0 and ASP.NET MVC 2.0 (I blogged about it back in April). When we started the project we had very clear goals regarding CI and deployment:

  • The build process should be totally automated
  • Building the site should result in a release package
  • The build server should run unit tests, code analysis and test code coverage every time the build is run
  • The deployment process should be totally automatic (for the test environment and for the production environment)
  • It should always be possible to rollback an update (files, database, IIS-settings, etc.). Rollback should also be fully automated.

I am very happy to say that we have fulfilled all our above goals, let me tell you have we did it.
Read the rest of this entry »

Microsoft WebDeploy (MSDeploy) is a very useful tool, not only for deploying web sites. In this post I will show you how MSDeploy can be used as a tool for synchronizing local and remote folders and executing commands on a remote server.

Read the rest of this entry »

13 Nov, 2010

Understanding output in PowerShell

Posted by: Peter In: .NET|Powershell

Lately I have been programing quite a lot of PowerShell. The release of PowerShell 1.0 in 2006 and more recently version 2.0, is probably one of the best things that has happened to development on the Windows/.NET platform for a long time (even though it takes some time to get used to the “wackiness” of PowerShell ).

What is really interesting with Powershell is that is is fully integrated with .NET, everything is PowerShell is .NET objects, which makes it very easy to use existing .NET DLLs from PowerShell. In comparison to most other scripting languages I have used, instead of just being able to pass text between different scripts, PowerShell takes a more powerful approach and allows for passing .NET objects between the scripts.

Read the rest of this entry »

04 Oct, 2010

Entity Framework 4 – Code First

Posted by: Peter In: .NET|C#

Entity Framework 4 itself is interesting but what really got me hooked was the CTP 4 preview, and what Microsoft call “Code First”. Code First allows us to describe our model using regular POCO classes, instead of designing our model using either the EF editor or creating in directly in the database.

Read the rest of this entry »

06 Jun, 2010

Two new features I really like in PHP 5.3

Posted by: Peter In: PHP

Namespaces
Finally PHP has support for namespaces, not one day too late! Before the days of object oriented PHP name clashes for functions was usually prevented by adding a prefix to your function names. When object oriented PHP was introduced function name clashes was less likely, but class names still had to be unique, ie you could only have one class named for example “User”. This led to the need of prefixing class names. From PHP 5.3 we no longer have to do this!

Read the rest of this entry »


  • Joe: It looks like IceCoffee Script may provide the 'await' keyword to JavaScript. http://maxtaco.github.com/coffee-script/
  • Florian: Dealing with events has two primary fashions: imperative (synchronous) code, and callback (asynchronous) code. Both are legitimate styles, for some
  • Joe: I think we haven't seen true PaaS offering yet in Azure. If you use a webrole you're still running on your own VM. This is still not true multi-tena

About

Welcome to source code bean! On this site I post stuff that I encounter in my job and spare time. The content is mostly related to .NET development, but my interest in techonology is very broad, so often you will find posts on totally different subjects!