Displaying the most recent of 15 posts written by

NilsH

How to align text on the whitespace after the first word character in vim.

Today I decided to make my factory_girl factory definitions look a little bit more pretty. My tool of choice for alignment in Vim is the famous Align plugin. It turned out the task at hand is not as trivial as one might think at the first glance. By additionally harnessing the power of the mighty [...]

How to start your RSpec / Cucumber / Spork / Watchr test environment with a single command

My Rails 3 test environment consists of RSpec, Cucumber, Spork and Watchr. Additonally I am running rails console and rails server. This means I have to spawn six terminals or on terminal with six tabs. My preferences lean towards the tab solution. I am setting this up just once or maybe twice a day, but [...]

Genetic Algorithm vs. 0-1-KNAPSACK

The Genetic Algorithm is the most widely known Evolutionary Algorithm and can be applied to a wide range of problems. After explaining the basic principles, I will show how to apply the Genetic Algorithm to the so-called 0-1-KNAPSACK problem and come up with an implementation of a suggested configuration [1] for the algorithm in Ruby. [...]

The tale of why I chose Vim over Emacs and any IDE.

Some month ago I watched someone hacking pretty impressive with Emacs . It was so fast I did not even get what he actually was doing. That day I decided to master Emacs to become as productive as he was. Some weeks passed and it started to feel really good. Until some friends at university [...]

How to ignore changes in git submodules

Recently while setting up my vimfiles for version control I encountered a problem with git submodules. The plugins are included as git submodules and loaded up with pathogen. For those interested in details on how this works, there is a Vimcast available on this topic. Some of the plugins need to generate helptags or other files that [...]

How to apply Naive Bayes Classifiers to document classification problems.

Within the last decades it turned out that it is often much easier to tell a computer how to learn to do a specific task rather then telling it exactly how to do it. One of the generic terms for this could be Machine Learning, which is basically summarized by Wikipedia as: Machine learning, a [...]

How to extract plain text from HTML with Nokogiri

While working at an upcoming blogpost, I encountered the problem of extracting some plain text from HTML. If I was interested the whole plain text, I could just run html2text in bash and feed it with the HTML, but what I needed was just a specific part of the plain text between two certain comments. [...]

Understanding parameter passing in Java: Call By Value

Some of the first semester students participating in the lecture Algorithms and Datastructures where I am working as tutor seem to have problems understanding how parameter passing works in Java, so I decided to do a little writeup on this. The most confusing part seems to be the passing of object references to methods, so [...]

How to embed actions within every match of a one-or-more ( rule+ ) or zero-or-more ( rule* ) rule in ANTLR?

This article shows how to embed and action into an ANTLR grammar, that should be executed for every match of a one-or-more rule ( rule+ ) or a zero-or-more rule ( rule* ).

New website

As you can see I have reworked my website. You may also have recognized I am writing in english now. Read on to get to know why,…