Hi, Claus Witt here. Danish web and software developer working for Arnsbo Media in Aarhus.

Blog Posts

Even though I regularly rant about not including jQuery as a default, without ensuring that you actually need it, I have done so myself. However I have done it in a special way (at the time of writing, this is only a...read post »»
At work, our git workflow forces every issue in jira to be created in a new tracking branch. The naming convention then makes sure that the release manager can identify issue and code, and their relation. However this means that either the...read post »»
Today I had an easy job of renaming 1800+ wave files which by my own fault had been uploaded to cloud storage with a prefix of 5 digits and an underscore before the correct filename. And since the filename maps directly to...read post »»
In one of our latest projects at work, we need to calculate two world coordinates. Instead of going into details about how the calculations is made, I will just refer to this page. This explains all details of math involved in getting...read post »»
My git worflow often has me changing several files, and testing the changes before I commit anything to any of the files. I find the easiest way to do a commit per file is to ensure that I review the code of...read post »»
As I wrote yesterday I just changed my blog platform from Wordpress to Jekyll. Today I have created some minor tweaks in my setup to allow me to easier create a post, and deploy the blog live. Now I call a simple...read post »»
Today I decided to move my blog from Wordpress to static html files. These files are generated via Jekyll. The first version of this new blog, contains (most) blog posts from the wordpress installation. The included migration script in the jekyll package...read post »»
Update: you may add you pear directory as a directory in the project, to ensure that you get them indexed (and get autocomplete on for instance ). On my mac, the pear package is located in /usr/local/share/pear - find where yours is...read post »»
For some time now I have wanted to use FLOW3 for work-projects. However it was not until it recently got out of the alpha/beta cycle that we decided to use it for a critical project. Mostly for fun, I just now finished...read post »»
A week or so ago I wrote a post about a simple AMD module I had created. Now I have created one more, this time a little more complex. While the latter was for a secret project, this one is (apart from...read post »»
I have recently begun to work a lot with AMD modules. I usually use RequireJS to load the modules - since this works both in the browser and in node. I am currently working - privately - on some exciting minor projects,...read post »»
Last week I wrote about simple statistics in javascript. However it turned out I needed something else. First of all, the only values I needed was the mean (arithmetic mean) and the standard deviation - but I needed these values from a...read post »»

Aarhus JS Status

On Sep 13 I sent out a survey to a network of developers, to find out wether or not to start some meetups and maybe working toward making a conference related to Javascript in Aarhus. The answers were very encouraging. I have...read post »»
This post is a bit embarrasing. For a long time (from Lion got released, and until a moment ago) I thought that my hosts-file problem in Lion was unsolvable and that it was the fault of Apple. The issue I had was...read post »»
I love tinkering with javascript, and working out solutions to simple little problems. Recently I had a simple statistical program in mind, that should be able to run in the browser. However while thinking about the idea, I wondered if there were...read post »»
Sometimes when you work on a project long enough, you find that for one reason or the other, parts of the project should be in a separate repository. Either the subdir contains reusable code, to be used on another project, or -...read post »»
The ninth Euler Problem is currently the one I have solved with the fewest lines of code. The problem is to find the product of the (only) pythagorean triplet for which the sum of the three numbers is 1000. Look at the...read post »»
Recently I had to implement a feature - running in chrome, safari and firefox - that enabled users to click in a text to split the text into two paragraphs. At first the solution eluded me, however a morning while entertaining my...read post »»
The eighth problem of Project Euler is very simple. Find the greatest product of five consecutive digits in the 1000-digit number. The problem at first however has a bit of a twist. You cannot represent that large a number as an integer...read post »»
The seventh problem of Project Euler is again a simple problem, which can be solved by iteration. The challenge is how to establish when a number is a prime. However, reading the definition of a prime number, you can get some help....read post »»
The sixth problem from Project Euler is about finding the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum. This problem is quite simple. Both numbers (sum of squares, and square...read post »»
I have written a few posts about NodeJs. (Albeit only as a way to demo some Project Euler solutions - until now). Requirements for getting my code to run on your own machine is that you install nodejs and npm. With npm...read post »»
For a simple walk through of how you can write widgets I decided to write a Twitter Widget, which shows a list of tweets for one or more people. The widget is simple to insert into a page. This widget of course...read post »»
Our order processing system at voicearchive has several background tasks that need to run often. For this we have a very nice cli script, written in php, from which these tasks are called. The cli runs every two minutes - first checking...read post »»
I follow about 60+ rss feeds, which I screen every day. On weekdays I only read a couple of articles - 3 at the most. In the weekends I usually about 5-10 depending on my schedule. I spend less than 10 minutes...read post »»
Typo3 like many other CMS'es have a problem with url's. In Typo3 the RealUrl extension does a great job of allowing nice urls for pages which is great for seo, however the pages are still available from the "old" url (index.php?id=xxx). It...read post »»
I know, I know. I have written enough about Roman Numerals. I have created a version of the Roman Numerals code kata I did in php and python in JavaScript. It has two public methods getRomanNumeral(number) which gets a valid roman numeral...read post »»
A while back I wrote about a code kata that I wrote, Roman Numerals in PHP. I decided that I would try to re-implement the same algorithm in different programming languages - both some I knew, and some i did not. My...read post »»
I love quicksilver, and I never (well almost never) open a file by browsing in Finder. When I want to watch a movie on my mac, I usually just find the file through quicksilver, and then I have an action named "Fullscreen...read post »»
Normally when deploying a php webapp, apc will automatically reset cache for changed files. However in our case we have our code hidden behind some nested symlinks. Most times when we deploy our webapplication it is while it is being used. And...read post »»
Pretty much a clone of the phing plugin, I have also created a plugin for ant. It works in almost the same way, however it uses a sed one-liner for getting the targets from the build file. Like my last plugin it...read post »»
A long time ago (a year and a half, I just checked) my good friend Jesper Rasmussen blogged about zsh, a shell that he had been ranting about for at least a year. About a year later I shifted to it as...read post »»
Doing code katas is something I have done for about a year now. Deliberately practicing my skills as a programmer is something that I find very pleasing, and I constantly see an improvement in the way I solve problems. Initially I did...read post »»
Continuing our combined node.js and project euler posts. We got to problem five, which asks us "What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?". First of all we only check numbers...read post »»
Find the largest palindrome made from the product of two 3-digit numbers. This is problem four of project euler, and this one actually caused me some problems. The reason was that I wrongly assumed that a number with the largest divisor would...read post »»
This past weekend I moved our work repositories from Subversion to Git. I have been using Git for my private projects for a couple of months now, and really wanted the same workflow and features for my daily work at VoiceArchive. Installing...read post »»
Continuing my posts about Project Euler Problems, this time with problem three, which asks us to find the "the largest prime factor of the number 600851475143". This time I have decided to explain the code a bit more, through comments - since...read post »»
Yesterday I posted my first euler-code. This time we will take a look at problem two, again with the help of some javascript running on node.js. The problem is "Find the sum of all the even-valued terms in the [fibonacci] sequence which...read post »»
A long time ago I decided to do a couple of posts about project euler. I find the problems to be great excersize. It was not before I began to look into node.js though, that I began writing code for the problems...read post »»
This is mostly just a follow up for my previous post on using a shell script to add and remove test domains in the hosts file. I have created two small applescripts for use in Quicksilver to execute that script. If you...read post »»
I just read a post about local development in apache by Jesper Rasmussen and thought one thing was missing. I usually test my sites and applications locally with the real domain - to ensure that functionality based on the url works as...read post »»
Once again I have a bash-oneliner. For some reason it is all I blog about at the moment. I had an import script for importing demo files (in mp3 format) to a database used at Voicearchive. Only problem the import script depended...read post »»
This weekend my girlfriend and I moved all the stuff I had in my private office/homestudio out, to create a room for our son. Because of this my old mac was put in the living room, and is now a primitive media...read post »»
I needed to find a way to count the number of files in a directory and only output that number. Bash is still my best friend for this sort of thing - especially with a little help from google. ls -1 |...read post »»
A couple of weeks ago I had to rename the file extension of several view scripts from html (from my own mvc framework) to phtml (zend framework). I found, as always, bash to be my friend. for i in * do (...read post »»
In my previous post about SSO for webapplications I have missed the obvious - why not use OpenId and OAuth. It is important however to know the difference between the two. OpenId is used for authentication - is the user who he...read post »»
I have been getting a thought into my head the last couple of days. I have been talking a lot about things surrounding web application building the last weeks. Primarily it has been about all the things that are common to most...read post »»
Writing your own PHP Framework, should you do it? While I worked at Wildside in Ă…rhus, Denmark, I wrote a MVC Framework for using in Typo3 extensions. The reason for this was that we were working on an application which required such...read post »»
First of all, the headline is a lie. I am in the process of copying all mp3 files that we in our household have had on a number of different machines to one central server, which all computers talk to via webdav....read post »»
I have several computers from which I access my online webdav server, where I save documents and other things, that I require to have access to at all times (when I'm online). For some reason I could not get my macs to...read post »»
This sounds to me like it should be the Mission Statement of any Software Development Company out there. Manifesto for Software Craftsmanship Nothing more to add there really. read post »»
Today I found myself needing a bit of Textmate magic. I had a sql-file containing a lot of tables, from some of these I needed all fieldnames in an array. I quickly found that Textmate would be my friend. This is mostly...read post »»

Projects, work and code