In my spare time, I help maintain the website of the Ultimate Frisbee team where I play, the Ghent-based Gentle Ultimate. We have a fairly extensive amount of pictures and videos in a Google Picasa web album, which I wanted to integrate in our Drupal site.Funnily enough, there is no (good) Drupal module for integrating Picasa into Drupal. Sure, there are modules for adding albums to nodes, but none to just show all albums and let the visitor browse through them.There are two

ASP.NET (WebForms) has a concept of postbacks. This is not entirely the same a submitting the current form. A LinkButton for example, when clicked, will call a __doPostBack javascript function which was added by ASP.NET. This means that you can’t always subscribe to the ‘submit’ event with jQuery: $(‘form’).on(‘submit’, function() {}); You might want to subscribe to the postback because, just before calling the server, you need to fill some hidden field. At least, that was my case. So, what

At the day-job, we (finally!) get to use Knockout in our old-school WebForms application, albeit on one page to begin with (which is fine; one step at a time). If you’re not familiar with Knockout, check out their site and great documentation. If you have a Pluralsight account, even better! They have an excellent course that will get you started very quickly. Anyway, I came across a situation where I needed to bind a property of my viewmodel to the

To get Windows to trust your code (in my case a Silverlight Out-of-Browser XAP file), you need to sign it with a certificate. With a Silverlight OOB app, this makes the difference when installing between seeing this: or this: Also, trusted applications can automatically update themselves (when adding the necessary code of course) while untrusted ones can’t. That’s when you get the following error: “Cannot update application, the installed application and update candidate differ in certificate/signature state.” To avoid this

If you’re testing your javascript with QUnit, you’ll probably run into the case where you need to initialize variables, objects, … before every test. You’ll want to run every test with the same baseline. In NUnit, you can use the SetUp attribute for this. In QUnit, it’s a little different, but nothing too hard.With the module function, you can group tests and have them run a function before starting each test. The module requires at least a string containing the

Continuing on my previous post on how to set up a Mercurial repository locally in under 5 minutes: what if you now want to push your changes to a remote repository? You might want to collaborate, or maybe you just want the backup. Or you want to develop across multiple machines. This is done very easily too. This is the procedure for Bitbucket, which I use: Fill in the details in the next screen (name, description, private/public repository, etc.). After that,

So you want to make a quick-and-dirty application to test something? And you start and hack away? And it starts looking fairly good? And suddenly it stops working? Here’s a pro-tip: CTRL-Z. For the more down-to-earth devs: use a source control system. I find myself using it more and more, even for mini-projects: from small proof-of-concepts to a static, HTML-only website for a friend. I can strongly advise you to download TortoiseHg and get started. Then, next time you fire

Test-driven development has become fairly standard (although not everywhere, and tests aren’t always written first). So, when we set out to build our applications and their features, we dutifully write our tests, run them everytime, yadda-yadda-yadda. Then, when we decide to add some javascript goodness to our web apps, so they feel like native apps, we … sort of end up with giant js-files full of unmaintainable javascript badness. Just like unit tests can drive your design decisions, and help

Someone once said something like: “Code is written once and read many times”. That is why I propose not to use RhinoMocks’ AssertWasCalled method for methods that accept parameters. Sure, it’s written faster than using GetArgumentsForCallsMadeOn, but check out the error message you get for this: var expectedMessage = “RhinoMocks baby!”; var actualMessage = “RhinoMocks dude!”; var fooMock = MockRepository.GenerateMock(); fooMock.Bar(actualMessage); fooMock.AssertWasCalled(x => x.Bar(expectedMessage)); Your test will fail with the following message: IFoo.Bar(“RhinoMocks baby!”); Expected #1, Actual #0. To fix

After having applied TDD for several years now, and after having assumed my colleagues do the same, I have been surprised lately to hear how many developers write their tests after their code. Test-driven development is meant to be: Write a test See that it fails (and fails correctly) Write your code See that your test passes Refactor (and see that your test and all others still pass) This has led to the well-known (for some) red-green-refactor adage. If you