johnsonroad.net

Quidquid latine dictum sit, altum sonatur.

Archive for August, 2008

My landlord recently built storage lockers in our basement, and I dug through my junk drawer to find an old combination Master Lock to secure mine. I had forgotten the combination. Not to worry, as it’s not too hard to crack one if you have about 10 minutes to try up to 100 different combinations using this technique:

  1. Set the dial to 0.
  2. Pull up and maintain pressure as if you’re trying to open the lock.
  3. Let up just enough pressure to let the dial turn until it stops.
  4. Wiggle the dial back and forth. It will have one number’s-width of play in it, and it will either move from one whole number to the next or from one number’s half-position to the next number’s half-position. For example, it will move from 3.5 to 4.5. In that case the number we want is 4. Ignore positions where it “straddles” a half number, like if it moves between 3 and 4.
  5. There are 5 of these numbers. Write them down. All of them except one will end with the same digit, e.g.: 2, 12, 22, 27, 32. The one that doesn’t fit this pattern, 27 in this case, is the last number in the combination.

The first 60 seconds of this video demonstrates the technique to find the numbers:

This Python script makes it pretty quick to list the 100 possible combinations once you’ve isolated the last number using the above technique:

masterlock.py:

import sys
last = int(sys.argv[1])
remainder = last % 4
first = [remainder]
while first[-1] < 36:
first.append(first[-1] + 4)
if remainder == 0:
second = [2]
elif remainder == 1:
second = [3]
elif remainder == 2:
second = [0]
elif remainder == 3:
second = [1]
while second[-1] < 36:
second.append(second[-1] + 4)
for f in first:
for s in second:
print f, s, last

Just pass the script the last number in the combination, and it will spit out a list of all 100 possible combinations, like so:

python masterlock.py 7

Of course, this shows that combination Master Locks are really only secure if someone can’t spend 10 minutes messing around with your padlock without getting caught. And it means that if you have ten minutes, and something to write with and on, you can open someone else’s padlock. Don’t be a jerk.

I haven’t confirmed this, but I’ve heard that Master Lock redesigned their locks within the last couple years so that this trick doesn’t work anymore. My padlock was purchased before that.

I know that my padlock really isn’t protecting my stuff very well, but considering that the storage locker “walls” are made of chicken wire, the padlock isn’t the weak part of the system. The lock’s just there as a deterrent to keep my (hopefully) honest neighbors out of my stuff.

  • 2 Comments
  • Filed under: Good Ideas, Python
  • My First Kiva Loan Has Been Repaid

    One year ago Nazirjon Holdorov requested a $1000 loan from Kiva, a non-profit organization that connects microfinance organizations to online lenders that each contribute small amounts.

    Nazirjon Holdorov

    I was one of 29 people that lent him money, and today he repaid his loan in full. This is the first Kiva loan of mine that’s been paid back, (no defaults yet, either) and it’s cool to see the system working.

  • 0 Comments
  • Filed under: Good Ideas

  • Herd immunity arises when enough of the population has been vaccinated against a disease that individual cases cannot spread to enough people to cause an epidemic. We almost got there with measles near the end of the 20th century. Then Andrew Wakefield published a now-discredited study and the myth began that the Measles, Mumps, and Rubella (MMR) vaccine causes autism.

    from The Guardian:

    The rate of MMR vaccination fell from 91% in 1997 - approaching the “herd immunity” levels that would virtually wipe out the disease - to 80% in 2003. They have recovered only slightly since then. The reason, almost certainly, is that parents were frightened by a possible MMR “link” to autism. This fear carried little credibility among medical professionals. But it received high, sometimes hysterical, media coverage.

    [...]

    The research that led to suggestions of an MMR “link” with autism came from Dr Andrew Wakefield and 11 colleagues at the Royal Free Hospital, London. It was later discredited. He and two others are now charged with serious professional misconduct before the General Medical Council.

    This myth has received enough sensational press coverage that the suspicion that vaccines cause autism has entered common knowledge. Celebrities like Jenny McCarthy and Jim Carrey are furthering anti-vaccination propaganda. This could have serious repercussions on public health in America. Just when science was finally ridding us of a deadly disease, unscientific superstition came along to put us back in danger.

    See Wikipedia for a summary of the “controversy” regarding autism and the MMR vaccine, and Science-Based Medicine for a discussion of vaccine side effects from an MD who specializes in Infectious Disease.

  • 0 Comments
  • Filed under: Body, Science
  • It’s the middle of August, which means it’s time for the UW-Madison students to arrive and for thousands of downtown apartment dwellers to toss most of their possessions to the curb and be homeless for a night until they can move into their new place the next day.
    Gratis by daquellamanera on Flickr
    Right outside the front door of my building was a box marked “FREE” of discarded electronics including what are now my new alarm clock and subwoofer-equipped computer speakers. It doesn’t get any easier or cheaper than this.

  • 0 Comments
  • Filed under: Uncategorized
  • Read Montague, the director of the Human Neuroimaging Lab at Baylor College of Medicine in Houston, TX, is trying to crack the code of how the brain makes decisions — the neurochemical foundation of free will.

    The neurotransmitter dopamine’s effect on creating the sensation of reward in the brain was discovered in the 50’s. Montague’s research is showing that the activity of dopamine neurons influences decision making in a more complex manner than previously thought. Dopamine isn’t just produced when something favorable happens. It’s also produced as soon as there’s an expectation that something favorable will happen.

    What’s interesting about this system is that it’s all about expectation. Dopamine neurons constantly generate patterns based upon experience: If this, then that. The cacophony of reality is distilled into models of correlation. And if these predictions ever prove incorrect, then the neurons immediately readjust their expectations. The discrepancy is internalized; the anomaly is remembered. “The accuracy comes from the mismatch,” Montague says. “You learn how the world works by focusing on the prediction errors, on the events that you didn’t expect.” Our knowledge, in other words, emerges from our cellular mistakes. The brain learns how to be right by focusing on what it got wrong.

    So the brain learns by avoiding prior mistakes and trying to supply itself with “fixes” of dopamine — kind of a brute force trial-and-error. Is that the meaning of life? Too much dopamine causes an organism to ignore its basic survival instincts even to its own death:

    They inserted the needle right next to the nucleus accumbens (NAcc), a part of the brain dense with dopamine neurons and involved with the processing of pleasurable rewards, like food and sex.

    Olds and Milner quickly discovered that too much pleasure can be fatal. After they ran a small current into the wire, so that the NAcc was continually excited, the scientists noticed that the rodents lost interest in everything else. They stopped eating and drinking. All courtship behavior ceased. The rats would just cower in the corner of their cage, transfixed by their bliss. Within days all of the animals had perished. They had died of thirst.

    Maybe the ultimate goal is to do whatever it takes to keep as much dopamine flowing as possible while still keeping yourself fed, sheltered, and breeding for as long as possible. It’s elegantly simple. Working out the details of pursuing that goal is the interesting part.

    [Seed Magazine]

  • 0 Comments
  • Filed under: Body, Science
  • Do we need all these nukes?

    This video gives you an idea of just how large and expensive our nuclear arsenal is. How could we possibly need all of these nuclear warheads? Is it just to keep money flowing to the companies that build and maintain them?

  • 0 Comments
  • Filed under: Politics
  • That’s a pangram, a sentence that uses every letter of the alphabet at least once. They should teach that instead of the “quick brown fox” one.

    [printartist on Twitter]

  • 1 Comment
  • Filed under: Good Ideas
  • The Nanking Massacre

    I watching Nanking today — a documentary about the Japanese siege and occupation of the then-capital of China, Nanking, during World War II. Despite being a horrific example of war crimes committed during the 20th century, I don’t recall ever hearing anything about the Nanking Massacre in school.

    Over 200,000 Chinese civilians were killed during the first 6 weeks of the Japanese occupation. Over 20,000 cases of rapes were reported.

    The documentary includes readings by Western actors of the diaries of Westerners that stayed in Nanking and tried to shelter Chinese civilians from the onslaught of the Japanese soldiers that were indiscriminately raping and executing them. These readings are interspersed with eyewitness accounts from Chinese civilians and soldiers as well as Japanese soldiers.

    This is what can happen if it becomes acceptable to think of other people as being less than human, whether on nationalistic, religious, ethnic, or racial grounds. This is the danger of uncritically accepting divisive propaganda.

    The trailer for the film:

  • 0 Comments
  • Filed under: Politics
  • Hydrogen: Enough, Already.

    Robert Zubrin, an aerospace engineer, wants us to quit chasing after the much-hyped “hydrogen economy.” I can’t say that I disagree.

    From his article “The Hydrogen Hoax“:

    What is needed is government action to break the vertical monopoly on the automobile fuel supply currently held by the petroleum cartel. This could most efficiently be done simply by mandating that all new cars—whether of foreign or domestic manufacture—sold in the United States be “flex-fueled.” Such cars, which can run on any mixture of alcohol or gasoline, are currently being produced in the United States for little more (typically an extra $100 to $200) than the same vehicles in non-flex-fueled form. But they only command about 3 percent of the market, because there are so few high-alcohol gas pumps to serve them. Conversely, the reason why there are few high-alcohol pumps is because there are not enough flex-fuel cars on the road to warrant them. If you own a fuel station with three pumps, you are not going to waste one distributing a type of fuel that only 3 percent of cars can use.

    Yet within three years of a flex-fuel mandate, there would be at least 50 million cars on the road in the United States capable of using high-alcohol fuel, and at least an equal number overseas. This would be a sufficient market to create a widespread network of high-alcohol fuel pumps. Moreover, this dramatically increased demand for alcohol fuels would greatly exceed the supply capacity of American corn-ethanol producers, which means that we could drop our current tariffs against Latin American sugar-ethanol. A similar circumstance would pertain in Europe and Japan, enabling the elimination of their protectionist measures against Third World agricultural imports. This would solve the problem of trade barriers against farm products that scuttled the recent Doha round of international trade talks, thus benefiting rich and poor nations alike.

    By simply exposing the oil cartel to competition from such alternative fuel sources, we could impose a powerful constraint on its ability to run up prices. Combined with an unrelenting tariff policy favoring alcohol over imported oil, we could destroy OPEC completely, and effectively redirect over $600 billion per year that is now going to the treasury of terrorism to the global agricultural and mining sectors. Instead of sending our money to the Islamists to spread fanatical ideology, we could give our business to the world’s farmers, coal miners, and other people who actually work for a living. Instead of selling off blocks of stock in Western media companies to Saudi princes, we could be selling tractors to Honduras. Instead of funding terrorism, we could be using our energy dollars to finance world development. That’s what a serious energy policy would look like.

    (emphasis mine)

    [The New Atlantis via The Lone Sysadmin]