Monday, 7 July 2008

The Rain!

It's 9:00am, Julia left for work 2 hours ago, and I'm listening to the morale-building going on outside one of the real-estate offices across the street. The workers in the office building kitty-corner to us often file out and do calisthenics in the parking lot early in the morning. But every morning these real-estate agents line up in two rows (one of men, one of women) on the sidewalk and do cheerleading routines involving chants, clapping, singing, and hand gestures, often to music.

The heat and humidity are already up; the former due mostly to two rare days of clear skies over the weekend. I no longer trust my key-chain thermometer as I have long suspected that it always reads between 27 and 29 degrees. I attribute this defect to the photograph I took of it maxed out at 50 degrees in northern Australia nearly 3 years ago. Google, however, says it is 27 degrees and 74% humidity right now... not bad for nine in the morning. It's amazing to me that a place can be this humid in the summer (wait for August!) and so dry in winter. If the heat doesn't dehydrate you here the air conditioning will and I wake up every morning with a dry throat.

The clear skies this weekend probably came thanks to the rain on Friday (rain seems to settle the fine particulate pollution). Julia and I met for dinner after work on Friday and then decided to go to a movie. As we emerged from the restaurant, it began to rain lightly. As we emerged from the taxi and sprinted to the cinema, it began to rain heavily. Forty minutes later, as our film was about to start, they informed us that Cinema 6 was being shut down because of water flooding into it and that we could get our money back. Upstairs, parts of the street were now flowing like rivers as the rain alternately poured and paused in 5-minute cycles. After half an hour trying to find a taxi that was (a) empty, (b) willing to pick us up (not sure why this is a problem), and (c) closer to us than to somebody else looking for the same thing, we gave up and walked to the subway. Unfortunately the subway was closed, due (as far as we could tell) to flooding. Tiring of waiting, we crossed the street and attempted to decipher the bus system. We did eventually manage to get close enough to home that we could walk the rest of the way, having become wet enough by then that we'd given up caring about staying dry anyway. In total, it took us two full hours to get home... this city doesn't deal well with heavy rain.

Friday, 4 July 2008

I bowled a 162!

For as long as I've known Julia I've been trying to get her to go bowling with me. It's not like I bowl often but it's fun occasionally. Well we finally had the opportunity last weekend at a social event organized by Julia's company and while I couldn't knock down more than 9 pins to save my life in the first game, I managed nearly all strikes and spares in the second as I found my stride. People said I had "good form" which I guess I can only attribute to a few years of regular curling; I did feel pretty consistent.

Sunday was a busy day for us. Julia had uniform measurements and team building with her hospitality staff, then we had lunch and bowling, and then we had a few hours to kill before she and I went to a noodle and dumpling cooking class. Unfortunately, we really only had a demonstration and a little practice of the noodle pulling so I still can't claim to have successfully mastered the art but at least I have an idea how the dough should feel. The dumplings, or jiaozi, were quite successful: pork-and-celery and egg-mushroom-and-bok-choi. And I had left overs for lunch!

In other news, I'm currently struggling under the weight of decisions regarding employment, flights out of here, and their destinations so more to come once those are settled. I won't go into all the details of the complications of obtaining a Russian visa but, after a frustrating experience with the Russian embassy in Kuala Lumpur coloured by view of Russian hospitality, I have essentially decided to put off my trans-siberian trip for another occasion.

We're nearly within a month of the Olypmics here now so the pace is accelerating. Julia is busy at work, we have our spare room rented out, and I have an accreditation that removes the need for me to leave the country one last time. The new subways are nearly open and construction sites are racing to get their landscaping done and their walls down before the construction ban kicks in a few weeks from now. Should be interesting times ahead...

Friday, 27 June 2008

RSS Feed Change

Just a quick note to anyone (Steve) who may be reading the feed for this blog: I've decided to start using FeedBurner, mostly just to provide email subscription for people who don't know what RSS means but also because I'm curious. I've been told that many news aggregators don't follow redirects, so you may need to update your feeds to the new URL: http://feeds.feedburner.com/BlogDotFitzellDotCa

And for anyone who would rather receive an email when there are new posts, use this link: http://www.feedburner.com/fb/a/emailverifySubmit?feedId=2122389&loc=en_US

Friday, 20 June 2008

Bash: using the read command

While I normally use awk or sed to pull a piece of information I want out of a line of text, it doesn't work as well when you need multiple pieces of information. Well it works fine for displaying multiple pieces of information, but if you want them in variables to use later?

I once wrote a script that used declare to do the equivalent of this:
declare `w | head -1 | 
awk '{ print "DAYS=" $3 " " "USERS=" $6 }'`
# now do something with $DAYS and $USERS

Ewww... Now I know there's a better way: the "read" command. You could do something like this:
w | head -1 |
(read -a FIELDS
#do something with ${FIELDS[2]} and ${FIELDS[5]})

You can also do like so:
ls -l | tail -1 |
(read perms dunno user group \
size month date year file
echo "$user: $file")

You can even loop over all the lines of input. Let's take the /etc/passwd file as an example. Since that file uses a colon as a separator, we first need to set the IFS variable which determines what characters are used as field separators.
cat /etc/passwd | (IFS=:
while read user pass uid gid desc theRest; do
echo "$user: $desc"
done)

As pointed out here, this is also one way to deal with a file containing a list of filenames that may have spaces in them:
cat list | while read f; do
ls -l "$f"
done

Monday, 16 June 2008

Teenage Voting

I was reading an article on ChangeThis.com about the education system in the US and there was a quote that read:
Our educational system is the only major institution in our country that officially recognizes autocracy (in contrast to democracy) as its principle type of government.
I don't think that's correct. Rather, the education system is one of the few major institutions to deal essentially entirely with children; and children are dealt with pretty much universally as if they were living in an autocracy. That got me thinking about engaging teenagers in democracy. I wondered if there mightn't be some forward-looking European nation that included the under-18's somehow in the process.

The only case I can find is a BBC article stating the the Isle of Man has lowered their voting age to 16. This seems a reasonable enough action to me, despite the call by others (one example from a Maclean's article parodied here) that the age should be raised to 21 because "young people today have essentially tuned out". Yeah, preventing them from voting will really help them tune back in.

New York City apparently proposed a bill to lower the voting age to 16 and so have California and a number of other states, but as far as I can find, none have yet passed. The arguments in favour include: getting teenagers used to voting; that they pay sales and, often, income tax without any control over where the money goes; that they can be tried for crimes as an adult after 16 but can't affect the laws; that 18 is a bad age to start voting because students are heading off to college and have too much other stuff on their plates; and (most important to me) that they have more invested in the future than anyone else. I'm not even that old and I already have a slight trepidation at trusting "kids today" to cast a vote, but I'm still young enough to remember that I had perfectly valid and rational opinions in highschool.

I don't even know if you need to lower the voting age. The Californian bill initally proposed that "each 16- or 17-year-old's vote count as half an adult vote and each 14- and 15-year old's vote a quarter" (reference) but that was dropped before the bill was floored. Or what if, for example, everyone over 12 but under the voting age (whether it be 16 or 18) was invited to the polling stations and given a different ballot to cast. It would have the same choices but would only be advisory: the results would be reported, which would provide feedback to government, engage youth, and introduce them to the voting process. If you're concerned about children just voting randomly or following their parents (not that it really matters: adults do the same anyway) there could be a place on these ballots for written comments. They're informational anyway and what better way to get feedback from interested youth. I don't know... just a wild idea.

My favourite quote was in an article discussing a California bill to preregister 16- and 17-year-olds so they would automatically be ready to vote when they turn 18. A Republican assemblymam who was against the bill says:
The truth is, when you're young you tend to think like a liberal. As you get older and wiser … you tend to become more conservative.
Ha! So we shouldn't even help register young people to vote because they'll be liberals! The article goes on to say that Democrats killed legislation to require voters to show photo ID, and that Republicans killed legislation to allow citizens to register on voting day.

This makes me want to start my normal rant on party politics and career politicians, but I won't. In the end, though, the issue isn't so much specifically about youth. It's about politicians who have been elected by the current system being reluctant to change it. Whether the issue is proportional representation, holding polling days on weekends, or reducing the voting age (all of which could potentially increase voter turn out and the accurate reflection of their vote), the status quo seems just too tempting.

Bash: printing the alphabet

(Sorry for the geeky topic, non-geeky readers)

Most have probably run across the "seq" command that will let you generate a list of numbers:
$ seq 1 4
1
2
3
4
But you can do similar with "echo" for a list of letters:

$ echo {a..d}
a b c d
$ echo {a..d}{a..d}
aa ab ac ad ba bb bc bd ca cb cc cd da db dc dd

Wednesday, 11 June 2008

Think work sucks?

globeandmail.com: Think work sucks?
Actually, yes. Yes, I do.

Ok, let's be clear here: I like doing work but I don't really like the "traditional" work environment (an ironic term given the short length of time we've been working this way). Sarah forwarded me this article on ROWE (Results Only Work Environment) and all I can say is "Yes! Exactly! Has someone finally clued in?". Well, and also "Who came up with that name?". Maybe administrators love the name...

The idea is that you stop defining an employee's work in terms of hours in the office (or even hours worked, period) and start defining and measuring in terms of results. I've been lucky that most of my career so far has allowed me flexibility around the hours I work: a late morning here, a long day there, a banked day from working on the weekend, and so on. And I've always taken the attitude that, if I'm getting the job done, I don't need to feel too guilty if I spend a few minutes looking at a friend's photos while at work. But I've still always had to count hours because ultimately that's what I'm being paid for.

The difficulty with implementing a system like this, of course, is that it's easy to see if someone is sitting at their desk but much harder to determine whether they've achieved what you asked them to do. Plus you have to make sure your employees know what they're being asked to do. This may take more effort from managers to define tasks, set goals, and establish metrics. You might have to actually have those performance review sessions and dust off the 360 degree evaluation forms. But isn't this what managers are supposed to be doing anyway?

The end result is that there is just no excuse for not getting work done. As far as I can tell everyone wins, except possibly the guy in the back corner who hasn't done any actual work in 20 years. Maybe he gets motivated and actually finds himself happier? Maybe that's wishful thinking...

P.S. I don't think this ideas at the root of this are new or particularly insightful but if it's being adopted at all (and apparently Best Buy uses it) then that seems new.

P.P.S. What happens when employees start to feel like they're just being given a "harder" task than their co-workers?