Skip to content

In days gone by, if you wanted to imitate a book on a website, being able to browse content by flipping pages, you needed some Flash or some other extension to handle it.

Now, turn.js comes to the rescue.

With just a few lines of code and this open-source jQuery plugin, you can add a fully animated book feel to your site.

The only requirement to get it to work is an HTML5 compliant browser and let turn.js do the rest.

Share

I just upgraded my installation of Gramps, my favourite genealogical application, to the latest version (3.3.1).

One of the nice things is that, compared to my previous version (2.6 I think it was) I had installed, the install file for Windows is self-contained, making it easy to install. Previously, I had to install Python separately, which can be a pain, but now one setup file installs everything you need.

However, there is one issue that still bugs me – there is no way to easily set the application language without a technical solution.

Gramps relies on the computer’s locale settings to determine the language, which is not always so great. For me, for example, my locale is set to the Netherlands, setting the language to Dutch, but I want to work in the app in English.

There is an easy solution though. It is fixable by creating a batch file setting the desired local before starting the app, and the language you want will be selected.

SET LANG=en_US.UTF-8
SET LANGUAGE=en_US.UTF-8
"C:\Program Files (x86)\GrampsAIO\bin\pythonw.exe" -EO ..\share\gramps\gramps.py

Now, running this batch file, I can enjoy Gramps the way I want it.

Share

To focus on an element using jQuery is really easy, since all it takes is one function – .focus(). There are cases though were it is just a little bit trickier.

Let’s take the scenario where after entering a field, you need to validate it, and if the validation fails, you need to return focus to the field. You would expect the following code to do the job:

$(elem).blur(function(){
   if (do some validation fails) {
      $(this).focus();
   }
});

This code, logically, should work, and indeed it does in Internet Explorer, but Firefox stubbornly refuses to set the focus.

The problem is that the event is firing at the wrong time for Firefox, and therefore the focus event is being lost.

The solution for this is to delay the focusing by a small bit, which then yields a solution that works in all browsers

$(elem).blur(function(){
   if (do some validation fails) {
      var $this = $(this);
      setTimeout(function () { $this.focus(); }, 10);
   }
});
Share

Bobbie Beer himself

Bobbie Beer himself


Cole turned 10 yesterday, so, to celebrate, we went out for dinner at Bobbie Beer in Almere. This was our first dining out experience as a family since we moved to the Netherlands, not counting places like Burger King, so it was quite exciting for us.

Now, I can tell what you are thinking, and no, I did not take my 10 year old son to a pub for his birthday dinner. Beer is the Dutch word for bear, so in fact, we went to a bear-themed family restaurant. To be fair though, you are able to buy beer there too.

The restuarant has a lovely atmosphere, and is great place to go to with kids. It is also perfectly situated with a perfect view of the Weerwater, a large lake bordering on the edge of the Almere city centre.

Some of the decor

Some of the decor


Being a Friday night as well, you would expect the place to be bustling and unpleasant, but the noise levels were low even though the restaurant was rather busy.

The food was good and came in fairly large quantities ensuring that we did not starve. Cole and I had spare ribs that we perfectly tender and absolutely delicious, while Claudia treated herself to a scrumptious chicken salad.

The service was also excellent, and Cole even got a surprise for his birthday. The staff came to sing to him while bringing his dessert.

The most surprising thing of all though, was the affordability. Restaurants in the Netherlands are not known for their low prices, but Bobbie Beer certainly cost a lot less than we would have expected, especially compared to the quality of our experience.

All in all, they score full marks in my book for a value-for-money family-oriented restaurant.

Me and the birthday boy

Me and the birthday boy

Share

Why on earth do people spend so much time playing social games on sites such as Facebook?

I know that they appeal to people’s reward response by enticing you to unlock the next achievements, but lets face it, social games lack any form of depth at all, get boring quickly, and largely need you to have a lot of friends playing to be able to make much progress, thus ensuring a healthy user base for the game publisher to milk.

Now, I am not saying that all computer games are boring, or that makers of traditional computer games are not interested in profits, but there is a world of difference between real computer games and social computer games.

Let me use The Sims Social as an example. I got myself The Sims 3 recently, and have been enjoying it immensely. The game has a lot of depth, with many non-linear choices you can make, and many, many different approaches you can take. When you get bored, you can download additional content to get that perfect house you are after, or get the expansion packs giving you more choices of what to do. The options are limitless.

Comparing this to The Sims Social on Facebook, which I had tried out before this, I have no idea why anybody would choose to play the latter. The Sims Social suffers from all the usual drawbacks of social games such as needing to have real friends to play with (which Sims 3 does not care about), limited choices in what to do or buy, lack of depth, and a generally poorer gameplay experience. Many of the aspects of the original Sims games that make it fun are left out of The Sims Social, and it feels more like a Sims-themed clone of Farmville than a true Sims game.

Now I am not saying that I will never get bored of The Sims 3 – I certainly will eventually get bored of it – but the value I am getting out of it is astronomically higher than The Sims Social, so for what reason should I choose to play it?

Social gaming is starting to eclipse traditional gaming in terms of number of players, and this I cannot understand. Maybe I never will.

In any event, I am quite happy to leave my Facebook account idle while getting my gaming fix from what I consider real games.

Share

At long last, my little pet project is alive on the web. The Night Sky Notebook is a website which implements a whole range of astronomical calculations, much like Urania, my desktop version, but fully implemented in Javascript.

When I first had the idea of putting up astronomical calculations on the internet, it was simply going to be a convertion to JavaScript from the C# code that I have written about extensively on this blog. Afterwards, however, I decided to rewrite the entire library from scratch to improve the quality of the code, as well as the accuracy of the calculations, basing the new code largely on the algorithms specified in the book Astronomical Algorithms by Jan Meeus.

In addition to the pages containing pure calculations, the site also has a number of pages making use of HTML5 canvas features to render animations for things such as the Moon phase, planetary positions and Jupiter’s moons. This means, of course, that the site works best on newer browsers that support HTML5, such as Internet Explorer 9+, Firefox 5+ and Chrome.

The source code for the library is open-source and is released under the MIT license, and is available for download from here.

I hope that you have as much fun using the new site and astronomical library as I have had in writing it.

Share

It has been a really long time since I have last put up a blog post.

With a combination of the summer holiday, and then on to various pet projects that have been keeping me busy since then, I have had little time to blog.

One of the more interesting projects I am working on at the moment, is creating a web-based version of my Urania astronomical library, which is a complete rewrite of the C# codebase into Javascript.

It is still a while away from completion, but it is looking very promising indeed.

I will keep you posted as to my progress….

Share