Thursday, December 20, 2007

CentOS 5 + Tomcat5 + Java 6

I just installed a CentOS 5 server and I wanted to run Tomcat5 with the Sun Java 6 JRE, not the JRE that's packaged with CentOS 5. Naturally everything broke. It took about an hour of poking and debugging, but in the end the fix was surprisingly simple. Here's how I did it:
  • Removed all of the original java packages (java-*, gcc-java glib-java)
  • Installed the JDK 6 RPM downloaded from the Sun website.
  • Create two symbolic links:
    • ln -s /usr/java/latest /usr/lib/jvm/java
    • ln -s /usr/java/latest /usr/java/default-exports
That's it.

If you want to run Tomcat5 on port 80, it needs to have root privileges to bind to a low order port. In its default configuration Tomcat5 cannot do this because it is a pure Java application and must run cross-platform. Dropping privileges is not platform agnostic so Tomcat5 does not support it.

It is dangerous to run Tomcat5 as root, so only do it if you know what you are doing! I took this approach on this server because it is an intranet application server that is not exposed to the outside world. Do not do this if you are exposing a Tomcat server to the outside world...

Here's what to do:
  • Update the /etc/tomcat5/server.xml file and look for <Connector port="8080" Change the 8080 to 80.
  • In the file /etc/sysconfig/tomcat5 change "#TOMCAT_USER=tomcat" to "TOMCAT_USER=root"

If you are exposing your server to the outside world, your best bet is to do it in a way that it is only root while it is binding to the low order port. Here is a tutorial that appears to explain how to do this. Your other option is to run Apache on the same server and use it as a proxy. The upside to this approach is that you can use Apache to serve static content, like images, more efficiently than with Tomcat.

Thursday, December 13, 2007

Advanced Extraterrestrial Intelligence

Consider three conjectures:
  1. The universe is the same age for all objects within it.
  2. Chemical reactions between two chemicals takes the same amount of time on Earth as they do on any other potentially habitable planet. (Corollary: physics is the same on all habitable planets)
  3. Human intelligence on Earth evolved as fast as the underlying chemistry could support it.
If those conjectures are true, then I would hypothesize that any other habitable planets with intelligent life contain an intelligence that is pretty much equal to ours. This would be a reasonable explanation for why we haven't (yet) seen evidence of extraterrestrial intelligent life.

Conversely, if their intelligence is far more advanced, then we would have to question what happened during our development to stunt our growth.

Monday, November 05, 2007

Daylight Savings Discovery

I was resetting the clock on our stove yesterday and noticed that it had a "Sabbath Mode" setting. I've never heard of this before so I googled it (source:

Sabbath Mode Ovens
(The Following Applies to Yom Tov Only)

Sabbath mode ovens are designed to bypass many of the practical and halachic problems posed by the modern oven.

For the Sabbath mode ovens with the random delay feature, one may raise or lower the temperaturet of the oven without concern for the heating element or glow plug. This is because the computer does not directly react to the change in settings. The oven will randomly look to the setting and adjust the temperature. This means that turning on the heating element or glow plug is only an indirect result of your action (grama). Therefore, since a grama is permitted on Yom Tov one may actually adjust the temperature. For the Sabbath mode ovens without the random delay, the temperature may be raised when power is flowing to the oven and lowered when power is not flowing to the oven as indicated by the readout on the display.6

Another issue is that some ovens can be programmed to turn off at a preset time. This feature is known as timed bake. In many models, when the time has elapsed and the oven shuts off, it will sound a bell or buzzer or display a readout (such as the word “end”) to indicate that the oven is off. On some models this buzzer or display will continue until it is manually turned off or until the door is opened, which is not permitted on Yom Tov. On those Sabbath mode models that include the timed bake feature, the buzzer or readout is eliminated. (Please note that once the timed bake goes off, the oven cannot be used again for that Yom Tov.)

As a safety feature new ovens are designed to shut off after being on for twelve hours. Although this safety feature is very important, it creates a problem when preparing food for the daytime meal which is more than twelve hours after the onset of Yom Tov. For all types of Sabbath mode ovens, the twelve hour cutoff is bypassed.

In Sabbath mode ovens, the door plunger switch is disabled so that it will not directly cause any electronic reaction.

The oven cavity light for some Sabbath mode ovens will remain on or off, depending on how Sabbath mode was entered. For other Sabbath mode ovens, the light must be turned on at the control panel before entering the Sabbath mode, or the bulb must be unscrewed.

It is important to note that not all Sabbath mode models offer the same features. If you have a Star-K certified Sabbath mode oven, please check the appliance section of our website at to see which features are available on your model, or contact our office at 410-484-4110.7

The following are some commonly asked questions about oven and stovetop use on Yom Tov:

  1. Why is one allowed to push a button on the keypad of a Sabbath mode oven on Yom Tov?

    Pushing a button on an oven, when in Sabbath mode, on Yom Tov that starts a process internal to the computer without any heat, light, sound, movement or anything tangible that can be perceived, is not considered a melacha and is permitted on Yom Tov. When a melacha is finally accomplished, namely turning on the heating element in the oven, it is accomplished through a grama, (an indirect act because there is a random delay of between 15 and 25 seconds before the heating elements can be activated). This grama is permitted on Yom Tov, but not on Shabbos.

  2. Can one turn on a Sabbath mode oven on Yom Tov or Shabbos?

    Not on Yom Tov, and certainly not on Shabbos. This is because it directly causes the display to change which is prohibited.

  3. Can I set the timed bake feature on Yom Tov?

    For those ovens that have the timed bake feature included in the Sabbath mode, it can only be set from before Yom Tov. This will allow for a one time usage. Once the oven shuts off, it cannot be used again for that Yom Tov. One may not set the timed bake on Yom Tov (and certainly not on Shabbos).

  4. May one turn off their stove or oven to conserve energy on Yom Tov?

    No. One is only permitted to lower the setting when it is necessary for the preparation of the Yom Tov’s food.

  5. May one lower the setting on a Sabbath Mode oven even when it is not for the benefit of the food?

    Those Sabbath Mode ovens that are equipped with a random delay may be lowered on Yom Tov. This is because the random delay makes the reaction of the oven to lower the temperature a grama (indirect action). Although we only permit extinguishing or lowering a flame where it is needed for food, this only applies where one does the action. Here, where the computer will lower the temperature later on as a reaction to your instructions, it is called gram kibui and it is permitted.

  6. Can I open and close a standard oven door at any time on Yom Tov?

    One may open and close the door of an oven on Yom Tov to process the food as needed if this does not cause a light or icon to go on directly because the door was opened. On Shabbos there is a problem with opening the door because you will cause additional burning in the oven. This is prohibited on Shabbos8 and permitted on Yom Tov.

  7. Must I wait until I see the glow plug glowing to open the door to my gas oven on Yom Tov?

    As a rule the oven will not immediately go on because of the reduction of heat created by your opening of the door. Therefore, even though the oven will eventually go on because its door was opened, this is not a direct result of your action. The additional burning is permitted on Yom Tov.

Regarding raising the temperature of a gas oven on Yom Tov, one may not do so unless they know that the glow plug is glowing and the display will not change. This is because raising the temperature setting will direcly cause the glow plug to go on if it is otherwise off, creating a problem of molid. However, if the oven is cerified with sabbath mode that has a random delay feature built in, and this was initiated before Yom Tov, one may adjust the temperature on Yom Tov.

Thursday, September 20, 2007

Best Bible Synopsis Ever

Probably a bit inflammatory, but funny nonetheless... Found over at message boards, posted by "His Noodly Appendage" on September 3, 2007:

"... therefore, a cosmic Jewish zombie who was his own father wants you to telepathically acknowledge him as your master so that he can remove an evil force from your soul that was put there when a talking snake convinced a rib-woman to eat the fruit of a magical tree."

Monday, June 11, 2007

No Silver Bullet

Owing to Fred Brook's seminal paper "No Silver Bullet", it has slowly become clear to me that concepts in general cannot be explained to another person without rigor equivalent to that which is put into implementing an idea within a computer program. Once you actually try to implement a computer program, you realize how deficient your description is. You have to mete out the computer program detail by detail, instruction by instruction. Carefully thinking through each line in solitude and with fellow programmers.

When describing a concept from one's brain to another, the problem is compounded when one considers that an instruction does not mean the same thing between any two people, even those from the same socio-ethnic groups. In the computing world, this is known as compatibility. In the computing world there are relatively few platforms, but the platforms are vastly different. In the human world, there are billions of different "platforms", but the differences are generally very small. In the computing world, it's very easy to tell if your language is not being understood by a platform. In the human world, it is nearly impossible most of the time to tell if your language is being truly understood by another person. It is further made difficult when you consider that all computer programs have incorrect logic, otherwise known as "bugs".

All of the compatibility variances and logical errors leads me to conclude that it is nearly impossible for people to communicate without learning a common dialect. Without a common dialect, at best, after a great deal of discourse, time and energy the true flavor of what one seeks to communicate can only start to come through.

A syntax exists for communication, but it is difficult to understand. It is known as the language of mathematics and the scientific method. It is invariant universally and communicates the same regardless of who is commanding it. It is with this language that answers about our place in the universe are starting to come into focus.

It is also with this syntax that those who previously claimed a monopoly on answers are being revealed as the charlatans that they are.

Friday, June 01, 2007

Optimal Shop Temperature

According to Jim Whipple, most QA manuals indicate that the optimal machine shop temperature is 68 degrees F.

Wednesday, May 30, 2007

Developing on the Back Deck

In honor of Jesse Keating, I present this development metaphor/cliche:

"Developing on the back deck"

It can have any one of three meanings:

1. Developing code through a terminal session running on one OS to a different OS, thus masking the things that suck about your desktop OS.

2. Pulling code out of your posterior region.

3. Working from home.

Saturday, May 05, 2007

Prospect Theory

I've been doing some reading about prospect theory lately. Prospect theory basically says that people tend to risk more to keep something than they risked in acquiring it in the first place. It also says that people are more willing to accept incremental gains that are a sure thing than they are willing to accept a chance at a huge gain. I'm sure a true connoisseur prospect theory will cringe at this over simplified explanation, but I think it makes the point.

To me, prospect theory is just another good example of the concept of least cost, plain and simple. Over billions of years of evolution, humans have gained the ability to determine which path will require the least amount of energy. When viewed objectively in the context of the modern world, where resources such as food are plentiful, some decisions that people make, which would seem perfectly rational 50,000 years ago, seem downright comical today.

Thursday, March 15, 2007

Learned something new today...

I was trying to do a shallow copy rather than a deep copy of a Java HashMap. As far as I can tell, you can't use clone() in Java 5 without getting unchecked cast warnings, period. The solution is to either ignore the warnings, or forgo the shallow copy and instantiate a new version of the object with the old version of the object as an argument (copy instantiation). Generics are cool and suck at the same time...


Wednesday, February 14, 2007

Lathe Stand

Got my metal lathe mounted on the stand last night. I felt very mortal while doing it. Swinging 1100lbs of solid iron around isn't something you do lightly. I had to rent an engine lift to do the deed. The whole time I had it suspended in the air, my "mind's eye" could see it crashing to the ground. In the end, I managed to get it bolted down to the stand without a hitch!

Sorry about the quality of the pictures. I noticed only after taking them that the lens on my cellphone camera had a bunch of crud in it.

Saturday, January 27, 2007

What the Terrorists Want

Reprinted with permission verbatim from the September 15, 2006 issue of Bruce Schneier's most excellent monthly newsletter CRYPTO-GRAM:

On August 16, two men were escorted off a plane headed for Manchester, England, because some passengers thought they looked either Asian or Middle Eastern, might have been talking Arabic, wore leather jackets, and looked at their watches -- and the passengers refused to fly with them on board. The men were questioned for several hours and then released.

On August 15, an entire airport terminal was evacuated because someone's cosmetics triggered a false positive for explosives. The same day, a Muslim man was removed from an airplane in Denver for reciting prayers. The Transportation Security Administration decided that the flight crew overreacted, but he still had to spend the night in Denver before flying home the next day. The next day, a Port of Seattle terminal was evacuated because a couple of dogs gave a false alarm for explosives.

On August 19, a plane made an emergency landing in Tampa, Florida, after the crew became suspicious because two of the lavatory doors were locked. The plane was searched, but nothing was found. Meanwhile, a man who tampered with a bathroom smoke detector on a flight to San Antonio was cleared of terrorism, but only after having his house searched.

On August 16, a woman suffered a panic attack and became violent on a flight from London to Washington, so the plane was escorted to the Boston airport by fighter jets. "The woman was carrying hand cream and matches but was not a terrorist threat," said the TSA spokesman after the incident.

And on August 18, a plane flying from London to Egypt made an emergency landing in Italy when someone found a bomb threat scrawled on an air sickness bag. Nothing was found on the plane, and no one knows how long the note was on board.

I'd like everyone to take a deep breath and listen for a minute.

The point of terrorism is to cause terror, sometimes to further a political goal and sometimes out of sheer hatred. The people terrorists kill are not the targets; they are collateral damage. And blowing up planes, trains, markets, or buses is not the goal; those are just tactics. The real targets of terrorism are the rest of us: the billions of us who are not killed but are terrorized because of the killing. The real point of terrorism is not the act itself, but our reaction to the act.

And we're doing exactly what the terrorists want.

We're all a little jumpy after the recent arrest of 23 terror suspects in Great Britain. The men were reportedly plotting a liquid-explosive attack on airplanes, and both the press and politicians have been trumpeting the story ever since.

In truth, it's doubtful that their plan would have succeeded; chemists have been debunking the idea since it became public. Certainly the suspects were a long way off from trying: None had bought airline tickets, and some didn't even have passports.

Regardless of the threat, from the would-be bombers' perspective, the explosives and planes were merely tactics. Their goal was to cause terror, and in that they've succeeded. Imagine for a moment what would have happened if they had blown up ten planes. There would be canceled flights, chaos at airports, bans on carry-on luggage, world leaders talking tough new security measures, political posturing and all sorts of false alarms as jittery people panicked. To a lesser degree, that's basically what's happening right now.

Our politicians help the terrorists every time they use fear as a campaign tactic. The press helps every time it writes scare stories about the plot and the threat. And if we're terrified, and we share that fear, we help. All of these actions intensify and repeat the terrorists' actions, and increase the effects of their terror.

(I am not saying that the politicians and press are terrorists, or that they share any of the blame for terrorist attacks. I'm not that stupid. But the subject of terrorism is more complex than it appears, and understanding its various causes and effects are vital for understanding how to best deal with it.)

The implausible plots and false alarms actually hurt us in two ways. Not only do they increase the level of fear, but they also waste time and resources that could be better spent fighting the real threats and increasing actual security. I'll bet the terrorists are laughing at us.

Another thought experiment: Imagine for a moment that the British government arrested the 23 suspects without fanfare. Imagine that the TSA and its European counterparts didn't engage in pointless airline security measures like banning liquids. And imagine that the press didn't write about it endlessly, and that the politicians didn't use the event to remind us all how scared we should be. If we'd reacted that way, then the terrorists would have truly failed.

It's time we calm down and fight terror with anti-terror. This does not mean that we simply roll over and accept terrorism. There are things our government can and should do to fight terrorism, most of them involving intelligence and investigation -- and not focusing on specific plots.

But our job is to remain steadfast in the face of terror, to refuse to be terrorized. Our job is to not panic every time two Muslims stand together checking their watches. There are approximately 1 billion Muslims in the world, a large percentage of them not Arab, and about 320 million Arabs in the Middle East, the overwhelming majority of them not terrorists. Our job is to think critically and rationally, and to ignore the cacophony of other interests trying to use terrorism to advance political careers or increase a television show's viewership.

The surest defense against terrorism is to refuse to be terrorized. Our job is to recognize that terrorism is just one of the risks we face, and not a particularly common one at that. And our job is to fight those politicians who use fear as an excuse to take away our liberties and promote security theater that wastes money and doesn't make us any safer.

Incidents: or or or,,-6024132,00.html

There have been many more incidents since I wrote this -- all false alarms. I've stopped keeping a list.

The chemical unreality of the plot: or or,,2-2306994,00.html

This essay also makes the same point that we're overreacting, as well as describing a 1995 terrorist plot that
was remarkably similar in both materials and modus operandi -- and didn't result in a complete ban on liquids.

My previous related writings:

This essay originally appeared in Wired:,71642-0.html

Wednesday, January 17, 2007

Exponential Growth

Just read a great article by Dr. Albert Bartlett on Arithemetic, Population and Energy. The main take-away is one that I'd learned a long time ago, but definitely needed a refresher.

Dr. Bartlett shows that if you want to figure out how long something takes to double, divide 70 by the annual growth rate and you'll get the number of years until you're doubled. An example of this is to consider inflation. At an average of 3% annual inflation, it will only take 23.3 years for all prices to double. Another example that Dr. Bartlett uses is population growth. At a nominal growth rate of 1.3%, the earth's population will double to 12 billion people in 53.86 years. The natural conclusion is that we'll need double the infrastructure that we have now in order to support the population in 53.86 years.

I did a few calculations of my own. In 53.86 years, given an average inflation rate of 3%, everything will cost 4 times more than it does now. Will wages follow this trend?

Fortunately, according to the US Census bureau the population growth of the US is 1.1% and is expected to drop to .54% between 2040 and 2050 with a final population projection of 392 million by 2050. Taking into account economic globalization and the fact that the global growth rate is higher than the US growth rate, it's readily apparent to me that the US isn't going to remain at the top of the heap forever in terms of resource utilization. This is causing a shift that's been apparent for many years where we see the manufacturing jobs leaving to other countries where they are cheaper. The consequence is that there is a greater and greater emphasis on education in the United States.

Interestingly, this all leads me to predict that eventually all manufacturing will come back to the US and that we'll be a global manufacturing superpower. Why? Consider that as the US population growth declines and levels off, our emphasis leans more and more towards being educated and using our minds to create things. Over time, the US will take the lead in lean process automation to the degree that we can manufacture things far cheaper than even the cheapest labor because we'll be able to do it without labor. Other countries will follow suit of course, but as long as we have an intelligent and informed workforce, the lead we gain while other countries lap up our manufacturing jobs, will enable us to permanently stay one step ahead of the rest of the world.

Monday, January 15, 2007

Survival of the Fittest

The animal kingdom constantly seeks to improve itself through "survival of the fittest". The feeble and diseased are preyed upon by predators, thus cleansing the stock, leaving behind the strongest to compete for the attention of mates in order to reproduce. One could argue that over many generations, this constant "improvement" would lead to super animals within a given species, but in fact it hasn't.

Ecosystems eventually reach an equilibrium with their environment, where the weak and diseased are still "trimmed" from the pack, but the overall strength of the entire system remains constant.

This all brings three questions to mind:

1) Is there some sort of external constant downward entropy that gets stronger as groups of animals improve? Such a thing would cause a natural limit to be reached.

2) Are their natural limits of the physical biology that the animals are hitting?

3) Are families of animals that exceed natural limits the ones who go on to speciate?