Monday, February 02, 2015

A Mind For Numbers

One of my ongoing personal projects is discovering good techniques and tools for teaching math, science, and a problem-solving mindset to our two elementary school-aged kids. To that end, I recently read Dr. Barbara Oakley's excellent book: "A Mind for Mathematics: How to Excel at Math and Science (Even If You Flunked Algebra)."
Dr. Oakley's own story is inspiring. She transformed herself from a math-phobe into a professor of engineering. This book is not your usual anecdotal self-help book. While the tone and writing are very casual, the material is completely scientific. All the information is based on the latest brain research, and the book includes a comprehensive bibliography.

I did not need to read the underlying psychology and brain research papers to see the truth of what Dr. Oakley wrote. I found myself reflecting on my own successes and failures in learning. I’ve always considered myself naturally talented at math. I ended up with a BS in Mathematics. However, there were a few mathematical subjects that confounded me, most notably Linear Algebra. In retrospect, I saw that I lost the thread of understanding on Linear Algebra right from the start. After those early frustrations I established a fixed mindset and convinced myself that I just wasn’t any good at “matrix math.” In graduate school I worked very hard to pass a Numerical Methods qualifying exam. Numerical Methods makes extensive use of Linear Algebra. However, I was doomed by my lack of understanding of the underlying theory. As hard as I worked at memorizing and mastering techniques for solving the problems, I was helpless to apply those techniques to new or even slightly different problems. I needed to start from scratch and build up, but by then it was too late. Only now, many years later, can I see my mistakes.

Dr. Oakley’s book inspired me to apply her techniques to learning something new. I'm working on learning a new programming language (Python) and a new subject (Machine Learning). I recently finished Andrew Ng's Machine Learning course on Coursera. Now I’ve decided to master Linear Algebra, which is key to gaining a deeper understanding of Machine Learning (ML).

While waiting for my Linear Algebra course to begin, I enrolled in Dr. Oakley's Coursera course Learning to Learn. The class covers the same material as her book, but takes time to expand many of the concepts. Dr. Oakley’s book should be required reading for anyone with a brain. I plan on having both of my kids read this book some time during middle school. You can find my book review on Good Reads.

Friday, January 02, 2015


I have recently discovered Coursera. They offer hundreds of online courses in a wide range of subjects. Most courses are roughly equivalent to an semester-long undergraduate level course. Some are easier and some are equivalent to graduate-level coursework. 

I got started with Andrew Ng's Machine Learning (ML) course. I have been curious about machine learning, but a little biased against the field based on my limited knowledge of Artificial Intelligence (AI). My impression (and that of many others) has been that AI has long over-promised and under-delivered. However, recent advances in ML and its use in analyzing big data sets made its potential impossible to ignore.

When I started the course, I did not know that Professor Ng had helped found Coursera. Nor did I realize the extent of his influence in the field of machine learning. Learning these facts gave added weight to his personal anecdotes about applying machine learning techniques. When Prof. Ng includes advice on how to approach ML problems, perk up your ears! 

My enthusiasm almost got the better of me. I started auditing the Control of Mobile Robotics course and was getting ready to try Sports and Building Aerodynamics. Then the homework in the ML course started in earnest. So I used self control and decided to focus on one class a at a time.

The course was a good challenge and I enjoyed it immensely. My programming OCD kicked in and I finishing the course with a 100%. The extra credit programming assignment more than made up for the few points I missed on the quizzes.

I put my Caltrain commute to good use, watching the lectures and working the assignments. Noise cancelling headphones help to make hearing and understanding the lectures easier, by cutting out background noise. I would download that week's lectures to the iPad and work my way through them in 2-3 days of train commuting. 

I'm already onto my next course Learning to Learn taught by Dr Barbara Oakley.

Saturday, April 30, 2011

Bike to Work Month 2011

May is here again, that means bike to work month and bike to work day, May 12th.

For the last two years I have participated in the Bay Area Bicycle Coalition's Team Bike Challenge, a friendly contest to see what teams and companies can log the most bike commutes. In 2010 I challenged myself to bike to work for every commute and did it. This year I'm planning repeat that, with the added challenge of getting 1000+ ft of climbing each day. On average at least, because some routes don't have any hills. 

Blekko is going to be well represented in the company competition (Blekko Team Standings), with almost 50% of the employees planning to participate. I think we have a good shot at placing in the small company (less than 50 employees) competition.

Last year Blekko was co-winner of Strava's own bike to work challenge taking the distance per member competition (admittedly skewed by only having two team members: Bob and me). The overall winners were our "nemesis" Google's SF2G (San Francisco to Google) club.

The Team Bike Challenge played a big part in converting me from a casual cyclist, who sometimes biked to work, into a die-hard cycle commuter. I avoid driving if at all possible. I have purchased lights for my bike (a big shout out to Light & Motion bike lights, great products) so I can commute in the dark winter months. I upgraded to an Ergon backpack to haul clothes to and from work in comfort. I have been experimenting with various waterproof shoe covers and fenders in an effort to ride even on the wettest of days. Why? because I like it, it's a habit, and I just feel better on the days that I ride. The Team Bike Challenge made this possible because, in the interest of competition, I pushed myself to bike commute more than I might have otherwise. Creating a habit that will last a lifetime.

Friday, May 29, 2009

Bike To Work Month

May is Bike to Work month, with May 14th being Bike to Work Day.

The local Bay Area Bicycle Coalition ran a bike to work challenge. Whereby local companies signed up teams of bike commuters, who accumulated points for every day they bike commute in May. I signed up Blekko and drafted 4 other coworkers to complete the team roster.

Blekko did alright in the standings, despite most of the team having a 24+ mile one-way commute! Where we really did well was total miles bike, over 1240, of which 498 were mine. Sadly miles have no impact on final score, or else we would have been 3rd in San Mateo County.

Here are some observations from a month of bike commuting:

  1. Fewer trips by car means fewer visits to the gas station.
  2. I keep leaving the house withoug my car keys, several "doh!" moments this month.
  3. Eating more and sill losing weight is very cool.
  4. Great training for the Death Ride in July.
  5. Redwood Shores has the worst stop light sensors. Almost none detect bikes.
  6. I am super impressed by Krishna, still very new to cycling, who rode to work from the East Bay across the Dumbarton bridge. Dude!
  7. Clearly the way to win the Bike Commute Challenge is to have lots of "Novice" riders (scoring maximum points), have multiple teams (for the company stadings), and bike every day. :)
It has been a great month of biking, and the experience has established the habit of biking to work for the rest of the summer.

Friday, December 12, 2008

Date with Death

In a fit of madness, I've signed up for the 2009 Tour of the California Alpes, AKA the Death Ride. I've also enlisted biking partners Keith and Bob to join me on this mad quest.

The Death Ride is a 129 mile, 15k feet of climbing, monster of a ride. This is as hard, if not harder, than any single Tour de France mountain stage. Total madness.

Registration was a disaster. They opened registration at 10am on Dec 11. At 9:45 the registration site was already returning Java server errors and "too busy" pages. It took 30 minutes of the three of us clicking reload to get though. No Linux browser support apparently.

Today I spent some time doing research on the route. The 2009 route has about 56 miles of climbing, 52 miles of descents, and 19 miles of "flats." I figure if we can average 8mph on the climbs, 18mph on the flats, and 25mph on the descents, and with about 50 minutes of stops that is 11 hours total. Ouch. Those averages are aggressive, but doable. Faster would be better of course, fewer hours in the saddle. The best way to make up time is climb faster. Simple eh? :)

I'm using the Motion Based site to research previous years routes. Good for looking at the ride profile, speed on the climbs and descents.

Needless to say, training is going to be tough. I'll need to loose some weight, work on endurance, and most importantly get my climbing legs. I'm looking forward to it.

Wednesday, July 16, 2008

Oh Deer!

On July 5th I hit a deer, a baby deer to be precise, while out riding in the Los Altos Hills. It would as my (un)luck would have it, happen at the fasted point of my ride. I was traveling at 36mph at the time as the ride data from my Garmin 305 can attest.

Below is the Google street view of the accident scene:

View Larger Map

The deer ran out from behind the tree on the left. I had little time to react, I only managed to swerve left and clip it in the rear. the impact from the handlebars broke my scaphoid bone in my wrist and the subsequent impact with the pavement cracked the radius head in my elbow. I rolled over my left side, over my head, destroying my helmet, and then managed to land on my feet facing up the hill. I managed to run backwards and avoid falling down again. Really wish I have video.

The cast stays on for another 3 weeks, then a removable splint.

Thursday, June 05, 2008

Laguna Seca June 4, 2008

I attended another BMWCCA driving school, this time mid-week at Laguna Seca. The A/B group (I got promoted back to the A group, yeah!) was uncrowded and I had many traffic free laps.

Just prior to this event I switched to more narrow tires. From 255s front and 275s rear, to 235 s front and 255s rear. The numbers are the approximate width of the tire in millimeters. That translates to about an 0.8 inches of rubber per corner. I did this because the larger tires were rubbing against the wheel wells and suspension under heavy cornering. While I was quite happy with the setup, the overall stress of monitoring the wheels during events was annoying.

The smaller tires had me running almost 4 seconds slower at Laguna Seca yesterday. Some of that time is was the fact that the tires were not shaved and brand-sticker-new. Turn in was a bit squirmy and slow to take a set. I had to completely rewire my turn-in style. With the fatter, mature RA1s I could do a very aggressive turn in and then gas it through/out of the corner. The new, skinnier RA1s needed a more gradual turn in to take a set, and a more gradual addition of throttle.

As a result of the smaller tires, I found the car responded best to slowly dialing in steering and throttle on the way to the apex, then unwinding the steering slowly on exit. Adding throttle and steering at the same time violates the general rule of never adding throttle (or braking) at the same time as steering input. And if I got the mix wrong the car would understeer, but if I got it right the extra throttle kept the car balanced and turning.

The smaller tires are definitely forcing me to be a better driver. The fatter tires were masking some bad habits, so yesterday was full of learning better and smoother steering.

M Coupe @ Laguna Seca from B Dole on Vimeo.

I saw a couple M Coupes at Laguna Seca: Bill, Julian, and Sweet. Nice meeting you all. Most pledged to attend
Dorkfest this year. Mark you calendar: July 13, 2008. Bryn

Wednesday, May 21, 2008

Random Fail

I must be out of the security loop. I first learned about the latest random number bug via a cartoon. Schneier has a short summary of the problem.

This is very disturbing because it went unnoticed since September of 2006 in a number of Linux distributions. Both SSL certificates and SSH keys generated on these systems are affected.

This reminds me of a paper I wrote on a similarly weak RNG in Kerberos, with Steve Lodin and Gene Spafford 11 years ago. In the case of Kerberos Version 4, it used a RNG that depended only about 20 bits of entropy. The maintainers of Kerberos knew it was weak and implemented a much stronger one for Kerberos Version 5 and backported the new RNG to Version 4. However, the old RNG code was left in the source tree and due to a somewhat convoluted Makefile and source code, the new RNG was never called. The failure was masked by the existence of the old, weaker RNG code.

While working at Sun Microsystems, on the groundbreaking, but commercially unsuccessful SPF-100, I did more work on RNGs. These experiences confirmed to me the difficulty in writing a good, cryptographically strong, RNG.

The RNG that our group at Sun used was based on the RNG for PGP (the gold standard of crypto at the time). The seeding and generation of random numbers were fine, except the developer had gotten too clever. The algorithm used md5 to generate random bits based on a entropy pool. If you requested fewer bytes than were generated by the md5 block, those bits would be wasted. So instead, the algorithm saved the extra random bits for later. This was where the bug was, it wouldn't make any more random bits unless you asked for more than one md5 block worth of randomness. Session keys just happened to be short enough to never trigger new randomness. So while the Diffie-Hellman key exchange was secure, the underlying session keys were very weak.

Thankfully someone was debugging and noticed that the session keys stayed the same, even after they were renegotiated. Maybe it was Rich, I can't remember now.

The moral is: be very careful building your RNG and don't forget to test the randomness of the output. The Dieharder test suit is a good start. Make sure you test the right way too. Generate the random test data exactly like the RNG will get called in the code. Same number of bits, same pattern of calls. Then don't forget to retest before you ship. :)

Good luck, and stay random.


Tuesday, April 22, 2008


I'm trying twitter. After one day, I think I see why its popular. It makes you more self aware of noteworthy and joyous events in your every day life. Events that otherwise would just be forgotten.

The down side is there is now a permanent record for every dumb, narcissistic, and trite thing you can thumb into your phone.