03.27.11
Posted in personal, programming, web at 2:07 pm by danvk
It’s been almost a year since I introduced lmnowave, the collaborative crossword puzzle gadget for Google Wave. A lot has happened in that past year, not least the cancelation of Wave.
First, to clear up some confusion. It’s not “I’m no wave”, it’s “L-M-N-O-Wave”, which is a play on “L-M-N-O-Puz”, aka lmnopuz, the software on which my collaborative crossword system is based. Only a few dozen people ever saw lmnopuz, so no one got the joke. And I realized after releasing it that, by changing ‘puz’ -> ‘wave’, I’d taken away any hint of what my wave gadget actually did. A bad name. Oh well.
In August, Google announced that Wave was canceled. This seemed to be the end of lmnowave. Sure, Wave was still usable. But the life had been sucked out of the project. This was quite disappointing to me, since I’d spent a fair bit of my own time developing the crossword gadget.
Then, in mid-December, Douwe Osinga introduced the oddly-named Google Shared Spaces. It’s an attempt to salvage the Wave gadget code, to let it live outside of Wave.
For lmnopuz, it’s perfect. Here’s the lmnowave shared space. You can use it to collaborate on crosswords with your friends, just like you could with lmnowave. In some ways, it’s even better, since the Wave UI is stripped away and you can focus on your puzzle. To do crosscountry crosswords, my friend and I open up a shared space and call each other on Skype. The combination works really well.
What does the future hold for lmnowave? It’s a bit unclear. I may turn it into a Facebook game, or perhaps use it to learn how to write applications for the Mac App store.
Enjoy!
Permalink
03.09.11
Posted in programming, web at 8:16 am by danvk
At work, I often see web pages that display large numbers like so:
| num-bytes |
1,234,567,890 |
| num-entries |
123,456,789 |
Including the commas in the display makes the numbers easier to read. But it does have a downside. Say you want to calculate the average number of bytes per entry. If you copy/paste the numbers above, the commas will prevent most programming languages (e.g. python or bc) from interpreting them correctly.
My coworker Dan came up with a great solution to this conundrum using CSS. Try copy/pasting these numbers over into the text box:
- 1234 or 2345
- -12345.67
- -123456789
|
|
The commas don’t copy! Best of both worlds!
You can view source to see how it works, but let’s jump straight to the goodies:
Bookmarklet: commacopy
Unobtrusive JavaScript: commacopy.js
To use the bookmarklet, drag it to your browser’s bookmarks toolbar. If you click it, it will silently convert all numbers containing commas on the current page to the fancy copy/pasteable commas. This should really be a Chrome extension that runs on every page, but I’ll leave that as an exercise for the reader.
To use the unobtrusive JS, make a copy of commacopy.js and include it in your page via:
<script src="commacopy.js" language="text/javascript"><script>
commacopy works by converting a number like:
123,456,789
into this HTML:
<style type="text/css">
.pre-comma:before {
content: ",";
}
</style>
123<span class='pre-comma'>456</span><span class='pre-comma'>789</span>
The commas are only present in a CSS style, rather than in the text itself. For reasons which aren’t entirely clear to me, this means that they don’t make it into the clipboard when you copy/paste them.
Permalink
06.28.10
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!
Permalink
12.04.09
Posted in web at 5:29 pm by danvk
Charles Minard’s chart of the demise of Napoleon’s Grand Armée is famous for its “brutal eloquence”. Edward Tufte says it “may well be the best statistical graphic ever drawn”.

The width of the line represents the size of Napoleon’s army as it marched to Moscow and then retreated.
I found a version of this visualization put on a Google Map using protovis. This visualization is great! It draws attention to one of the main problems with this famous visualization: it doesn’t give any geographical context. I had no idea where Napoleon’s army started and turned around until I saw this map:

Some things that stand out:
- The Grand Armée was way far away from France at the start of this.
- The march wasn’t as long as I’d imagined. When I think “march across Russia”, the image in my mind goes halfway across Siberia.
Permalink
09.07.09
Posted in web at 3:20 pm by danvk
The other day, I noticed that one of my friends had Wikipedia’s article on the em dash bookmarked in her toolbar. While that article is a gem of punctuation literature, it turned out that she would go to it, select an em dash, and copy/paste it into emails.
A better way to do this is with a bookmarklet. Drag this to your browser’s bookmark toolbar:
character palette
Click the bookmarklet on any page. You’ll see a character palette like this:

Select the character you like and either copy/paste it or drag it where you like. Then click “Close” to make the palette go away until you need it again. Enjoy!
Note: I’ve tested this in Firefox, Safari and Chrome. This probably doesn’t work in IE.
Permalink
03.03.09
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:
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.
Permalink
02.16.09
Posted in web at 5:23 pm by danvk
Has anyone else noticed Twitter being mentioned in the news more and more the last few weeks?
These have all happened in the last month:
All this makes me think I should hop on the bandwagon. I just created an account. I’m danvdk.
Permalink
12.31.08
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 »
Permalink
11.27.08
Posted in news, politics, web at 11:57 am by danvk
Today is the 30th anniversary of the Moscone-Milk assassinations and, fueled by the upcoming release of the movie Milk, they’ve been all over the local airways.
For those not familiar with the basic story (I wasn’t before I moved to SF), City Supervisor Dan White quit his job, then asked to be reinstated. When Mayor George Moscone refused, White returned to city hall with a gun and murdered Moscone and Supervisor Harvey Milk, who happened also be the first openly-gay elected official in the country. Another Supervisor, now-Senator Dianne Feinstein became mayor as a result of these killings.

An NPR show yesterday included a clip of Feinstein giving a dramatic press conference announcing the deaths. Much to my surprise, an original copy of that night’s newcast has found its way online.
The Feinstein press conference is at 2:10. Listen to the gasps. The 70′s production is jarring to look at now though, except for the cars, the shots of San Francisco could have been taken yesterday.
I couldn’t figure out whether this is an isolated clip or part of a larger collection. How cool would it be if all of NBC’s old newscasts were online?
Permalink
06.12.08
Posted in programming, web at 12:41 am by danvk
Inspired by the sorttable library, I’ve done some Javascript hacking over the last day and created dragtable, a complementary library which lets you drag column headers around to rearrange HTML tables. A demo will make everything clear:
| Name |
Date |
Favorite Color |
| Dan |
1984-07-12 |
Blue |
| Alice |
1980-07-22 |
Green |
| Ryan |
1990-09-23 |
Orange |
| Bob |
1966-04-21 |
Red |
|
Drag the column headers to rearrange the table. dragtable is incredibly easy to use. To make a table rearrangeable, just add class=draggable to the table tag. And, if you set class="draggable sortable", you can have a table that’s simultaneously sortable and rearrangable! For more details and a download link, check out the dragtable page.
I’m calling this v0.9 since I’m sure there are plenty of bugs and tweaks left to make. I’d love to get some feedback, so take it for a spin and tell me what you think!
Update: I’ve added full-column dragging and bumped the version to 1.0. Head on over to the dragtable, grab a copy, and let me know what you think!
Permalink
« Previous entries Next Page » Next Page »