Category Archives: Programming

MVC 2 – Model binding happens automatically for properties not fields

For some reason, when developing MVC 2 (C#) projects, post data are not automatically bound to class members defined as Fields, but they will be bound to Properties. So this won’t work: but something like this WILL work: Hope this … Read more

Posted in C# | Leave a comment

HTML/DOM attribute change events and how it can improve maintainability in your web application

Do you find yourself in an unmaintainable mess where there’s DOM manipulation calls in every part of the code? Would it not be easier to simply set an attribute f.ex. data-progress=”50″ and then see the elements change automatically (seemingly by … Read more

Posted in JavaScript, jQuery | Leave a comment

Google API nightmare: How I fixed the “Could not load file or assembly ‘System.Net.Http.Primitives, Version= …” exception

PS: This solution may or may not apply to your situation; my environment consisted of VS 2012, .NET 4.0, C#, Non-MVC web application, EPi Server CMS. Well aren’t the Google API a joy uh? Spent way too much time figuring … Read more

Posted in C#, Google, Visual Studio | 9 Comments

Simple helping function for managing dependencies in JavaScript

Here’s a very simple helping function that can be used to manage arbitary dependencies in your script. The dependency check is defined with a callback so you can write dependencies for when DOM is loaded, a script is ready or … Read more

Posted in JavaScript | 1 Comment

Possible issue when omitting semi-colons in JavaScript

In my latest JavaScript projects I’ve tried to omit the semi-colon (;) on line endings. Why? I don’t know, because I can? I’m not going to go into a deep discussion about this subject here but rather warn others who … Read more

Posted in JavaScript | Leave a comment

PHP lesson learnt.. always use the DIRECTORY_SEPARATOR constant

Always use the DIRECTORY_SEPARATOR constant when pointing to files/directories on the server-side. It will make your system more portable. Windows boxes uses backslash as a directory separator while for example Unix uses forward slash. Not using the DIRECTORY_SEPARATOR constant may … Read more

Posted in PHP | 1 Comment

How to map a Servlet to only the front page / root path of your webapplication

This post is about Java Web Servlets and will hopefully save you some hours of debugging. Prelude Rant I was naive enough to think that the reasonable URL pattern “/” would match only the root path of the application. Guess … Read more

Posted in Java | 1 Comment

Iron Man, software development and entrepreneurship

Just finished watching Iron Man. It’s a fun movie, especially the Tony Stark character (the guy wearing the Iron Man suit). He’s somewhat narcissistic and arrogant but he has a good heart underneath that armor, well sort of, at least … Read more

Posted in Entrepreneurship, Programming | 3 Comments

The Duck(typing) movie – movie script idea

An continuation of my silly programming movie script ideas. Briefing room: A (commander dude): When I see a bird that walks like a duck and looks like a duck and quacks like a duck, I call that bird a duck! … Read more

Posted in Comedy, Programming | Leave a comment

Super-simple way in Java with Netbeans to build all dependant libraries and subprojects with distribution

I think I finally figured out a simple and elegant way to build dependant libraries directly with the distribution and kiss that NoClassDefFound error goodbye. I also have a similar solution for Java Web Application projects. What you need is: … Read more

Posted in Java, Netbeans | Leave a comment