A few days ago I was desperately trying to solve a bug which made no sense. In most circumstances everything worked fine, but then when you added more data, everything broke. Steven eventually discovered it was because I was overriding my JavaScript object's length attribute causing problems when trying to loop over every element in the object.
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).
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.
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.
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.
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.
OCFA Michelin restaurant Istanbul Michelin star art gallery PNG Edinburgh Deterrence Theory law Lenzie Skye thesis piggy bank Opera Edinburgh Fringe naughty bunny mobile phones Irari rules Hayes commands Shira camp cree.py foamcore Myxomatosis cybercrime East Lothian programming ACPO celebrities masters ISACA exhibition web browser forensics birthday paradox thumbs.db confirmation bias text Google Chrome Firefox Turkey O2 SANS rock exams RHD security Woodilee intelligence File tunnelling pork Ian Kendall blood News of the World Kilimanjaro beach GDPR risk Pentlands chemistry quantitative page breaks