Thursday, 27 September 2012

Facial recognition lock in 3... 2... 1...

Things are good. I still would rather be at home playing all day with my girls, but work is fine. The thing that I'm having a hard time not doing is going as fast as I can on my bike ride home. Because I know what happens when I walk in the door: Alice sees my face and there's that moment when she's trying to figure out where she knows me from. Then the whole world lights up. Those blue eyes. That two tooth smile. I melt. Any thoughts of work, worries, or frustrations evaporate away. Maybe just for a minute or two, but for that time it's just me and my girls. Bliss.

DSC_0940

Thursday, 20 September 2012

2^5

It's not often you have a birthday that's a power of two. Looking back at the Jim that was half my age, I didn't have a clue what I wanted to be, where, or any other details. I don't think that there's really any way that I could have predicted where I am today even if I wanted to. I don't think that I'll be able to figure out those details for when I double my age again. Maybe by then we'll all have self driven cars and things will be so different than they are today. Hopefully for the better.

I'm looking at my family tonight and wondering what adventures we'll have the next time I cross a power of two. I can only hope that we'll meet those challenges wearing silly hats. Because... you know... silly hats are fun.

Friday, 14 September 2012

Signs of the times

For quite a while we've been trying to do baby sign language when dealing with Alice. Simple things like: up, finished, milk, bath, change diaper, mommy, daddy, and "divert more power to the starboard thrusters". You know, the usual. At first we were quite good at it. We'd sign like talking was going out of style. Nothing back from her. Eventually she started to recognize the signs and take action. Like for "up", she'd lift her arms to make it easier to pick her up. But she didn't sign back to us.

Until this week.

At breakfast she signed "finished". We thought that it might have been a fluke. But since then she's been making the sign when she's done eating in her highchair. It's pretty exciting to be able to not have to interpret just grunts, waving of arms, and different cries in some weird version of charades. Hopefully she'll pick up more signs as we go. Clear communication is always nice because it'll take the guesswork out of it, which will reduce everyone's stress.

Monday, 10 September 2012

The Story of the Craftsman

There once was a construction company that build homes and other buildings. They hired skilled craftsmen (and women, but we're calling them all craftsmen) to do the work. These people had been told that they'd be building homes built on the latest designs, using the best materials, in order to build peoples dream homes for a reasonable price.

The craftsmen were told that the company would provide all the tools in order to ensure a consistent quality. The workers requested pneumatic nail guns since that allow them to go as quickly as possible. The request went to the hardware store were the clerk insisted most of their sales were for tac hammers. Clearly tac hammers are all that are required, so those were purchased. The craftsmen protested - this would take them 10x as long and would cause much frustration. Craftsmen, like all skilled labour, like to feel that they are working at the best of their ability with the appropriate tools. A tac hammer is clearly not a valid replacement for an air hammer.

Ah, but the management of the company said that the tac hammers make perfect sense. If their paid more money for the faster tools, it would be out of the company budget. This would save time, and therefore money, but only what was billed to the customers. So it wasn't in the companies best interest to ensure the craftsmen have the proper tools.

The craftsmen promised that they would pay for their own tools if they were allowed to bring them into work. Alas the company's management stated that would be against policy. I mean, if the craftsmen brought in their own tools, how would that look? People would start to think that the company wasn't able to provide the proper resources to do the job.

Sunday, 9 September 2012

Partners take turns

Before we were married, yet living together, I'd often refer to Laura as "my partner". It felt like the right thing to do at the time, because that's how I saw our relationship - as a partnership. You know, working together and all that crap.

Now that we have a kid, I feel that idea carries even more meaning. We have to work together better than we did before. Taking turns is required. Turns feeding Alice. Turns eating. Turns going to the bathroom. Turns changing Alice. Turns going for a bike ride. Turns, turns, turns. I don't understand how that would work if you weren't partners. It can be hard enough to make it work even if you are.

Well, most things require you to take turns. I think now we'll all go for a nap. Because as they say, the family that naps together, sleeps all at the same time. Or something like that.

Thursday, 6 September 2012

Fun fun

I've only been back at work for a couple of weeks and changes with Alice seem like they are accelerating. Luckily I get updates, including pictures, of what's going on at home. She can now stand up by herself without pulling herself up. All she needs is a wall or something similar. It's only a matter of time before she figures out that she doesn't need a wall. A tooth has also come in, as evidence by the scrape marks on the end of the crib. I think that she's starting to understand waving, which is pretty cool.

The other day we were looking at photos from her birth and it almost seems inconceivable that she was so small. Each stage seems so exciting with "quickly! Come see what she can do!". I can't wait until I can sit down with her and we can play imagination together - like tea time or using a time machine / space ship.

She is a really good kid (so far) and doesn't get into too much trouble. She's patient with us when we're preparing her food, as long as it's clear that we've understood her request. It's really good. I'm a bit sad every day when I leave to go to work, but it's getting easier. Both of my girls are making it easier. Now if I can just get Laura to greet me with a drink and my bubble pipe when I get home...

Blueberry

Wednesday, 5 September 2012

Java find files for a given extension, recursively

In a bit of code I was doing I wanted to run without depending on any external libraries. The trouble that I had was that I was using commons-io.



The problem was given a directory, find all jar files recursively. Commons IO solution:


Collection<File> jarFiles = FileUtils.listFiles(new File(root), new String[]{"jar"}, true);



Simple and clean. How would I do this in java? Wait a second, I'm using java 7 which has improvements to the IO. You know, called New IO 2, or NIO2. This will probably be even easier is what I thought. Well, below is the solution that I came up with after looking at many different blogs.


final Collection<File> jarFiles = new ArrayList<File>();

final PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:**/*.jar");
Files.walkFileTree(Paths.get(root), new SimpleFileVisitor<Path>() {

@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (matcher.matches(file)) {
jarFiles.add(file.toFile());
}
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
return FileVisitResult.CONTINUE;
}
});



Close to 20 lines. Yuck. To be fair, it is super powerful with what kinds of different things that you do do with it, not just looking at the extensions, but man oh man is that a whole bunch of ugly. Why with java do you always have to use heaps of libraries and frameworks to get anything that even starts to look clean and tight?