21 September 2011

Rosh Hashanah, the sun, and the moon

Here's my current stab at visualizing a series of the following events:
  • sunrise, sunset
  • moonrise, moonset
  • the Hebrew calendar
  • the Gregorian calendar
I'm using the days surrounding Rosh Hashanah just for fun, and because it is upon us.

All times are one hour too early because I am not correcting for Daylight savings.

One thing to note is the new moon on 28 Elul/09-27, as can be seen from the fact that moontime and daytime are nearly centered upon each other. (I'm using "moon-time" to mean the time between moonrise and moonset.) Ideally the new moon would be on 1 Tishrei, but it doesn't always work out that way.

Another thing to note is that this period includes the day on which there is almost exactly 12 hours of light, 27 Elul/09-26. (To match the chart, below I use times in PST not PDT, i.e. I ignore Daylight savings.)
  • sunrise 0544 (5:44am)
  • sunset 1745 (5:45pm).
You might think that this day with 12 hours of light should be the equinox (09-23), but here's an explanation of why this is not the case.

Some of the many areas for improvement include adding the days of the week, using daylight savings, and solving the problem with blurry text on top of color.

19 September 2011

Tisha B'Av and the moon

This year I attended a discussion of the Jewish holiday Tisha B'Av lead by Rabbi Nickerson at Temple Isaiah. Indirectly, this led me to do a lot of learning about the moon. How did I get from Tisha B'Av to the moon?

Well, first I learned that Tisha B'Av just means the ninth day of the month of Av. (Well, its deeper meaning is the commemoration of the destruction of the Temples, but that's not what I'm concerned with here.) I noted with surprise that this year the ninth of Av was also the ninth of August. I'm too lazy to figure out how often this happens, but my guess is that it is pretty evenly distributed and thus happens only about once every 30 months (2.5 years).

Then I remembered something I learned from Joshua Mason-Barkin when one time he led our Torah study at Temple Isaiah: Jewish months start around the time of the new moon.

So that got me thinking: this August, the day of the month will correspond to the phases of the moon. This is no big deal for a Jewish month (it literally happens all the time), but is kind of special for a Gregorian month. Wikipedia helped me make the following guesses for the big four phases of the moon in August. (The key piece of information was that a quarter of a synodic month is about 7.38 days).
  1. I guessed that the new moon must have been around day 1 (Aug 1).
  2. I guessed that the first quarter must have been around day 8.4 (Aug 8).
  3. I guessed that the full moon would be around day 15.8 (Aug 16).
  4. I guessed that the last quarter would be around day 23.1 (Aug 23).
  5. I guessed that another new moon would be around day 30.5 (Aug 31).
I wasn't quite right, but I was close. Here are the exact answers from Griffith Observatory's LA-customized run of the US Naval Observatory's MICA software. (The only sense in which this is LA-customized is with respect to the time zone, i.e. the phases of the moon (unlike moonrise and moonset times!) are global.)
  1. new moon: Jul 30 11:40
  2. first quarter: Aug 6 16:08
  3. full moon: Aug 13 11:57
  4. last quarter: Aug 21 14:54
  5. new moon: Aug 28 20:04
Here's a calendar visually showing the phases of the moon for each day in August 2011.

The main source of my errors is that the new moon wasn't exactly at 00:00 on August 1. It was actually about 1.5 days before that, Jul 30 11:40. Jewish months start around the time of the new moon, but not exactly at the new moon. To be fair, the month of Av started at sunset on July 31, which was a little closer to the new moon than 00:00 on August 1.

How far off is the start of the Jewish month from the new moon? What were the sources of my errors other than this main one? What's up with the times of moonrise and moonset? Are they related to the phase of the moon? What are some good ways to visualize the relationship between moonrise, moonset, sunrise, sunset, the Gregorian date, and the Jewish date?

I will try to cover some of the questions in a follow-up blog post.

Tisha B'Av commemorates the sometimes-tragic consequences of the irreconcilable differences between Jewish and Gentile civilizations. But this year it landed in harmony with the secular calendar, bringing me closer to the solar system we live in and bringing me closer to the great ancient civilizations that tried, and almost succeeded, in reconciling the irreconcilable motions of the earth, the moon, and the sun.

15 September 2011

Pestering cruise offer robo-call

Anybody else getting this robo-call?
On behalf of Royal Caribbean, Norwegian, and Celebration Cruise Lines, your household has been selected to receive an all-inclusive cruise. For fun in the sun, press "one;" to be removed, please press "two." Again, to speak to an agent, please press the "one" key.
We get it about once a week. I've tried to be removed by pressing "two" but it has not worked. Of course the number is blocked, which is not allowed. Also we are on the "Do Not Call" list so they should not be calling in the first place.

The secret crisis in real-time software

This is a weird post, because really it is just two links. First, I want to give a shout-out to the following article, which I view as very important.

Edward A. Lee. "Computing Needs Time". Communications of the ACM, 52(5):70-79, May 2009.

Second, and, far less important, but in line with the general self-aggrandizing character of this blog (and most blogs?), here's a link to a post of mine on Lambda the Ultimate, "My enthusiastic support, for whatever that's worth."

13 September 2011

Faith in DRY; no hope for software

DRY means Don't Repeat Yourself. It is, or at least should be, a fundamental principle of software engineering. I believe in DRY. Strongly. Perhaps more strongly than I believe in God. But I don't advocate for it, because advocating DRY implies the following beliefs:
  1. lots of people don't believe in DRY, and
  2. of those people, lots can be convinced of DRY.
I believe (1) but not (2), and that combination deprives me of hope for software. As in, all hope is lost. Seriously. Not that all the computers in the world will soon stop working, as was feared for Y2K, or something dramatic like that. Just that we are doomed to never make any progress beyond where we are today. Today we produce software through a laborious, undisciplined process that combines the low quality work of many with the heroic high quality work of a few. What would progress look like? Well, an efficient, disciplined process that raises the minimum quality of the work and requires no heroism. But it ain't gonna happen. Not enough people believe in DRY and other good practices like it.

A person should come to believe in DRY automatically after their first experiences writing software. If this has not happened, you should not try to convince them of DRY; rather, you should try to convince them to stop writing software. This is not to say that such a person is bad or unintelligent; they are just bound to write software of low quality.

There are people who "get" DRY and people who don't. Trying to convince someone of DRY is asking them to change something too fundamental. It is somewhere between a way of thinking and a core belief. It is not something whose value you can prove to someone. The trade-offs are too complex to measure objectively.

Now, you may say that I am being too extreme in that there must be some people who are on the fence and can be convinced of DRY. The only wiggle room for hope I see here is that some "closet" believers can be encouraged to come out when other believers set a good example by practicing their faith openly and vigorously. Also, you can of course share techniques for DRY among believers. But that's not what we're talking about here.

Now, you may also say that I am being too extreme in that even a non-believer must be able to play a productive role in writing software if that role is appropriately bounded. Perhaps this can help a little, but I see two reasons why it can only help a little.

The first reason bounding only helps a little is that DRY is still important at small scales. At small scale it is easiest to achieve, and therefore perhaps least interesting to discuss among believers, since the techniques are more obvious, e.g. the use of subroutines. But please remember that there are people who basically do not believe in subroutines. I have worked with people who think nothing of a subroutine that is 500 lines long. In fact it makes more sense to them that way. They say they like that they can read it straight through like English text without being distracted by "jumps" to subroutines. The fact that DRY is not practiced even when it is easy to achieve shows how deep non-belief can run.

The second reason bounding only helps a little is that bounding someone's work can mean forcing them to repeat what others have done. DRY really includes the less-catchy abbreviation DRSE, Don't Repeat Someone Else. Another way of looking at this is that DRY in some sense works against modularity. Or, to be more precise, DRY frequently demands re-drawing the boundaries of modules when commonalities are discovered as those modules develop. So restricting someone's work to a pre-determined module can mean inviting a large-scale DRY violation. Now, non-believers would usually not see such commonalities, and even if they saw them, they would never exploit them. The point is that bounding their work does not bound the impact of their non-belief. You still end up with software that repeats itself.

Even though we're never going to convert the non-believers, it would be nice if our tools at least allowed us to practice our faith. Instead, particularly at large scales, they require us to go to great lengths to practice DRY. The trade-offs, already hard to justify objectively, become even harder to justify at large scale.

For an example from my experience, build systems do a terrible job of supporting DRY. In some sense these are small-scale problems but I consider them large-scale in the sense of considering stuff like build systems and test code that isn't part of the final product.

Build systems suffer from the same problem of any system that encodes information without abstraction mechanisms to avoid repetition: they make the fatal mistake of distinguishing data from code. Have the 60-year-old discoveries of LISP taught us nothing? Concretely, why can't I specify my build using a real language, with subroutines? Even better if this real language is an existing rather than novel one.

To be fair, some build systems run counter to this trend; for example Buildbot builds are specified in Python. An alternative is of course to continue to distinguish data from code, but make it easy for the user to generate the data, thus abolishing the distinction. This is usually what practicing DRYers end up doing, but systems often make it very hard to do.

I've just begun to dip my toes into the big water that is database programming, but it already seems to me that, despite mighty efforts to the contrary, the state of the art is still generating SQL queries in a way that requires repetition and therefore invites inconsistencies between the queries, the database, and the surrounding code. Perhaps C#'s LINQ makes some progress on this front; I don't know. And even if they did not widely succeed, perhaps the fact that mighty efforts that have been made (e.g. object-relational mapping) is encouraging.

I will end on that encouraging note.

07 September 2011

Are sunsets boring?

Here are my comments on a thought-provoking piece by Lillian Daniel called Spiritual but Not Religious? Please Stop Boring Me. Thanks to Rabbi Joel Nickerson for bringing it to my attention by tweeting a link to it.
On airplanes, I dread the conversation with the person who finds out I am a minister and wants to use the flight time to explain to me that he is "spiritual but not religious."
On airplanes, I dread conversation, period. I guess that makes me an all-around misanthrope. This could be argued to be either an ethically stronger or weaker position than Daniel's more targeted dread. While I dread more people, a worse thing, I dread all people equally, perhaps a better thing.
Such a person will always share this as if it is some kind of daring insight, unique to him, bold in its rebellion against the religious status quo.
It is indeed tiresome when people overestimate the novelty of their thoughts, especially in the age of Google. But in some communities in the US, being non-religious is still a daring thing to share and does represent a divergence, if not a rebellion, from the status quo.
Next thing you know, he's telling me that he finds God in the sunsets. These people always find God in the sunsets. And in walks on the beach. Sometimes I think these people never leave the beach or the mountains, what with all the communing with God they do on hilltops, hiking trails and . . . did I mention the beach at sunset yet? 
Like people who go to church don't see God in the sunset! Like we are these monastic little hermits who never leave the church building. How lucky we are to have these geniuses inform us that God is in nature. As if we don’t hear that in the psalms, the creation stories and throughout our deep tradition.
Right, so why not use this as an opportunity to engage with this person and suggest to them that their "god in nature" idea is not only not in conflict with religion but in fact contained within religion? Perhaps they're more interested in showing off their not-so-novel idea than learning something. If so, I sympathize with Daniel. I know the type. I am one myself.
Being privately spiritual but not religious just doesn't interest me. There is nothing challenging about having deep thoughts all by oneself.
But the premise here is that this god-in-sunsets person is not having these thoughts all by himself! He's trying to engage with you about them. Or at least he might be, if he's not just trying to show off or pick a fight.
What is interesting is doing this work in community, where other people might call you on stuff, or heaven forbid, disagree with you. Where life with God gets rich and provocative is when you dig deeply into a tradition that you did not invent all for yourself. 
I agree with this idea of creating meaning through friction or even conflict between people. One might even go so far as to (circularly?) define God as "what people are arguing about when they argue about what God is." Perhaps this attitude is not surprising, since I am a Jew. But of course Jews have no monopoly on this.

But, I think it is the friction, not the tradition, that is necessary here. Having a tradition as a background for the friction grounds the discussion in a useful way, but is not necessary for the discussion.
Thank you for sharing, spiritual but not religious sunset person. You are now comfortably in the norm for self-centered American culture, right smack in the bland majority of people who find ancient religions dull but find themselves uniquely fascinating. Can I switch seats now and sit next to someone who has been shaped by a mighty cloud of witnesses instead? Can I spend my time talking to someone brave enough to encounter God in a real human community? Because when this flight gets choppy, that's who I want by my side, holding my hand, saying a prayer and simply putting up with me, just like we try to do in church.
The idea that our culture has become too self-centered resonates with me. I think the rise in popularity of self-authored wedding vows is perhaps an indicative trend, though one I can hardly condemn since I was part of it at my own wedding. My wife and I did use Google to borrow from others to form our vows and in that respect perhaps we showed some humility. Or was it just laziness? I suppose we formed our vows within the amorphous spiritual community that is the Internet.

I can see how the companion Daniel wishes for would be far superior for her, and perhaps even for me. But I feel compelled to point out that being religious is far from a guarantee that a person will be as spiritually rich as she describes. She is asking to sit next to someone very like her extraordinary self.

She seems to appreciate some degree of difference, so perhaps a rabbi companion would work as well for her as a minister. Though it is interesting to ask whether a turbulent flight is a time in which you want your beliefs to be questioned; I can see it going either way. On the one hand you might want to be comforted by agreement; on the other hand the rich engagement that comes with some disagreement might provide some welcome distraction.

In the end it is of course not important that we are interesting but that we are good. It matters not whether we see God in sunsets, or the testy supernatural being of the old testament, or both. It matters how we relate to the world around us: its people, animals, and environment. Then again, isn't being interesting part of how we relate to other people, and therefore perhaps a facet of being good?

P.S. For full disclosure, about 20 years ago, Lillian Daniel played bass in a band called Geek with my brother Derek Denckla.