05.21.12

Reading ClarisWorks 3 Documents in Mac OS X

Posted in personal at 2:45 pm by danvk

I recently found a disk image I made from an old, circa 1997 hard drive. Back then we used ClarisWorks for all of our word processing needs. I quickly ran into my own version of the Digital Dark Age: how to read these ancient files? I spent enough time figuring this out that I owe it to the web to write up the process.

Read the rest of this entry »

05.17.12

puzzle+: Crosswords for Google+

Posted in programming, web at 8:48 am by danvk

To solve a crossword with your friends in Google+, click this giant hangout button:

Start a Hangout

You’ll see something like this:

Click “Hang out” to invite everyone in your circles to help you with the puzzle. If you want to collaborate with just one or two people, click the “x” on “Your Circles” and then click your friend’s names on the right.

You’ll be prompted to either upload a .puz file or play one of the built-in Onion puzzles. You can get a free puzzle from the New York Times by clicking “Play in Across Lite” on this page.

With the puzzle downloaded, drag it into the drop area:

And now you’re off to the races! The big win of doing this in a Google+ hangout is that you get to video chat with your collaborators while you’re solving the puzzle, just like you would in person!

Astute readers will note that puzzle+ is a revival of lmnopuz for Google Shared Spaces, which was a revival of lmnowave (Crosswords for Google Wave), which was in turn a revival of Evan Martin and Dan Erat‘s standalone lmnopuz. Hopefully the Google+ Hangouts API will be more long-lived than its predecessors.

05.14.12

Horizontal and Vertical Centering with CSS

Posted in programming, web at 10:04 am by danvk

I recently wanted to center some content both vertically and horizontally on a web page. I did not know in advance how large the content was, and I wanted it to work for any size browser window.

These two articles have everything you need to know about horizontal centering and vertical centering.

The two articles don’t actually combine the techniques, so I’ll do that here.

In the bad old days before CSS, you might accomplish this with tables:

<table width=100% height=100%>
  <tr>
    <td valign=middle align=center>
      Content goes here
    </td>
  </tr>
</table>

Simple enough! In the wonderful world of HTML5, you do the same thing by turning divs into tables using CSS. You need no fewer than three divs to pull this off:

<div class="container">
  <div class="middle">
    <div class="inner">
      Content goes here
    </div>
  </div>
</div>

And here’s the CSS:

.container {
  display: table;
  width: 100%;
  height: 100%;
}
.middle {
  display: table-cell;
  vertical-align: middle;
}
.inner {
  display: table;
  margin: 0 auto;
}

A few comments on why this works:

  • You can only apply vertical-align: middle to an element with display: table-cell. (Hence .middle)
  • You can only apply display: table-cell to an element inside of another element with display: table. (Hence .container)
  • Elements with display: block have 100% width by default. Setting display: table has the side effect of shrinking the div to fit its content, while still keeping it a block-level element. This, in turn, enables the margin: 0 auto trick. (Hence .inner)

I believe all three of these divs are genuinely necessary. For the common case that you want to center elements on the entire screen, you can make .container the body tag to get rid of one div.

In the future, this will get slightly easier with display: flexbox, a box model which makes infinitely more sense for layout than the existing CSS model. You can read about how do to horizontal and vertical centering using flexbox here.

04.10.12

The Sunrise/Sunset Onebox, Now in Many Languages

Posted in personal at 12:14 pm by danvk

Nearly two years ago, I wrote about launching the Sunrise/Sunset Onebox, which tells you when the sun will rise or set in any location.

You trigger it in English by search for [sunset nyc] or even just [sunset] to get times for your current location.

Over the weekend, I launched the onebox in 30+ new languages. It’s pretty cool to see your work in a language that you don’t understand. Here are a few examples:

Arabic: [غروب الشمس في المدينة المنورة] = [sunset in medina]

Onebox triggering for [sunset in medina] in Arabic

Or in Vietnamese: [mặt trời mọc Hà Nội] = [sunrise in Hanoi]

Onebox triggering for "sunset in hanoi"

Or in French: [coucher de soleil paris] = [sunset paris]

Onebox trigger for sunset in paris

The translated onebox is proving particularly popular in Arabic-speaking countries, where the sunrise is important for prayer times. It will be interesting to see whether there’s a spike in Hebrew queries on Friday, when Israel observes the sabbath beginning at sundown.

This launch has been more of a slog than I ever would have expected, so it’s gratifying to see it out there in the wild, being used. The world’s languages are a baffling mix of left-to-right and right-to-left. Arabic gets a special shout-out here for its plural forms. It has different word endings for quantities of 1, 2-10 and 11+!

02.12.12

Happy People: A Year in the Taiga

Posted in movies, reviews at 10:06 pm by danvk

Last fall, I was excited to read about Werner Herzog and Dmitry Vasyukov’s new film, Happy People: A Year in the Taiga.

I bought tickets for its one-night premiere at the IFC. Raven and I raced from our dinner to catch the 9 PM show… only to find out that it had been the night before. A tragic mistake for a one-night only show!

I recently found a full copy of the film on YouTube and we watched it. (Pro tip: the volume is a little low in the YouTube video. You can visit saveyoutube.com to download it to your hard drive. Then watch it in a desktop player like VLC with the volume turned up past the max.)

Herzog and Vasyukov glamorize life in the Taiga. The fur trappers’ existence is simple. They have few material possessions which they do not make themselves. A rifle, snowmobile and outboard motor are the lone exceptions. There’s something immensely satisfying about seeing the hunter making skis and a canoe in the fall, then using them in the winter. They are nearly completely cut off from the modern world. The only intrusion it makes into the film is when a Siberian politician visits on a boat, a curiosity to which the villagers pay little regard.

The men live for the winter hunt, and this is clearly the part of their lives which the filmmakers found most interesting. We hear more about their hunting dogs than we do about their wives or children. The only time we see real emotion from a hunter is when he describes watching a bear kill his favorite dog. Less pleasant things are talked of only briefly: the native people have been largely displaced by ethnic Russians, and those who remain are alcoholics. The protagonist of the movie was brought to Bakhta by helicopter thirty years ago to trap for the communist government. They had few supplies. Another man came with him, but he was “not up to the task” of survival.

This is a beautiful film which offers a glimpse into an increasingly rare way of life. Herzog and Vasyukov portray it as simple and remote, but I think is more due to their editing than to the reality of life in Bakhta. What about the women, who never speak in this film? Or the natives? Happy People leaves you respecting the people who live in the Taiga, but wanting to know more about them.

« Previous Page« Previous entries Next entries »Next Page »