Find me on Facebook, LinkedIn, LastFM and Twitter | Now listening to: Out Of My Mind by James Blunt
lowmanio.co.uk title image

Articles with the tag: Python

Doppelgangers at large?

Mon, 09 Nov 2009 07:44PM

With 9 comments

In today’s forensic science theory lectures we got taught that not only is DNA not unique, but there is an actual chance of two people having the same DNA profile. The lecturer first explained the birthday paradox, and then tried to explain it with DNA and got me terribly confused with what numbers go where in what equations. So I’ve read up on it and will now try and explain the birthday paradox and why there are potentially thousands of doppelgangers in the world.

Read full article

Image Steganography

Sun, 01 Nov 2009 01:33PM

With 1 comment

Steganography is the art of hiding something in something else in plain sight. Usually images or text are hidden within other images or sound files. For example, in the image below of trees there is an image of a cat hidden inside it. Wikipedia explains that for each component of each RGB value, if you take just the last 2 bits of it and then turn the brightness up 85%, you get a picture of the cat. The whole point is so the image of the trees looks identical to an image of the trees without an image hidden inside to the human eye.

Read full article

Script to put your music in a database

Fri, 28 Aug 2009 12:24PM

I made this script a while back now to populate a database with all the music on my computer (so excuse any poor Python!). It assumes you are on Windows and have all your music in one folder, arranged by artist with sub folder albums with songs in them. It also assumes you'll use PostgreSQL, but it's trivial to change this to mySQL or even SQLite which comes with Python2.5 or higher. You can tell it to ignore certain folders by adding to the ignorables set. It will automatically grab any album art it finds and try and get the genre, track number and composer etc from MP3 meta data (I couldn't find a way of doing any other kind of music type).

Read full article

PostgreSQL full text search and SQLAlchemy

Sun, 16 Aug 2009 02:37PM

You may have noticed I have added a search bar at the top of the website. Here is how to make use of PostgreSQL's full text search facility with SQLAlchemy, a Python SQL Toolkit and Object Relational Mapper. 

Read full article

Creating captchas in Python 2

Thu, 30 Jul 2009 02:52PM

Once the script to generate captchas is set up (see previous post) this can be easily tied into a Python web page. This assumes you are using Werkzeug and Mako, but I'm sure Django/Pylons with Jinja etc won't be too different. 

Read full article

New website!

Wed, 29 Jul 2009 05:10PM

With 2 comments

I have redesigned lowmanio.co.uk to be more bloggy, and hopefully I shall actually keep up with my blog this time. I got a little over enthusiastic with blog posts as you can see...I've already blogged 6 times! The topics I will blog about are in the categories to your right. I am starting a masters in Forensics Informatics in September, so will post anything interesting I learn here. I'm also really interested in Human-Computer Interaction (HCI) and general art and design, and computers in general! Hobbies wise, I own two rabbits called Pixel and Nybble and I love to cook. Both of these will get mentions - hopefully not at the same time (although rabbit meat is delicious). I have also moved my bunny blog which used to live at http://rabbits.lowmanio.co.uk to here.

Read full article

Blog tags in Python

Wed, 29 Jul 2009 05:10PM

Creating the blog tags for this website was a bit tricky because I wasn't sure how to make the tags have different sizes according to their significance. I started off with 5 spans and ordered the tags in terms of frequency and divided them equally into the spans. However tags are not evenly distributed, so instead I calculated the normalized weight of the tag according to the others, and made the font size a percentage of that.

Read full article

Creating captchas in Python

Wed, 29 Jul 2009 05:10PM

With 2 comments

In making this website and in my 4th year honours project I implemented a captcha (which you can see if you try and make a comment). I thought this would be a bit of a nightmare to do, but with Steven's help and the awesomeness of Python, it was quite easy. The code originally comes from here, but I have made a few edits such as keeping the image in memory.

Read full article