Sunday, July 28, 2013

St Thomas

Meeting the horses at our B&B

Saying hello to Sir Topham Hatt

Thomas tattoos

Watching the Thomas TV show

Thomas! 
 

Riding behind Thomas. (A local railway had loaned the red caboose and about 10 carriages.)



Happy train riders!

Pictures with Thomas


You could pay for the pro picture, or shoot over the photographer's shoulder.

Pause for cupcakes.

Nathan shows off his Lego work.

Off to the Elgin County Railroad Museum, which was a big hit with the kids. A real locomotive and caboose to look at, plus this giant model railway, a representation of the one-time network at St Thomas, a big railway town, back in the day.




Megan learns the fine details of model railroading. This volunteer showed her all kinds of things.

Before bedtime, playing on the farm. This game involved climbing onto the top of the hay bale after a huge run-up.


"Don't go in the corn!"




Too much excitement for one day!


Monday, January 16, 2012

Megan eating breakfast


... at Daddy's house. She likes the bar stools. I would guess that the bowl contains an unreasonable number of Cheerios.

After breakfast, Megan made this out of her big bucket of shapes:


I think it looks like a penguin sitting down. But that's just me.

My new abode


Some pictures of my new abode. I think they came out in backwards order, but never mind:


The view out of Megan's window, looking northeast. Yes, that is a train!


The view out of my bedroom window. The building on the right is under construction, but not too noisy at the moment.


The first thing I saw this morning was a bunch of men in hard hats working on the currently top floor. But this photo was taken on Sunday. The view here is southeast (the previous one was east) and, right now, from somewhere south of east, I am getting the morning sun.


My bedroom, as the sign on the door indicates. (Megan and I had a sign-making frenzy one day.) The other door leads into "my" bathroom.


Looking into Megan's room. Quite why Megan needs three signs, I'm not sure.


Megan's room has windows on two of its four sides, which makes it nice and light, but also rather chilly in winter if you have the door closed during the day! I'm not really sure about the paper blinds, but they were there and will do for now. So it's not very dark at night, but that doesn't bother Megan.


Looking from the living room into the bedrooms.


Looking the other way from the previous shot. The living room, with piano. And books. In the far corner is my dining table, a gift from Tammy (they had an extra dining table in their basement that they weren't using). The counter on the left, where the bar stools are, looks into the kitchen.


Looking out of the living room through the balcony. In shot are a Government of Canada building, another apartment building, and under the blue roof-like object, the entrance to the mall and station/bus terminal. Somewhere in the distance is Superstore, a nice grocery store. But FreshCo is cheaper and nearer.


The office corner of my living room, and a little of Megan's bedroom.


Looking into the kitchen from the living-room side, with piano lurking in background.

Inside the kitchen, looking into the living room. It's a galley-type kitchen.


... as you see. That's Megan's school class photo on the fridge. (I had to get fridge magnets.)


Looking from the front hallway through part of the kitchen into the living room.


Looking down the hallway from the front door. The first shelf is my "pantry". The other bathroom is behind you in this view, opposite the front door. This has a shower stall and also the washer and dryer.

Friday, January 21, 2011

Prying

We are having new closets fitted in a couple of weeks, so my job is to get the stuff out of the closets so that the new shelving, hangers etc. can go in. This not only means what's in there now, but also the fixtures. I unscrewed a bundle of wire shelves from the closets in my office. There was also some bits of wood nailed to the drywall, to support wooden shelves and so on. How do I get them out?

After trawling the web for ideas (and some tries with a flat-head screwdriver that made a mess of the drywall), I landed upon:
  • score around the edge of the wood with a craft knife (so as to make less of a mess of the paint, though I'm going to paint again anyway).
  • use a flat-head screwdriver to pull the wood a little away from the wall, being careful to do this far from the nails where it's easier
  • when the gap is wide enough, ease the claw of a hammer into the gap, and try to make the gap a little bigger.
  • Put a "shim" (small piece of wood, or, in my case, a nice thin but solid coaster advertising McVities Digestives) under where the hammer would go into the wall, and use the hammer claw to push the wood away from the wall, nails and all.
Having gotten all the wood off the wall in my office closet, I then tackled Megan's closet. It took me about 10 minutes, most of which time was spent finding a place to put the stuff that was in there already. The actual prying part was pretty quick.

The remaining closets are Amy's office (full of stuff, but otherwise just like Megan's), our closet (bigger, with a plastic hanging bar rather crudely screwed to the shelf), and the hall closet downstairs, which has a wood platform on the floor.

Oh, and I also rigged up something that would keep the mudroom door closed, involving the old door catch, a spare piece of wood, some nails (for the spare piece of wood) and a judicious arrangement of screws to fix the old door catch to the door jamb, and to hold it away from the jamb so I didn't have to try and chisel out a hole. (It's probably a temporary arrangement only, since I didn't hang the door properly in the first place, and, besides, the door is too small for the hole.)

I'm quite pleased with myself. Now I have to figure out something for dinner, including for Nathan, who doesn't eat much, especially if I cook it.

Thursday, January 13, 2011

how to cheat at scrabble

One of the things that grieves me about playing scrabble is "I wonder
if I missed a bingo?", particularly if I have a bunch of
likely-looking letters (or a blank). I did some searching, finding a
Perl one-liner (I like Perl) that searched a dictionary (like the Unix
/usr/dict/words) using regular expressions. But that didn't work when
I had multiples of a single letter, since regular expressions (without
some tweaking) don't help you count *how many* matches you have. It
seemed to be a natural application for hashes (associative
arrays). So, during a subway ride, I was able to put together such a
program.

First, the word list. I'm running Linux, so I have
/usr/share/dict/words, which has a whole bunch of words, not all legal
for Scrabble, one per line. Then I found an old Scrabble word list on
the web, likewise one word per line, which is what I ended up using.

The observation that a hash was the thing led to the following
subroutine for turning a word into a hash:

sub makehash {

  my ($s)=@_;

  $s=uc($s); # my dictionary has words in uppercase, but user will
             # probably type lowercase

  my @s=split //, $s; # divide word into array of individual chars

  my %h=();

  for my $i (@s) {
    $h{$i}++;
  }

  # for example, $h{'A'} is the number of A's in the word

  return %h;

}

Now, I'm looking for bingos (to use up all the letters from my rack,
plus maybe one on the board), so I need any candidate word to have at
least as many of each letter as I do on my rack (plus any letters I'm
planning to use on the board). Conversely, if the dictionary word has
*fewer* of any letter than I have on my rack, I can reject it right
away.

I put in one more refinement: I might have a blank on my rack, so as
well as inputting to the program the letters I would like to use up
(my rack plus anything on the board), I also enter the length of word
I would like to find. That way, any dictionary words not that length
can be rejected without even making a hash for them.

With that in hand, the strategy is:

- read the desired letters and word length from the command line
- turn those letters into a hash
- for each word in word list:
  - reject if wrong length;
  - turn into a hash
  - if examination of the hash reveals that the dictionary word has
    fewer of any letters than the input does, that dictionary word
    can be rejected.
  - if dictionary word is not rejected, print it out
  
which leads to the following main program:

my $letters=shift;
my $length=shift;

$length+=2; # one is the line-ending newline, but I don't know what
            # the other is
%l=makehash($letters);


open IN, "TWL06.txt"; # or die....
WORD: while (<IN>) { # the dictionary word is in $_
  next unless length==$length;
  my %m=makehash($_);
  for my $l (keys %l) {
    next WORD if $l{$l}>$m{$l};
  }

  print;
}

As an example, I had INGESTI on my rack. I had seen that this makes
IGNITES, but there was no place to put it. There was, however, an open
N. Any help? Could I make an 8-letter bingo?

ken@ken-laptop:~/words$ perl search.pl ingestin 8
GINNIEST

Woo hoo!

Another example: suppose I have ROTANE plus a blank. What 7 letter
bingos do I have? Quite a few:

ken@ken-laptop:~/words$ perl search.pl rotane 7
ANOTHER
ATONERS
BARONET
ENACTOR
NEGATOR
OPERANT
OUTEARN
PRONATE
PROTEAN
REBOANT
SANTERO
SENATOR
TONEARM
TREASON

Tuesday, January 11, 2011

making symbolic links

I always forget this. I often want to make a short name for a directory with a long name. The syntax for that is

ln -s longdirectoryname shortname

where the long name is the one that exists and the short name is the one I want to create. Do it in the directory where you want the short name to be (like the home folder). 

At http://www.tech-recipes.com/rx/172/create_a_symbolic_link_in_unix_solaris_linux/ there is a handy mnemonic (if such it is): ln -s works just like "cp" or "mv".