Monday, August 4, 2008

Quietly Does it









I have had my eye on a pair of Bose headphones for some time but never managed to justify the cost. And to be honest I am not sure that I ever will. Except that they are truly fabulous and on my first tip with them on a plane left me feeling relaxed and comfortable. The noise onboard a plane seem to raise my tension levels but removing that noise really helped me enjoy the flight.

I was told when I bought them that the batteries were fully charged and would each last 10 hours. I can only testify to 8 on one battery with almost continuous use.

I will confess that I have tried a number of different headphones, both in and out of ear, with and without noise cancelling but nothing comes close to the peace that these phones bring with them.
So maybe I have justified them :)

Toronto - Sunday








DSC00146.JPG


Today is my first day in Toronto, preparing for Agile 2008. After a surprisingly smooth and peaceful crossing from the UK, and an even smoother journey to downtown Toronto I find myself preparing some slides for my short experience report 'TeamPace - Keeping the build times down' on Thursday.


I am staying at the Hilton just across the street from the conference at the Sheraton Centre for an early morning start.



Friday, August 1, 2008

Code is Poetry








On a recent visit to the Wordpress sight I was struck by their tag line "Code is poetry". I have been searching for some time for a phrase that would sum up how I feel about well crafted code; code that is easy to understand, read and generally feels 'just right'.


I am not completely convinced that code is poetry - but it comes pretty close.




Agile2008

Next week I will be in Toronto for Agile 2008 to present a short experience report, catch up with friends and immerse myself in all things Agile :)



Monday, May 19, 2008

Trains and WiFi

I am just returning from Leeds to London by train with power and free Wireless internet. Ok it is not the fastest link but works well - even for blogging

Tuesday, May 13, 2008

Keyboard touching

I am definitely with Jeff Atwood on when it is appropriate to touch monitors - NEVER.


Tuesday, April 29, 2008

Further perf ruby, python C++ file reading

Following on from the log files article I decided to do some basic perf checks of ruby and python reading text files. The results were a little disapointing - performance was roughly the same, so my ruby log file reading optimisation was complete rot.



Further experimentation required.































ARGV.each do | param |
cc = 0
File.new(param, 'r').each_line do |line|
cc += line.size
end
puts "File has #{cc} characters"
end

Processing /Users/gcb/work/log-analysis/cc.rb ... created /Users/gcb/work/log-analysis/cc.rb.html


Realy simple script - and probably the most obvious - add up the length of all the lines in the file.


File has 1673435763 characters

real 0m56.035s
user 0m33.873s
sys 0m3.609s





ARGV.each do | param |
cc = 0
i = File.open(param, "r")
begin
line = i.readline()
until line.nil?
cc += line.size
line = i.readline()
end
rescue Exception => e
ensure
i.close
end
puts "File has #{cc} characters"
end

Processing /Users/gcb/work/log-analysis/cc1.rb ... created /Users/gcb/work/log-analysis/cc1.rb.html


Based on previoud observations this one uses the realine method from the IO library but did not affect the performance.


File has 1673435763 characters

real 0m55.569s
user 0m35.506s
sys 0m3.451s




import sys
cc = 0

source = open(sys.argv[1])
for line in source:
cc += len(line)
source.close()
print 'file has ', cc, ' characters'

Processing /Users/gcb/work/log-analysis/cc.py ... created /Users/gcb/work/log-analysis/cc.py.html


As a benchmark a simple python scrpt - again adding up all the line lengths in the file.


file has 1673435763 characters

real 0m53.462s
user 0m23.147s
sys 0m3.781s




#include <stdio.h>


int main(int argc, char** argv)
{
int count = 0;
FILE* f = fopen(argv[1], "r");

while (getc(f))
count++;

printf("File has %d characters\n", count);
}

Processing /Users/gcb/work/log-analysis/cc.cpp ... created /Users/gcb/work/log-analysis/cc.cpp.html


Baseline written in C++


File has 1673392372 characters

real 0m53.167s
user 0m31.473s
sys 0m3.094s




#include <stdio.h>


int main(int argc, char** argv)
{
int count = 0;
FILE* f = fopen(argv[1], "r");

char buffer[512];
int read = fread(buffer, 1, 512, f);

while (read > 0) {
count += read;
read = fread(buffer, 1, 512, f);
}

printf("File has %d characters\n", count);
}

Processing /Users/gcb/work/log-analysis/cc1.cpp ... created /Users/gcb/work/log-analysis/cc1.cpp.html


A (poor) buffered version of the baseline written in C++


File has 1673435763 characters

real 0m52.425s
user 0m1.526s
sys 0m4.473s