Category Archives: Technology

Vancouver ISP Search

There’s a game you have to play if you want to want to pay a reasonable price for internet. Every 2 years you need to shop around for promotions and switch service providers (or at least threaten to). We’ve been lucky to avoid the game for the past 8 years with Novus, which offers affordable fibre connections but only serves dense condo developments. When we moved I got ready to play the Telus vs Shaw game.

Back in November, I started looking for Black Friday promotions and found Telus offering Internet 75 on sale for $50 (normally $70). I signed up and scheduled the installation for December 9. But that failed when the installer couldn’t get access to the telephone room in our building. After a game of broken telephone between Telus, myself, and the property manager, a second technician was sent out 10 days later. He ran into the same problems because the first tech hadn’t recorded the updated lock box instructions. Our installation date was pushed back until December 29. Upset about not having internet for Christmas and worried this frustrating cycle would never end, I searched for alternatives.

I found Freedom Home Internet, a repackaged Shaw offering with a simple router that could be self-installed. It was offering 150 Mbps speeds for $55 a month without any contract or price jumps after a year or two. It sounded too good to be true, especially right before Christmas. I was skeptical it would just work, but the woman at the Freedom store said I could bring it back within 2 weeks for a full refund. I took a chance knowing I could always go with Telus if it didn’t work out.

Turns out it was really easy to install. I just plugged the coax cable into the wall and powered it up. For 10 minutes a little yellow light blinked at me while it configured itself. I wasn’t sure it was working, but the the LED turned solid white and it was done. I had a fast internet connection without needing a technician to visit.

The wifi antennas on the router aren’t quite powerful enough to send signals to all the corners of our 3 story townhouse, so I spent a day tweaking settings and adding my old router as a 2nd access point upstairs. Now I’m really happy with the setup.

With Freedom Internet 150, I’ve been consistently seeing speeds of over 170 Mbps.

After 10 days on Freedom (via Shaw), I was sufficiently satisfied and convinced the download speeds were good. I cancelled the Telus appointment and closed the account. Telus was offering me a pretty sweet deal with $250 in account credits (details below), but it wasn’t worth the installation stress or frustration in 2 years when the price jumped.

Continue reading Vancouver ISP Search

Science vs Vegans


One of my favourite podcasts just did an episode on veganism, and its great. Science Vs tackled three questions:

  • Is going vegan better for the environment?
  • Do you need milk for strong bones?
  • If you don’t eat any meat at all, is it bad for you?

Listen here or wherever you get podcasts.

And if you liked that episode, check out:

Note: While the vegan episode shows that the science is firmly behind the diet, the same can’t be said for the other episodes above (sorry keto, detoxes, supplements, and even organic food). You might find your beliefs and lifestyle choices refuted by the science. That’s ok. Listen with an open mind, and challenge your own preconceived notions. Committing yourself to constantly learning and improving is probably the healthiest diet.

Faster Internet – Is Your Router Holding You Back?

Emily has been complaining about our slow internet for a while now. We’re not big bandwidth users but we’ve noticed laggy video calling. I’ve always shrugged it off as a problem on the other end. We were on the cheapest Novus internet plan, but 35 Mbps should be plenty fast enough for Skype or Google Hangouts.

So, we upgraded to Internet 75 but that didn’t make much of a difference. And then I did a speed test on our router, comparing the wireless speeds we were getting to speeds when connected with an ethernet cable. And our router sucks. Apparently wireless technology has advanced a lot in the past 20 years.

So we bought a new D-Link AC1900 DIR-878 router, and our wireless internet speeds are now 15x faster. Now when Baba and Gigi Skype they might be able to see Astrid and not just a pixilated avatar.

Baby Data Nerd

ProjectAstrid.jpg

It’s time to unveil Project ASTRID – Analytic System Tracking Rapid Infant Development.

I’ve been working on it for the past two months in my spare time. It’s a webapp hosted on Github Pages that visualizes some of the baby data we’ve been tracking. Originally, I just wanted to analyze Astrid’s sleeping patterns, but the website has morphed into a digital baby book with milestones and growth charts. I’m still adding features to it, but it’s polished enough that I’m happy to share it.

The chart below is probably the most interesting one I’ve created so far because it quantifies the quality of Astrid’s sleep. It shows her night sleeps, with the longest stretch in blue, the second longest in red, and the remainder in orange. Like all parents, our goal has been to get Astrid to sleep through the night. So that means getting as much blue as possible.

overnight_sleep.png

On October 7, after weeks of crappy sleeping, we started sleep training with Astrid. We didn’t realize it at the time, but there was a steady improvement over the next month. Then we hit sleep bliss. Astrid slept for 12 hour stretches every night for 3 weeks. We were living every parent’s dream. But last month, we hit the dreaded sleep regression. Luckily it only lasted 2 weeks (although it felt like it would never end at the time) and things have been better lately. We’re still waiting for those consistent 12-hour nights again, but she’s only waking up once a night right now, which seems very manageable.

Project ASTRID is open-source and adaptable for anyone else who might want to use it for their own child. Although realistically I know I’m probably the only one who likes having this much data about their baby. I just hope that one day our daughter appreciates the nerdy, data-heavy view of her early life, or at least isn’t completely embarrassed by it.

Getting to Legendary in Hearthstone

Hearthstone

Hearthstone is a curious game. It’s an online card game that has attracted a huge following of casual and competitive players. There are over 40 million world-wide players and the World Championships this weekend had a $1 million prize pool. The game is kind of like poker and chess combined, with a lot of strategy around trading pieces and a bit of luck with card draws and other random effects. I like it because the games only lasts 5-15 minutes and there is a lot of strategy and thinking involved. Most online games require fast reaction times, but Hearthstone is turn-based and you get 75 seconds each turn to plot your moves.

There are a few game modes, but the most popular is the ranked ladder. You start the game at Rank 25 and play against other players with the same rank. As you win games, your rank improves, lose games and your rank gets worse. The ultimate goal is to progress beyond Rank 1 to Legendary status. Every month the ranks reset. I’ve never gotten beyond Rank 5 and I had to play a lot of games to get that high.

Getting to Legend status is about consistently playing well (above 50% win rate) and grinding out a lot of games. How many? That depends on the deck win rate. I wrote a script (below) to simulate how many games it would take to reach Legendary depending on your win rate.

If you’re only winning  50% of your games you play, you can make it to Legendary but be prepared to play around 1440 games. With a 55% win rate, a pretty good result in competitive Hearthstone, it would take on average 483 games to reach Legendary status (at least 15 games a day). Even if you could consistently win 60% of the games you played, an impressive feat, it would take 287 games a month to reach Legendary. I thought I played a lot of Hearthstone, but I don’t have that kind of time.

hearthstone_legendary

Code:

import random
n_runs = 100000
stars_needed_from_25_to_legendary = 10+15+20+25+25
stars_above_which_no_bonus_is_awarded = stars_needed_from_25_to_legendary25
max_games = 20000
def stars_to_rank(stars):
ranks_gained = 0
if stars <= 10:
ranks_gained = stars / 2
elif stars <= 25:
ranks_gained = 5 + (stars10) / 3
elif stars <= 45:
ranks_gained = 10 + (stars25) / 4
else:
ranks_gained = 15 + (stars45) / 5
return 25 ranks_gained
for win_rate in range(100,49,1):
win_rate = win_rate / 100.0
n_legendary_runs = 0
n_total_games = 0
n_total_max_stars = 0
for runs in range(n_runs):
legendary = False
games_played = 0
won_last_game = False
won_second_last_game = False
stars = 0
max_stars = 0
while not legendary and games_played < max_games:
win = random.random() < win_rate
if win:
if won_last_game and won_second_last_game and stars < stars_above_which_no_bonus_is_awarded:
stars += 2
else:
stars += 1
else:
stars = max(0, stars 1)
max_stars = max(stars, max_stars)
legendary = stars >= stars_needed_from_25_to_legendary
won_second_last_game = won_last_game
won_last_game = win
games_played += 1
# print ("Win rate: {}, Games played: {}, stars: {}".format(win_rate, games_played, stars))
n_legendary_runs += legendary
n_total_games += games_played
n_total_max_stars += max_stars
print ("Win rate: {:.0%}, Most Stars: {}, Higest Rank: {}, Legendary chance: {}, Games played: {}".format(win_rate, n_total_max_stars / n_runs, stars_to_rank(n_total_max_stars / n_runs), float(n_legendary_runs) / n_runs, n_total_games / n_runs))

view raw
hs_legendary.py
hosted with ❤ by GitHub

Win rate: 100%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 61
Win rate: 99%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 62
Win rate: 98%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 63
Win rate: 97%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 65
Win rate: 96%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 66
Win rate: 95%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 68
Win rate: 94%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 70
Win rate: 93%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 71
Win rate: 92%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 73
Win rate: 91%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 75
Win rate: 90%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 77
Win rate: 89%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 79
Win rate: 88%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 82
Win rate: 87%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 84
Win rate: 86%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 87
Win rate: 85%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 89
Win rate: 84%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 92
Win rate: 83%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 95
Win rate: 82%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 98
Win rate: 81%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 101
Win rate: 80%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 105
Win rate: 79%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 108
Win rate: 78%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 112
Win rate: 77%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 117
Win rate: 76%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 121
Win rate: 75%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 126
Win rate: 74%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 131
Win rate: 73%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 137
Win rate: 72%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 142
Win rate: 71%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 149
Win rate: 70%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 156
Win rate: 69%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 164
Win rate: 68%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 172
Win rate: 67%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 182
Win rate: 66%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 192
Win rate: 65%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 203
Win rate: 64%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 216
Win rate: 63%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 231
Win rate: 62%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 247
Win rate: 61%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 266
Win rate: 60%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 287
Win rate: 59%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 313
Win rate: 58%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 344
Win rate: 57%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 379
Win rate: 56%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 426
Win rate: 55%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 483
Win rate: 54%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 560
Win rate: 53%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 663
Win rate: 52%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 813
Win rate: 51%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 1048
Win rate: 50%, Most Stars: 95, Higest Rank: 0, Legendary chance: 1.0, Games played: 1440

Powering Your Vehicle in Vancouver

Downtown Vancouver is home to 100,000 people and some of the most expensive real estate in Canada. And yet pretty soon there will only be a single gas station serving the entire area (the Chevron on Georgia is being sold to developers).

As Anne McMullin points out in the article linked above, “land in the city is too valuable to be saved for a single use”. Because gasoline is volatile, you can’t just slap a condo on top of a gas station.

gas_stations_vancouver
Map of gas stations (via GasBuddy)

However, you can put an electric vehicle charging station just about anywhere. Which is why there are over 50 charging stations in downtown Vancouver.

electric_vehcile_charing_stations_vancouver
Map of Electric Vehicle Charging Stations (via ChargeHub)

Roomba vs Hoover

Roomba and Hoover

The Roomba I bought 2 years ago is one of the best luxury purchases I’ve ever made. It does such a great job keeping our floors clean and picking up cat hair. But I was concerned with how much power it uses, so I plugged it into a power meter for a week.

Turns out, it uses hardly any energy. After a week of daily cleaning, it only used 0.65 kWh (which works out to less than $3/year). I plugged in our old Hoover and did some vacuuming for comparison, and it uses a lot more power. One hour of vacuuming with the Hoover used more energy than the Roomba did in a week. Although there’s no way I would be vacuuming for an hour a week, especially since we only have carpet in the bedrooms. I guess sweeping is still the most energy efficient option, but I’m more than happy to pay a few dollars a year in energy bills for the robot to do the sweeping and vacuuming for me.

Roomba 770 Hoover S1361
0.65 kWh per week 0.78 kwh per hour
28 W max demand 857 W max demand
$2.81/year ¹ $1.68/year ²

1. Using BC Hydro’s residential rate of 8.3 cents / kWh (which is very cheap)
2. Assuming 30 minutes of vacuuming a week.

Riddler Revisited

I’m taking a second crack at FiveThirtyEight’s Riddler problem. I thought I solved the problem two weeks ago, but my answer wasn’t quite right.

Here is this week’s problem:

There’s an airplane with 100 seats, and there are 100 ticketed passengers each with an assigned seat. They line up to board in some random order. However, the first person to board is the worst person alive, and just sits in a random seat, without even looking at his boarding pass. Each subsequent passenger sits in his or her own assigned seat if it’s empty, but sits in a random open seat if the assigned seat is occupied. What is the probability that you, the hundredth passenger to board, finds your seat unoccupied

I’m not even going to try and figure out the math for this puzzle. My statistics skills aren’t nearly strong enough. But my coding skills are. This is an easy problem to solve with a Monte Carlo simulation.

Here’s my python solution.

And the output charted.

nth_passengerThe last passenger has a 50% chance of getting their assigned seat.

passengers_in_assigned

The number of passengers who get their assigned seats is distributed around 95, with a 1% chance of everyone getting their assigned seat (in the event the first passenger randomly chooses his/her own seat).

Interestingly, it doesn’t matter how many seats are on the plane. If there are 10 or 200 seats, the last passenger still has a 50% chance of getting their assigned seat. The second last passenger has  67% chance, and the 3rd last passenger has a 75% chance.

It’s easy to derive the equation for the Xth last passenger from this, even though I can’t figure out the math to prove it. The Xth last passenger has a X/X+1 chance of getting their assigned seat. So the 5th last passenger, has a 5/6 = 83.3% chance of getting their seat.

Math Problems

einstein_math
I’ve noticed a few Grade 6 math problems on Facebook that I’m sure Einstein would be embarrassed to see his picture on. I’m not sure which is sadder, that people consider a problem given to 11-year olds genius-level, or that only 50% of adults got the answer right.

I’m much more interested in the problems that FiveThirtyEight has been posting for their Riddler series. This week the problem involves cars getting stuck in traffic. Thankfully, not something I normally have to deal with, but I think I figured out the answer.

The Problem:

There is a very long, straight highway with some number of cars (N) placed somewhere along it, randomly. The highway is only one lane, so the cars can’t pass each other. Each car is going in the same direction, and each driver has a distinct positive speed at which she prefers to travel. Each preferred speed is chosen at random. Each driver travels at her preferred speed unless she gets stuck behind a slower car, in which case she remains stuck behind the slower car. On average, how many groups of cars will eventually form? (A group is one or more cars travelling at the same speed.)

My solution:

f(N) <- average number of car groups if there are N cars
f(0) = 0
f(1) = 1

If we have 2 cars there is 50% chance of the first car being faster, which would create 2 groups; and 50% chance of the 2nd car being faster and merging into a single group.
f(2) = 0.5 * 2 + 0.5 * 1 = 1.5

More generally, if we just consider the first 2 cars. There’s a 50% chance of there being a solo lead car plus the groups that form behind it, and a 50% chance of the first car merging into the group behind it. We can define the average number of cars recursively, where:
f(N) = 0.5 * (1 + f(N-1)) + 0.5 * f(N-1)

that equation reduces to:
f(N) = 0.5 + f(N-1)

testing it out:
f(2) = 0.5 + f(1) = 1.5
f(3) = 0.5 + f(2) = 2
f(4) = 0.5 + f(3) = 2.5

Which is an arithmetic series that can be reduced to:
f(N) = 0.5 + 0.5 * N

or more succinctly:
f(N) = 0.5 * (N + 1) (for N >= 1)
f(N) = 0 (for N < 1)

Loving the Cloud Money

ntrust-deals
One of my favourite tech discoveries this year has been nTrust – a mobile payment app made by a local Vancouver startup. I’ve been using it to transfer money between friends (like Interac e-transfers but without any fees) and purchase lunch from local food carts.

They’ve been pushing hard to increase their user base and running a lot of lucrative promotions. If you sign up using referral code ‘chr597’ you get $10 for free. They’ve also been running deals with cloud money discounts at my favourite food carts – Arturo’s and Culver City Salads. Nothing like a free lunch.

I’ve been using their app a lot and they asked if they could feature me on their blog. The post went up today – Keep on (taco) truckin’. Somehow I mislead them into believing I was a born in Vancouver, but other than that I’m happy with how it turned out.