General

A general blog entry

Very simple Python script to count the number of words in a block of text

Recently I had to write a small 'essay' which required not more than 250 words.  Since it was Computer Science related, I figured I would write a small script to count the words for me... this is what I came up with.

doc = raw_input()
count = doc.count(' ') + 1
print count

 

 

How to use Mercurial for source control

Recently I started working on a project that uses Mercurial for source control.  I've used SVN, and have a love-hate relationship with it but the step up to Mercurial took a bit of getting my head around.  Probably the most helpful tutorial I have read on it is here:

http://hginit.com/01.html

Hope it helps others as much as it helped me : )

Nixie Clock

Well, I've always wanted to build one - and recently I purchased 4 x IN16 Russian NOS nixies, and 4 K155N driver IC's (equivalents of the 74141 driver IC).  One of the issues is that the nixie requires around 170V to light it up - so I am building up a power supply rather than use back-to-back transformers which is common practice but clunky and heavy.  I've borrowed a circuit from here and so far I have prototyped most of a test circuit:

Crystal Sets Revisited

 Well, my original crystal set post had some experimentation on it, and I have done a little more recently due to wanting my daughters Cub Group to build one as an experiment.  The biggest hurdle was getting the cost down to a resonable figure - otherwise the project was dead in the water.

CTRL-ALT-BACKSPACE to restart X Windows in Ubuntu 10.10

Recently I started to have a problem with my new 22" flat panel where it won't wake up from sleep - leaving me with just my laptops display running.  Pulling the HDMI plug and re-inserting it works in Windows 7, but not in Ubuntu - I get a popup message stating that the discovered monitor cannot be enabled as the new display configuration doesn't fit - or words to that effect.

Accessing shared Windows folders in Sun (Oracle) VirtualBox

I've used Sun VirtualBox (Now Oracle VirtualBox) for a couple of years as a handy way to run Linux on my Windows-based laptop.  It broke a while back and I only just got around to reinstalling it using the new 4.0.0 release - and found shared folders didn't work out of the box.  I could set one up - and I could see it - but it wouldn't allow me access - I got the following error:

You do not have the permissions necessary to view the contents of "sf_virtualbox_sharename"

Eclipse 3.6 (Helios) Android Auto-complete very slow / freezes

Recently I have started developing for the Android platform - and this has forced me to face Eclipse, which I have never really liked.

The most annoying thing was the painfully slow way in which Eclipse seems to handle autocompletion of class and method names - its almost as if it passes the request around the office a bit, goes out for lunch, comes back, has a nap, then looks it up using an old-school rubber-cup 300-baud modem, chisels it into a stone tablet and returns it... eventually.  The worst example is setting an on-click listener for buttons, something I do a lot.

Spider Coil Calculator for Radio Applications - Python Code

In my crystal set post I use spider coils, because they are easy to make (my 8yo daughter wound one all by herself), and because they have better Q than a TPR coil (Toilet Paper Roll - common type used in basic crystal sets).

Caesar Cipher / Affine Cipher cracking

Recently I started doing a course on encryption (which due to unforseen earthquakes I had to drop again).  What I did before I left the course is got quite interested in the process of cracking codes (actually, I had an interest in that already - this course just gave me an excuse to delve into it).

Knights Tour - Auto-Solver, written in Python

What follows is my first attempt at a Knights Tour solver.

It is written in Python (2.6), and is currently pretty ugly, but it works.
I'll post updates as I add them (IF I add them). Feel free to comment.

Steve