Monday, October 3, 2011

A little python script to convert a file with scientific notation to decimal notation, line by line.

#!/bin/python

from decimal import *
import re


infile = open('in.txt', 'r')
outfile = open('out.txt', 'w')
pattern = '[0-9]E\+[0-9]'
pattern1 = '[0-9]E\-[0-9]'

array = []

for line in infile:
 array.append( line )
 data = line.split()
 n =0
 for i in data:
  str1 = 'data['+str(n)+'] = '
  print str1
  print data[n]
  print "\n"

  if re.search(pattern,i) or re.search(pattern1,i):
   print "Match"
   print i
   print "\n, convert"
   s = Decimal(i).normalize()
   print s
   print"$$$$\n"
  n = n + 1
 mylist = map(lambda(x): str(x), dataout)
 outfile.writelines(mylist)
 outfile.write("\n")
 
infile.close()
outfile.close()

Wednesday, June 22, 2011

Central Limit Theorem Lecture

The central limit theorem is something I can vaguely remember covering in my second year at uni, long forgotten I wanted to revise it. This lecture dose the job.

http://vimeo.com/13491306

It's a good course / intro / refresher to probability theory stochastic process. Very accessible, a little slow but well done. and dose not get too bogged down in the detail of all of the maths which is just what I wanted. I can read book for all the nasty details but want a nice quick over view to get the ball rolling so I can start using it.

Wednesday, June 15, 2011

New Bikpacking / Bivi forum

New forum, UK based rather than US which is always nice.

 http://www.bikeandbivi.co.uk/

Hopefully should be a useful source of info, not that there is that much to going out and camping with you bike. It's about actual doing it! Unfortunately my long awaited trip has been postponed due to guttering work over running yesterday. With some luck I'll manage to go next week!

Sunday, June 12, 2011

Short trip camping setup

A couple of quick ics of my short trip / bikepacking setup. Backpack is rather large but cooking pan would not quite fit in my 10 l camel back.



Yes that is a mudguard on in the summer, I just can't be bothered to remove it as removing the mudguards encourages rain!

Wednesday, May 11, 2011

Hello World!

Hello world!

This is a blog post.



This is a photo