Moving House with Broadband

June 30, 2015

I've been a Zen customer for many years, so when I recently moved house I thought I'd continue with them.

We checked the phone number for the existing occupants of our new house and found that it could get FTTC. This was an important part of our decision ...

Accessing Files in a JAR

May 28, 2015

I wanted to have text files in my Java project that I could read and process in a Java program. I wanted this to work both when running code in Eclipse, and when running an executable JAR file of the same code.

I added a marker.txt file at top ...

Django Invalid HTTP_HOST header

May 27, 2015

After upgrading to Django 1.7, I was getting error emails similar to the following:

Invalid HTTP_HOST header: 'XXX.XXX.XXX.XXX'. You may need to add u'XXX.XXX.XXX.XXX' to ALLOWED_HOSTS.

Request repr(): 
GET:<QueryDict: {}>,
POST:<QueryDict:     {u'redirect:${#res=#context.get(\'com ...

Sorting Hashtable Keys in Java

April 30, 2015

I wanted to sort the keys in a hashtable in Java, this can be done with the following code:

 private void process(Hashtable<String, String> pColumnsHash)
    List<String> lColumnNames = new ArrayList<String>(pColumnsHash.keySet());

    Iterator<String> lColumnNamesIterator = lColumnNames.iterator();

Django User Profiles Deprecated

March 14, 2015

Django user profiles are deprecated in Django 1.6, but I have a legacy application that still needs to work with them. This post documents the steps used to remove this functionality, but still have the site work without making any database changes.

Change Profile Model

My existing model was ...