06.28.10

Sunrise/Sunset Onebox

Posted in astronomy, personal, web at 6:45 pm by danvk

If you try searching for [sunrise san francisco] on Google, you’ll see a special display in the results:

This is known as a “onebox”. It’s designed to get you answers quickly. Other examples include the calculator (e.g. [2*2]), weather ([weather 94110]) and time ([time italy]) oneboxes.

The sunrise/sunset onebox is a project that I worked on in my spare time and recently launched. You can read more about it on the Official Google Blog. I first had the idea for this onebox about two years ago, so it’s very gratifying to see it finally launch!

A few features which are worth calling out:

  • The sunrise and sunset times are calculated when you perform your query. They are a function of latitude, longitude and the current time. The algorithm is based on the one used by NOAA.
  • In most places, you can just search for [sunrise] or [sunset] to get results for your current location. Google figures this out based on your IP.
  • This onebox works on mobile phones, too, so you can search for sunset times when you’re out on a hike.

There’s a wrinkle to the sunrise/sunset calculation that non-astronomers don’t typically think about. The sun starts to behave strangely once you get north of the arctic circle or south of the antarctic circle. If you’re north of the arctic circle, then there will be at least one day during the summer when the site never sets. And there will be at least one day during the winter when it never rises. This is truly a special case for the onebox! Here’s what it looks like:

I feel bad for those Barrowans — hopefully they’ll be able to fall asleep sometime in the next 34 days!

12.30.09

Books I Read in 2009

Posted in books, personal at 10:00 am by danvk

As part of my 2009 year-in-review, I tried to make a list of all the books I’d read. Give it a shot for yourself, this is hard to do! I can remember what I’ve read in the last few months, but my memory starts to fade as I get towards summer. I found a few books from the start of the year via Amazon receipts and library records, but I’m sure there are many I missed.

Here’s the list, with a few thoughts about each.

oracle-bonesOracle Bones, Peter Hessler
A follow-up to River Town, this book chronicles Hessler’s time in China as a journalist. Both books offer a great impression of life in China, though this one started to drag on a bit towards the end. Highlights: his discussion of the alphabetization of Chinese and his interactions with Polat, the Uighur trader who wants to emigrate to America.

betterBetter: A Surgeon’s Notes on Performance, Atul Gawande
This book fits neatly in the “find six interesting stories and give them a catchy one-word title” genre pioneered by books like Freakonomics. But the stories here are very interesting! And the thesis is, too. In medicine (and presumably elsewhere), there are huge gains to made through non-technological means. Apgar scores reduced child mortality by making it easier to test the efficacy of treatments and changing perceptions about which babies could live. Changed expectations and the sharing of case histories had dramatic effects on the life expectancy of Cystic Fibrosis patients.

Guns, Germs, Steel, Jered Diamond
My thoughts on why this is a really bad book are documented in another blog post.

botanyThe Botany of Desire, Michael Pollan
As always, Michael Pollan treads that fine line between greatness and wishy-washiness. The Omnivore’s Dilemma was great. In Defense of Food was not. This book is somewhere in between. At least Michael Pollan is always honest, a welcome change after reading Jered Diamond. His researches into Johnny Appleseed were particularly fun to read. I’d never thought about this historical figure.

copernicusThe Book Nobody Read, Owen Gingerich
After reading Koestler describe Copernicus’s De Revolutionibus as “the book that nobody read”, Gingerich sets out to find every extant copy and document the marginalia — evidence of who read the book and what they thought. Part of what makes this book fun is just what a quintessential academic Gingerich is. The one thing lacking is any discussion of where Copernicus got his ideas from. This book also implicitly makes a strong argument for digitizing books: think how easy his quest would have been if he’d had search!

The watershed; a biography of Johannes Kepler, Arthur Koestler
A 250-page excerpt from the book with which Gingerich took issue. I’d always though of Kepler as the first astronomer who really “got it”. His three laws cleared away millenia of intellectual baggage. If nothing else, this book rid me of that delusion. Kepler is a really frustrating figure. He is spectacularly modern in some senses, but frustratingly medieval in others. He certainly did not consider the three laws for which we remember him his most significant contribution to science. Koestler clearly has an agenda, but I didn’t find it too distracting.

scourgeScourge: The Once and Future Threat of Smallpox, Jonathon Tucker
A really fun read. The eradication of smallpox was one of the most significant technological feats of the 20th century, and yet I’d never heard/read anything about it before. There are many great stories in the final steps towards eradication. I learned a lot about disease and pathogens from this book.

parisParis from the Ground Up, James H. S. McGregor
I read this on the way to Paris. It gave me a great sense of the city: where things were, what the significant sights were, why they were significant, etc. It follows a bizarre chronological cross thematic progression as you read which I found confusing at first, but ultimately enjoyed. If you’re going to Paris and want to have to have some context for what you’ll be seeing, this is a great book to read!

crowded-universeThe Crowded Universe: The Search for Living Planets, Alan Boss
This book chronicles the hunt for extra-solar planets between 1998 and 2008, a time during which this area exploded. It reads like a blog, with dated entries any time something interesting occurred. I wrote the author and suggested he start a blog, but he didn’t want to lose the potential revenue from another book ten years from now. NASA does not come across well in this book. The trials and tribulations of what became the Kepler Mission span the whole time frame.

asset-allocatorThe Intelligent Asset Allocator, William Bernstein
This is really close to the ideal personal finance book that I’d like to read. Whereas A Random Walk Down Wall Street explains why you should index, this book talks about how you should allocate assets between bonds, stocks, real estate, etc. It’s not particularly prescriptive — it won’t say “you should be 75% stocks and 25% bonds” — but at least it gives a good background on the issues involved. Basic upshot: some diversification is always a good idea.

long-emergencyThe Long Emergency, James Kunstler
This book is bad, bad, bad. Kunstler’s argument is that our society is so deeply dependent on oil that, once we run out, the effects will be completely catastrophic. Large swaths of the United States will become uninhabitable. Much of modern agriculture is dependent on fossil fuel-based fertilizers, so billions of people will starve to death as earth’s carrying capacity plummets. Kunstler loves laying out doom and gloom scenarios. The problem is that he can’t be bothered to explain why they’re inevitable. There are zero charts or tables in this book, and his dismissal of technological solutions as cornucopianism is infuriating. See my thoughts on Guns, Germs, Steel for what it’s like to read a non-fiction book where you feel actively mislead.

11.01.09

Healdsburg Half Marathon

Posted in personal, sports at 1:25 pm by danvk

I ran my first half marathon this weekend, the Healdsburg Half in scenic California wine country. The race was held on Halloween, and no small number of runners came in costume. This is a nice twist on the usual “what should I be for Halloween” dilemma. Instead, it’s “what should I be that I can sweat in for 13 miles?”

My first goal was to finish. My second goal was to finish in under two hours. And I did! Final time was 1:54:33.1 (they are apparently very precise about these things!)

A race like this is a field day for data junkies like me, especially when you jog with an iPhone app like RunKeeper. I had it going for the first 10 miles, before my phone ran out of batteries. Here’s the track and mile splits:

mi pace
1 9:40
2 9:43
3 8:54
4 8:21
5 8:57
6 9:10
7 8:57
8 8:40
9 8:21
10 8:20

I must have picked it up after that — my pace over the remaining non-iPhone miles was 8:14/mile.

Some more stats and thoughts on what to do differently next time:

  • My co-worker Jeremy suggested that a good goal for a first half marathon would be a “reverse split”: running the second half faster than the first. I did that, too! The first 6.6 miles took 61 minutes, so the second must have taken 53. I guess I should have run the first half faster!
  • I should have charged my iPhone the previous night! More important than recording a track, it let me know exactly how far I’d gone: “6.34 miles” instead of “a few minutes past that six mile marker”.
  • I should have brought a jacket with me to the start. The race started before dawn and it was very cold! They even transported stuff to the end of the race for the runners. Something to remember for next time.
  • Running with a friend is great and can be good motivation. I ran most of the race with my friend Erica, who shaved a full 20 minutes off her previous half marathon time!
  • Erica’s dentist (a former marathoner) told her that she should take a drink at every water station. This was good advice. The only drink station I skipped was the one serving wine samples!

The Healdsburg Half was very well-organized. They had full results (PDF) posted the day of the race. I finished 396/1438 overall, 234/496 amongst men and 40/76 amongst 25-29 men.

09.12.09

Morning Headlands Ride

Posted in personal, san francisco at 10:07 am by danvk

On my way in to work Friday morning, I took a detour via the Marin Headlands:

It was a total whiteout on the Golden Gate Bridge, but as soon as I got to the north bay, it cleared right up. I went back into the fog for the ~800 foot climb up Hawk Hill before breaking through and getting some amazing views from the top:

Top of the World

I saw a fighter plane zoom into the city, which made me briefly think that it was Fleet Week. Not so! (It’s in October.)

The ride down the back side was misty, beautiful and frighteningly slick. All in all, I left at 7:40 and got into work with a change of clothes right around 10.

One more view from the top:
View from Headlands

08.16.09

Cabbie Karma

Posted in personal at 10:44 am by danvk

I rode a cab to Joe and Amy’s wedding yesterday. It cost $5.05. In a rare moment of innumeracy, I handed the driver a $20 bill and asked for $16 in change. (I’d meant to ask for $14.)

In the confusion that ensued, I wound up paying $5 for my ride to an unhappy cab driver and got out before realizing what had happened. I felt terrible — my cabbie karma was at zero.

On the ride home, I resolved to do better. It was $6.15, so I gave the driver a $10 and asked for $2 back. He handed me a single bill. I was about to complain when I noticed that it was a $2 bill. A sure sign that my cabbie karma had been restored!

05.25.09

Close to Me

Posted in personal, san francisco at 11:44 am by danvk

While walking around my block with an out-of-town friend the other day, I found myself pointing out all the restaurants I had never been to. How could I be so remiss? Part of it is the sheer number of food places: 40 within a three block radius.

Here they are. I’ve been to the bolded places. The links go to Yelp.

Within one block (3/4):

  1. Cafe du Soleil
  2. rotee (Indian)
  3. S&W Market
  4. Two Jack’s Seafood

Within two blocks (8/13):

  1. Chili Cha Cha’s Thai Food
  2. Cu Co’s Restaurant
  3. Estela’s Fresh Sandwiches
  4. Indian Oven
  5. Kate’s Kitchen
  6. Lo-Cost Meat and Fish Market
  7. Metro’s Caffe
  8. Nickie’s (bar)
  9. Roland’s Bakery
  10. Squat & Gobble
  11. Thep-Phnom (Thai)
  12. Three Twins Ice Cream
  13. Volare Pizza

Within three blocks (12/23):

  1. Abe’s Market
  2. Bistro St. Germaine
  3. Burger Meister
  4. Cafe International
  5. Castro Coffee
  6. Golden Natural Foods
  7. Hanabi Japanese Restaurant
  8. La Carreta Taqueria
  9. Love ‘n Haight Deli & Cafe
  10. Mad Dog in the Fog
  11. Memphis Minnie’s
  12. Molotov’s (bar)
  13. Mythic Pizza
  14. Naan and Chutney
  15. Noc-Noc (bar)
  16. O’Looney’s Market
  17. PeaCock Lounge (bar)
  18. Raja Cuisine
  19. Rosamunde (“the sausage place”)
  20. Tacqueria El Castillito
  21. Toronado (bar)
  22. Uva Enoteca
  23. Whole Foods Co

Now that I have a list, there’s no excuses!

03.03.09

A Great Twitter Experience

Posted in personal, web at 10:50 am by danvk

As danvk.org regulars know, I recently joined Twitter. I had a great experience with it last weekend and came away feeling as though I’d “seen the future”.

I ran into Tyler Hinman last weekend at a friend’s Oscars party. Tyler’s claim to fame was that he’d won the American Crosssword Puzzle Tournament the previous four years, starting in 2005 when the movie Wordplay was filmed. Tyler played a major role in that movie.

Tyler told us that he’d be trying to make it five times in a row the next weekend. So, come the weekend, I was curious to see how he did.

After one day of competition, the official results page showed Tyler in fourth with one puzzle left before the finals. If you’ve seen Wordplay, you know that fourth place is a bad spot to find yourself. Only the top three finishers qualify for the finals.

On Sunday, the standard news sources weren’t helpful. A crossword tournament is not exactly front-page material. The official tournament page hadn’t been updated. Even the bloggers would take another few days to tell the story. So I tried Twitter.

I searched for #acpt and saw these two results:

Tim-boone-tristin_normal boonebgorges: Congrats on the fivepeat to Tyler Hinman, and nice work to Francis and Trip for a valiant final round! #acpt
Bzbz2_normal bgzimmer: #acpt The thrilling conclusion of the crossword tourney, now on YouTube: http://tinyurl.com/dzx5uw

Not only did I immediately get the bit of news I wanted, I also got to watch it on video!

I’m not saying this is a great way to get news in general. A crossword puzzle tournament is more likely draw the twitterers than most events. But just consider that this would not have been possible even one year ago.

02.13.09

Fun with a Wireless Repeater

Posted in personal at 11:27 am by danvk

I recently purchased and installed a Belkin F5D7132 Wireless Repeater. It was $37 on Amazon, about half to a third the price of most other options. Most reviews along the lines of this one: “Hard to configure, a charm once [it's] done”. I thought I’d share my experiences, in case they’re helpful to anyone.

Here’s the basic layout of my apartment:
wireless-apartment

The wireless router is in the living room, and all the bedrooms come off a long hallway. My bedroom is the farthest from the living room. Somewhere between the middle bedroom and my bedroom, the throughput falls off a cliff. (I measured this using the Speakeasy Internet Speed Test)

My plan was to install the repeater somewhere in the middle bedroom, just before the performance cliff.

Installation

I followed the instructions on this Amazon review, rather than those in the instruction booklet. You’ll need a Windows machine to set the thing up, nothing else will do. The basic trick is to make sure that you’re plugged directly into the repeater via Ethernet when you run the setup utility, and that you’re on the same subnet. Its default IP is 192.168.2.254. This is pretty unusual, so it’s not going to “just work”.

After the subnet business, the most annoying part of the install was the ethernet cable that Belkin included with the Repeater. It kept slipping out of my laptop. Most of the problems I had were solved by shoving the ethernet jack back in place.

Once I got into the web interface, there were a few more hiccups. The first time I set its parent network and network name, it rebooted the router. When it came back, only the parent network had been set. But after one more change and reboot, everything was working fine.

Security: I chose the WPA-PSK, but had to switch from TKIP (the default) to AES to get it to work with my Macbook.

I also gave the Repeater a different SSID (network name) than the main wireless router. This made testing it much simpler, since I knew which one I was connected to.

Placing the Repeater

The absolute key for this was AP Grapher, a Mac OS X application that plots wireless strength over time. I would place the repeater, then watch the signal strength plummet as I walked around the corner, into the hallway and into my room. After experimenting with a few locations, I realized that:

  1. The Repeater’s antenna is much better than my laptop’s.
  2. The Repeater’s antenna is much worse than the main router’s.

As soon as there was even a single wall between my laptop and the repeater, its signal strength was indistinguishable from the main router’s. So here’s the configuration I wound up using:

wireless-apartment

This is not at all how I’d expected my setup to look, but you can’t argue with results! Here are the details:

  Before After
Signal (db) -55 -36*
Noise (db) -95 -96
Downlink (KB/s) 378.9 853.8
Uplink (KB/s) 342.1 692.3

The uplink/downlink stats are the most impressive. The “Signal” stat is misleading, since it’s only half the story. There are two wireless connections (Router to Repeater, Repeater to Laptop) and this only represents the strength of the latter.

When it’s all said and done, $37 for a 2.5x wireless speedup made the Belkin F5D7132 a great investment!

12.31.08

FreeCreditReport.com scam

Posted in personal, web at 7:16 pm by danvk

I was looking over my checking account transactions for the past year and saw a mysterious $12.95 charge from “CIC*Triple Advantage 877-48168″ appearing once a month. A search quickly showed that I’d been had by FreeCreditReport.com.

Turns out I’d used this site to get a credit check when I moved in to my old apartment last August. Everyone is entitled to one free credit check per year, and I thought that this was what I was getting. I’d failed to notice the fine print on their main page (helpfully displayed in blue-on-blue text):

When you order your free report here, you will begin your free trial membership in Triple AdvantageSM Credit Monitoring. If you don’t cancel your membership within the 7-day trial period†, you will be billed $14.95 for each month that you continue your membership.
ConsumerInfo.com, Inc. and Freecreditreport.com are not affiliated with the annual free credit report program. Under a new Federal law, you have the right to receive a free copy of your credit report once every 12 months from each of the three nationwide consumer reporting companies. To request your free annual report under that law, you must go to www.annualcreditreport.com.

That’s right, they sign you up for a free trial of a monthly service which you must opt-out of after 30 days. They do their best not to tell you that they’ve signed you up.

Looking back in my checking account, I found 16 months * $12.95/month = $207.20 in charges. Thanks to help from this discussion, I was eventually able to get this refunded in its entirety. Read more for details.

Read the rest of this entry »

08.20.08

Another move!

Posted in personal, san francisco at 9:16 pm by danvk

A year after making my last move, I’m doing it again! This is less of a dramatic shift. Whereas the last one was a 35-mile move from Mountain View to San Francisco, this is a 2 mile move between neighborhoods in the city (Russian Hill to Lower Haight).

I’ll post pictures when the move happens after September 1. For now, you’ll have to settle for maps. Here are the places that are twice as close to my new place as my old:
Read the rest of this entry »

« Previous entries Next Page » Next Page »