Archive for October 2006

Python CSV read from string hack

I’ve wanted to use the python CSV package to read from a string a couple of times now, and I always forget this cheesey little hack so I’m writing it down in the hopes I will be able to find it in the future.

There are a couple of other approaches out there for doing this, but for reading a single line CSV string this is by far the simplest and shortest, perhaps too terse. The more general version of this is to use the following csv.reader( x.split( os.linesep ) ) for multiline csv strings.

x = '1,2,3,"stuff",5'
import csv
csv_reader = csv.reader( [ x ] )
for row in csv_reader
print row
x = '1,2,3,"stuff",5' import csv csv_reader = csv.reader( [ x ] ) for row in csv_reader: print row
['1', '2', '3', 'stuff', '5']

Browser Market Share

The latest estimates for browser share are out and although they are in the ball park, they seem to be a tad high, from my experience.

The following are numbers from a consumer oriented web site, the data is from May 15 to Oct 10, 2006. With 636,319 sessions, 13,955,971 pageviews, 326.56 GB transferred and 56,707,575 hits, which are real numbers to measure browser use, at least in Canada.

       
  Internet Explorer 79.19%  
  Firefox 8.63%  
  Mozilla Compatible Agent 4.00%  
  Safari 1.99%  
  internal zero knowledge agent 1.82%  
  Netscape 1.27%  
  msnbot 1.05%  
  Freedom 0.29%  
  Mozilla 0.27%  
  Opera 0.22%  
       

The article Safari, Firefox Shares of Browser Market Highest of Year  quotes the following numbers: Safari maintained its ongoing third place position with 3.53 percent of the browser market. Firefox, still in second place, climbed up to 12.46 percent, and Internet Explorer dipped again down to 82.10 percent, according to statistics from Market Share. As always the Mac folks seem rather optimistic, with respect to Safari.

 Of course the data I'm using includes robot agents which may skew the numbers a little bit.

Fonts for software development

I recently saw a digg article on a cool font for development, namely triskline, I tried it out and frankly it was good enough so I used it over the default courier. But, the italics in triskline sucked, and in Komodo, the development environment/editor I use, comments are italics, and this irked me to no end.

Today I saw another link to programming fonts, and I have to say I like the Vera Bitstream. So I've switched, the italics is much better and you also have the choice of different point sizes, something not available with triskline.

Viva la Bitstream Vera!