Latest Entries

Python Generators


divs = ( line.strip() for line in open("tmp.html") if line.find(">DIV")>0 )
for line in divs:
  print line

I started reading Apress Pro Python and immediately learned something new. I knew about Generators as a pattern for writing classes but I didn’t know you could make them on the fly and use in a similar way to List Comprehensions.

The above code lists all the lines in an HTML file which contain a DIV tag, while stripping the white space off the start and end of the lines. Previously I would have written it in a much more clunky way.

Yep. Nothing beats actually stepping away from the PC and reading a book.

Command line Wifi foo with Ubuntu

One of the really nice things about running Ubuntu is that you can get information about the hardware from the command line.

For example:
sudo iwlist eth1 scan | grep ESSID

lists up the names of any Wifi hotspots in close proximity. I will leave it as an exercise for the reader to think as to what could this be useful for.

In which I muse about blogging..

I upgraded WordPress today to the latest version. Hopefully, the Subversion checkout method will make upgrading easier. I changed to a clean new Theme too.

While looking through the links posts that I previously posted, I thought that I would start the laborious task of adding proper titles and fleshing out the contents, adding tags and generally making them into real blog posts. However, the link on one of the first posts I looked at was broken. Typical.

One of the reasons I started this task was inspired by the thought about whether to outsource blog hosting to a commercial site or whether to do it all myself. i.e right down to writing the blogging software. This thought came about due a session at the recent Tokyo BarCamp about whether we can trust our content to commercial sites.

Now I am wondering whether to go through all the old posts and fix up the broken links. Is there any blog software that captures the page that you are linking to in case it goes away?

I decide to go and do some tidying up as there is a lot of information here that I have forgotten and it must have been interesting to me in the past to make the effort of writing it down.

I’m going to start getting in the habit of searching my own site first for links and to write my notes here as I have the feeling I am searching for the same things over and over. After all that was what the first “homepages” were about. It was your site, your browser’s homepage.

7:42 to Shinagawa

If you want to be at the front of the queue for the 7:42 Express to Shinagawa which starts at Kurihama you have to be on the platform at 7:25. You need to know that it will come in on platform 3 not 4 as it won’t be on the sign board yet. You also need to know it will be labeled as going to Kanazawa-Bunko rather than Shinagawa. You also need to know that the Yokosuka line will come an reverse into the siding at 7:19 blocking the road to the station for a few minutes.

Virtual Dreams

I was having a dream last night where I remember thinking, “this dream would make a fantastic science fiction story”, but when I woke and remembered it ,it was laughably bad. I was dreaming that people were somehow getting getting trapped in their VMWare virtual OS images..

What is that smell?

I went to doctors on Saturday for my monthly appointment and mentioned that I had a cough and sore throat and he looked up my nose, dabbed my throat with Iodine and sent me away with 5 more different tablets to take. I wasn’t feeling so bad when I went there but, actually, after taking the antibiotics and the mucus thinner; excuse the gory details, I feel a lot better than I did. I guess you can get used to feeling run down.

While I was in the shower this morning I noticed a really weird smell, I couldn’t locate it but when I got out, I found that Chizu was cooking Brocolli in the kitchen. If you loose your sense of smell gradually, you don’t notice it in the same way you would if you lost your sight, sense of touch or hearing. But when your sense of smell comes back you get affronted by all sorts of smells. Tonight I noticed the smell of strawberries in the refridgerator and it was quite overpowering.

Zen’s sense of smell is amazing. He detected Chizu was secretly eating a sweet in the kitchen several meters away and went in to demand one.

c.f How Can I Accurately Test a Patient for Loss of Ability to Smell?

A dream within a dream

I told Zen this morning the plot behind a time-travel movie. At first he didn’t get it but suddenly his eyes lit up and he shuddered when he understood what I meant. He decided that he didn’t want to meet himself in the past.

Later in the conversation he asked, "Where is it that we are seeing when we are dreaming?", which kind of says to me that up and until then he thought he was seeing a different physical place to the real world in his dreams ala L.P.Lovecraft’s "Dreamlands"..

I found my paternal Grandmother and Great-Grandfather on this site from 1891 census:

Warwickshire Ancestors Project

1891 Civil Parish of Long Itchington, Eccl. Parish of Long Itchington

4,New Fields,1,Charles Long,Head,M,46,,Shepherd,Employed,Launton Oxfordshire,,
,,,Hannah Long,Wife,M,,45,,,Mollington Warwickshire,,
,,,Elizabeth Long,Dau,S,,16,Domestic Servt General,,Launton Oxfordshire,,
,,,Alice Long,Dau,,,13,Scholar,,Launton Oxfordshire,,
,,,Fanny Long,Dau,,,10,Scholar,,Launton Oxfordshire,,
,,,John Long,Son,,8,,Scholar,,Launton Oxfordshire,,
,,,Elsie Long,Dau,,,3,,,Launton Oxfordshire,,

I heard that my Father’s mother was called Fanny and her father was "Shepherd Long". We had a part of rusted sheep sheers, probably belonging to Shepherd Long but I think they were thrown out when we moved from Southway.

The new Calbee Potato Chips – Okinawa Spice flavour are just plain spicy. My mouth is burning!

Test from OPML editor

This is where I write something

I guess I missed out on 2008. Not much to show there..

  How about indentation. I wonder how that works…


Copyright © 2004–2009. All rights reserved.

RSS Feed. This blog is proudly powered by Wordpress and uses Modern Clix, a theme by Rodrigo Galindez.