Revision as of 23:35, 22 June 2021 view sourceClueBot NG (talk | contribs)Bots, Pending changes reviewers, Rollbackers6,439,425 editsm Reverting possible vandalism by 210.55.88.11 to version by Larry Hockett. Report False Positive? Thanks, ClueBot NG. (3997480) (Bot)Tag: Rollback← Previous edit | Revision as of 23:37, 22 June 2021 view source 210.55.88.11 (talk) yurTag: RevertedNext edit → | ||
Line 1: | Line 1: | ||
] messages were the state of the art in rapid long-distance communication, elaborate systems of [[co | |||
{{short description|System of rules to convert information into another form or representation}} | |||
#my glossary project# | |||
{{Other uses}} | |||
{{Redirect|Encoding|other uses|Encoding (disambiguation)}} | |||
{{For|], "Code#01 Bad Girl" and "Code#02 Pretty Pretty" redirect here. For the EPs by Ladies' Code|Code 01 Bad Girl|Code 02 Pretty Pretty}} | |||
{{More citations needed|date=March 2010}} | |||
In ]s and ], '''code''' is a system of rules to convert ]—such as a ], ], sound, image, or ]—into another form, sometimes ] or ], for communication through a ] or storage in a ]. An early example is an invention of ], which enabled a person, through ], to communicate what they thought, saw, heard, or felt to others. But speech limits the range of communication to the distance a voice can carry and limits the audience to those present when the speech is uttered. The invention of ], which converted spoken language into ] ]s, extended the range of communication across space and ]. | |||
from tkinter import * | |||
The process of '''encoding''' converts information from a ] into symbols for communication or storage. '''Decoding''' is the reverse process, converting code symbols back into a form that the recipient understands, such as English or/and Spanish. | |||
#key down function | |||
One reason for coding is to enable communication in places where ordinary ], spoken or written, is difficult or impossible. For example, ], where the configuration of ] held by a signaler or the arms of a ] 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. | |||
def click(): | |||
entered_text=textentry.get() #this will collect the text form the text entry box | |||
output.delete(0.0, END) | |||
try: | |||
definition = my_compdictionary | |||
except: | |||
definition = "sorry there is no word like that please try again" | |||
output.insert(END, definition) | |||
#### main: | |||
window = Tk() | |||
window.title("My computer Science Glassary") | |||
window.configure(background="black") | |||
#### My photo | |||
photo1 = PhotoImage(file="me.gif") | |||
Label (window, image=photo1, bg="black") .grid(row=0, column=0, sticky=E) | |||
#create label | |||
== Theory == | |||
Label (window, text="Enter the word you would a definition for:", bg="black", fg="white", font="none 12 bold") .grid(row=1, column=0, sticky=W) | |||
{{main|Coding theory}} | |||
In ] and ], a code is usually considered as an ] that uniquely represents ] from some source ], 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. | |||
#create a text entry box | |||
Before giving a mathematically precise definition, this is a brief example. The mapping | |||
textentry = Entry(window, width=20, bg="white") | |||
:<math>C = \{\, a\mapsto 0, b\mapsto 01, c\mapsto 011\,\}</math> | |||
textentry.grid(row=2, column=0, sticky=W) | |||
is a code, whose source alphabet is the set <math>\{a,b,c\}</math> and whose target alphabet is the set <math>\{0,1\}</math>. Using the extension of the code, the encoded string 0011001 can be grouped into codewords as 0 011 0 01, and these in turn can be decoded to the sequence of source symbols ''acab''. | |||
#add a submit button | |||
Using terms from ], the precise mathematical definition of this concept is as follows: let S and T be two finite sets, called the source and target ], respectively. A '''code''' <math>C:\, S \to T^*</math> is a ] mapping each symbol from S to a ] over T. The '''extension''' <math>C'</math> of <math>C</math>, is a ] of <math>S^*</math> into <math>T^*</math>, which naturally maps each sequence of source symbols to a sequence of target symbols. | |||
Button(window, text="SUBMIT", width=6, comman=click) . grid(row=3, column=0, sticky=W) | |||
#create another label | |||
=== Variable-length codes === | |||
Label (window, text="\nDefiniition:", bg="black", fg="white", font="none 12 bold") .grid(row=4, column=0, sticky=W) | |||
{{main|Variable-length code}} | |||
In this section, we consider codes that encode each source (clear text) character by a ] from some dictionary, and ] of such code words give us an encoded string. Variable-length codes are especially useful when clear text characters have different probabilities; see also ]. | |||
#create a text box | |||
A ''prefix code'' is a code with the "prefix property": there is no valid code word in the system that is a ] (start) of any other valid code word in the set. ] is the most known algorithm for deriving prefix codes. Prefix codes are widely referred to as "Huffman codes" even when the code was not produced by a Huffman algorithm. Other examples of prefix codes are ], the country and publisher parts of ]s, and the Secondary Synchronization Codes used in the ] ] 3G Wireless Standard. | |||
output = Text(window, width=75, height=6, wrap=WORD, background="white") | |||
output.grid(row=5, column=0, columnspan=2, sticky=W) | |||
#the dictionary | |||
] characterizes the sets of codeword lengths that are possible in a prefix code. Virtually any uniquely decodable one-to-many code, not necessarily a prefix one, must satisfy Kraft's inequality. | |||
my_compdictionary = { | |||
'algorithm': 'Step by step instruction to complete a task', 'bug': 'piece of code causes a program to fail' | |||
} | |||
#exit label | |||
Label (window, text="click to exit:", bg="black", fg="white", font="none 12 bold") .grid(row=6, column=0, sticky=W) | |||
#exit function | |||
=== Error-correcting codes === | |||
def close_window(): | |||
{{main|Error detection and correction}} | |||
window.destroy() | |||
{{see also|Block code}} | |||
exit() | |||
Codes may also be used to represent data in a way more resistant to errors in transmission or storage. This so-called ] works by including carefully crafted redundancy with the stored (or transmitted) data. Examples include ]s, ], ], ], ], ], ], ], ]s, and ]s. | |||
Error detecting codes can be optimised to detect ''burst errors'', or ''random errors''. | |||
#add exit button | |||
Button(window, text="Exit", width=14, comman=close_window) . grid(row=7, column=0, sticky=W) | |||
####run the main loop | |||
== 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 ], more quickly, and less expensively. | |||
window.mainloop()#my glossary project# | |||
Codes can be used for brevity. When ] messages were the state of the art in rapid long-distance communication, elaborate systems of ] that encoded complete phrases into single mouths (commonly five-minute 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."). ]s were chosen for various reasons: ], ], 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 ] run by ] 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 ] predates the computer era; an early example is the telegraph ] where more-frequently used characters have shorter representations. Techniques such as ] are now used by computer-based ]s to compress large data files into a more compact form for storage or transmission. | |||
from tkinter import * | |||
=== Character encodings === | |||
{{Main|Character encoding}} | |||
Character encodings are representations of textual data. A given character encoding may be associated with a specific character set (the collection of characters which it can represent), though some character sets have multiple character encodings and vice versa. Character encodings may be broadly grouped according to the number of bytes required to represent a single character: there are single-byte encodings, ] (also called wide) encodings, and ] (also called variable-length) encodings. The earliest character encodings were single-byte, the best-known example of which is ]. ASCII remains in use today, for example in ]. However, single-byte encodings cannot model character sets with more than 256 characters. Scripts that require large character sets such as ] must be represented with multibyte encodings. Early multibyte encodings were fixed-length, meaning that although each character was represented by more than one byte, all characters used the same number of bytes ("word length"), making them suitable for decoding with a lookup table. The final group, variable-width encodings, is a subset of multibyte encodings. These use more complex encoding and decoding logic to efficiently represent large character sets while keeping the representations of more commonly used characters shorter or maintaining backward compatibility properties. This group includes ], an encoding of the ] character set; UTF-8 is the most common encoding of text media on the Internet. | |||
#key down function | |||
=== Genetic code === | |||
def click(): | |||
{{Main|Genetic code}} | |||
entered_text=textentry.get() #this will collect the text form the text entry box | |||
] organisms contain genetic material that is used to control their function and development. This is ], which contains units named ]s from which ] is derived. This in turn produces ]s through a ] in which a series of triplets (]s) of four possible ] can be translated into one of twenty possible ]s. A sequence of codons results in a corresponding sequence of amino acids that form a protein molecule; a type of codon called a ] signals the end of the sequence. | |||
output.delete(0.0, END) | |||
try: | |||
definition = my_compdictionary | |||
except: | |||
definition = "sorry there is no word like that please try again" | |||
output.insert(END, definition) | |||
#### main: | |||
window = Tk() | |||
window.title("My computer Science Glassary") | |||
window.configure(background="black") | |||
#### My photo | |||
photo1 = PhotoImage(file="me.gif") | |||
Label (window, image=photo1, bg="black") .grid(row=0, column=0, sticky=E) | |||
#create label | |||
===Gödel code=== | |||
Label (window, text="Enter the word you would a definition for:", bg="black", fg="white", font="none 12 bold") .grid(row=1, column=0, sticky=W) | |||
In ], a ] was the basis for the proof of ]'s ]. Here, the idea was to map ] to a ] (using a ]). | |||
#create a text entry box | |||
=== Other === | |||
textentry = Entry(window, width=20, bg="white") | |||
There are codes using colors, like ], the ] employed to mark the nominal value of the ]s or that of the trashcans devoted to specific types of garbage (paper, glass, organic, etc.). | |||
textentry.grid(row=2, column=0, sticky=W) | |||
#add a submit button | |||
In ], ] codes can be used for a financial discount or rebate when purchasing a product from a (usual internet) retailer. | |||
Button(window, text="SUBMIT", width=6, comman=click) . grid(row=3, column=0, sticky=W) | |||
#create another label | |||
In military environments, specific sounds with the ] are used for different uses: to mark some moments of the day, to command the infantry on the battlefield, etc. | |||
Label (window, text="\nDefiniition:", bg="black", fg="white", font="none 12 bold") .grid(row=4, column=0, sticky=W) | |||
#create a text box | |||
Communication systems for sensory impairments, such as ] for deaf people and ] for blind people, are based on movement or tactile codes. | |||
output = Text(window, width=75, height=6, wrap=WORD, background="white") | |||
output.grid(row=5, column=0, columnspan=2, sticky=W) | |||
#the dictionary | |||
] are the most common way to encode ]. | |||
my_compdictionary = { | |||
'algorithm': 'Step by step instruction to complete a task', 'bug': 'piece of code causes a program to fail' | |||
} | |||
#exit label | |||
Label (window, text="click to exit:", bg="black", fg="white", font="none 12 bold") .grid(row=6, column=0, sticky=W) | |||
#exit function | |||
Specific games have their own code systems to record the matches, e.g. ]. | |||
def close_window(): | |||
window.destroy() | |||
exit() | |||
#add exit button | |||
Button(window, text="Exit", width=14, comman=close_window) . grid(row=7, column=0, sticky=W) | |||
####run the main loop | |||
=== Cryptography === | |||
In the ], ] were once common for ensuring the confidentiality of communications, although ]s are now used instead. | |||
window.mainloop() | |||
Secret codes intended to obscure the real messages, ranging from serious (mainly ] in military, diplomacy, business, etc.) to trivial (romance, games) can be any kind of imaginative encoding: ], game cards, clothes, fans, hats, melodies, birds, etc., in which the sole requirement is the pre-agreement on the meaning by both the sender and the receiver. | |||
== Other examples == | |||
Other examples of encoding include: | |||
*Encoding (in ]) - a basic perceptual process of interpreting incoming stimuli; technically speaking, it is a complex, multi-stage process of converting relatively objective sensory input (e.g., light, sound) into a subjectively meaningful experience. | |||
*A ] - a specific encoding format for converting a specific type of ] to ]. | |||
*Text encoding uses a ] to tag the structure and other features of a text to facilitate processing by computers. (See also ].) | |||
*] of formal language A informal language B is a method of representing all terms (e.g. programs or descriptions) of language A using language B. | |||
*] transforms a signal into a code optimized for ] or ], generally done with a ]. | |||
*] - the way in which information is represented in ]s. | |||
*] - the process of converting sensations into memories. | |||
*]: ], ] and ] | |||
Other examples of decoding include: | |||
* ] | |||
* ], methods in communication theory for decoding codewords sent over a noisy channel | |||
* ], the study of signals in a digital representation and the processing methods of these signals | |||
* ], the use of analog circuit for decoding operations | |||
* Word decoding, the use of ] to decipher print patterns and translate them into the sounds of language | |||
==Codes and acronyms== | |||
]s and abbreviations can be considered codes, and in a sense, all ]s and ]s are codes for human thought. | |||
]s are three-letter codes used to designate airports and used for ]s. ]s are similarly used on railways but are usually national, so the same code can be used for different stations if they are in different countries. | |||
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 ] to mean "end of story", and has been used in ] to signify "the end".<ref>Kogan, Hadass {{webarchive|url=https://web.archive.org/web/20101212101705/http://ajr.org/Article.asp?id=4408 |date=2010-12-12 }} American Journalism Review. Retrieved 2012-07-03.</ref> | |||
<ref>{{cite web | |||
|title = WESTERN UNION "92 CODE" & WOOD'S "TELEGRAPHIC NUMERALS" | |||
|publisher = Signal Corps Association | |||
|year = 1996 | |||
|url = http://www.civilwarsignals.org/pages/tele/wurules1866/92code.html | |||
|access-date = 2012-07-03 | |||
|url-status = live | |||
|archive-url = https://web.archive.org/web/20120509135118/http://www.civilwarsignals.org/pages/tele/wurules1866/92code.html | |||
|archive-date = 2012-05-09 | |||
}}</ref> | |||
== See also == | |||
{{Commons category|Codes}} | |||
* ] | |||
* ] | |||
* ] | |||
* ] | |||
* ] | |||
* ] | |||
* ] | |||
== References == | |||
{{reflist}} | |||
* {{cite journal |last1=Chevance |first1=Fabienne |title=Case for the genetic code as a triplet of triplets |journal=Proceedings of the National Academy of Sciences of the United States of America |volume=114 |issue=18 |pages=4745–4750 |pmc=5422812 |year=2017 |pmid=28416671 |doi=10.1073/pnas.1614896114 }} | |||
] | |||
] |
Revision as of 23:37, 22 June 2021
] messages were the state of the art in rapid long-distance communication, elaborate systems of [[co
- my glossary project#
from tkinter import *
- key down function
def click():
entered_text=textentry.get() #this will collect the text form the text entry box output.delete(0.0, END) try: definition = my_compdictionary except: definition = "sorry there is no word like that please try again" output.insert(END, definition)
- main:
window = Tk() window.title("My computer Science Glassary") window.configure(background="black")
- My photo
photo1 = PhotoImage(file="me.gif") Label (window, image=photo1, bg="black") .grid(row=0, column=0, sticky=E)
- create label
Label (window, text="Enter the word you would a definition for:", bg="black", fg="white", font="none 12 bold") .grid(row=1, column=0, sticky=W)
- create a text entry box
textentry = Entry(window, width=20, bg="white") textentry.grid(row=2, column=0, sticky=W)
- add a submit button
Button(window, text="SUBMIT", width=6, comman=click) . grid(row=3, column=0, sticky=W)
- create another label
Label (window, text="\nDefiniition:", bg="black", fg="white", font="none 12 bold") .grid(row=4, column=0, sticky=W)
- create a text box
output = Text(window, width=75, height=6, wrap=WORD, background="white") output.grid(row=5, column=0, columnspan=2, sticky=W)
- the dictionary
my_compdictionary = {
'algorithm': 'Step by step instruction to complete a task', 'bug': 'piece of code causes a program to fail' }
- exit label
Label (window, text="click to exit:", bg="black", fg="white", font="none 12 bold") .grid(row=6, column=0, sticky=W)
- exit function
def close_window():
window.destroy() exit()
- add exit button
Button(window, text="Exit", width=14, comman=close_window) . grid(row=7, column=0, sticky=W)
- run the main loop
window.mainloop()#my glossary project#
from tkinter import *
- key down function
def click():
entered_text=textentry.get() #this will collect the text form the text entry box output.delete(0.0, END) try: definition = my_compdictionary except: definition = "sorry there is no word like that please try again" output.insert(END, definition)
- main:
window = Tk() window.title("My computer Science Glassary") window.configure(background="black")
- My photo
photo1 = PhotoImage(file="me.gif") Label (window, image=photo1, bg="black") .grid(row=0, column=0, sticky=E)
- create label
Label (window, text="Enter the word you would a definition for:", bg="black", fg="white", font="none 12 bold") .grid(row=1, column=0, sticky=W)
- create a text entry box
textentry = Entry(window, width=20, bg="white") textentry.grid(row=2, column=0, sticky=W)
- add a submit button
Button(window, text="SUBMIT", width=6, comman=click) . grid(row=3, column=0, sticky=W)
- create another label
Label (window, text="\nDefiniition:", bg="black", fg="white", font="none 12 bold") .grid(row=4, column=0, sticky=W)
- create a text box
output = Text(window, width=75, height=6, wrap=WORD, background="white") output.grid(row=5, column=0, columnspan=2, sticky=W)
- the dictionary
my_compdictionary = {
'algorithm': 'Step by step instruction to complete a task', 'bug': 'piece of code causes a program to fail' }
- exit label
Label (window, text="click to exit:", bg="black", fg="white", font="none 12 bold") .grid(row=6, column=0, sticky=W)
- exit function
def close_window():
window.destroy() exit()
- add exit button
Button(window, text="Exit", width=14, comman=close_window) . grid(row=7, column=0, sticky=W)
- run the main loop
window.mainloop()