Tuesday, August 19, 2008

Computer security announcement

Friends, family members, and weird strangers reading my blog: as one of the computer geeks in your life, I must mention that now is a very good time to take two minutes to update your Google Mail account to use secure communication. This will not overtly change your GMail experience, but it might save you the problem of someone stealing your GMail password. It appears that in two weeks a tool will be released that allows bad guys to do exactly that.

If you're like me, you're not too worried about boogeymen reading your email. However, if you're like me, you've got bank accounts and other important financial accounts that are linked to your email account, and a bad guy could possibly reset your bank account password by using your email address. Bad news indeed!

The good news is that updating your GMail account is easy; follow these easy steps.
  1. Log in to GMail.
  2. Click the "settings" link in the upper-right corner of the screen. The link should send you to a screen that shows, among other options, an option called "Browser connection".
  3. Set the browser connection option to "Always use https".
  4. Click the "Save Changes" button.
That's it.

If you don't use GMail but instead use Hotmail or Yahoo, apparently you're screwed. The tool-to-be-released will work against accounts with those email services, and I'm told both Yahoo and Hotmail don't provide a secure communication option.

Obligatory Slashdot link of the day: A Good Reason To Go Full-Time SSL For Gmail.

Tuesday Morning Time Trial

I have a great commute to work. By bicycle it's about 13¼ km (8¼ mi). The first ½ km is through a commercial zone and is followed by a few kilometers that climb up lazy false flats through quiet residential streets until reaching the Arizona Canal, along which runs a path that zips diagonally under surface streets to an exit no more than 200 meters from my office. The path literally goes under the surface streets, for there exists an underpass for pedestrians and bicyclists at most intersecting roads.

I suspect there exists no place else in the valley where I could live without sacrificing either the quality of the commute or else living within walking distance to so many amenities.

Having a commute isolated from regular rush hour traffic affords me the opportunity of extending my ride goals beyond the metaphorical Point A and Point B. Some days I train and do sprints or intervals1; some days I take my time to recover and relearn the simple childhood joy of being on a bicycle. Sometimes I focus on my technique, such as maximizing the efficiency of my stroke or body posture or I experiment with different cadences. In fact, cadence experimentation transformed me from a casual pedaler favoring a cadence of 70-80 RPM into a supple spinner favoring a quick cadence of 100-110 RPM. If bicycling is the new golf, then I liken my work commute to driving range practice, where I work at improving for the weekend showoff.

Some mornings I ride a time trial2. Time trials are great as tests but are merely okay as workouts; sprints and intervals are far superior for stressing the body. I start the clock shortly after pulling out of my apartment's driveway, and I stop the clock just before exiting the canal path. The route includes three traffic lights, all at the beginning; a left turn that is usually clear; and two stop signs; but the variance in delay caused by these various impedances is surprising small in the mornings: usually no more than fifteen seconds. Such regularity provides decent fairness across efforts. The variance is quite high in the afternoon, however, and furthermore any delays are unknowable until the last stretch through the commercial zone, so I don't do time trials on the way home.

This morning I rode a time trial, although when I first mounted the bicycle I was planning on doing intervals instead. Such incidental time trials are artifacts of the route; at the beginning my pace is determined by what is necessary to catch green lights, and this frequently culminates in a half-mile pseudo-sprint between the last two lights. The remainder until the first checkpoint, which is what I call the entrance to the canal path, 4¾ km into the ride, is slightly uphill, and I usually ride it hard as something of an extended interval, to establish a good baseline for the remainder of the ride. However, sometimes I reach the checkpoint with a really good time, and it becomes opportune to switch to a time trial.

Such is what happened today. I reached the first checkpoint at a near personal best clip, so I decided to do a time trial despite having done a time trial yesterday and clocking a personal second-best time (with wind assist) of 23:05 (34.6 kph average).

A time trial requires one to know his limitations; pushing beyond the red line can cause a mid-ride breakdown which will nullify the chance for a good time. Gears must be chosen on the basis of maximizing speed given a sustainable amount of effort. Even sips from the water bottle must be taken quickly and in concert with the route's slower stretches, such as during the approach to a stop sign. Time trials are stressful physically and mentally, but they yield a satisfyingly quantifiable result. Upon completion one knows just how well one did.

Today's time trial was brutal, especially on the last stretch where I faced a bit of a headwind, but I rode well and got lucky, making all three green lights and not spending any more time than necessary at the stop signs. I even went off-road at the right-angle turn after the Central Ave underpass to avoid an oncoming cyclist without slowing down. I was rewarded with the total effort by clocking a final time of 22:40 (35.2 kph average), a personal best without significant wind assist.

YouTube link of the day: Lance Armstrong in Stage 9 of the 2003 Tour de France showing what real off-roading on a road bike entails.

Intervals are like regular, moderated sprints. They are frequently complicated, but they all follow the same basic pattern of alternating fast with slow. For example, one interval pattern that I like is to ride a faster-than-average pace for one minute followed by a slower-than-average pace for one minute and so on.

A time trial is an individual effort by a cyclist to achieve his fastest time for a given route. All effort is made for the purpose of completing fastest; this usually entails riding at a steady level of effort sustainable just long enough to complete the route.

I'm feeling lucky

I noticed just today that a Google search for "just enough craig" displays this blog as the first hit. I've been eagerly awaiting this moment and checking Google every other day or so since creating the blog; it's somewhat surprising that it took the mighty Google nearly a month.

So go ahead and forget the URL to this blog and ask yourself this one question: do I feel lucky?

Google search of the day: Waldo.

(Sure enough, Google found him!)

Wednesday, August 13, 2008

Gone Metric!

My friend Jeff obstinately uses Celsius units when describing the weather regardless to whom he's talking. Celsius might be one of the most difficult of day-to-day Metric units for an American because most of us have no clue what to wear based solely on a Celsius reading of the temperature. Is 20° C hot or cold? Most of us don't know without performing a conversion to Fahrenheit first. As it turns out, 20° C is a pleasant 68° F.

Jeff's independent change of habit to using metric temperature units inspired me to do the same; I reconfigured the weather widget on my Google homepage to display metric units. Doing so has increased my familiarity with the range of temperatures from 30° C to 45° C this summer but has done little else to spark a greater comfort with the Celsius unit.

I gained a bit more exposure to the Metric System this summer by reading articles about the Tour de France. Of course, being a French race, the stage distances are measured in kilometers (although American publications usually convert the distances to miles), and foreign news articles frequently report average speeds in kph rather than the more familiar mph.

Today I have decided to take a plunge and increase my familiarity with the meter; I reprogrammed my bicycle computer to display metric units: km for distance and kph for speed. An incidental advantage of this switch is that an arduous pace of 22 mph is now a sleek pace of 35 kph. The speed is the same, but 35 kph sounds way cooler than 22 mph. And my work commute of 8.25 miles expanded to 13.3 km with no additional pedaling effort required.

Wikipedia link of the day: Metrication in the United States.

Tuesday, August 12, 2008

Side project snapshot

Erratum: The original source code posted in this entry was both incorrect and has been moved. The new source code can be found here. Look for the file named rc.py.

* * *

I remember reading in middle school a short story called
The Case of the Missing Will by Agatha Christie. This is a very faint memory, and I had to google for the title, author, and characters to reference it here. What I do remember is the gist of the plot. For those of you too lazy to follow the link to read Wikipedia's plot synopsis, the story is about a detective named Poirot who helps a Miss Marsh discover the whereabout of a missing will. The will was devised by a departed relative who stipulated that Miss Marsh must find the will within a month or else forfeit the inherited fortune. The stipulation was intended to prove whether Miss Marsh is clever enough to deserve the inheritance.

Poirot discovers the will as expected. However, the question arises whether Miss Marsh deserved the inheritance because she didn't find the will herself but used a detective. One of the characters -- possibly Poirot himself -- suggests that by seeking assistance for the search Miss Marsh acted in most clever way and thus deserved the fortune.

***

A coworker brought in a Rubik's Cube, which he now keeps on his desk available for anyone's amusement. I've made fruitless attempts in the past to unlock the Cube's secrets. Not once have I been close, but nevertheless I refuse to look up a solution. However, this time I'm hoping to be a bit more clever and am seeking the assistance of a much brainier associate: my computer.

Below is a quick-and-dirty script I wrote to simulate a Rubik's Cube. My goal is to map out the results of various N-rotation sequences. An example of a 4-move sequence is
top clockwise, left count-clockwise, top counter-clockwise, left clockwise. The result of any N-move sequence leaves some squares with their original color and some with a different color. Working out these results on a real Cube or in my head is too error-prone, for I quickly lose track of which side is which, and working it out on paper is too time-consuming. Hence, my brainier associate, the script.

In theory, if there exists a set of N-move sequences whose only effects are to swap two squares' colors and any two like-squares (corner and sides) can be swapped , then solving a Cube becomes trivial, if not potentially time consuming. Does such a set of sequences exist? Perhaps this script, when automated, can help discover the answer
.

Saturday, August 2, 2008

Stoicism versus Epicureanism

One of the books I'm reading is the third volume Will Durant's series The Story of Civilization: Caesar and Christ. I started with the second volume on classic Greece after making an impulse purchase at a used bookstore. I went to the store having decided that I would replace my knowledge of Roman history, which I had acquired largely by reading Colleen McCullough's Masters of Rome series of historical fiction, with non-fiction history, but I made a last-minute decision that I would be better off reading some Greek history first. The impulse turned out to be a good one; I was very pleasantly surprised by both the book and the author.

Will Durant
(1885-1981) was a progressive and a socialist who wrote a good deal about both philosophy and the ancient world. His history books are known as historiographies, which are biographies of a civilization. It's a fitting term; both the second and third volumes cover a diverse range of topics: politics and governance, economics and commerce, philosophy, religion, literature, art, architecture, science, technology, and so on. Both books provide a varied run-through of Greek and Roman civilization as well as expounding on themes of civilizations' rise and fall: individuals' security versus their freedom; agrarianism versus an urbanism; theism versus atheism; and, especially in the third volume, Stoicism versus Epicureanism.

Reading about this last conflict has reawakened my appreciation of philosophy, and I think I understand Durant's aim in writing about philosophy. According to Wikipedia, Durant thought that philosophy is a stagnant field because it fails to address real world problems, and Durant does well with relating the abstract with the practical in The Story of Civilization. The books narrate great states' cyclic path from being composed of a people possessing practical, Stoic attitudes to its people possessing indulgent, Epicurean attitudes.

I find this conflict between Stoicism and Epicureanism interesting because I've considered myself an Epicurean. This may surprise some who are accustomed to the modern definition of Epicureanism, which is quite different than the philosophical definition. Take this following maxim of Epicureanism (from the Wikipedia article):

Luxurious food and drinks, in no way protect you from harm. Wealth beyond what is natural, is no more use than an overflowing container. Real value is not generated by theaters, and baths, perfumes or ointments, but by philosophy.

Or this summary from Diogenes:

When, therefore, we say that pleasure is the chief good we are not speaking of the pleasures of the debauched man, or those that lie in sensual enjoyment ... but we mean the freedom of the body from pain, and of the soul from disturbance. For it is not continued drinkings and revels, or the enjoyment of female society, or feasts of fish or other expensive foods, that make life pleasant, but such sober contemplation as examines the reasons for choice and avoidance, and puts to flight the vain opinions from which arises most of the confusion that troubles the soul.

And this (also from the Wikipedia article):

Don't fear god,
Don't worry about death;
What is good is easy to get, and
What is terrible is easy to endure.

This last one is from Epicurus himself, and I'm fond of paraphrasing the first three lines to myself to sum up courage from time to time. The fourth line I'm not so sure about because chronic pain is by definition difficult to endure, and I know this from practice because I suffered from chronic pain when I was younger.

Epicurus founded Epicureanism -- or at least he popularized it -- and was an interesting fellow. He was what we nowadays call a minimalist or simplicitist. He thought the Good was easy to obtain because the Good was the pleasure of living a simple life free from worries and unnecessary upkeep. How can I not love Epicureanism?

Stoicism was founded by another Greek, Zeno, and is in many ways Epicureanism's opposite. Stoicism asserts that the Good is a firm self-control that allows the individual to overrule his emotions and to live for the good of the group firstly and his own good secondly. Stoicism also maintains an objective view of truth and reason. Stoicism appeals to me in ways, especially with its two foci of self-control and of abiding by the laws of society, but I too often struggle to mesh it with my nature.

One interesting thing about these two philosophies is how in both the individual's relationship to the world becomes corrupted when applied in the real world by real persons.

  • Epicurean ideals: relative truth, pursuit of pleasure for the self but where pleasure stems from a simple life free from dependency.
  • Stoic ideals: absolute truth, promotion of a life in accordance with duty to the state and to the community.
  • Epicurean reality: a life ruled by the immediate satisfaction of the senses through worldly pleasures.
  • Stoic reality: a life ruled by intolerance and the fear of God.

A major problem with Epicureanism in practice is that one cannot give real persons the green light for pursuing pleasure without expecting a good number of them to take to food, drink, and narcotics excessively. A major problem with Stoicism is that you cannot give persons the green light for an objective model of truth and reason without some of them creating intolerant, inflexible dogma. These are inevitable and unfortunate side-effects. However, I prefer Stoicism's side-effects to Epicureanism's when applied to a people even though I much prefer the Epicurean ideals to the Stoic ideals as an individual. The inflexible sheath created by a people ruled by dogma has cracks of opportunity for me to pursue my ideals. The wastefulness of a people ruled by short-sighted pleasure-seeking allows me nearly total freedom to pursue my ideals, but my corresponding disappointment with others' stagnation and self-destruction is inescapable.

Epicureanism is a dangerous philosophy. It's a disaster for people who are inclined to say "yes" too often. I read in horror and sick fascination about the early Princes of the Roman Empire -- Caligula, Nero, Domitian -- and their normal and their abnormal vices and the parallel collapse of Roman sturdiness amongst the Roman citizenry. This is Epicureanism on the grandest of scales, and it is ugly. But I am no Stoic. I will live by my Epicurean ideals while I hope that society chooses Stoicism.