Random Articles (Page 4)

Have a deep view into what people are curious about.

πŸ”— M4 (computer language)

πŸ”— Computing πŸ”— Computing/Computer science

m4 is a general-purpose macro processor included in all UNIX-like operating systems, and is a component of the POSIX standard.

The language was designed by Brian Kernighan and Dennis Ritchie for the original versions of UNIX. It is an extension of an earlier macro processor m3, written by Ritchie for an unknown AP-3 minicomputer.

The macro preprocessor operates as a text-replacement tool. It is employed to re-use text templates, typically in computer programming applications, but also in text editing and text-processing applications. Most users require m4 as a dependency of GNU autoconf.

Discussed on

πŸ”— Toilet Paper Orientation

πŸ”— Sociology

Toilet paper when used with a toilet roll holder with a horizontal axle parallel to both the wall and the floor has two possible orientations: the toilet paper may hang over (in front of) or under (behind) the roll.

Some people hold strong opinions on the matter; advice columnist Ann Landers said that the subject was the most responded to (15,000 letters in 1986) and controversial issue in her column's history. Defenders of either position cite advantages ranging from aesthetics, hospitality, and cleanliness to paper conservation, ease of detaching sheets, and compatibility with pets. Some writers have proposed connections to age, sex, or political philosophy, and survey evidence has shown a correlation with socioeconomic status.

Solutions where the views of household members differ include using separate dispensers or separate bathrooms and ignoring the issue. One man advocates a plan under which his country will standardize on a single forced orientation, and at least one inventor hopes to popularize a new kind of toilet roll holder which swivels from one orientation to the other.

Discussed on

πŸ”— Etaoin shrdlu

πŸ”— Typography πŸ”— Primates

Discussed on

πŸ”— Schwartzian Transform

πŸ”— Computer science

In computer programming, the Schwartzian transform is a technique used to improve the efficiency of sorting a list of items. This idiom is appropriate for comparison-based sorting when the ordering is actually based on the ordering of a certain property (the key) of the elements, where computing that property is an intensive operation that should be performed a minimal number of times. The Schwartzian transform is notable in that it does not use named temporary arrays.

The Schwartzian transform is a version of a Lisp idiom known as decorate-sort-undecorate, which avoids recomputing the sort keys by temporarily associating them with the input items. This approach is similar to memoization, which avoids repeating the calculation of the key corresponding to a specific input value. By comparison, this idiom assures that each input item's key is calculated exactly once, which may still result in repeating some calculations if the input data contains duplicate items.

The idiom is named after Randal L. Schwartz, who first demonstrated it in Perl shortly after the release of Perl 5 in 1994. The term "Schwartzian transform" applied solely to Perl programming for a number of years, but it has later been adopted by some users of other languages, such as Python, to refer to similar idioms in those languages. However, the algorithm was already in use in other languages (under no specific name) before it was popularized among the Perl community in the form of that particular idiom by Schwartz. The term "Schwartzian transform" indicates a specific idiom, and not the algorithm in general.

For example, to sort the word list ("aaaa","a","aa") according to word length: first build the list (["aaaa",4],["a",1],["aa",2]), then sort it according to the numeric values getting (["a",1],["aa",2],["aaaa",4]), then strip off the numbers and you get ("a","aa","aaaa"). That was the algorithm in general, so it does not count as a transform. To make it a true Schwartzian transform, it would be done in Perl like this:

Discussed on

πŸ”— Wikipedia on Santos

Discussed on

πŸ”— Foetry.com

πŸ”— Internet πŸ”— Computing πŸ”— Literature

Foetry.com, sometimes referred to as just Foetry, was a website that attempted to identify fraudulent and unethical practices in poetry contests. It was active from April 1, 2004 until May 18, 2007.

Discussed on

πŸ”— Stonewall Nation

πŸ”— California πŸ”— LGBT studies

Stonewall Nation was the informal name given to a proposition by gay activists to establish a separatist community in Alpine County, California in 1970. The small population of the county and the election rules for California counties at the time suggested to these activists that if they could induce a relatively small number of gay people to move to the county, they could recall the county government and replace it with an all-gay slate.

The plan did not gain traction in the LGBT community and a right-wing Christian minister announced plans to move large numbers of Christians to the county to counteract any attempt by gay people to take over the county government. The plan was abandoned about a year after it was conceived and the idea has come to be seen as a practical joke.

Discussed on

πŸ”— Luhn Algorithm for validating credit cards

πŸ”— Computing πŸ”— Mathematics

The Luhn algorithm or Luhn formula, also known as the "modulus 10" or "mod 10" algorithm, named after its creator, IBM scientist Hans Peter Luhn, is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers in the United States, Canadian Social Insurance Numbers, Israel ID Numbers, South African ID Numbers, Greek Social Security Numbers (Ξ‘ΞœΞšΞ‘), and survey codes appearing on McDonald's, Taco Bell, and Tractor Supply Co. receipts. It is described in U.S. Patent No. 2,950,048, filed on January 6, 1954, and granted on August 23, 1960.

The algorithm is in the public domain and is in wide use today. It is specified in ISO/IEC 7812-1. It is not intended to be a cryptographically secure hash function; it was designed to protect against accidental errors, not malicious attacks. Most credit cards and many government identification numbers use the algorithm as a simple method of distinguishing valid numbers from mistyped or otherwise incorrect numbers.

Discussed on

πŸ”— TP-82 Cosmonaut survival pistol

πŸ”— Soviet Union πŸ”— Firearms

The TP-82 (Russian: ВП-82) was a triple-barrelled Soviet pistol that was carried by cosmonauts on space missions.

It was intended as a survival aid to be used after landings and before recovery in the Siberian wilderness. The TP-82 was the result of cosmonaut Alexei Leonov's concerns after being stranded in the Siberian wilderness when his Voskhod capsule malfunctioned. He feared that the 9mm pistol that was provided in the survival kit would be ineffective against the Siberian wildlife, namely bears and wolves.

The upper two shotgun barrels used 12.5Γ—70Β mm ammunition (40 gauge), and the lower rifled barrel used 5.45Γ—39mm ammunition developed for the AK-74 assault rifle. The TP-82 has a large lever on the left side of the receiver that opens the action and a small grip-safety under the trigger-guard that resembles a secondary trigger.

The pistol could be used for hunting, to defend against predators and for visible and audible distress signals. The detachable buttstock was also a machete that came with a canvas sheath. TP-82s were carried regularly on Soviet and Russian space missions from 1986 to 2007. They were part of the Soyuz Portable Emergency-Survival Kit (Носимый Π°Π²Π°Ρ€ΠΈΠΉΠ½Ρ‹ΠΉ запас, Nosimyi Avariynyi Zapas, NAZ). In 2007, the media reported that the remaining ammunition for the TP-82 had become unusable and that a regular semi-automatic pistol would be used on future missions.

Discussed on