Feb
21
2009
Sorry to any arachnophobics out there, but here’s another spider picture. This one lives in my wardrobe. It’s been there a while and doesn’t seem to be doing any harm so I’m letting it stay. It seemed kind of nonplussed about having a camera-phone stuck in its face.
I’m reasonably certain that this is an example of pholcus phalangioides, the daddy long-legs spider. From its pale, almost translucent colouring it’s probably young. They go pale brown as they grow up.

2 comments | tags: spider photo | posted in Photos
Feb
18
2009
Just evicted this spider from my flat. I thought it looked kind of interesting so I took a photo first. I think it’s probably a lace webbed spider or one of the clubiona species. But I’m basing that on a few other pictures I saw online, so it’s probably not very reliable.

no comments | tags: spider photo | posted in Photos
Feb
10
2009
I present to you Jimm’s Page of Groovosity – one of the first websites I ever made. I only found it tonight by accident. Indeed, I have absolutely no memory of making this. Judging by the timing of it, I think it dates back to 1998 or thereabouts. I’d have been 16. I can’t believe it still exists. I can vaguely remember making those graphics in the version of Paintshop Pro 4 that came free on the CD of a computer magazine.

There’s some stunningly awful poetry there. I mean look at Visions of a Seer. I point out on the site that it won the senior poetry competition at school. What I fail to mention is that it was the only poem entered into the senior poetry competition at school. Seriously, how angstful is this?
Gaze upon the pain that you never dared believe existed.
Gaze upon it now.
But when you look away you won’t remember.
You won’t want to remember the truth.
For the truth
is pain.
Ha!
I do kind of like my collection of javascripts though. I particularly like the Shakespeare Quote Generator. I think I must have spent an evening typing in the Shakespeare section of the big book of quotations we had when I was a teenager.
I apparently only got the first bit of the website done and the section about my ‘online aliases’ is missing. Calaxir (which is the search term that led me to this ridiculous little piece of personal history) was the name a character I played in one of the early chat-room style free-form RPG’s on WBS. I really should have chosen a better name – one that didn’t sound like a laxative. I mostly hung out in the Realm of Elahrair.
Bah. Kids today with their MyBook and FaceSpace. Back in my day we had to hew the raw HTML out of the internet with our teeth. And we liked it that way.
2 comments | posted in Me
Feb
2
2009
While on breaks at work I’ve been reading a bit about Genetic Programming. The following is a quick-and-dirty python script I threw together (mostly for myself) the other night. It evolves the target string “Hello World” over several generations, starting with random strings. After a bit of experimentation I found that a population size of 300 seems to work best for this.
import random
import string
class GenePool:
def __init__(self, population_size):
self.population_size = population_size
self.population = [self.generate()
for i in range(population_size)]
def run(self):
i = 0
while True:
print "Generation " + str(i) + ": " + self.population[0]
i = i + 1
if self.step():
return
def step(self):
fittest = self.get_best(self.population_size/2)
if self.successful(fittest[0]):
print "Success! " + fittest[0]
return True
else:
self.population = self.get_new_generation(fittest)
return False
def generate(self):
return "".join([random.choice(string.ascii_letters + " ")
for i in range(11)])
def evaluate(self, individual):
s = "Hello World"
total = 0
for idx in range(len(s)):
if individual[idx] == s[idx]:
total = total + 1
return total / 11.0
def get_best(self, n):
fitness = []
for idx, individual in enumerate(self.population):
fitness.append((idx, self.evaluate(individual)))
fitness.sort(cmp=lambda x,y: cmp(x[1], y[1]), reverse=True)
best = []
return [self.population[tup[0]] for tup in fitness[:n]]
def successful(self, individual):
return individual == "Hello World"
def get_new_generation(self, individuals):
population = []
while len(population) < int(self.population_size * 0.75):
population.extend(self.breed(
random.choice(individuals),
random.choice(individuals)))
while len(population) < self.population_size:
population.append(self.generate())
return population
def breed(self, mother, father):
point1 = random.randint(0,len(mother)-2)
point2 = random.randint(point1+1, len(mother)-1)
new1 = mother[:point1] + father[point1:point2] + mother[point2:]
new2 = father[:point1] + mother[point1:point2] + father[point2:]
if random.random() < 0.05:
new1 = self.mutate(new1)
if random.random() < 0.05:
new2 = self.mutate(new2)
return (new1, new2)
def mutate(self, individual):
x = list(individual)
x[random.randint(0, len(x)-1)] = random.choice(
random.choice(
string.asciiletters + " "))
return "".join(x)
if __name__ == "__main__":
G = GenePool(300)
G.run()
no comments | tags: genetic programming, python | posted in Software, python