Richard Barnes

Richard Barnes

Scientist. Developer. Tinkerer.

GitHub LinkedIn Stack Overflow Google Scholar ResearchGate Blog

I develop high-performance algorithms for investigating big data problems in society and the environment.

Skip to content
Planning for the 2 August 2027 eclipse

The August 2nd, 02027 eclipse will sweep from Gibraltar across North Africa, passing over Luxor, and onward to Arabia. Near Luxor, Egypt, totality will last for ~6 minutes 23 seconds. This will be the longest total eclipse over land until 2114. The Pyramids of Giza are not in the path of totality.

I've made a planning tool for use in figuring out my own trip. It's got the eclipse path, lines of equal totality, and cloud climatology. Clicking the map shows eclipse stats for that spot: the beginning and end of totality, the Sun's position, the spot's elevation, whether hills hide the Sun, and cloud cover for that spot over previous years. Airports within a six-hour drive of the path are marked.

read more →
How far does a ship coast?

My family went on a cruise last Christmas and we somehow found ourselves discussing how many miles it takes for a cruise boat to come to a stop. The physics on this isn't too bad, so I worked it out over dinner.

Ship stopping derivation and estimate, handwritten on the back of a Holland America Line card

read more →
Kayaking Tomales Bay at dusk

(See also: my planning notes.)

On October 14–15, 2026, I went back to Tomales Bay with a group of friends for another overnight paddle. Unlike on my previous trips, this time we only had a single car. No matter: the six rachet straps I'd brought held them all on.

Kayaks strapped to the roof of the car in Point Reyes Station

I was driving a Hyundai Santa Fe, which nominally has room for seven people. With five of us plus gear, the car was pretty packed! I'm glad I opted for the larger vehicle. Despite all the gear, we were still able to get everything on the kayaks with minimal trouble. This was aided by having 100' of paracord and a bunch of 55 gallon garbage bags to keep the stuff dry, as well as the legs of the folks in the open-deck kayaks.

Kayaks mostly packed for departure

read more →
How much totality is left in your life?

The morning of the 2026 solar eclipse I stood in a room full of friends and strangers while someone tried to wrangle cars. "Who here has seen a solar eclipse?" he asked. A bunch of hands went up. "And who thinks it was the coolest thing they've ever witnessed in their entire life?" The hands stayed up. "I would recommend for your life that you go --- you won't know any different --- but the other path is better."

The other path is better. I hope you see an eclipse.

There are 124 total and hybrid solar eclipses between now and the end of 2200 offering just over seven hours of eclipse time. You won't get it all. Sometimes the shadow of the eclipse falls on Antarctica or the open ocean, or in a country known for its violence and inaccessibility to outsiders. More importantly, you'll (likely) be dead for most of the eclipse.

So, how much time do you have?

read more →
Programming a new Prius fob key

I sent one of my Prius fobs through the laundry a few years back and, ever after, the electronics just didn't work.

Recently I bought a replacement fob from Amazon, and I'm pleased to report it worked brilliantly... after I completed the chicken dance, which I'm copying from here, for posterity.

xkcd #979: Wisdom of the Ancients

Some Prius keys have SKS. Your key has this ability if you can drive the car with the fob in your purse or pocket, not in the dash slot.

Procedure A: Programming the fob to start/stop the engine from the key port

All new fobs should be programmed for this. This will program the fob to start/stop engine while it is inserted into the key port.

  1. Get into the car.
  2. Close and unlock all doors.
  3. Ensure the car is off.
  4. Insert and remove your old fob (the one that currently works) into the fob slot 4 times in a row fairly quickly.
  5. Insert it a fifth and final time and leave it there.
  6. Open and close driver door 6 times fairly quickly.
  7. Remove old fob from slot.

The car should be in programming mode now. This will be indicated by the red car-shaped dash light staying on and not blinking.

If the red car-shaped dash light is not on solid, you have failed. Go back to step one and try again. Maybe you need to go faster or slower.

If the red car-shaped dash light is on solid, proceed.

  1. Insert your new fob and leave it in the slot. The red anti-theft light on the dashboard should begin blinking.
  2. When the light stops blinking and goes dark, your new fob is programmed. This may take up to a full minute.
  3. Remove the new fob.

You're now done with the START/STOP portion of the programming.

If you have SKS, proceed to PROCEDURE B don't have SKS, proceed to PROCEDURE C).

Procedure B: Locking/unlocking doors + smart key functionality, if you have SKS

This procedure is for chrome logo key fobs and vehicles with SKS functionality.

  1. Open the driver door and leave it open with no fob in slot (ensure the driver door is unlocked). Other doors can be locked or unlocked, it doesn't matter.
    Complete step 2 within 5 seconds of Step 1.

  2. Insert the old fob into the key slot and remove it twice.
    Complete steps 3 and 4 within 40 seconds of completing step 2.

  3. Close and open driver door twice.

  4. Insert and remove old fob once.
    Complete steps 5, 6, 7, and 8 within 40 seconds of completing step 4.

  5. Close and open driver door twice again.

  6. Insert old fob in slot and close door.

  7. Without pressing the brake, press power button, wait a second, press it again, wait a second, press it a third time to turn car back off.

  8. Remove old fob from slot. You'll be in "add mode" at this point. Within 3 seconds, the car should lock and unlock doors to verify it is in add mode (the precise number of times the car locks/unlocks the door is model specific, but it should do it at least once). If it does not cycle the locks, return to step 1; otherwise, proceed to step 9.
    Steps 9a and 9b should be started within 40 seconds of completing step 8.

  9. Adding a new key

    a. Press and hold the Lock and Unlock key (simultaneously) on the OLD/MASTER fob. A couple of seconds should pass and the locks will cycle once. If you do not get this cycle, it is likely due to a weak CR 2032 battery in your fob. Replace the battery in your old fob and try again.

    b. Press both the Lock and Unlock key (simultaneously) on the NEW fob. Hold for about 1.5 seconds then immediately, within 3 seconds...

    c. Press the lock key on the NEW fob. If successful the lock/unlock will cycle once indicating success. It may take a while for the lock/unlock cycle. I've seen it happen just as I was ready to say, "well, it didn't work". If you wait for a long time (a long time being more than a minute) and get no cycle at all, complete step 10 and test to see if the SKS functions of your new fob work. Remember to put old fob outside the car or else the test of whether the new smart key can start the car without being in a slot in the dash would be meaningless.

    Several users have reported it being necessary to execute 9b step twice before doing 9c, but most do not find this to be true. If your first go-around does not succeed , try it again and execute step 9b twice then 9c. You may be able to just do it over from 9a onward if your car is still in "add" mode, rather than going all the way back to Step B1.

    d. If you need or want to program another "new" fob, repeat steps 9a, 9b, and 9c for the next new fob.

    If done programming fobs, proceed to step 10.

  10. To end this programming, open then close the driver's door.

To test whether you have successfully programmed SKS mode, put the old fob outside the car and close the door, then try to start the car without putting the new fob in the slot.

Procedure C: For black logo key fobs without SKS functionality

  1. Open the driver door with no fob in slot and the doors unlocked.
  2. Insert old fob into slot and remove it twice within 5 seconds.
  3. Close and open driver door twice.
  4. Insert and remove old fob once.
  5. Close and open driver door twice again.
  6. Insert old fob in slot and close door.
  7. Without pressing the brake, press power button, wait a second, press it again, wait a second, press it a third time to turn car back off.
  8. Remove old fob from slot. You'll be in "add mode" at this point.
  9. Car should lock and unlock doors twice to verify it is in add mode.
  10. Press and hold both buttons on new fob simultaneously for a second and a half.
  11. Within 3 seconds, press just the lock button on new fob.
  12. Car should respond with one quick lock/unlock to verify that the new fob is all set. If the car responds with two lock/unlocks, that means it didn't work. Either try again, your fob is bad or, you have too many fobs assigned to the car.
  13. To end this programming, open then close the driver's door or put fob in the slot.
read more →

See all posts →