29 Apr 2009, 7:22pm

by Layne

2 comments

Velocipede, not Velociraptor

Whenever I write about velociraptors, my spellchecker always suggests “velocipede” as the word I’m most likely trying to spell. Curiosity eventually got the better of me, so I looked up the meaning of this rather odd word:

The velocipede was a series of human-powered vehicles created in the late Georgian era. There were designs with two, three and four wheels. Some two-wheeled designs had pedals mounted on the front wheel, while three- and four-wheeled designs used treadles and levers to drive the rear wheels. Later two-wheel versions had increasingly large front wheels, directly driven by bicycle pedals, and a smaller back wheel—these leading to the penny-farthing.

Now you know…

Velocipede

via Velocipede – Wikipedia, the free encyclopedia.

18 Apr 2009, 7:06am

by Layne

leave a comment

Shabbat Mode

Sabbath mode is a feature in many modern appliances, including ovens and refrigerators which is intended to allow the appliances to be used (subject to various constraints) by Sabbath-observant Jews on the Sabbath and Jewish holidays.

One of the Sabbath laws is that raw food may not be cooked on the Sabbath, but food which was already cooked beforehand may be kept warm until mealtime. On holidays, food may be cooked fresh, but turning the flame on is problematic. In the past, both of these could be accomplished simply by lighting a flame before the day begins, and using its heat over the course of the day. In recent decades, however, appliance manufacturers have instituted a safety feature which automatically shuts off the heat after a number of hours. This renders the appliance useless for those who observe these religious laws.

The key features of Sabbath mode ovens are that it disables the standard six- or twelve-hour cutoff and all lights and displays are disabled, so that no visible activity takes place when the oven door is opened.

In more recent ovens, Sabbath mode will often feature the ability to adjust the temperature of the oven without any feedback to the operator of the oven. This is not relevant to the Sabbath, but is useful on holidays, when adjusting the heat is allowed, but changing a digital readout on the control panel is not, according to the prevailing Orthodox opinion and the minority Conservative view.

With some Sabbath mode ovens that are controlled using a keypad to set the temperature, there is a pseudo-random delay triggered after a button is pressed before the temperature change takes place.

Those who feel that hitting the keypad closes a switch and that completing a circuit is not allowed do have other options, such as the “Tweaker” which was featured on the TorahTechnologies.org web site that emulates old manual ovens by adding a knob that confuses the accurate temperature measurement in a beneficial fashion.

A Sabbath mode refrigerator includes, at a minimum, the ability to disable all lights or other electrical activity from occurring when the refrigerator door is opened. Some Sabbath mode refrigerators include a timer for the compressor so that opening the door, which will normally indirectly cause the compressor to turn on as the temperature rises, will have absolutely no effect on any electrical operation of the appliance.

See also:

via Shabbat mode – Wikipedia, the free encyclopedia.

14 Apr 2009, 2:36pm

by Layne

leave a comment

Saturation Arithmetic

Saturation arithmetic is a version of arithmetic in which all operations such as addition and multiplication are limited to a fixed range between a minimum and maximum value. If the result of an operation is greater than the maximum it is set (“clamped”) to the maximum, while if it is below the minimum it is clamped to the minimum. The name comes from how the value becomes “saturated” once it reaches the extreme values; further additions to a maximum or subtractions from a minimum will not change the result.

Typically, early computer microprocessors did not implement integer arithmetic operations using saturation arithmetic; instead, they used the easier-to-implement modular arithmetic, in which values exceeding the maximum value “wrap around” to the minimum value, like the hours on a clock passing from 12 to 1. In hardware, modular arithmetic with a minimum of zero and a maximum of 2n can be implemented by simply discarding all but the lowest n bits.

However, although more difficult to implement, saturation arithmetic has numerous practical advantages. The result is as numerically close to the true answer as possible; it’s considerably less surprising to get an answer of 127 instead of 130 than to get an answer of −126 instead of 130. It also enables overflow of additions and multiplications to be detected consistently without an overflow bit or excessive computation by simple comparison with the maximum or minimum value (provided the datum is not permitted to take on these values).

Additionally, saturation arithmetic enables efficient algorithms for many problems, particularly in digital signal processing. For example, adjusting the volume level of a sound signal can result in overflow, and saturation causes significantly less distortion to the sound than wrap-around.

via Saturation arithmetic – Wikipedia, the free encyclopedia.

Using command line arguments in Python in IDLE.

I’m not a big fan of integrated development environments (IDEs), but they can be nice to help people get introduced to a new language, or even to programming in general. Processing and Arduino wouldn’t be as easy for new people to use if they didn’t have a decent IDE.

Most useful scripts accept command line arguments to configure their behavior, but sometimes it is difficult to set command line parameters from within an IDE. I was recently working on a python project with a friend living in Florida, new to the world of programming, so I showed him how to use Python’s IDLE interface, a nice IDE for Python work. Unfortunately, there is no way to set command line arguments from IDLE, so our scripts weren’t working in the IDE. I found a way to manually set the command line arguments if a Python script is run from IDLE, but doesn’t interfere if the script is run from the console.

To use, insert this code right after the start of your main-line code, right before you do your parsing and validation of the input parameters. Be sure that the specified arguments below match what your program is expecting.


try:
    __file__
except:
    sys.argv = [sys.argv[0], 'argument1', 'argument2', 'argument2']

10 Apr 2009, 5:41pm

by Layne

leave a comment

Azertyuiop

Azertyuiop is a top-class 2 mile National Hunt steeplechase horse. He won the Arkle Challenge Trophy at the 2003 Cheltenham Festival, going on to win the Queen Mother Champion Chase the following year, and then coming home third in the same race in 2005. He was trained by Paul Nicholls and was ridden by Ruby Walsh in every chase bar one. He is owned by John Hales who also owned One Man, who won the 1998 Queen Mother Champion Chase and the 1995 and 1996 King George VI Chase. His name derives from the top row of letters on the French keyboard layout.

via Azertyuiop (horse) – Wikipedia, the free encyclopedia.

Century egg

A Century egg, also known as preserved egg, hundred-year egg, thousand-year egg, and thousand-year-old egg, is a Chinese cuisine ingredient made by preserving duck, chicken or quail eggs in mixture of clay, ash, salt, lime, and rice straw for several weeks to several months, depending on the method of processing. After the process is completed, the yolk becomes a dark green, cream-like substance with a strong odor of sulfur and ammonia, while the white becomes a dark brown, transparent jelly with little flavor or taste. The transforming agent in the century egg is its alkaline material, which gradually raises the pH of the egg from around 9 to 12 or more. This chemical process breaks down some of the complex, flavorless proteins and fats, which produces a variety of smaller flavorful compounds.

via Century egg – Wikipedia, the free encyclopedia.

3 Apr 2009, 11:46am

by Layne

leave a comment

Reaction Wheel

A reaction wheel is a type of flywheel used primarily by spacecraft to change their angular momentum without using fuel for rockets or other reaction devices. Reaction wheels are devices which aim a spacecraft in different directions without firing rockets or jets. They are particularly useful when the spacecraft must be rotated by very small amounts, such as keeping a telescope pointed at a star. They may also reduce the mass fraction needed for fuel. This is accomplished by equipping the spacecraft with an electric motor attached to a flywheel, which upon spinup causes the spacecraft to turn the other way by conservation of angular momentum. However, they are not capable of moving the spacecraft from one place to another, they can only rotate the spacecraft around its center of mass.

Momentum wheels used in the Hubble Space Telescope are a different type of actuator, mainly used for gyroscopic stabilization of spacecraft: momentum wheels have high rotation speeds (around 5000 rpm) and mass, while reaction wheels work around a nominal zero rotation speed.

Reaction wheels are usually implemented as special electric motors. Both spin-up and braking are controlled electronically by computer controls. The strength of the materials of a reaction wheel determines the speed at which the wheel would come apart, and therefore how much angular momentum it can store.

Since the reaction wheel is a small fraction of the spacecraft’s total mass, easily-measurable changes in its speed provide very precise changes in angle. It therefore permits very precise changes in a spacecraft’s attitude. For this reason, reaction wheels are often used to aim spacecraft with cameras or telescopes.

via Reaction wheel – Wikipedia, the free encyclopedia.