# Code: Wikis

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

# Encyclopedia

A code is a rule for converting a piece of information (for example, a letter, word, phrase, or gesture) into another form or representation (one sign into another sign), not necessarily of the same type.

In communications and information processing, encoding is the process by which information from a source is converted into symbols to be communicated. Decoding is the reverse process, converting these code symbols back into information understandable by a receiver.

One reason for coding is to enable communication in places where ordinary spoken or written language is difficult or impossible. For example, semaphore, where the configuration of flags held by a signaller or the arms of a semaphore tower encodes parts of the message, typically individual letters and numbers. Another person standing a great distance away can interpret the flags and reproduce the words sent.

## Theory

In information theory and computer science, a code is usually considered as an algorithm which uniquely represent strings in some alphabet, by encoded strings, which may be in some other alphabet.

### Variable-length codes

In this section we consider codes, which encode each source (clear text) character by a code word from some dictionary, and concatenation of such code words give us an encoded string. Variable-length codes are especially useful when clear text characters have different probabilities; see also entropy encoding.

A prefix code is a code with the "prefix property": there is no valid code word in the system that is a prefix (start) of any other valid code word in the set. Huffman coding is the most known algorithm for deriving prefix codes, so prefix codes are also widely referred to as "Huffman codes", even when the code was not produced by a Huffman algorithm. Another examples are country calling codes, the country and publisher parts of ISBNs, and the Secondary Synchronization Codes used in the UMTS W-CDMA 3G Wireless Standard are prefix codes.

Kraft's inequality characterizes the sets of code word lengths that are possible in a prefix code. Virtually, any uniquely decodable one-to-many code, not necessary a prefix one, must satisfy Kraft's inequality.

### Error correcting codes

Codes may also be used to represent data in a way more resistant to errors in transmission or storage. Such a "code" is called an error-correcting code, and works by including carefully crafted redundancy with the stored (or transmitted) data. Examples include Hamming codes, Reed–Solomon, Reed–Muller, Bose–Chaudhuri–Hochquenghem, Turbo, Golay, Goppa, low-density parity-check codes, and space–time codes. Error detecting codes can be optimised to detect burst errors, or random errors.

## Examples

### Codes in communication used for brevity

A cable code replaces words (e.g., ship or invoice) with shorter words, allowing the same information to be sent with fewer characters, more quickly, and most important, less expensively.

Codes can be used for brevity. When telegraph messages were the state of the art in rapid long distance communication, elaborate systems of commercial codes that encoded complete phrases into single words (commonly five-letter groups) were developed, so that telegraphers became conversant with such "words" as BYOXO ("Are you trying to weasel out of our deal?"), LIOUY ("Why do you not answer my question?"), BMULD ("You're a skunk!"), or AYYLU ("Not clearly coded, repeat more clearly."). Code words were chosen for various reasons: length, pronounceability, etc. Meanings were chosen to fit perceived needs: commercial negotiations, military terms for military codes, diplomatic terms for diplomatic codes, any and all of the preceding for espionage codes. Codebooks and codebook publishers proliferated, including one run as a front for the American Black Chamber run by Herbert Yardley between the First and Second World Wars. The purpose of most of these codes was to save on cable costs. The use of data coding for data compression predates the computer era; an early example is the telegraph Morse code where more-frequently used characters have shorter representations. Techniques such as Huffman coding are now used by computer-based algorithms to compress large data files into a more compact form for storage or transmission.

### Character encodings

Probably the most widely known data communications code so far (aka character representation) in use today is ASCII. In one or another (somewhat compatible) version, it is used by nearly all personal computers, terminals, printers, and other communication equipment. It represents 128 characters with seven-bit binary numbers—that is, as a string of seven 1s and 0s. In ASCIIvcx a lowercase "a" is always 1100001, an uppercase "A" always 1000001, and so on. There are many other encodings, which represent each character by a byte (usually referred as code pages), integer code point (Unicode) or a byte sequence (UTF-8).

### Genetic code

Biological organisms contain genetic material that is used to control their function and development. This is the DNA, which contains units named genes that can produce proteins through a code (genetic code) in which a series of triplets of four possible nucleotides are translated into one of twenty possible amino acids.

## Gödel code

In mathematics, a Gödel code was the basis for the proof of Gödel's incompleteness theorem. Here, the idea was to map mathematical notation to a natural number (using a Gödel numbering).

### Other

There are codes using colors, like traffic lights, the color code employed to mark the nominal value of the electrical resistors or that of the trashcans devoted to specific types of garbage (paper, glass, biological, etc.)

In marketing, coupon codes can be used for a financial discount or rebate when purchasing a product from an internet retailer.

In military environments, specific sounds with the cornet are used for different uses: to mark some moments of the day, to command the infantry in the battlefield, etc.

Communication systems for sensory impairments, as the sign language for deaf people and braille for blind people, are based in movement or tactile codes.

Musical scores are the most common way to encoding music.

Specific games, as chess, have their own code systems to record the matches (chess notation).

### Cryptography

In the history of cryptography, codes were once common for ensuring the confidentiality of communications, although ciphers are now used instead. See code (cryptography).

Secret codes intended to obscure the real messages, ranging from serious (mainly espionage in military, diplomatic, business, etc.) to trivial (loving, games) can be any kind of imaginative encoding: flowers, game cards, clothes, fans, hats, melodies, birds, etc., in which the sole requisite is the previous agreement of the meaning by both the sender and the receiver.

## Codes and acronyms

Acronyms and abbreviations can be considered codes, and in a sense all languages and writing systems are codes for human thought. Occasionally a code word achieves an independent existence (and meaning) while the original equivalent phrase is forgotten or at least no longer has the precise meaning attributed to the code word. For example, '30' was widely used in journalism to mean "end of story", and it is sometimes used in other contexts to signify "the end".

## References

A code is a rule for converting a piece of information (for example, a letter, word, phrase, or gesture) into another form or representation (one sign into another sign), not necessarily of the same type.

In communications and information processing, encoding is the process by which information from a source is converted into symbols to be communicated. Decoding is the reverse process, converting these code symbols back into information understandable by a receiver.

One reason for coding is to enable communication in places where ordinary spoken or written language is difficult or impossible. For example, semaphore, where the configuration of flags held by a signaller or the arms of a semaphore tower encodes parts of the message, typically individual letters and numbers. Another person standing a great distance away can interpret the flags and reproduce the words sent.

## Theory

In information theory and computer science, a code is usually considered as an algorithm which uniquely represents symbols from some source alphabet, by encoded strings, which may be in some other target alphabet. An extension of the code for representing sequences of symbols over the source alphabet is obtained by concatenating the encoded strings.

Before giving a mathematically precise definition, we give a brief example. The mapping

$C = \\left\{\, a\mapsto 0, b\mapsto 01, c\mapsto 011\,\\right\}$

is a code, whose source alphabet is the set $\\left\{a,b,c\\right\}$ and whose target alphabet is the set $\\left\{0,1\\right\}$. Using the extension of the code, the encoded string 0011001011 can be grouped into codewords as 0 – 011 – 0 – 01 – 011, and these in turn can be decoded to the sequence of source symbols acabc.

Using terms from formal language theory, the precise mathematical definition of this concept is as follows: Let S and T be two finite sets, called the source and target alphabets, respectively. A code $C:\, S \to T^*$ is a total function mapping each symbol from S to a sequence of symbols over T, and the extension of M to a homomorphism of $S^*$ into $T^*$, which naturally maps each sequence of source symbols to a sequence of target symbols, is referred to as its extension.

### Variable-length codes

In this section we consider codes, which encode each source (clear text) character by a code word from some dictionary, and concatenation of such code words give us an encoded string. Variable-length codes are especially useful when clear text characters have different probabilities; see also entropy encoding.

A prefix code is a code with the "prefix property": there is no valid code word in the system that is a prefix (start) of any other valid code word in the set. Huffman coding is the most known algorithm for deriving prefix codes, so prefix codes are also widely referred to as "Huffman codes", even when the code was not produced by a Huffman algorithm. Another examples are country calling codes, the country and publisher parts of ISBNs, and the Secondary Synchronization Codes used in the UMTS W-CDMA 3G Wireless Standard are prefix codes.

Kraft's inequality characterizes the sets of code word lengths that are possible in a prefix code. Virtually, any uniquely decodable one-to-many code, not necessary a prefix one, must satisfy Kraft's inequality.

### Error correcting codes

Codes may also be used to represent data in a way more resistant to errors in transmission or storage. Such a "code" is called an error-correcting code, and works by including carefully crafted redundancy with the stored (or transmitted) data. Examples include Hamming codes, Reed–Solomon, Reed–Muller, Walsh-Hadamard, Bose–Chaudhuri–Hochquenghem, Turbo, Golay, Goppa, low-density parity-check codes, and space–time codes. Error detecting codes can be optimised to detect burst errors, or random errors.

## Examples

### Codes in communication used for brevity

A cable code replaces words (e.g., ship or invoice) with shorter words, allowing the same information to be sent with fewer characters, more quickly, and most important, less expensively.

Codes can be used for brevity. When telegraph messages were the state of the art in rapid long distance communication, elaborate systems of commercial codes that encoded complete phrases into single words (commonly five-letter groups) were developed, so that telegraphers became conversant with such "words" as BYOXO ("Are you trying to weasel out of our deal?"), LIOUY ("Why do you not answer my question?"), BMULD ("You're a skunk!"), or AYYLU ("Not clearly coded, repeat more clearly."). Code words were chosen for various reasons: length, pronounceability, etc. Meanings were chosen to fit perceived needs: commercial negotiations, military terms for military codes, diplomatic terms for diplomatic codes, any and all of the preceding for espionage codes. Codebooks and codebook publishers proliferated, including one run as a front for the American Black Chamber run by Herbert Yardley between the First and Second World Wars. The purpose of most of these codes was to save on cable costs. The use of data coding for data compression predates the computer era; an early example is the telegraph Morse code where more-frequently used characters have shorter representations. Techniques such as Huffman coding are now used by computer-based algorithms to compress large data files into a more compact form for storage or transmission.

### Character encodings

Probably the most widely known data communications code so far (aka character representation) in use today is ASCII. In one or another (somewhat compatible) version, it is used by nearly all personal computers, terminals, printers, and other communication equipment. It represents 128 characters with seven-bit binary numbers—that is, as a string of seven 1s and 0s. In ASCIIvcx a lowercase "a" is always 1100001, an uppercase "A" always 1000001, and so on. There are many other encodings, which represent each character by a byte (usually referred as code pages), integer code point (Unicode) or a byte sequence (UTF-8).

### Genetic code

Biological organisms contain genetic material that is used to control their function and development. This is the DNA, which contains units named genes that can produce proteins through a code (genetic code) in which a series of triplets of four possible nucleotides are translated into one of twenty possible amino acids.

### Gödel code

In mathematics, a Gödel code was the basis for the proof of Gödel's incompleteness theorem. Here, the idea was to map mathematical notation to a natural number (using a Gödel numbering).

### Other

There are codes using colors, like traffic lights, the color code employed to mark the nominal value of the electrical resistors or that of the trashcans devoted to specific types of garbage (paper, glass, biological, etc.)

In marketing, coupon codes can be used for a financial discount or rebate when purchasing a product from an internet retailer.

In military environments, specific sounds with the cornet are used for different uses: to mark some moments of the day, to command the infantry in the battlefield, etc.

Communication systems for sensory impairments, as the sign language for deaf people and braille for blind people, are based in movement or tactile codes.

Musical scores are the most common way to encode music.

Specific games, as chess, have their own code systems to record the matches (chess notation).

### Cryptography

In the history of cryptography, codes were once common for ensuring the confidentiality of communications, although ciphers are now used instead. See code (cryptography).

Secret codes intended to obscure the real messages, ranging from serious (mainly espionage in military, diplomatic, business, etc.) to trivial (romance, games) can be any kind of imaginative encoding: flowers, game cards, clothes, fans, hats, melodies, birds, etc., in which the sole requisite is the previous agreement of the meaning by both the sender and the receiver.

## Other examples

Other examples of encoding include:

Other examples of decoding include:

## Codes and acronyms

Acronyms and abbreviations can be considered codes, and in a sense all languages and writing systems are codes for human thought.

International Air Transport Association airport codes are three-letter codes used to designate airports and used for bag tags.

Occasionally a code word achieves an independent existence (and meaning) while the original equivalent phrase is forgotten or at least no longer has the precise meaning attributed to the code word. For example, '30' was widely used in journalism to mean "end of story", and it is sometimes used in other contexts to signify "the end".

# Study guide

Up to date as of January 14, 2010

### From Wikiversity

 Run a search on Code at Wikipedia.
 Search Wikimedia Commons for images, sounds and other media related to: Code
 Search for Code on the following projects:
 Lost on Wikiversity? Please help by choosing project boxes to classify this resource by: subject educational level resource type

# Source material

Up to date as of January 22, 2010
(Redirected to The Code article)

### From Wikisource

 The Code by Robert Frost
 From North of Boston, 1914.

THERE were three in the meadow by the brook
Gathering up windrows, piling cocks of hay,
With an eye always lifted toward the west
Where an irregular sun-bordered cloud
Darkly advanced with a perpetual dagger
Flickering across its bosom. Suddenly
One helper, thrusting pitchfork in the ground,
Marched himself off the field and home. One stayed.
The town-bred farmer failed to understand.

“What is there wrong?”

“Something you just now said.”

“What did I say?”

“To cock the hay?—because it’s going to shower?
I said that more than half an hour ago.
I said it to myself as much as you.”

“You didn’t know. But James is one big fool.
He thought you meant to find fault with his work.
That’s what the average farmer would have meant.
James would take time, of course, to chew it over
Before he acted: he’s just got round to act.”

“He is a fool if that’s the way he takes me.”

“Don’t let it bother you. You’ve found out something.
The hand that knows his business won’t be told
To do work better or faster—those two things.
I’m as particular as anyone:
Most likely I’d have served you just the same.
But I know you don’t understand our ways.
You were just talking what was in your mind,
What was in all our minds, and you weren’t hinting.
Tell you a story of what happened once:
I was up here in Salem at a man’s
Named Sanders with a gang of four or five
Doing the haying. No one liked the boss.
He was one of the kind sports call a spider,
All wiry arms and legs that spread out wavy
From a humped body nigh as big’s a biscuit.
But work! that man could work, especially
If by so doing he could get more work
Out of his hired help. I’m not denying
He was hard on himself. I couldn’t find
That he kept any hours—not for himself.
Daylight and lantern-light were one to him:
I’ve heard him pounding in the barn all night.
But what he liked was someone to encourage.
Them that he couldn’t lead he’d get behind
And drive, the way you can, you know, in mowing—
Keep at their heels and threaten to mow their legs off.
I’d seen about enough of his bulling tricks
(We call that bulling). I’d been watching him.
So when he paired off with me in the hayfield
I built the load and topped it off; old Sanders
Combed it down with a rake and says, ‘O. K.’
Everything went well till we reached the barn
With a big catch to empty in a bay.
You understand that meant the easy job
For the man up on top of throwing down
The hay and rolling it off wholesale,
Where on a mow it would have been slow lifting.
You wouldn’t think a fellow’d need much urging
Under these circumstances, would you now?
But the old fool seizes his fork in both hands,
And looking up bewhiskered out of the pit,
Shouts like an army captain, ‘Let her come!’
Thinks I, D’ye mean it? ‘What was that you said?’
I asked out loud, so’s there’d be no mistake,
‘Did you say, Let her come?’ ‘Yes, let her come.’
He said it over, but he said it softer.
Never you say a thing like that to a man,
Not if he values what he is. God, I’d as soon
Murdered him as left out his middle name.
I’d built the load and knew right where to find it.
Two or three forkfuls I picked lightly round for
Like meditating, and then I just dug in
And dumped the rackful on him in ten lots.
I looked over the side once in the dust
And caught sight of him treading-water-like,
Keeping his head above. ‘Damn ye,’ I says,
‘That gets ye!’ He squeaked like a squeezed rat.
That was the last I saw or heard of him.
I cleaned the rack and drove out to cool off.
As I sat mopping hayseed from my neck,
One of the boys sings out, ‘Where’s the old man?’
‘I left him in the barn under the hay.
If ye want him, ye can go and dig him out.’
They realized from the way I swobbed my neck
More than was needed something must be up.
They headed for the barn; I stayed where I was.
They told me afterward. First they forked hay,
A lot of it, out into the barn floor.
Nothing! They listened for him. Not a rustle.
I guess they thought I’d spiked him in the temple
Before I buried him, or I couldn’t have managed.
They excavated more. ‘Go keep his wife
Out of the barn.’ Someone looked in a window,
And curse me if he wasn’t in the kitchen
Slumped way down in a chair, with both his feet
Stuck in the oven, the hottest day that summer.
He looked so clean disgusted from behind
There was no one that dared to stir him up,
Or let him know that he was being looked at.
(I may have knocked him down); but my just trying
To bury him had hurt his dignity.
He had gone to the house so’s not to meet me.
He kept away from us all afternoon.
We tended to his hay. We saw him out
After a while picking peas in his garden:
He couldn’t keep away from doing something.”

“Weren’t you relieved to find he wasn’t dead?”

“No! and yet I don’t know—it’s hard to say.
I went about to kill him fair enough.”

“You took an awkward way. Did he discharge you?”

“Discharge me? No! He knew I did just right.”

# 1911 encyclopedia

Up to date as of January 14, 2010

### From LoveToKnow 1911

CODE (Lat. codex), the term for a complete and systematic body of law, or a complete and exclusive statement of some portion of the law; and so by analogy for any system of rules or doctrine; also for an arrangement in telegraphy, signalling, &c., by which communications may be made according to rules adopted for brevity or secrecy.

In jurisprudence the question of the reduction of laws to written codes, representing a complete and readily accessible system, is a matter of great historical and practical interest. Many collections of laws, however, which are commonly known as codes,' would not correspond to the definition given above. The Code of Justinian (see Justinian I.; Roman Law), the most celebrated of all, is not in itself a complete and exclusive system of law. It is a collection of imperial constitutions, just as the Pandects are a collection of the opinions of jurisconsults. The Code and the Pandects together being, as Austin says, "digests of Roman law in force at the time of their conception," would, if properly arranged, constitute a code. Codification in this sense is merely a question of the form of the laws, and has nothing to do with their goodness or badness from an ethical or political point of view. Sometimes codification only means the changing of unwritten into written law; in the stricter sense it means the changing of unwritten or badly-written law into law well written.

1 The most ancient code known, that of Khammurabi, is dealt with in the article Babylonian Law.

The same causes which made collections of laws necessary in the time of Justinian have led to similar undertakings among modern peoples. The actual condition of laws until the period when they are consciously remodelled is one of confusion, contradiction, repetition and disorder; and to these evils the progress of society adds the burden of perpetually increasing legislation. Some attempt must be made to simplify the task of learning the laws by improving their expression and arrangement. This is by no means an easy task in any country, but in England it is surrounded with peculiar difficulties. The independent character of English law has prevented an attempt to do what has already been done for other systems which have the basis of the Roman law to fall back upon.

The most celebrated modern code is the French. The necessity of a code in France was mainly caused by the immense number of separate systems of jurisprudence existing in that country before 1789, justifying Voltaire's sarcasm that a traveller in France had to change laws about as often as he changed horses. At first published under the title of Code Civil des Frangais, it was afterwards entitled the Code Napoleon (q.v.) - the emperor Napoleon wishing to attach his name to a work which he regarded as the greatest glory of his reign. The code, it has been said, is the product of Roman and customary law, together with the ordinances of the kings and the laws of the Revolution. In form it has passed through several changes caused by the political vicissitudes of the country, and it has of course suffered from time to time important alterations in substance, but it still remains virtually the same in principle as it left the hands of its framers. The code has produced a vast number of commentaries, among which may be named those of A. Duranton, R. T. Troplong and J. C. F. Demolombe. The remaining French codes are the Code de procedure civile, the Code de commerce, the Code d'instruction criminelle and the Code penal. The merits of the French code have entered into the discussion on the general question of codification. Austin agrees with Savigny in condemning the ignorance and haste with which it was compiled. "It contains," says Austin, "no definitions of technical terms (even the most leading), no exposition of the rationale of distinctions (even the most leading), no exposition of the broad principles and rules to which the narrower provisions expressed in the code are subordinate; hence its fallacious brevity." Codes modelled on the French code have, however, taken firm root in most of the countries of continental Europe and in other parts of the world as well, such as Latin America and several of the British colonies.

The Prussian code (Code Frederic) was published by Frederick the Great in 1751. It was intended to take the place of "Roman, common Saxon and other foreign subsidiary laws and statutes," the provincial laws remaining in force as before. One of the objects of the king was to destroy the power of the advocates, whom he hoped to render useless. This, with other systems of law existing in Germany, has been replaced by the Civil Code of 1900 (see Germany).

The Statute Law Revision Committee also perform a useful work in excising dead law from the statute-book, partly by repeal of obsolete and spent acts and parts of acts, and partly by pruning redundant preambles and words. The construction of a section of an act may depend on the preamble and the context, and the repeal of the preamble and certain parts of the act may therefore affect the construction of what is left. This is provided for by a clause which is said to have been settled by Lord Westbury. It provides (in effect) that the repeal of any words or expressions of enactment shall not affect the construction of any statute or part of a statute. The lawyer, therefore, cannot rely on the revised edition of the statutes alone, and it is still necessary for him to consult the complete act as it was originally enacted.

The process of gradual codification adopted in India has been recommended for imitation in England by those who have had some experience of its working. The first of the Indian codes was the Penal Code (see Criminal Law), and there are also codes of civil and criminal procedure.

Whether any attempt will ever be made to supersede this vast and unarranged mass by a complete code seems very doubtful. Writers on codification have for the most part insisted that the work should be undertaken as a whole, and that the parts should have relation to some general scheme of the law which should be settled first. The practical difficulties in the way of an undertaking so stupendous as the codification uno coetu of the whole mass of the law hardly require to be stated.

In discussions on codification two difficulties are insisted on by its opponents, which have some practical interest - (1) What is to be done in those cases for which the code has not provided? and (2) How is new law to be incorporated with the code? The objection that a code will hamper the opinions of the court, destroy the flexibility and elasticity of the common law, &c., disappears when it is stated in the form of a proposition, that law codified will cover a smaller number of cases, or will be less easily adapted to new cases, than law uncodified. The French system ordered the judges, under a penalty, to give a decision on all cases, whether contemplated or not by the code, and referred them generally to the following sources: - (1) Equite naturelle, loi naturelle; (2) loi romain; (3) loi coutumier; (4) usages, exemples, jugements, jurisprudence; (5) droit commun; (6) principes generaux, maximes, doctrine, science. The Prussian code, on the other hand, required the judges to report new cases to the head of the judicial department, and they were decided by the legislative commission. No provision was made in either case for incorporating the new law with the code, an omission which Austin justly considers fatal to the usefulness of codification. It is absurd to suppose that any code can remain long without requiring substantial alteration. Cases will arise when its meaning must be extended and modified by judges, and every year will produce its quota of new legislation by the state. The courts should be left to interpret a code as they now interpret statutes, and provision should be made for the continual revision of the code, so that the new law created by judges Or directly by the state may from time to time be worked into the code.

 << Coda

# Wiktionary

Up to date as of January 15, 2010

## German

German Wikipedia has an article on:
Code

Wikipedia de

### Noun

Code m. (, plural Codes)

1. (rare) code

# Simple English

A code or cypher is a way of changing information into something else. Sometimes this is done as a way of keeping a message secret. Sometimes it is done as an easier way of sending a message. For example, when people on two different boats want to send a message, they may be too far away from each other to talk, but they can send messages with a flag code. Another code that people use a lot is called Morse Code, which changes letters to dots and dashes, like this:

 SOS:   ···−−−···


Computers use codes, by changing letters into 1's and 0's. This is called an ASCII code.

Some people write codes as a kind of game. They think it is fun to make codes, and fun to break codes. Breaking a code means taking it apart to understand how it works, and then you can understand messages that are written in that code.

In the United States, there is an organization called the NSA. Their job is to break other people's codes, and to make codes that the United States government can use, which are hard to break.

The algorithm (code) for making a message secret is called the encryption algorithm. To change a secret message back a decryption algorithm is needed.

When you change the message back you most likely use a cypher (commonly spelled as cipher). The word Cypher is also in French as cifre and Latin as cifra, from the Arabic word sifr (zero).