Archive for 2009

Mac OS X Stats: 12/2009

Wednesday, December 23rd, 2009

When some of our apps check for updates, they send along the Mac OS X version number, helpful in case we need to send a message to a specific set of OS users. The additional bonus of this (fully anonymous) data is that is gives us a very good look at where our users are, and lets us plan accordingly.

I took the last week’s worth of data — including repeat launches, of course, but mathematically I think it all evens out, which is to say I’m terrible at math and have no idea if that’s true — and made two charts.

Coda

Coda users are famously cutting-edge, and this chart reflects it.

The Leopard/Snow Leopard dominance is strong, and it seems like Coda users are pretty adamant about running the latest and greatest. This makes sense for web developers, who, for the most part, really should be using the latest Safari.

But one chart, and one app, doesn’t tell the full story…


Transmit

With a higher install base than Coda, and a much broader set of users — from web developers, to printing presses, to press photographers, to who knows what — the Transmit results are a bit different.

Hello, legacy!

17% still on 10.4. As most of our future software development is focused on Leopard or above, this means we’ll have to keep our legacy apps around…

As Tim reminds me, 10.4 is the last OS that Classic still runs under, so is it possible that these 10.4 users are dependent on some extremely old piece of software?

If you’re still using 10.4 or 10.5, what is your primary reason for holding back on an upgrade?

(It’s also interesting to compare these numbers with The Omni Group. So similar!)

Q: “Once in a blue moon” is a rare event. But what does “blue moon” really mean?

Monday, December 21st, 2009

calendar-iconThis was the final question last week at Pub Trivia, and our team won the evening with the same answer to this question that almost everyone else gave, probably the answer you’ve heard before: a blue moon means two full moons in one calendar month. This month, December 2009, has a blue moon on the 31, since it also had a full moon on the 2nd. But I had the nagging feeling that I’d read or heard somewhere (probably on QI) that the popular definition is wrong, that the real blue moon isn’t that straightforward. When I got home, Google confirmed it: We were wrong, quizmasters and all.

This idea that a month with two full moons is unusual points out the incongruity between the lunar cycle and our familiar 12 month, 365 day calendar. Month and Moon are nearly the same word–why don’t they mean the same thing? The answer, of course, is that they once did. But nature seems to hate an integer* as much as it reportedly hates a vacuum, so a year isn’t an even 365 or 366 days or 12 orbits of the moon around the Earth; neither does the moon take exactly 29 or 30 days to go around. So the problem is one of successive approximation, dividing one number by another and dealing with the remainder.

A first approximation: the lunar calendar

The moon was a useful timekeeper, despite its reluctance to synchronize with the cycles of the seasons. Instead of having to remember “day 237 after the winter solstice is wheat-planting day”, a farmer simply knew that the eighth moon is the wheat-planting moon. The wheat didn’t care much if one year’s full moon was 11 days earlier (or 18 days later) than the last year’s. Before the unveiling of the Julian calendar in 45 BC (more on that later) nearly all cultures on the planet used a calendar based on the cycles of the moon. (The Mesoamericans are a notable exception, and that 2012 thing is complete malarkey. Just saying.)

calendarjoke2

So here’s the first rounding error: Twelve cycles of the moon take between 354 and 355 days, but it’s 365 or 366 days between winter solstices. Or in other words, every two or three years will have thirteen full moons in it instead of twelve. And this is where the “blue” moon comes in, the moon that’s different from the others. (Though at this time, months and moons were the same thing so there’s not any question of having two of one in the other.) If you have a Stonehenge or other primitive-but-awesome celestial observatory handy (robed druids included) to tell you exactly when the solstice occurs you’ll notice that the phase of the moon and the solstice just about line up every 19 years. (But not exactly. Again, nature versus integers.) And even if you don’t, you’d eventually notice that, on average, 7 of every 19 cycles of the seasons need 13 months instead of 12 to keep everything in sync, or you’ll planting your wheat at the wrong time of year.

One interesting exception to this is the Islamic calendar, which has twelve lunar months and doesn’t adjust to match the seasons. This calendar is used for civil and religious purposes; a separate solar calendar must be used for agriculture. An Islamic, or hijri, year is on average 354.36 days long, so their calendar shifts forward by around 11 days each year relative to the seasons. Ramadan isn’t just on different dates every year (which would be more alarming to us if we didn’t have to deal with Easter), it crosses the seasons and returns to the same time of year every 33 years. This also means their years are counting up around 3% faster than seasonal years: It’s currently 1430 AH in the Islamic calendar, but in the year 20874 (AH and AD) their years will “catch up” with ours.

Next approximation: the solar calendar

In the Roman Republic the months were determined, as in most other cultures at the time, by priests (or imams, robed druids, etc.) who announced the presence of a new moon–and thus a new month–just after sunset. (The word “calendar” comes from the Latin calare “to call out, announce”, by way of kalends, the first day of the Roman month.) The Pontifex Maximus, high priest of the Roman religion, had the additional task of determining how long the year would be, 12 or 13 months, and therefore which day of the week important holidays would fall on–important stuff for a superstitious lot like the Romans. Originally, this was a purely religious role, but by the middle of the first century BC Roman politics had become particularly nasty and the Pontifex Maximus could use the calendar as a political tool, choosing to add an extra month to years when allies were in power or denying an extra month to his enemies.

To what extent Julius Caesar did this after becoming Pontifex Maximus in 63 BC isn’t clear, but 17 years later, in 46 BC, Caesar reformed the calendar, taking the power to define the year away from the position. The Julian reform declared that the Roman Republic would use a 365 day calendar with an extra day every 4 years. (Sound familiar?) In other words, the year was approximated at 365 1/4 days. To align the new calendar with the equinox, though, he had to add another two months to the already extended year, making 46 BC 445 days long. Cicero called this “the last year of confusion”.

One last tweak: our modern calendar

calendarjokeBy the end of the Middle Ages, it had become apparent that the Julian calendar had drifted away from the seasonal calendar. This distressed the Catholic Church terribly because the most important thing in the world for the Catholic Church was celebrating Easter on the correct day. It had spent the previous thousand years trying to sort it out and now it found that their calendar, the calendar that Caesar had set in motion 1600 years before, was missing the equinox by more than a week.

During this time, some very clever people had figured out that the Julian calendar was moving forward around 3 days every 400 years, and came up with a modification to the leap year scheme: Every 100 years would not be a leap year, except for every 400 years. (You may remember that 2000 was a double exception year–it wouldn’t have been a leap year, but it was. So if you weren’t paying attention, you didn’t really miss anything.) In 1582, Pope Gregory XIII announced a reform of the calendar, the new leap year scheme along with a 10-day shift to get the calendar synced back up with the seasons.

The Church and a number of Catholic countries adopted the new calendar on Friday, October 15th of 1582, one day after (Julian) Thursday, October 4th. Protestant Europe resisted this papist conspiracy until the 18th century; the British Empire (including the American colonies) saw Thursday, September 14th follow Wednesday the 2nd in 1752. Sweden tried to make a gradual change by ignoring leap years until their calendar matched the Gregorian, but lost its nerve and switched back to the Julian calendar after 12 years. To make up for a day gained in the interim, they added a 30th of February to 1712. In Alaska, the change took place in 1867 when US took possession of the territory from Russia, which still used the Julian calendar. Because the international date line shifted at the same time, Friday, October 6th was followed by another Friday, the 18th of October.

Time in the future

Modern astronomy tells us that a year is, to within one day in a million years, 365.242199 days long. The Julian calendar put 1 year as 365.25 days, for an error of 7.8 days per 1000 years. The Gregorian calendar put 1 year as 365.2425 days, for an error of 0.3 days every 1000 years. The astronomer Sir John Herschel proposed that the year 4000 and every 4,000th year after should not be a leap year in order to reduce this remaining error to about half a day every 10,000 years, but the standard has not yet been adopted. New calendars have been proposed (mostly to solve the problem of figuring out which day of the week any given date is) but the Gregorian calendar’s ordering of leap years is sufficient to keep the calendar aligned to the seasons as far into the future as we need.

Well, almost. At this scale we begin to see that the speed at which the Earth rotates on its axis isn’t constant, or even predictable. The pull of the moon’s gravity is slowing the rotation of the Earth, making each day longer by a fairly constant 2.3 milliseconds per century, but other factors, most notably shifting mass on and inside the planet, add to or subtract from this by a different amount every year. Since 1967, when the length of a second was standardized in precise atomic terms, days have been between 0.3 and 1 ms longer than the traditional 24 * 60 * 60 = 86,400 seconds. As a result, every once in a while astronomers add a “leap second” to UTC, Coordinated Universal Time. Surprisingly, while just about every year between 1972 and 1999 required a leap second to keep the clock synchronized with the Earth’s rotation, there have only been two leap seconds added in the last ten years. The Earth has sped up just a bit, and no one knows why.

Time in Cocoa

Since this is a Panic Engineering post, I should probably write something about calendars and programming. If you’re not a Cocoa programmer (and even if you are), feel free to skip this–it won’t be on the test.

First, here’s the code I used to find the year that the Islamic and Gregorian calendars meet. The NSCalendar and NSDateComponents classes were introduced in OS X 10.4 to replace NSCalendarDate, and are also available on the iPhone OS. They provide calendar operations such as converting NSDate objects to and from units of years, months, days, etc., and finding the difference between two NSDates. (Since we mentioned it above, it’s worth noting that as far as the OS is concerned every day is 86,400 seconds long. NSCalendar does not know about leap seconds.)

  1. NSCalendar* gregorian = [NSCalendar currentCalendar];
  2. NSCalendar* islamic = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCalendar];
  3. NSDateComponents* components = [[NSDateComponents alloc] init];
  4.  
  5. [components setDay:1];
  6. [components setMonth:11];
  7. [components setYear:20874];
  8.  
  9. // Always use a format string in NSLog, even if it's just @"%@"!
  10. NSLog(@"%@", [gregorian dateFromComponents:components]);
  11. NSLog(@"%@", [islamic dateFromComponents:components]);

And here’s a snippet showing the jump from the Julian to the Gregorian calendar on October 15th, 1582. Be aware that the default NSCalendar uses the Julian calendar before this date. (For “fun”, check out October 1582 in iCal…)

  1. [components setDay:15];
  2. [components setMonth:10];
  3. [components setYear:1582];
  4.  
  5. NSDate* date = [gregorian dateFromComponents:components];
  6. NSLog(@"%@", date); // 1582-10-15 00:00:00 -0800
  7.  
  8. NSDateComponents* offset = [[NSDateComponents alloc] init];
  9. [offset setSecond:-1];
  10.  
  11. date = [gregorian dateByAddingComponents:offset toDate:date options:0];
  12. NSLog(@"%@", date); // 1582-10-04 23:59:59 -0800

OS X 10.4 provided Gregorian, Buddhist, Hebrew, Islamic, Islamic Civil, and Japanese calendars. 10.6 added Republic of China (for calendrical operations only, not formatting), Persian, Indian, and ISO8601, the traditional calendar of ISO8601istan. NSDateFormatter can format dates in any of these calendars:

  1. NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
  2. [formatter setDateStyle:NSDateFormatterFullStyle];
  3.  
  4. NSLog(@"Today's Gregorian date: %@", [formatter stringFromDate:[NSDate date]]);
  5.  
  6. NSCalendar* buddhist = [[NSCalendar alloc] initWithCalendarIdentifier:NSBuddhistCalendar];
  7. [formatter setCalendar:buddhist];
  8.  
  9. NSLog(@"Today's Buddhist date: %@", [formatter stringFromDate:[NSDate date]]);
  10.  
  11. NSCalendar* islamic = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCalendar];
  12. [formatter setCalendar:islamic];
  13.  
  14. NSLog(@"Today's Islamic date: %@", [formatter stringFromDate:[NSDate date]]);

Blue Moons

The article that told me I was wrong about what “blue moon” means (and hilariously refers to that definition as “trendy”) explains that the “two full moons in a month” definition is due to a misreading of the Maine Farmers’ Almanac: the real Blue Moon is the third full moon in a season that has four full moons. Why the third? The first full moon of the season is particularly significant; e.g., the Easter moon. The moons before and after have names as well–the Lent Moon precedes the Easter Moon, whether it’s the third or fourth moon of the winter–so the third moon of four is the extra one. By this definition, 2009 does not have a blue moon, since the full moon on December 31st is after the solstice and belongs to next year’s winter.

For an example of the importance of the sequence of the moons to daily life, consider Charlemagne’s naming of the months of the year (a solar year, but even so), used for over 700 years after his death:

Wintarmanoth, winter month
Hornung, the month when the male red deer sheds its antlers
Lentzinmanoth, Lent month
Ostarmanoth, Easter month
Wonnemanoth, love-making month
Brachmanoth, plowing month
Heuvimanoth, hay month
Aranmanoth, harvest month
Witumanoth, wood month
Windumemanoth, wine month
Herbistmanoth, autumn harvest month
Heilagmanoth, holy month

One etymology claims “blue” comes from belewe, “betrayer”. Imagine if an extra moon showed up and delayed Wonnemanoth for 29 days. Betrayer moon!

A: The third of four full moons in a season

The next day I emailed the quizmaster to let her know how we were all terribly, horribly wrong, that we’d need to recount the scores, possibly have a do-over. She said they’d take either answer.

* A Correction

“Nature hates integers” is a gross oversimplification and ignores not just all of chemistry, where everything happens in even ratios, but the surprising phenomenon of orbital resonance. Pluto and Neptune, for example, are phase-locked in a stable 2:3 resonance: Pluto orbits the sun exactly twice for every three of Neptune’s orbits, and has for millions of years. Our moon’s rotation is locked to its orbit around the Earth due to tidal forces, which is why we only ever see one side of it. For the same reason, the Earth’s rotation is also slowing down and will eventually match the orbit of the moon. At that point, billions of years from now, both a day and a month will last for around 47 of our current 86,400-second-long days. One side of the Earth will face the moon; the other will never see it again.

Transmit Beta Signup

Friday, December 18th, 2009

truckyJust a quick note:

If you’re serious about testing software, you’re good at filing well-written bugs, dedicated about trying successive builds, and you have a knack for breaking things, we’d like to personally invite you to sign up to possibly test an upcoming Transmit release.

A few disclaimers: we can only accept a limited number of testers (you’ll be notified only if you’re chosen and please don’t take it personally if you’re not!), you’ll likely will receive no compensation, and there are inherent risks with testing beta software, especially when it transfers your presumably important files.

All that being said, as a small company with (sadly) no QA department (yet?), your input will be literally invaluable to our engineers, and you’ll help make a better shipping product!

10-4 good buddy, etc. We hope you have a nice weekend!

Quick Notes #1

Monday, December 14th, 2009

Battle Soup

Wednesday, December 9th, 2009

The weather is cold, the holidays are approaching, the food-talk is at an all-time high; this means war. More specifically, a cook-off battle pitting friend against friend: Panic Inc.’s Les against Panic Inc.s’ yours truly. This has happened before (we all remember August’s Battle Tomato) and it was bound to happen again.

Prep

The Rules

  • All food must be prepared between Saturday morning and Monday noon
  • The cooks shop for the chief ingredients together, on Saturday
  • All dishes must be new to the cooks; no recipes allowed
  • The food must be challenging to cook…
  • …but not challenging to eat, as it is served to the whole office, which includes picky eaters.
  • This week’s theme was soup. Stews, broths, chowders, chilis, gumbos, bisques – if it’s cooked down and you eat it with a spoon, it qualifies.

A food battle makes for a busy weekend. I drove around looking for turkey legs and Gjetost cheese (the best-designed cheese in the world) while Les built his food muscle the long way: nine hours to make the broth, eight hours to braise the pork, an overnight kimchi.

Plating

Monday morning, disaster struck: the gas burners in the office would not fire. All was lost, hopes dashed, stews cold and gelatinous. But then, Dave Hayden remembered how the elders of his family told the legend of an ancient mystical device, some kind of magical fire on a stick they used to start the stove, long ago before they had sparkers… So we fired the burners using a match – really, have you seen these things? They’re great – and off we went, right on schedule. The smoky, sweet, porky smells drew a crowd into the kitchen.

Battle Soup Menu

Les

White Bean and Ham Soup with Kale
Radish Kimchi Stew with Braised Pork
Sweet Persimmon Soup

Neven

Turkey Bean
Chestnut Brunost
Apple Honey

Table

Menu

Diners

More photos here! (All taken by Christa Mrgan)

Les describes his offerings thusly: “Like Neven, I started with a homestyle, smoky bean soup. The idea of kimchi stew was stuck in my head from reading David Chang’s Momofuku book. (Of course, in accordance with competition rules, no recipe was used.) And while I’d never heard of persimmon soup, somehow it was an easy decision. It’s the end of the season when the fruit is sweetest. I balanced the persimmon purée with cream, vanilla, ginger, allspice, and lemon zest.”

Sweet Persimmon Soup

As for my dishes, the first one was a childhood favorite, though I’d never made it myself before. The chestnut soup paired its star ingredient’s nutty winter warmth with the familiar yet unexpected caramel flavor of Scandinavian brunost cheese. And for the sweet tooth, Granny Smiths cooked in mead, served with sugared bacon and gorgonzola dolce. You can see approximate recipes for my dishes on my blog.

Honey Apple soup

The Office Responds

Reactions ranged from positive to overwhelmed to off-topic:

“Les’ kimchi stew and Neven’s turkey bean soup battled it out for supremacy of Panic kitchen… the winner, all of us!” – Wade

“The spoon hurt my lip.” – Will

“I could taste each and every hour Les put into that kim chee stew, and it tasted like smiles and rainbows. And pork. Rich, succulent pork.” – Tim

“I would have enjoyed it even if I hadn’t been required to attend.” – Ned

“Les found a way to get me to eat Kim Chi. I fear his eldritch magick.” – Steve

“Ultimately satisfying, even if it failed to live up to the hype.” – Dave

“Productivity in the office decreases as the food that is served increases in deliciousness. Today is not a productive day.” – Mike

“Who knew putting 72 hours of love into pig meat would pay off this big. And dessert soup?!? I am coming to work at least 5 times a week from now on.” – Ian

We will meet again on the battleground, Les. The next challenge is yours to give.