Accidentally in Code

Archive for the ‘Reflections’ Category

There are many things that make it difficult to move to another country. Finding somewhere to live and dealing with not having a credit rating any more are two that spring to mind. Ikea is another. Then there are smaller, but still annoying things – like the fact that your DVDs won’t play on your DVD player.

There are many things I miss about living in the UK. My friends, family, and Smart car of course spring to mind. At this time of year, the more temperate climate is a big one.

There are good things too – it’s a challenge! Meeting new people. I get a big kick about how people dig my accent – a double, because they like the English-English one and the French-French one. Change of scenary. Nicer summers. Beautiful fall. Different attitude. Different lifestyle. Great Asian food. All in all, these outweigh the things I miss.

Sometimes though, I get a little homesick. The first time it happened my roommate (who later went completely bonkers, but that’s a whole other story) came home to find me in tears because I couldn’t order pizza – I’d called the two big international pizza companies and after much kerfuffle with them not understanding my accent/not knowing where I lived because I lived in a new building/me not knowing where I lived in relation to wherever they were talking about, I’d given up.

My roommates and I would celebrate/commiserate/relax with pizza and a girly movie. Any movie in that period you’d be ashamed to rent from Blockbuster, I’ve probably seen. And liked. We also watched a whole lot of Charmed. So whenever I’m feeling a little overwhelmed or run down, I want to kick back with my roommates and a double-decker with extra cheese, bacon and chicken and BBQ sauce. But I don’t have roommates, I have a boyfriend who loathes these kind of movies and we don’t order pizza, because Greek food is healthier.

Finding new habits, rituals, is hard when you’re starting from scratch. Finding people you can turn to when you’re having a bad day who’ll listen, and sympathize, or just watch a terrible movie is hard, and I know I feel like I don’t want to impose. But little by little, I’m building a life here. It’s scary, and it’s stressful, and it’s hard… but the adventure is worth it.

This was discussed at the WECS meeting this week, there’s a new attention to it as the number of women enrolled in undergraduate programs from a high of 20% to 17%. See the full report here. Recommendations are as follows:

  1. Raise the profile and improve the image of the profession.
  2. Explore how engineering curriculum and its delivery could, without compromising the high standards of the Canadian system, become more attractive to a greater diversity of students.
  3. Demonstrate the value of diversity in engineering education and in the workplace.
  4. Help better prepare female engineers for the workforce.
  5. Promote information-sharing on mentorship programs and the importance that mentors have in the attraction and retention of women in engineering.
  6. Work with industry on methods to help improve the retention of female engineers in the workforce and diversity in general.

I’m particularly interested in 1, 2 and 4.

1. This makes me wonder, is the lack of women self-perpetuating? Few women go into it so few are inclined to? Why is biology succeeding to attract women, where engineering fails?

2. Most beginner programming courses I’ve seen fail to engage. One thing I see regularly is having a solution (what you want to teach) and trying to twist a problem to fit it. Finding the right problem makes the solution seem much more intuitive. Also, making stuff that has no bearing on the real world. That’s a big one. Innovative curriculum designed for engagement could go a long way, I think. In Computer Science, particularly teaching Java, there’s no excuse not to do this. There are so many free and open source teaching tools out there.

4. It’s tough to work in a predominantly male environment. I’ve done it – the only other girl was the secretary. As nice as the boys were, it can be difficult. I’m hoping WISE can put together a workshop for this.

Let me know what you think, and how WISE could help!

I don’t know what to think anymore. Too much information from all sides, some positive, some not so much. Today in the space of 10 minutes I came across these two things, one positive for equality – the other, not so much (although the video is charming).

Positive – Marcus Buckingham writing in the HuffPost – men are becoming more like women, with the work-life balance stresses that go with that.

Not so much – KIRTSY Takes a Bow.


There are two things that are almost guaranteed to bring out the giant ***** in me. One is people who accost me in the street trying to convert me to one religion or another (it’s amazing none of them have punched me for suggesting they’re mentally ill). The other thing is sales calls.

I think this allows me to be nice to almost everyone else, even when they’re being annoying.

Anyway, this morning I got a call from the Ottawa Sun, asking if I wanted a trial of the newspaper for as little as $0.20 a day. I said,

My boyfriend and I are 24 and 28. I don’t think either of us has ever bought a newspaper, apart from The Economist. We get all of our news online. So I don’t think we’re really your target market

This guy he took it really well, laughed and complimented me, and told me his kids were the same way.

I was talking to Treena the other day about her start-up, Betidings. She observed that the people who had really “got it” were my generation.

Now, it seems obvious. People used to hear about events in the paper (perhaps some people still do). However, I don’t know anyone who reads a paper – I’m the exception, and I only read the Economist! We get our news from various sources online, and hear about events from our friends or via Facebook or Twitter. But you can’t export Facebook events to your calendar and Facebook doesn’t really display them that helpfully either. The thing about Twitter is that in order to hear about events someone is going to you have to be tuning in to everything they’re saying, and even then you may only hear about it on the day (when it’s too late to get tickets). Betidings means you can just tune into their calendar. That’s kinda awesome.

I think newspapers will die, but I also think that presents an opportunity to those willing to look for them. Betidings is one such example. Do you have another?

Check out what events I’m going to through my Betidings calendar.

After I gave my presentation the other week, someone asked a question. It was:

So, basically what you’re doing is data-mining?

And I said, no, well yes, but that’s not how I think about it. I see it as creating something that will help people understand their use of Twitter. The fact that I achieve this by data mining is by-the-by.

Maybe when we speak to other programmers it’s OK to say something like, “I’m data-mining social graphs in Twitter and visualizing them” but when we speak to our users, that may not mean very much to them. What’s more, I don’t think I would have come up the idea to do that if I’d gone to Twitter with the intention of data-mining. This didn’t come from me as a programmer with an interest in data-mining, or an interest in visualization (as an aside, I took a course in visualization at Edinburgh and hated it. Mostly because we were coding in Tcl). It came from me as a Twitter user, wanting a better way to measure engagement than followers/following.

Yesterday, I wrote a little bit about the journey that brought me to Ottawa. I think I’ve finally realized what I’m passionate about. It’s people. It’s users. This is why I’m so fascinated about what I’m working on right now – what’s more people than social networking? It’s also why I’m so interested in Usability. I’ve read every article on Don Norman’s website, I find usability so interesting, so important.

I’m passionate about giving users what they want – that’s usability, better ways to display data, etc. That’s creating the things they say they want.

Even more so, though, I’m passionate about giving user what they want, that they don’t realize they want yet. In small ways, that’s telling people who are emailing spreadsheets about Google Docs, or explaining to someone frustrated by their web designer about the simplicity and ease of use of WordPress. In bigger ways, it’s been taking a mess of spreadsheets and turning it into a database that can answer questions that users hadn’t even thought to ask. It’s been creating something that’s can make you really aware of your conversational network, and encourage you to talk to new people (the most rewarding feedback I got was from someone who told me they were now making an effort to speak to more people after seeing their graph). I hope these things are just the beginning.

So, what do I want to be when I grow up? I want to be a programmer who speaks fluent human. How about you?

I’d never heard of Don Dodge until about a week ago, until he was one of the people laid off in Microsoft’s latest round of layoffs. He took it with great class, you can read the blogpost here.

I didn’t subscribe to his blog before, but his blogpost about his departure went viral on Twitter. A week later, the fact that Google has hired him went viral as well.

First off, well done him – on the new job and on handling the transition with grace. In his exit interview with TechCrunch he refused to say anything bad about Microsoft. Right the end, all he said was, “I was just surprised… I don’t… y’know, when I’m emperor I won’t do it that way”.

Second – this is a great example of blogging being good for your career. Working at Microsoft might have contributed to his personal brand, but when he left he took his personal brand with him. Handling it with class, built his personal brand up more. Now, a week later, he takes his personal brand to Microsoft’s nemesis – Google.

Talk about the best revenge being a life well lived!

I read a lot about how companies worry about their staff using Social Media. Microsoft was rare in that it allowed it’s employees to blog and identify themselves as working for Microsoft. It’s dawning on me that companies are going to have a new problem – when they lay off someone and that person announces it on their blog (what better way to let your contacts know you’re in the market for a new job?) they will have to deal with the fallout from that as well. That person could be bitter, and justifiably so, but maybe if they say no more than,

However, laying off 5,000 people when you have $37B in cash and huge profits is not cool.

… that might be worse.

So far this is the best new name I have for my blog. I’m still brainstorming, but this is a story I want to tell and now is as good a time as any.

I wrote, a while ago, about how I don’t have Imposter Syndrome any more. Perhaps it would have been better to say, I mostly don’t have impostor syndrome. Sometimes I don’t feel geeky enough. I don’t subscribe to xkcd (although I do appreciate the ones that I see), and I’ve never watched Star Wars or Star Trek, don’t understand the distinction, and I’m not particularly interested to either. I don’t drink Red Bull and stay up all night coding.

The nerdiest thing I ever did was get fed up with Windows when I was 16 and wiped it off my hard-drive, replacing it with RedHat. Only I was at boarding school, with no internet connection, and couldn’t download all the necessary drivers. So my dad took it in to PC World, they fixed it, and I put up with Windows until I eventually got my first Mac nearly 3 years later.

I learned HTML at 13 or 14, but didn’t learn to code until I was 16 (when I learned C in school). Then I went to University to study Chemistry, I wasn’t sure exactly what I wanted to do but I liked making stuff go fizz and occasionally burst into flames. My DOS (director of studies) put me in Computer Science as an elective, and I took the mandatory math course.

Part way through my first semester, I went to him and said “I hate Computer Science”. I was frustrated by being taught programming through slides, not doing (I still don’t think this works well, especially not for beginners), and weirded out by all the boys who didn’t seem to wash regularly. I was also completely mystified by “Object Orientated Programming”, having learned procedurally. I could explain it beautifully, but the concept just made no sense to me. I remember a professor commenting in my third year that Computer Science had changed because you couldn’t expect everyone coming in to have taught themselves a good chunk of what they needed to know anymore – because there were non-geeks. Non-geeks like me.

My DOS bribed me to stay in CS for another semester, promising he’d get me into Economics the following year. Anyway, it turned out Chemistry didn’t have enough explosions for me and I ended up still in CS, and Economic History rather than Economics (another story altogether, and not such a happy one… Economic History is all the boring bits of History and all the non-math-sy bits of Economics. It’s very dull). I guess at some point I started to like it, and then to love it. I wrapped my head around OO, discovered Recursion and Functional Programming (which I really liked) and met people who, if rather more nerdy than me, were at least clean. I interned at a wonderful company which gave me so much more confidence in terms of my ability, and I graduated with a good 2:1.

I wanted to be a programmer, but I wasn’t sure where, or what kind, and I wasn’t yet ready to settle down, wasn’t sure if I wanted to go to grad school or not, so I took off. I worked in the US, trained in martial arts in China, hung out in Europe for a while, qualified as a ski instructor in Canada, worked for a bit in the UK and then went back to the US to work, ended up here in Canada at uOttawa. I’d realized I wanted to know more stuff and as only banks seemed to be hiring (oh, the irony!) it was a good time to go back to school.

In the US I worked as a programming instructor, and after the second summer they recruited me to develop the programming curriculum. It also lead to the opportunity to work in China, last summer. In the UK, I worked to transform the zillions of spreadsheets a department was using to organize themselves into a database, that was easier to update and maintain and easier to extract information out of.

The job in the UK really hit it home to me how we as programmers often don’t really understand how “normal people” use computers, which ultimately means that we don’t always know who our users are. People who don’t realize what a little know-how can do, and how if you represent your data the right way it can be a goldmine of information, with little effort. It’s now something that I try to consider, and it influences my research and general attitude to users.

I read this article the other day – don’t let your strengths become weaknesses. It’s fascinating, because it explores this idea of how your weaknesses have corresponding strengths. So if my weaknesses that I’ve been talking about here are:

  • Lack of confidence
  • Not feeling enough of a geek

My corresponding strength are:

  • Lack of confidence -> Patience as an instructor: I remember what it’s like to be confused so it’s easier for me to be patient when my students get confused. When they make an endless loop, I find it funny rather than frustrating.
  • Not feeling enough of a geek -> empathy with end users, and a better understanding of people for whom computers are a facilitator, not the be-all-and-end-all, or even the most important thing. An interest in how computers can be useful to regular users, rather than just technologically or programmatically more advanced.

So an accident? Yes! A happy one? Yes! And if I don’t always quite feel like I belong, that’s not necessarily a bad thing – it can lead to other opportunities.

Last week, and at the start of this week I was feeling really worn out and disillusioned. Things were taking longer than they should, and despite working a lot and effectively I really wasn’t making the progress I wanted to be. I felt like I wasn’t achieving anything. What this really means, is that on Monday I worked from around 8 in the morning to 11pm at night (- perhaps 2 hours) and yet didn’t cross anything off The List. Tuesday I started a little later, but ultimately didn’t cross anything off the list either. Or Wednesday.

I feel this real need to make progress, achieve something concrete, day in, day out. I’m aware that as a grad student there’s a risk of ending up at this place where you show up but nothing concrete happens, and this continues until you’ve been there for several years and people joke about whether you’re ever going to graduate.

I don’t want to be that person.

My far off goal, is finishing my thesis. It’s impossibly far away, and too large to conceptualize, so I have to break it into smaller, manageable tasks that mean I’ll make it, in increments. Like reading a paper a day. Coding a new visualization. Writing up all the papers I’ve read that are covered in notes into my work-in-progress. But then sometimes I end up spending a week on stuff that doesn’t help achieve these goals – like marking, or a ridiculously large assignment for the course I have to take. And then at the end of the week I look back and think, well I worked really hard, and I got this done, but in a months time (or even just another week) will anyone care? Will I care?

It’s frustrating. And so every day, I set myself an unrealistic list of tasks. If something (for example, the presentation we made this week) takes longer than expected and I don’t achieve them, the following day’s list is even more unmanageable. And it continues. This is why the “Week in Brief” and my “Goals” list are so helpful, because when I’m trying to do 10+ high level tasks in a week I have to give myself a reality check and admit, that’s never going to happen.

Setting goals that push me but don’t overwhelm me is something I’m working on. Because when I’m overwhelmed I’m not effective, I’m just overwhelmed. I’m not getting stuff done, I’m not motivated, I’m contemplating hiding from the world and wondering if everything would be OK if there were just 30 hours in the day. Panicking because I think I’ve missed an important appointment when I’ve in fact just misread my calendar.

The irony here? After all that stressing at the start of the week, there’s a chance I might just cross everything off the list this week.

Lesson? Start big tasks at the start of the week. Postpone smaller ones to the end of the week. Achieving large tasks motivates and inspires me to achieve the smaller ones. Vice versa does not work so well. Spend more time doing and less time scheduling.

Like pretty much every software engineer, Google is probably my dream job. One of my good friends works at Google, and he loves it. The Googleplex (in London) was amazing when he took me around it. Let’s admit it – there’s something about the wacky creativity, the changing of the Google logo for Sesame St. etc combined with the cutting edge technology (Wave? Google Voice?) that catches our attention.

So I was interested to see this list of interview questions in the Guardian. My first thought – arrgh I have no idea how to answer these. But with the help of Google itself, maybe I can have a go. At the end of it, a lot of them that seemed intimidating just rely on estimating and justifying your reasoning. That’s not so hard, but I still don’t get the one about the pirates…

Why are manhole covers round?

I had some idea about this one – round covers can’t fall through the hole itself, and don’t need to be rotated to be put back (important when they’re heavy, which obviously they need to be because cars drive on them). Wikipedia has a whole host of other answers though! See here.

You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?

This question is nuts. The real kicker is (I think) that it’s hard to conceptualize how small you are. From money.cnn, these responses

  1. Use the measurement marks to climb out
  2. Try to unscrew the glass
  3. Risk riding out the air current

How much should you charge to wash all the windows in Seattle?

number of hours spent cleaning = (estimate of number of buildings x estimate of number of windows per building) / estimate of number of windows per hour

what you should charge = number of hours spent cleaning x hourly rate

Explain a database in three sentences to your eight-year-old nephew.

A database is like a super-organized folder of “records” and each “record” is standardized in terms of what information is where, so that it’s really easy to find what we’re looking for. So for people, we might organize records by name, and in each record we’d want information like their first name, middle name, last name, birthday, etc. We can even link to other records, for example by having a place in the record for a list of their friends.

In a country in which people only want boys, every family continues to have children until they have a boy. If they have a girl, they have another child. If they have a boy, they stop. What is the proportion of boys to girls in the country?

Assume a 50/50 chance of having a boy or a girl.

50% of families will have a boy the first time, and stop right away.

50% will have a girl, of this 50%, half (so 25% of the total) will have a boy the second time, and stop. And so on.

So if there are N families, there will be N boys.

For girls, there will be the sum of (N/2) + (N/4) + (N/8) + … – the theoretical maximum of this is N. So it will be a little under 1:1.

Counter intuitive, huh? More detailed answer here.

If you look at a clock and the time is 3.15, what is the angle between the hour and the minute hands? (The answer is not zero!)

360 = number of degrees in the whole clock

12 = the number of hours

4 = the number of 15 minutes in each hour

360/(12*4) = 7.5 degrees

How many piano tuners are there in the entire world?

This is an approximation question, requiring various assumptions. First, how many piano tuners are there in the population in the US? Say A per B (this will be thousands) of people. Then consider the population of the US (P) to come up with a number in the US. Then, given that people in less developed countries probably don’t have as many pianos, what proportion of the world’s piano tuners likely exist in the US? Say 1/D.

Estimate: A x (P/B) x D

Four people need to cross a rickety rope bridge to get back to their camp at night. Unfortunately, they only have one flashlight and it only has enough light left for 17 minutes. The bridge is too dangerous to cross without a flashlight, and it’s only strong enough to support two people at any given time. Each of the campers walks at a different speed. One can cross the bridge in one minute, another in two, the third in five, and the slow poke takes 10 to cross. How do the campers make it across in 17 minutes?

Key points: they have to cross the bridge in 2’s and someone has to keep going back with the flashlight. So first idea is to have them go across and use the fastest person to go back

Time = 0: 1 min and 10min go across together

Time = 10: 1 min goes back

Time = 11: 1 min and 5 min go over

Time = 16: 1 min goes back

Time = 17: flash light is out, 1 min and 2 min are stranded.

Hmm… must be smarter. Perhaps if we just say that the flashlight must be on the bridge whilst they are moving?

Time = 0: 1 min and 5 min set off (5 min has flash light)

Time = 1: 1 min makes it across, 2 min sets off

Time = 3: 2 min arrives

(note to stay close to the light, this can happen any time up to time = 5 – the point is that 1 min and 2 min cross whilst 5 min is crossing)

Time = 5: 5 min arrives, 1 min goes back with flashlight

Time = 6: 1 min arrives back, leaves with 10 min

Time = 16: 1 min and 10 min arrive.

Feel like this is cheating, so I looked up here. If you have the two slowest people cross together, then the 2nd slowest is never a limiting factor. So I can refine my first idea:

Time = 0: 1 min and 2 min go over

Time = 2: Arrive, 2 min goes back

Time = 4: 5 min and 10 min leave together

Time = 14: 5 min and 10 min arrive, 1 min goes back

Time = 15: 1 min arrives, departs with 2 min

Time = 17: Everyone is across, flashlight runs out.

I’ve heard this question before, I feel stupid for not getting it sooner now!! I guess it’s supposed to make you think about whether the fastest solution (1 min) is always the best to use – in this case, not, because it means sending over the two slow guys separately.

How many golf balls can fit in a school bus?

This can be oversimplifies by treating the balls as cubes and estimating how many fit width-wise (W), height-wise (H) and depth-wise (D) and saying total = W x H x D.

This is less than will actually fit though, because of them actually being spherical so it would be possible to arrange the balls to take better advantage of that space.

You’re the captain of a pirate ship, and your crew gets to vote on how the gold is divided up. If fewer than half of the pirates agree with you, you die. How do you recommend apportioning the gold in such a way that you get a good share of the booty, but still survive?

Egalitarian views get in the way here, and I just want to split it up equally…

Then I think about findings in Stumbling on Happiness (Amazon) and think that as long as the other pirates believe I deserve it (I’ve “won” it) they’ll be OK with me having it.

This thinking is really clouded by the thought that it would be horrible to be killed by a bunch of pirates, though.

The Times has an answer, but I’m not sure it’s optimal…

This week I’ve spent a lot of time debugging other people’s code, and we had some fun bugs in class too. This was my favorite bug (I refused to fix it, but she worked out how). I’ve helped people in C, VB, and Maple – none of which are my favorite languages (I didn’t know Maple at all), and don’t have the great debugging capabilities of Java in Eclipse. As a result, I’ve come up with some tips for beginner programmers as a result of the common errors I’ve seen.

  1. Don’t take your code not running personally. Your code (or your instructor) is not out to get you! Debugging requires calm and rational thinking, the more you get upset that your code isn’t working, the less able you’ll be to fix it.
  2. Google is your friend. Lots of people learning to code have had the exact same problems you’ve had, if you can search you’ll often find potential solutions (just be careful – they may not be good, or exactly what you’re looking for). Online is also where you may be able to find that function you need.
  3. Read error messages. I’m losing track of the number of times that someone calls me over to look at a program, shows me how a compilation error pops up and then hits enter before I can read it. Read the error messages! Even if you can’t fix them yet, once you’ve learned what they mean you’ll know what to look for and be better able to fix them in the future.
  4. What are you declaring and why? Think about your variables – what to you need? What do they do? The type of the variable (String/Integer/Boolean etc) is important.
  5. Frame your problem in terms of behavior. If someone frames their problem well, I know exactly what kind of bug I’m looking for. Explain it briefly, then let me look at the code.
  6. Print statements! So useful to see what’s going on inside in the code. Don’t be afraid to use them – you can always delete them later.
  7. Small things can cause big problems. My friend spent hours trying to fix something in her code yesterday – the problem? She was using assignment equals (=) rather than logical equals (==) in an if statement (you can do this in C). Small distinctions can be really important – pay attention to them.
  8. Turn the monitor off. A blank text-editor filling your screen can distract you from the problem itself. Writing code should be the last step in solving the problem – not the first. Turn off the monitor, think about the problem, and break it down into it’s component parts. Then code it in the parts (but don’t be afraid to break them down again if necessary).
  9. The computer will do exactly what you tell it to do, in exactly the order you tell it. A lot of people forget this, but it’s so important. When the computer is not behaving the way you want it to, reflect on this. It’s important to be clear on what you want to happen first, or what you want to repeat (or don’t want to repeat) in a loop, for example.
  10. If you’re lucky enough to have a TA or friend willing to help you – take advantage of that!

Anything I’ve missed? Let me know!