AJP Ping
August 23rd, 2010 // By Jeff
Have you ever wanted to check your tomcat instance without going through mod_jk? Would you like to know if a server problem is caused by your servlet engine or your connector? If you answered "whaaa???" to either of those questions, then the answer is no. If you're still reading this post, then we offer this handy troubleshooting device: ajping
ajping relies on Time::HiRes and Socket. It sends "\x12\x34\x00\x01\x0a" to the server and checks for "\0x41\0x42\0x00\0x01\0x09" in response. For an explanation of that exchance, check out the AJP protocol page.
Script: ajping
Geometric Mean
August 2nd, 2010 // By Jeff
JoeDog::Stats (tarball - zip) was updated to version 1.15. This version adds support for the geometric mean in arrays and hash tables.
The Geometric Mean of a set of n positive numbers is the nth root of the product of n numbers. There are two main uses of the Geometric Mean: (1) to average indexes or (2) determine the average percent increase of a series of numbers from one time to another. JoeDog::Stats performs the first function. If you require the latter, let us know.
The Geometric Mean is calculated as follows:
________________ GM = \n/ (x1)(x2)...(xn)
NOTE: if one of the numbers is zero or negative the Geometric Mean cannot be computed. JoeDog::Stats will return "undef" in those cases.
To illustrate the geometric mean consider the following example. If Joe's Bar and Whorehouse made annual profits of 3, 2, 4 and 6% over a period of four years, what is the geometric mean profit?
__________ GM = \4/(3)(2)(4)(6) ______ = \4/ 144 = 3.46
This is slightly less than the artimetic mean which is 3.75. In the example above, Joe had a disproportionately good fourth year that skews his average. The Geometric Mean, therefore, provides a better description of a typical year's profits. The Geometric mean is not as weighted by extreme measures. Because of this, it provides a better indicator or typical experience. It is a good stat to describe positively skewed data such as network performance measures.
Make M$ Pay
July 28th, 2010 // By Jeff
Who's more like Hitler, Bush or Obama? Is Glenn Beck more like a spent condom or Jesus Christ? The Internets love to argue. One of the more contentious debates is Windows vs. Linux. Now, your blogger clearly favors Linux for numerous reasons. First and foremost is stability. "Oh, Windows is just as stable" he's heard Microsoft bigots claim. Really? Well if you're on life support which OS do you want to manage the controls?
On Signatures
July 26th, 2010 // By Jeff
Don't you love messages from Mr. Self-important? He's got a disclaimer in his email signature. "The [misspellings and grammatical errors] you just recieved may be privileged information. If you recieved this message in error, please delete it and contact me immediately." Yeah. Sure. When I get messages in error, I ditch them because who cares? Yet when I see a directive like that, I want to post it to usenet.
I'm on Obama's mailing list. The Leader of the Free World doesn't have as much self-importance as some mid-level corporate drones. There's no legal disclaimer; no threats implied or otherwise. The President doesn't ask me to burn after reading. His signature just asks me for money. What is he, homeless?
Did you ever see this? Somebody puts their email address in their email signature. Do they know how email works? Hey thanks. Without that signature, I'd never be able to contact you. How about the guy who actually needs it. "I'd like to contact Bob but all I have is an inbox filled with his messages..."
In 2009, 247 billion email messages were sent daily. Unless you're in the market for boner pills and cheap meds, most of that is spam. Yet if 10% of all messages contain a 532 byte signature (the average of the ones I sampled), the Internets are moving 12 gigs of pointless fluff daily. Some may say that's a small price to keep Mr. Self-important happy but I say waste more bandwidth and post his drivel on wikileaks. You know he wants the drama....
Sisyphus Calls Their Bluff
July 21st, 2010 // By Jeff
During the winter of 2009-2010, we experience several crippling snow storms in the American Northeast. The Internets replied like a alcoholic asked to guard a case of scotch. The Moonie Washington Times displayed its rightwing contempt for "liberal" science: "Record snowfall illustrates the obvious: The global warming fraud is without equal in modern science."
Efforts to convince deniers that extreme weather is consistent with anthropogenic climate change are best reserved for Sisyphus. When naysayers bashed climate change theory on a local forum, I was able to squash their contempt without a single point of data.
The contemptuous right understands one thing: money. Last January with two feet of snow on the ground I posed this challenge to every climate change denier on the forum: I will cover this wager for any amount for anyone who wants to take it: 2010 will be one of the top ten warmest years on record.
Change We Can Believe In
July 21st, 2010 // By Jeff
You can understand why some think evolution is bullshit. Imagine if best humans of each successive generation produced people whose asses glowed each time they wanted sex. Yet this was the process through which fireflies found themselves with glow-in-the-dark butts. We can light our farts but women don't respond like lightning bugs. (You win this round, fireflies)
Unfortunately for evolution's critics, the implausibility of illuminous asses hardly falsifies the theory. The best way unseat a prevailing theory is to propose an alternative model that better explains the facts. This new theory should make verifiable predictions that are not anticipated by the old one. Darwin predicted a mechanism that would pass traits to ensuing generations, a notion that contradicted Lamarck's soft inheritance. Modern genetics settled the dispute in Darwin's favor.
Unable to propose alternative theories that satisfy science and a particular worldview, critics continue to nip at evolution's heels. Criticisms generally take the form of a question: If evolution is so real, why are humans not evolving further?
The inquisitor suffers from near-sightedness. What? -- because you resemble grandpa evolution is bullshit? Evolutionary change requires more than three generations but that doesn't mean we can't recognize it.
Consider this: Ten thousand years ago, humans began to cultivate rice in Asia. They soon discovered that fermentation made rice better and got wasted on sake. Drinking and carousing must have posed a threat to survival because a variant gene that protects against alcohol soon became prominent in the wake of rice cultivation.
Meanwhile, 3000 years ago in Tibet a gene variation enabled indigenous people to thrive in the low oxygen environment of the Tibetan highlands. It represents another genetic response to local conditions. If this study withstands peer-review, it represents one of the most recent examples of human evolution.
Most of us continue to evolve....
The Weakening Herd
July 20th, 2010 // By Jeff
California is in the midst of a whooping cough epidemic, a vaccine preventable bacterial infection. Poverty on the high plateau and insanity in the suburbs have lowered vaccination rates with predictable results.
Infants are particularly vulnerable to whooping cough. According to the CDC, they cannot begin vaccination treatments prior to two months. Until they are fully immunized, infants must rely on herd immunity to avoid infection. Parents who fail immunize their children place them and others at risk. Newborns are at the mercy of a herd that contains some individuals who appear to be a few cards shy of a full deck.
No Needle and the Damage Done
July 20th, 2010 // By Jeff
For centuries, whooping cough was one of the leading causes of infant death. It induces persistent coughing that can lead to vomitting which can cause malnutrition, infection and pnuemonia. With the introduction of pertussis vaccines in the 1940s, reported cases fell from 157 to 1 cases per 100,000 people. These vaccines saved thousands of lives.
This week California declared a whooping cough epidemic. Fifteen hundred cases have been reported so far, a five-fold increase over the year before. There have been five, possibly six, deaths in the first six months of 2010. Increased occurances can be attributed in part to parents who opt out of vaccination.
One of the worst hit areas is located north of San Francisco in affluent Marin County. The area has had ten times more reported instances this year than in the previous ten. What's going on?В
In Marin, parents are able to cite "personal beliefs" in order to opt out of vaccination. As a result, 7.1% of children enter kindergarten without proper protection. This practice is driven by parental fears which have all been debunked. It's one thing for a Luddite Amishman to eschew technology to his inconvience. It's quite another to leave infants vulnerable to vaccine preventable diseases. Unfortunately, many parents are willing to trust Jenny McCarthy rather than a family physician.
UPDATE: This article mentions a sixth death possibly attributed to whooping cough. Today that was confirmed.
Beautiful People
July 19th, 2010 // By Jeff
A Newsweek survey concludes it's better to be good looking than good. Beautiful people land better jobs, get better promotions, make more money and get more face time than their homely counterparts. According Daniel Hamermesh, an economist cited by Newsweek, a good looking man will earn a quarter million dollars more than his less attractive peers over the course of their careers.
It's not bias, it's biology:
Biologically speaking, humans are attracted to symmetrical faces and curvy women for a reason: it's those shapes that are believed to produce the healthiest offspring. As the thinking goes, symmetrical faces are then deemed beautiful; beauty is linked to confidence; and it's a combination of looks and confidence that we often equate with smarts.
So what does this mean for you? If you were agonizing between a private college and a public university, go with the subsidized education. It's less expensive and even best college won't change your looks.
Release Early, But Meet Expectations
July 19th, 2010 // By Jeff
"Release early, release often." - Eric Raymond
Most successful open source projects rely on the RERO development model. Frequent releases provide developers with a steady stream of customer feedback which allows them to shape a product to fit the needs of those who use it. Open source projects tend to evolve as a community of customers and developers form around them.
Eric Raymond proposed this model in 1997 when open source was still playing catch up to commerical software. Does it still make sense?
Frequent releases seem to improve security as bug fixes and security patches move quickly to end users. In the 1990s, somebody with too much time on their hands discovered you could crash most devices by sending them large ICMP packets, the dreaded ping of death. Within two hours, the Linux kernel team provided a fix. Their commercial counterparts needed days, weeks and, in the case of Microsoft, months to provide users with a fix. The ability to get fixes in the hands of users quickly is without question a Good Thing. But what about RE part of RERO? What about early releases?
I've encountered too many open source projects that were, frankly, a waste of my time. Unless it's designated as a developer's relase, a 1.0 software project should meet a minimum set of standards:
- It should do what you say it will do. If your project is a plug proxy, then release 1.0 should act as a plug proxy. Users understand it might not do IP filtering or load balancing but, dammit!, it ought to serve as a plug proxy.
- It should have a help section. The first thing somebody does when they see a new binary is pass it a -h/--help option to understand its behavior. You can add this option in less than an hour. Users will forgive your 1.0 version for lack of a man page but you better provide a help section.
- It should rely on GNU autotools. Yes, autotools sucks but users are conditioned to run ./configure, make and make install. Again, there are plenty of open source projects from which you can steal a configure.in and a Makefile.am. Feel free to steal them from mine.
- If it's a daemon, then it should write a PID file to a configurable location. If your project is going to be successful, then you'll need to add this at some point. Why not add it to release 1.0?
- If it's a daemon, then it should reload its configuration with kill -HUP. It's no longer 1997. The internet is filled with open source software. There are plenty of examples of this implementation. Find one and steal the code.

