E-Mail:

awarberg

Author Avatar

Find and delete empty directories

I had iTunes “help” me organize my musik for a while. Now I’ve abandoned it for this reason, among others (e.g. it’s terribly slow and playback stutters).
I’ve used http://musicbrainz.org/ products to clean up the mess, but only to be left with a bunch of empty directories (thanks again, iTunes). I wrote up this ruby script […]

Author Avatar

PPTPD setup for home networks

I managed to get the poptop aka pptpd server running to my content today.
I have an Ubuntu server at home, which I would like to access from the internet side. I mostly use Windows machines, which natively support pptp connections so the choice of poptop was obvious. A good alternative would be OpenVPN, of course.
First […]

Author Avatar

Windows network confusion

Hi
I am playing around with a poptop box on an Ubuntu server at home. While testing the connection to the VPN server I got this very interesting result when pinging the IP, which was assigned to me by pptpd:
C:\>ping 192.168.0.210

Pinging 192.168.0.210 with 32 bytes of data:

Reply from 192.168.0.210: bytes=32 time=4ms TTL=128
Reply from 192.168.0.210: bytes=32 time=-4ms […]

Author Avatar

Transform ruby array to tex table

This has probably been written in many projects, anyways here is the code I wrote up to convert a ruby table / 2-dimensional array / array of arrays to a tex table:
def to_tex(table, user_opts = {})
default_opts = {:center => true, :sep_cols => true, :col_align => ‘l’}
opts = default_opts.merge(user_opts)
lines = […]

Author Avatar

Firefox File Links Take 2 - URL Protocol Handler

Update 15-12-2007: for smb links, I noticed that the handler would throw an error message when a login to the server hosting a resource had not yet been done regardless of the existence of the resource. I changed the handler so that it will try to open the resource in explorer if it is not […]

Author Avatar

Fast test for consecutive integer set using Gauss summation rule

I needed to test whether a set of integers, T, formed a consecutive series including all integers from min(T) to max(T).
This can be achieved by sorting T into ascending order and, for each index i, checking whether T[i] is one larger than its predecessor, T[i-1]:
public static boolean cons_sort(List<Integer> T) {
Collections.sort(T);
for (int i = 1; i […]

Author Avatar

No more Vista

My university has an agreement with Microsoft so that students, following courses from the computer science department, may download from a selection of Microsoft software for free. This includes Windows Vista, which is available in the Business version.
I am interested in the current operating systems so I got my copy and have been using it […]

Author Avatar

Random Iterator in Java

This is some Java code I wrote for a school project to save some time when iterating in random order over a part of list (until some condition becomes true):
import java.util.List;
import java.util.Iterator;
/**
* Provides a random iteration over the given list.
*
* This effect can be achieved by using Collections.shuffle,
* which shuffles the entire collection in linear […]

Author Avatar

Firefox file links

Update 04-12-2007: please see my latest blog entry on handling of file links in Firefox (and other protocols) here.
In Internet Explorer you can link to a file or folder on your own harddrive (local pages) or network share using anchor html code like … href=”\\server\share\folder” …
Due to security restrictions in Firefox and (as far as […]