text:
Cookbook:Stuffed Peppers

Ingredients

 * 1.5–2 ounces (50 g) white parboiled rice
 * 1 pound (500 g) ground meat (either beef, lamb, or pork)
 * 6 large red bell peppers
 * 1 egg
 * Salt, pepper, paprika
 * Oil

Procedure

 * 1) Cook the rice.
 * 2) Turn on the oven to preheat at 390°F (200°C), while placing a baking dish with the bottom covered in oil (or water or thin tomato sauce) inside.
 * 3) Cut out the stems and the seeds of the peppers so that the peppers form a cup.
 * 4) Mix the rice, the egg and the ground beef and spice everything with salt, pepper and paprika.
 * 5) Fill the peppers, set them into the baking dish, and bake for 45 minutes.
 * 6) Serve with green salad and tomato sauce.

title: Cookbook:Stuffed Peppers


text:
Wikijunior:World War II/Pearl Harbor

What is Pearl Harbor?
The attack of Pearl Harbor (or the Hawaii operation, as it was called by the Imperial General Headquarters) was a surprise military strike conducted by the Japanese navy against the US Navy on December 7 1941.

What is "the attack on Pearl Harbor"?
On December 7, 1941, Pearl Harbor (and other places between Honolulu and San Francisco) was attacked by the Japanese. About 2,403 people were killed, 188 airplanes destroyed, and 8 battleships were either destroyed or seriously damaged.

Why did Japan attack Pearl Harbor if the USA was neutral?
Although the US was neutral during the attack on Pearl Harbor, the US was helping China by giving money and shipping oil to them. As a result, Japan no longer got certain resources such as oil and rubber that they really needed. The Empire of Japan saw this embargo (an order from government that stops trade between countries) as a threat and started to prepare to attack. In doing this, Japan hoped that they could make quick advances in the Pacific while the American Navy was damaged, and then build up defenses causing America to sign a peace treaty.

How did the US respond to all this?
The US declared war on Japan the day after Japan attacked Pearl Harbor. Japanese-Americans were forced out of their homes to live in "War Relocation Camps" because of the wide discrimination of Japanese-Americans in the US that sparked after Pearl Harbor. Days later, U.S. forces in the Pacific were defeated in the Philippines, as the British also lost island territories in the Pacific to the Japanese.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Wikijunior:World War II/Pearl Harbor


text:
Wikijunior:World War II/Invasion of the Soviet Union

Preparations and Plans
After the invasion of France and the Battle of Britain, the German leader, Adolf Hitler, made plans to invade the Soviet Union (USSR). Hitler had always hated the communist government in the USSR and everything it stood for. He thought the people who lived there were "sub humans". Hitler had always said that nobody should fight a war "on two fronts", meaning that you should always finish off one enemy before making another one. As part of this strategy, Germany signed a non-aggression agreement with the USSR. But with his attack on the USSR he was breaking his own rule - Britain still wasn't beaten.

What happened?

The code name for the attack on the USSR was "Operation Barbarossa". The attack started on 22 June 1941 and was a complete surprise to the Soviets. It is amazing that it was a surprise because the British had been telling the Soviet leader, Stalin, for months that the Germans would attack. They knew this because they could read the German secret codes. But Stalin didn't want to believe he would be attacked.

More than 4.5 million soldiers from Germany and its allies invaded the USSR. The width of the attack was huge - nearly 1,800 miles long. The idea was to conquer the "European" part of the USSR. Although the attack went well and millions of Soviet soldiers were captured, the Germans couldn't reach the Soviet capital, Moscow. Although the Germans went on to win many battles in the USSR they never had the strength to win the overall war.


text:
Category:Halal recipes

Recipes that can be prepared in accordance with Muslim dietary rules.

title: Category:Halal recipes


text:
XQuery/XMP data

= Motivation = Adobe have introduced an XML format for image metadata called XMP. You want to display a photograph and some of the metadata.

= Background =

Matt Turner has an example of using MarkLogic to extract XMP data from a JPEG image.

= eXist/ XQuery implementation =

Here is the code using eXist XQuery extensions. Matt's photograph of a boat has been stored in the XML Database as a binary file.

= Show the full XMP XML =

The binary image is retrieved from the database as a BASE64 encoded string, converted to a UTF-8 string, the metadata text extracted and turned back to XML using util:parse

declare function local:extract-xmp ($jpeg as xs:string) as item { let $binary := util:binary-doc($jpeg) let $text := util:binary-to-string($binary) let $xmp := substring-after($text,"") let $xmp := concat("") return util:parse($xmp) };

let $photo := request:get-parameter("photo",) let $xmp := local:extract-xmp(concat("/db/Wiki/eXist/",$photo)) return $xmp

XMP XML

= Some basic Dublin Core elements =

Here we extract a few of the Dublin Core elements and create an HTML fragment containing the image and the meta-data.

declare namespace dc="http://purl.org/dc/elements/1.1/";

declare function local:extract-xmp ($jpeg as xs:string) as item { ..... };

declare option exist:serialize "method=xhtml media-type=text/html";

let $photo := request:get-parameter("photo",) let $xmp := local:extract-xmp(concat("/db/Wiki/eXist/",$photo)) return    Format : {string($xmp//dc:format)} Title: {string($xmp//dc:title)} Creator: {string($xmp//dc:creator)}

Basic Dublin Core elements

title: XQuery/XMP data


text:
Animal Behavior/Language

The view of the brain as a tabula rasa, a blank slate, all too long a basis for the thinking of learning theorists, is patently absurd—Peter Marler, 1996

Human Language
Humans show exceptional skill to communicate with fellow conspecific using verbal and gestural symbols. Such competence is arguably one of mankind's greatest assets as well as a key to most of our species' achievements. It brings us together with our peers and enriches us through an exchange of experiences, thoughts and value systems. It endows us with the means to acquire skills for situations that we may have never personally encountered before. A staggering range of regionally distinct languages and dialects, grouped in larger language families, not only serves as a system of communication but also tags us for membership within a specific group. In addition to bringing us together, it has thereby been at the heart of an ancient source of division. Although few things in biology ever group cleanly into one of the nature vs. nurture extremes, this particular division seems to be purely cultural. Regardless of the specific race, ethnic or regional group that we happen to have joined through birth, we all are able to acquire competence in any human language. In particular, we seem to acquire our native language without formal education, long before many of our intellectual capabilities have matured, and simply by immersion into the particular language environment of parents and relatives during the first few years of our life. The scientific study of the nature and structure of languages is called linguistics.

Universal Grammar
BF Skinner (1957) suggested that infants learn language through a process described as operant conditioning, namely, via the monitoring and management of reward contingencies. Skinner's position would be that a four-term contingency analysis comprised of motivating operations, discriminative stimuli, responses and reinforcing stimuli would be the means by which behavior could be explained. In children and infants this process would be expanded by what he called "shaping", "prompting" and other stimuli modeling, imitation and reinforcing procedures. Language acquisition then is a process that would take thousands of instances of such training, and this appears largely to be what takes place. Critics who do not understand the inductive power of this approach largely assert that this view now "appears quite simplistic." However, this argument to complexity is not dissimilar to arguments against Darwin's theory of natural selection. How could the amazing complexity of the animal kingdom come about through such a simple means? Surely, we would need something more complex to explain the variety of animals? Darwin's theory of selection is now accepted as such a means, despite it's "apparent simplicity". Similarly the mechanism of operant conditioning can be seen as sufficient to account for very complex forms of behavior in a wide variety of circumstances without appealing to unproven, non-data driven speculative theoretical approaches like those of Noam Chomsky and others.

Language learning is clearly the most complex task any of us will ever undertake. Yet, the process appears to be considerably less painfull than acquiring an understanding of calculus, or organic chemistry. Noam Chomsky (1975) has long argued that this paradox is best explained by the view that humans, and in particular children, have innate abilities that support the acquisition of a language. It is clear that we seem to be naturally good at it, especially before we reach puberty. Moreover, we appear to have a natural need to fill our world with language; in the absence of formal language tutoring a form of language structure develops anyway. Some say a specialized language faculty seems to aid in this process, one that includes innately specified constraints on what forms are possible. These innate, language-specific, information processing mechanisms may be encapsulated in language module of the brain. However, these innate faculties are inferred, hypothesized explanations with no foundation in fact. No biological location has been found for them, no genetic location, no brain structure. It is all inference.

All human languages, even spontaneous ones, show many common principles of language acquisition as well as rules of grammar. The concept of universal grammar proposes that this is due to a set of innate rules, which guide how we acquire language and how we construct valid sentences in it. It thus attempts to explain language in general, and not simply describe the construction of any one specific language per se.

There are many alternative theories of human language consistency besides the speculative theory of "universal grammar". One theory is that human environments possess common structures and human language simply responds to the commonality of the world. Universal grammar is a speculative, unproven hypothesis that is still awaiting confirmation and has no evidence to support it other than "rational argument".

Language Acquisiton
At very young age, we acquire our native language by listening to, guessing at the meaning of, and imitating the symbols used by tutors around us. Moreover, during these early years we learn to walk and talk without any explicit need for understanding how we are doing what we are doing. In this process we seem to be helped by a set of Inherent learning strategies, the ability for optimized pattern perception of common, ambient symbols.

Infants are exceptionally broad in their abilities to perceive sound qualities. In fact, as infants we can distinguish many more language sounds than we can as adults. During the first year of life, infant brains are actively engaged in optimizing acoustic perception for the language sounds that surround them. Such early acquisition of information about native language depends on perceptually mapping both the critical aspects of language, and statistical properties of speech.

It is now clear that infants perceive the various phonetic units, track the frequency of different formants, and extract the boundaries of words from running speech. Patricia Kuhl (2000) suggests that language acquisition is based on a combination of factors to provide a powerful discovery procedure for language. Evidence suggests that initial perception parses speech in a universal way in all human infants. Infants have inherent perceptual biases that segment phonetic units without providing innate descriptions of them. They were able to parse and discriminate a wide range of basic phonetic units. Adults, in contrast, are only able to discriminated phonetic units that occur in their first language, but fail to distinguish those that are not used there. Japanese adults, for example, fail to discriminate phonetic boundaries of r vs. l, boundaries that do not exist in Japanese. Such discrimination is based on general auditory processing mechanisms, rather than on innate phonetic feature detectors for speech. Language learning requires mapping these probabilistic patterns into language strategies. As infants detect frequency patterns in language input they identify higher-order units. Infants thus discover the critical parameters and phonetic dimensions of the sounds used in their native language. Sensory processing becomes optimized by experience for enhance perception of the specific language around them. Vocal learning unifies language perception and production where vocal learning depends on a comparison of one's own vocalizations to those of others. Imitation forms the integral bong between the perception and production of language abilities and together they become optimized for the first language. If a second language is learned lateron, it will carry the accent typical for the speech motor patterns of their primary language, even following long-term instruction. Similarities in infant-directed speaking styles (increased pitch and exaggerated stress) enhances language learning by assisting infants in discriminating phonetic units, as well as by capturing attention.

Brain Areas
Broca's Area underlies the ability to produce speech, but it is not critical for understanding language. Patients with damage will fail to form words properly, and speech is halting and slurred. Wermicke's Area is essential for the ability to understand language. Patients with damage to this area can speak clearly, but the words make no sense (i.e., word salad). The Arcuate Fasciculus connects these two areas. Damage to this connection causes conduction aphasia where language is understood, but neither can words be repeated, nor does own speech make any sense. Capabilities for speech are not distributed evenly across the two halfs of the brain. Speech is only disrupted when amobarbital is selectively used to anesthetize only the half of the brain which contains these speech centers. Imaging techniques (e.g. fMRI) have identified that bilingual individuals utilize an overlapping set of neurons in the language areas for these two languages. In contrast, individuals who have acquired a second language later in life will likely rely on separate neuronal areas in these speech centers. Late bilungual speakers are also less likely to show strong lateralization of speech function. This suggests that as two language systems are learned together early-on, they can share the same brain centers without causing catastrophic interference. In adult learning, the best sites of brain real estate have already been taken up by the first language, thus, any new language learning must coopt 'new' territory adjacent to it or on the other half of the brain.

Bird Song
Birds communicate information about danger, food, sex, group movements and many other purposes via acoustic signals. A subset of these have been termed song, as they frequently feature with extended, tonal, melodic characteristics. The Zebra Finch's song, for instance, includes several introductory notes followed by a string of syllables within an extended melodious pattern. Sonograms (i.e., a plot of the intensity of pitch against time) are commonly used as a primary tool for studying and comparing bird songs.

Respiratory muscles force streams of air from large air sacs through the bronchi. Membranes in the syrinx vibrate as air expressed from bronchi passes over them. Syrinx muscles for left and right sound producing structures can act independently, and many birds are able to sing harmonies with themselves. Song appears to play a role in advertising for sex and species recognition as song complexity frequently coincides with the presence of ornate plumage. It also stimulates and synchronizes courtship behavior, stimulates reproductive readiness in females, and contributes to pair bond maintenance. Local song dialects exist in many species.

Successful song in most adult male songbirds depends on memorizing the calls of a conspecific tutor during an earlier, sensitive phase in life. The appropriate song repertoire is acquired in a series of distinct stages. Young birds, during an early Sensory Phase, listen to a conspecific tutor and thereby obtain information about the characteristics of its own song. Only a very specific subset of surrounding songs is actually accepted as suitable, suggesting the presence of an in-built song template. Following this sensory phase, young birds actively begin to vocalize themselves. Their Subsong is an atonal, noisy, meaningless repetition of sounds, which lacks recognizable syllables. Akin to human Babbling birds practice coordinated movements of the respiratory system, sound producing organs, and related structures (e.g., tongue). During Sensory-motor Phase, young birds spontaneously produce Plastic Song, consisting of vocalizations with distinct syllables and recognizable elements. Such "work in progress" will include elements from the song of tutors and elaborate them into a variety of syllables and phrases that even exceed what eventually will be used in its adult song. The ability to hear its own vocalizations are critical for normal development. In transition to the Mature phase, birds adopt a Crystallized Song with syllables and syntax structure that is characteristic of its species. Once established, these song patterns remain fixed in many species, are no more disrupted by deafening, and are presented intact during each subsequent breeding season. In contrast open-ended learners (e.g. starlings and canaries) retain the capacity to adjust or alter their song throughout life.

Song production is under the control of multiple hormonal systems from embryonic gonads. Injections of testosterone induce adult males to sing, even out of season, while similar injections in females have no such effect. The presence of estrogen during male development appears to be essential. When estrogen is blocked experimentally in developing males, testosterone injections fail to elicit song. However, when estrogen had been delivered to developing females, injection of testosterone elicited song in them (Konishi).

Several neural centers with a role in song have been identified. The Higher Vocal Center (HVc) is a group of neurons in the forebrain that is larger in (singing) males than in (non-singing) females. Damage to it blocks song production in adults. The nucleus of the archistriatum (RA) in males is larger than in females and its neurons increase in size and dendritic arborization during song learning. Damage to this area blocks song production in adults. The lateral magnocellular nucleus of the anterior neostriatum (LMAN) is neither sexually dimorphic nor shows seasonal change in neuron size or number. Its ablation in young birds interferes with song acquisition but its ablation in adults brings about few deficits as long as song had already been been learned prior to damage. Area X of the paraolfactory lobe (Area X) is sexually dimorphic and new neurons are added in song learning. Damage to it interferes with song acquisition in young birds but not in adults.

Zebra Finch Song and Tinbergen's Four Aims
As in every behavioral system, a series of independent questions can be addressed for song behavior in Zebra finches (Taeniopygia guttata).

Proximate Causation: Zebra finch song production requires the flow of air through semi-independent vibrators in syrinx and vocal tract. The presence of song, and song repertoire size are reflected in sexual dimorphism of its controlling brain areas and nuclei. A learning pathway esists separate of a motor pathway. Singing, which is largely restricted to males, is under the control of androgens.

Ultimate Causation: Song in Zebra finches is a learned vocalization used during courtship and defense of a territory. Advertising the individual's presence it serves to elicit mating opportunities from females and to stimulate the partner's reproductive behavior and physiology. Moreover, it functions to claim a territory and to repel competitors from it.

Phylogeny: Virtually all 9000 species of birds have the ability to vocalize, including crows, turkeys, owls or nightingales. A large subset of them, including the zebra finch, are characterized by complex vocal organs, distinctive brain circuitry for song, and acquisition of species-characteristic vocalizations through learning. Taxonomically these are all restricted to a single order - the Passeriformes.

Ontogeny: The emergence of adult zebra finch song illustrates the interactions of genetic and environmental factors in behavioral development. After periods of listening to the songs of tutors, starting its own partial vocalizations, rehearsing and adaptating its own song, the species-specific adult version slowly emerges. Song circuits exhibit extensive plasticity even in adults with ongoing neurogenesis and seasonal changes in neuronal morphology.

White-crowned Sparrows
White-crowned sparrows (Zonotrichia leucophrys nuttalli) males sing a single song that shows considerable geographic variation in the form of stable dialects. Bilingual and blended strategies exist at the boundaries. The distinctiveness of the song depends on patterns of natal dispersal and the timing of learning. Subject to reinforcement by the song of neighbors, the system is highly dependent on auditory feedback. The work by Peter Marler, Doug Nelson and others for over 30 years illustrates how genetic and environmental factors interact during the development of a complex communication system. Males generally establish territories during late plastic song with a repertoire that consists of ~4 different songs. Improvisations yield individual-specific songs which closely match that of the nearest rival. Cross-fostering experiments illustrate the role of auditory templates in song learning. Young birds reared in the presence of taped song will learn and present that song, even if the tape came from another species. A Song sparrow raised with a swamp sparrow tape will experience little difficulty to learn the swamp sparrow song. Birds in Isolation experiments are raised without access to intact adult song (i.e., no template) and will subsequently show deficiencies in their own song upon maturation. The song does nonetheless contain valid elements of intact adult song. Moreover, Deafening experiments, which deafen birds at hatching, results in song that still contains some valid elements but is an even cruder version than those of isolated birds. When Song preference experiments present young birds with a wide range of conspecific and heterospecific songs, they recognize and preferentially learn the song of its own species. Birds raised in Mixed syllables experiments in the presence of a mixture of swamp- and song sparrow syllables, will accurately produce these syllables in their song but lack the normal adult syntax.

Castration Experiments have shed light on the roles of hormones in song learning. Swamp sparrows that are castrated early in development have low testosterone levels compared to their male siblings. They acquire song but progress to plastic phase only. Treating such birds with injections of testosterone (Enhanced Testosterone Experiment) immediately crystallizes the song. Interfering with testosterone function in adult birds (Reduced Testosterone Experiment) degrades previously crystallized song back to plastic.

Brown-headed Cowbirds
Brown-headed cowbirds (Molothrus ater) are gregarious birds that follows cattle herds. Brood parasites that are raised by parents of different species, no consistent, conspecific tutor available. So, how do they learn their own conspecific song? One of the strongest stimuli is the bird's own crystallized song and feedback from females is important (i.e., action-based learning).

Paralleles between Bird Song and Human Speech Learning
To learn their language, humans and white crowned sparrows follow similar steps, recognition, practice, and clarity. The best time for a human to learn their language is from toddler to twelve years old (Macdonald) and the best time for a white crowned sparrow to learn its song is between 10–50 days from when they were born. Both genes and environment play roles in determining the way each communicate (Alcock 25).

The first step for humans and white crowned species in learning their language can be considered recognition. White crowned sparrows and humans listen to a tutor before they begin to communicate their language. The tutor teaches the language and the particular dialect, according to the area. Just like humans, the sparrows also have a dialect depending on where they live. A white crowned sparrow has certain genes that only allow them to learn its own species’ songs. Experiments have been performed in which the sparrow was kept in isolation and played tapes of other song sparrows, the white crowned sparrow will not imitate the other species’ song, but will sing an odd song unlike either species’ song (Alcock 24-25). Humans also cannot communicate with each other using a different species’ language. A study was done in Avignon, France that observed children who were brought up by wolves. It was observed that the children spoke no language at all. Before studies of this kind were done it was thought that the children might learn to communicate with the wolves, just like the Tarzan story. This is not true, the children could not speak the human language nor the language of the wolves (Macdonald). It is a combination of environment and genes that tell white crowned sparrows and humans to learn their proper language. Genes tell the species to only learn the language of their own species and environment plays a factor in determining which dialect each will use.

Once the white crowned sparrow or infant has recognized its species, song, they can begin to practice the language. Infants first communicate by making sounds. The sounds can range from grunts to sounds that mimic their surrounding environments. For example, before babies can say words, they might say moo- moo when looking at a cow. After sounds come words. By the time the infant reaches one year, they should be making sentences out of words (Macdonald). The white crowned sparrow also does not immediately master its song. The sparrow will first sing a short subsong derived from the tutor’s full song. The sparrows keep practicing their subsong just as infants practice their words. After the sparrow has mastered its subsong it can start to form a full song. In both species it is necessary for them to hear themselves in order to vocalize their language correctly (Alcock 26).

In conclusion, both white crowned sparrows first listen and recognize their particular species’ language. A white crowned sparrow has a tutor to teach the song. Infants usually have parents that teach them their verbal language. Then they must practice the language, starting off slow with sounds and building up. Both species will continue to improve and clarify their language throughout their lives.

title: Animal Behavior/Language


text:
XQuery/String Analysis

XQuery analyze-string
XSLT 2.0 includes the analyze-string construct which captures matching groups (in parentheses) in a regular expression. Strangely this is not available in XQuery. It is possible to use the XSLT construct by wrapping an XQuery function round a generated XSLT stylesheet, even though this seems rather painful. In this installation of eXist, the XSLT engine is Saxon 8. declare function str:analyze-string($string as xs:string, $regex as xs:string,$n as xs:integer ) { transform:transform (,                                                                                ,  ) };

UK Vehicle Registration numbers
To illustrate the use of this function, here is a decoder for UK vehicle license plates. These have undergone a number of changes of format, so the script must first decide which format is used, then analyze the number to find the significant codes for the area and date of registration. The patterns are defined in XML and define the regular expression to be used, and the meaning of the matched groups.

Problem: Passing repetition modifiers through is failing

import module namespace str = "http://www.cems.uwe.ac.uk/string" at "../lib/string.xqm";

declare variable $patterns :=  Area Date  Date Area  Area Date ;

declare function local:decode-regno($regno) { let $regno := upper-case($regno) let $regno := replace($regno, " ","")

return for $pattern in $patterns/pattern let $regexp := concat("^",$pattern/@regexp,"$") return if (matches($regno,$regexp)) then let $analysis := str:analyze-string($regno,$regexp,count($pattern/field)) return  {for $field at $i in $pattern/field let $value := string($analysis[position = $i]) let $table := concat($field,$pattern/@version) let $value := /CodeList[@id=$table]/Entry[Code=$value] return element {$field} {$value/*} }      else };

let $regno := request:get-parameter("regno",) return local:decode-regno($regno)

Decode tables
Separate tables decode codes to date ranges or areas. These tables are plain XML created from CSV files via Excel. The pre-83 area codes are currently incorrect.

e.g.

Bournemouth</Location> </Entry> <Entry> <Location>Worcester</Location> </Entry> <Entry> <Location>Coventry</Location> </Entry> ...

Examples

 * 1) A current number plate: WP05LNU
 * 2) One from the previous series: L162BAY

Location Mapping
One use of this conversion is to display the locations on a map. Here we take a file of observed registration numbers, decode them all, group by location and generate a KML file with the locations geocoded through the Google API.

<NumberList> <Regno>H251GBU</Regno> <Regno>WRA870Y</Regno> <Regno>ENB427T</Regno> <Regno>C406OUY</Regno> <Regno>N62VNF</Regno> <Regno>R895KCV</Regno> <Regno>C758HOV</Regno> <Regno>H541HEM</Regno> ...

(: this script plots the registration locations of a set of  UK vehicle license plates using kml.  :)

import module namespace geo="http://www.cems.uwe.ac.uk/exist/geo" at "../lib/geo.xqm";

import module namespace str = "http://www.cems.uwe.ac.uk/string" at "../lib/string.xqm"; declare namespace reg = "http://www.cems.uwe.ac.uk/wiki/reg";

declare option exist:serialize "method=xml media-type=application/vnd.google-earth.kml+xml indent=yes  omit-xml-declaration=yes"; declare variable $reg:icon := "http://maps.google.com/mapfiles/kml/paddle/ltblu-blank.png"; declare variable $reg:patterns := <pattern version="01" regexp="([A-Z][A-Z])(\d\d)[A-Z][A-Z][A-Z]"> Area Date <pattern version="83" regexp="([A-Z])\d+[A-Z]([A-Z][A-Z])"> Date Area <pattern version="63" regexp="([A-Z][A-Z])[A-Z]?\d+([A-Z])"> Area Date ;

declare function reg:decode-regno($regno) { let $regno := upper-case($regno) let $regno := replace($regno, " ","")

return for $pattern in $reg:patterns/pattern let $regexp := concat("^",$pattern/@regexp,"$") return if (matches($regno,$regexp)) then let $analysis := str:analyze-string($regno,$regexp,count($pattern/field)) return <regno version="{$pattern/@version}"> {for $field at $i in $pattern/field let $value := string($analysis[position = $i]) let $table := concat($field,$pattern/@version) let $value := /CodeList[@id=$table]/Entry[Code=$value] return element {$field} {$value/*} }      else };

declare function reg:regno-locations($regnos) { for $regno in $regnos let $analysis := reg:decode-regno($regno) return if (exists($analysis//Location)) then string($analysis//Location) else };

let $url := request:get-parameter("url",) let $x := response:set-header('Content-Disposition','inline;filename=regnos.kml;')

return <Document> Reg nos {for $i in (1 to 10) return <Style id="size{$i}"> <IconStyle> {$i} <Icon> {$reg:icon} </Icon> </IconStyle> </Style> }     {      let $locations :=   reg:regno-locations(doc($url)//Regno) let $max := count($locations) for $place in distinct-values($locations) let $latlong := geo:geocode(concat($place,',UK')) let $count := count($locations[. = $place]) let $scale := max((round($count div $max * 10),1)) order by $count descending return <Placemark> {$place} ({$count}) <styleUrl>#size{$scale}</styleUrl> <Point> {geo:position-as-kml($latlong)} </Point> </Placemark> }  </Document>

Generate Map

SMS service
The Department of Information Science and Digital Media supports an SMS service with facilities to send and receive text messages. The service is paid for by the University of the West of England, Bristol and all traffic is logged.

A decoder for UK vehicle license numbers is one of the demonstration services which are supported for mobile-originated (MO) text messages.

The format of the text message is REG L052

e.g.447624803759

A text message in this format sent to our SMS mobile number 447624803759 passes through a PHP script which allows multiple SMS services to be supported. The script uses the first word of the message to identify the associated service endpoint, and then invokes that endpoint via HTTP, passing the prefix as code, the rest of the message as text and the origination mobile number as from.

For the prefix REG, the associated endpoint is an XQuery script: http://www.cems.uwe.ac.uk/xmlwiki/regno/smsregno.xq

The smsregno.xq script is essentially the parseregno script above.

The SMS switch then sends the Reply on to the originating mobile phone.

To do

 * solve problem with repetition modifiers (or function support for analayze-string)
 * Pre-83 area code data
 * Switch implementation in XQuery to replace the PHP application - awaits switch to eXist v2

title: XQuery/String Analysis


text:
User talk:Mital.vora

Welcome message
Hello, and welcome to Wikibooks!

Here are some tips to help you get started:
 * To learn the wiki-markup-language syntax, see Help:Editing.
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~
 * There is a box at the top of the edit window that will insert this, too; it looks like part of a signature.
 * Remember to conduct any editing experiments in the sandbox.
 * You can tell the community something about yourself in your userpage.
 * You can get to this page by clicking the tab at the top of the page labeled with your registered username.
 * If you are a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI (requests for importation) to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using Wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Reading Room with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be a good idea to add this page to your "watchlist" so that you can see when any new information is posted there. You can do that by clicking the tab labeled "watch" at the top of the page.

Good luck! --Panic 14:01, 31 October 2007 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Mital d vora. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Mital d vora~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:30, 17 March 2015 (UTC)

title: User talk:Mital.vora


text:
User talk:Gudni

Welcome message
Hello, and welcome to Wikibooks!

Here are some tips to help you get started:
 * To learn the wiki-markup-language syntax, see Help:Editing.
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~
 * There is a box at the top of the edit window that will insert this, too; it looks like part of a signature.
 * Remember to conduct any editing experiments in the sandbox.
 * You can tell the community something about yourself in your userpage.
 * You can get to this page by clicking the tab at the top of the page labeled with your registered username.
 * If you are a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI (requests for importation) to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using Wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Reading Room with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be a good idea to add this page to your "watchlist" so that you can see when any new information is posted there. You can do that by clicking the tab labeled "watch" at the top of the page.

Good luck! --Panic 14:01, 31 October 2007 (UTC)

title: User talk:Gudni


text:
User talk:MrFish

Welcome message
Hello, and welcome to Wikibooks!

Here are some tips to help you get started:
 * To learn the wiki-markup-language syntax, see Help:Editing.
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~
 * There is a box at the top of the edit window that will insert this, too; it looks like part of a signature.
 * Remember to conduct any editing experiments in the sandbox.
 * You can tell the community something about yourself in your userpage.
 * You can get to this page by clicking the tab at the top of the page labeled with your registered username.
 * If you are a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI (requests for importation) to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using Wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Reading Room with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be a good idea to add this page to your "watchlist" so that you can see when any new information is posted there. You can do that by clicking the tab labeled "watch" at the top of the page.

Good luck! --Panic 14:01, 31 October 2007 (UTC)

title: User talk:MrFish


text:
Talk:XQuery/String Analysis

I feel that I should be able to pass the string as a parameter to a common stylesheet but I haven't made that work.

The decoder is not year complete - Area83 table missing

I can't get repeat constructs into the Reg exp clearly the { } need escaping but I cant figure out how.

Patterns are too rigid - 1,2 or 3 digits are allowed, but I need the repetition construct for this

title: Talk:XQuery/String Analysis


text:
User talk:209.34.120.31

-- Herby talk thyme 14:30, 31 October 2007 (UTC)

title: User talk:209.34.120.31


text:
Wikibooks:AutoWikiBrowser

 * For enabled users, see AutoWikiBrowser/CheckPageJSON

title: Wikibooks:AutoWikiBrowser


text:
Talk:Russian/Cheat Sheet

Stress
What's this about Ё generally not being stressed? I learnt that it is pretty much always stressed... --Wolfox4777 16:37, 31 October 2007 (UTC)

title: Talk:Russian/Cheat Sheet


text:
Principles of Economics/What Kind Of Economist

It is helpful to ask yourself some questions and see what interests you most to gain a better grasp of what kind of economics you want to study. Of course, being an economist in no way means choosing solely to become either a macroeconomist or a microeconomist, but some people will find one field more interesting than the other.

So, in an attempt to help you learn a little bit about economics and a little about yourself, here is a brief list of questions that ought to aid you in your quest for economic knowledge:

Which of the following interests you more?
 * 1) How the stock market works?
 * 2) What do we mean when we call a company a monopoly? Why did Microsoft get so much attention surrounding this word?
 * 3) Is a federal budget deficit considered harmful to an economy? Why or why not?
 * 4) Why do dentists make large salaries?
 * 5) What factors affect the economic hardships faced by developing African countries?
 * 6) How do we measure living standards?
 * 7) What exactly is inflation? How do we stop it? Should we?
 * 8) Why are name brand products more expensive than their generic equivalents?
 * 9) What causes prescription drug prices to be so expensive?
 * 10) How does a firm maximize its profits?

Of the preceding questions, 1, 3, 5, 6 and 7 are macroeconomic questions, and 2, 4, 8, 9 and 10 are microeconomic questions. This list of questions is not comprehensive and shouldn’t be used to discourage you from exploring one side of economics over the other. There are so many facets to each discipline that it would be unfair to proverbially judge a book by its cover. This questionnaire is just a tool to help focus your own personal interests in economics.


text:
Principles of Economics/GDP

GDP is Gross Domestic Product (distinct from GNP, which is Gross National Product). There are two ways of determining a nation's GDP.

You've probably heard this term on the news or read about it in the paper when the national or global economy is being discussed. GDP is formally defined as the value of all the final goods and services produced in a country during a given time period. Intermediate goods — produced goods that are used up in making other goods and services — aren't counted because they would in effect cause double-counting to occur (as you will later see). Finally, capital goods — long-lived goods where they are used to create goods rather than be used up in producing other goods — are included only if they are produced within a given year.

 * Reasoning for not including Intermediate Goods.
 * Let Good A be an intermediate good that makes it possible to produce final Good B. Assume that we are allowed to count Good A and Good B into the GDP. We would have to effectively count Good A once when it was made, and count Good B and Good A; after all, Good B is effectively Good A as well. Ergo, we counted Good A twice. However, if we allowed that counting, we would vastly overestimate the GDP. Therefore, we count only final Good B.

 * Reasoning for including Capital Goods.
 * Let Good A be an capital good that creates final Good B. Assume that we are allowed to count Good A and Good B into the GDP. We would have to effectively count Good A once when it was made, and count Good B only; after all, Good B is not Good A, but a byproduct of Good A. Another reason why we count Good A is because if we did not count it, then a country that invested in the future would look worse off than one that did not.

GDP also refers to the income of the country as well. GDP also only refers to goods produced within a certain country. This means that if a firm is located in one country but manufactures goods in another, those goods are counted as part of the foreign country's GDP, not the firm's home country. For example, BMW is a German company but cars manufactured in the United States are counted as part of the United States GDP.

You can think of it another way, GDP is a way for us to measure how productive a country is on the whole. Let's break down the name for concrete understanding. Gross refers to the summation of all the country's resources towards producing output. Domestic just relates the output to the country from which the output was produced. Lastly, product just refers to the goods and services that make up output.

Market Value
The market value of a good or service is the posted price at which the final good is sold at a market. The GDP measures the market values of final goods made within a domestic market during a specified period of time. Any good or service is sold in a market such that the prices at which goods are posted determine the quantity demanded. However, for goods that have a higher price than others, the market value is higher because it costs the most to consumers. The goods with a higher market value $$h$$ will contribute more to the GDP per marginal purchase of the good or service than lower market value goods because if $$P_{m}<P_{h}$$, then when purchasing $$z$$ goods, $$P_{m} \cdot z<P_{h} \cdot z$$. Our goal with this is to measure the total market value of goods sold within a domestic economy – i.e., how much total money is made within an economy using purchased final goods and services.

Therefore, to measure the GDP using the market value, we need to add the total revenue made from selling final goods or services within a domestic economy. Let the price of a product $$n$$ be $$P$$, and let the quantity of product $$n$$ purchased be $$Q$$. The total revenue made from selling product $$n$$ is $$P_n \cdot Q_n$$. We can therefore model an equation of the GDP of an economy:

$${\text{GDP}=(P_1 \cdot Q_1)+(P_2 \cdot Q_2)+\ldots+(P_{n+1} \cdot Q_{n+1})+(P_n \cdot Q_n)}$$

Since the $$20$$ cookies are worth $$$1.50$$ each, and the $$10$$ milk cartons are worth $$$3.00$$ each, calculate the total revenue of each purchase of the goods. Let $$P_{1}=1.5$$, and let $$Q_1=20$$: $$P_{1} \cdot Q_{1}=1.5\cdot20=30$$, Finally, let $$P_{2}=3$$, and let $$Q_2=10$$: $$P_{2} \cdot Q_{2}=3\cdot10=30$$. Add each revenue made and you get the GDP of the economy: $$(P_1 \cdot Q_1)+(P_2 \cdot Q_2)=30+30=60$$.

In using the equation we learned, we assume that we are only looking at the current year production. Such an assumption makes the calculation above a nominal GDP. However, this is limiting for one very large reason: the price of any product can increase in an economy in the future, so the change in GDP cannot always signify a change for the better. To fix this, economists use the real GDP to compare the current year GDP with a "base-line GDP" (i.e. a set "base year" GDP). Let $$P_{B,n}$$ be the base year price of product $$n$$, and let $$Q_{C,n}$$ be the quantity of good $$n$$ purchased in the current year. The total revenue made from selling product $$n$$ is $$P_{B,n} \cdot Q_{C,n}$$. We can therefore model an equation of the real GDP of an economy:

$${\text{Real GDP}=(P_{B,1} \cdot Q_{C,1})+(P_{B,2} \cdot Q_{C,2})+\ldots+(P_{B,n+1} \cdot Q_{C,n+1})+(P_{B,n} \cdot Q_{C,n})}$$

Any time there is a quantity for the base year (2019), ignore it and focus only on the price. The price in the base year for the Honda Civic 2019 is $$$19,550$$ and the Toyota 2019 Avalon Hybrid car is $$$36,650$$; let the prices be $$P_{B,1}$$ and $$P_{B,2}$$, respectively.

Any time there is a price for the current year (2020), ignore it and focus only on the amount of the product purchased in that year. The quantity of Honda Civic 2019 purchased in 2020 is two, and the quantity of the Toyota 2019 Avalon Hybrid purchased is three; let the quantity purchased be $$Q_{C,1}$$ and $$Q_{C,2}$$, respectively. Now you may multiply the two "total revenues" together and you get the real GDP of the economy. $${\text{Real GDP}=(P_{B,1} \cdot Q_{C,1})+(P_{B,2} \cdot Q_{C,2})}$$ $${\implies \text{Real GDP}=(19,550 \cdot 2)+(36,650 \cdot 3)}$$ $${\implies\text{Real GDP}=75,750}$$

National Income Accounting Model
GDP < the sum of all income earned = : This interpretation is missing two additional, non-income components that must also be added to find GDP:
 * Employee compensation
 * Corporate profits (this is income that accrues to public companies' shareholders)
 * Proprietors' income (this is income that accrues to private companies' owners)
 * Net interest
 * Rental income
 * Depreciation costs
 * Indirect (excise and sales) taxes and subsidies

National Expenditure Accounting Model
The gross domestic product or the GDP is a measure of the total productivity of a country. It is a quantifiable figure that tells how much better the country and its people are at that point of time. GDP is defined as the market value of all the total goods and services produced in the country for the given period of time.

GDP = :
 * Consumption ($$C$$)
 * Investment ($$I$$)
 * Government spending ($$G$$)
 * Exports ($$X$$)
 * Imports ($$M$$)

$$ \mathrm\ GDP = C + G + I + (X - M) $$

Consumption, $$\mathbf{C}$$ is essentially the aggregate of all the goods and services consumed in the country. Haircuts, hamburgers, gasoline, etc. are all part of the GDP in the country in which they are purchased.

Government Spending, $$\mathbf{G}$$ is the sum of all the goods and services purchased by the government.

Investment, $$\mathbf{I}$$ is a bit trickier because most people confuse this term with financial investment. In economics, we refer to investment as the purchase of new capital by firms or individual consumers. That is, firms can buy non-residential capital (buildings, equipment etc.) and individual consumers can purchase residential capital (i.e. houses). If we ever mean the kind of investment done through the stock market or finances, we will specifically use the term financial investment. So unless otherwise noted, investment will always mean capital investment.

Exports, $$\mathbf{X}$$ are all the goods and services exported to foreign countries. That is, the goods and services produced by the domestic country and consumed by foreign countries.

Imports, $$\mathbf{M}$$ are just the opposite. These are goods and services produced by other countries but consumed by the domestic country.

Together $$ X - M = \text{net exports} $$. This is just a way of getting the net value of the goods traded between the domestic country and the rest of the world. Why do we add exports but subtract imports? Well, exports are added to the GDP because the domestic country receives payment for those goods produced and that is part of the value added to the economy by the domestic country. However we subtract imports, instead of just NOT counting imports, because the payment of these goods is taken away from the domestic country and added to the foreign country from which they came. You can think of subtracting imports as taking out the part of consumption where the good or service came from a foreign country.

Limitations with the GDP Model
Despite the clear usefulness of GDP, there are some problems associated with GDP that all economists must understand before moving to see what the changes in GDP mean:

 * Sometimes, it is not easy to know what constitutes final goods or intermediate goods.
 * Some goods or services are not recorded in the GDP because they are not seen in market activities.

Top 10 highest countries listed by GDP (US dollars at current nominal exchange rates)
1st Usa 18 trillion,

- EU (European Union) 16 trillion

2nd China 11 trillion

3rd Japan 4.9 trillion

4th Germany 3.4 trillion

5th UK 2.6 trillion

6th France 2.4 trillion

7th India 2.2 trillion

8th Italy 1.8 trillion

9th Brazil 1.8 trillion

10th Canada 1.5 trillion

Check your Understanding
{A U.S. steel company makes $$$200,000$$ worth of steel in the U.S. economy. In an attempt to make zero economic profits, the steel company sells $$500$$ pounds of steel to a Japanese car company. The Japanese car company uses the $$500$$ pounds of steel to make cars, in the US, worth $$$10$$ million. Should the steel be included in the U.S. GDP? (2 marks.) - Yes, since the steel is sold to a car company outside the U.S., the consumption component and the export component increase. - Yes, since the steel is sold to a car company outside the U.S., the investment component and the export component increase. - No, since the steel is sold to a car company outside the U.S. to make a car, it should not be counted because such purchases would increase the import component. + No, since the steel is made in the U.S. and then sold to a Japanese company to be made later in the U.S., it should not be counted because it would double-count the GDP. - It is impossible to determine whether or not the steel should be included in the GDP because the steel was purchased by a foreign company; export, $$X$$, increases to make a good domestically.
 * type="" coef="2"}
 * Although the car company purchased the steel, the material is used to make a final good, a car. Because the steel is an intermediary good for the car, the purchase is not counted in the GDP. Plus, it should be noted that even if a good is exported, the good must be final first before you count it into the GDP. Finally, it is important to note that consumption, $$C$$, applies to only purchases made by households, not firms. However, since no domestically located firms have purchased the five-hundred pounds of steel, the investment, $$I$$, component does not increase either.
 * Although the car company purchased the steel, the material is used to make a final good, a car. Because the steel is an intermediary good for the car, the purchase is not counted in the GDP. Plus, it should be noted that even if a good is exported, it still needs to be a final good first before it is counted. Finally, no company domestically purchased the five-hundred pounds of steel, so the investment component does not increase.
 * Goods made inside the domestic economy is by definition counted in the GDP. If it was sold outside the domestic economy, such purchases would count as exports, not imports, which would be added into the U.S. economy. Even if such purchases were imports, it would be subtracted from the GDP. Finally, this distracter does not give the right reason for not including the steel into the U.S. GDP.
 * This is the correct response because double-counting occurs whenever intermediate goods are included in the GDP. If intermediate goods were included in the GDP, the steel purchase would be counted twice.
 * If the steel was made in the U.S. economy, and the steel was then sold to a foreign company, located outside the U.S., then it would be an increase in export, $$X$$. However, after making the car domestically, it would then use the steel from now to make a car in the U.S. during that period. The steel would double-count the GDP because it was used to make a car, the final good. As such, we know that we cannot include the steel into the GDP.

{A Japanese company called Lightbulb is making cars worth $$$30$$ million inside the U.S. economy. Currently, a foreign company, BulbLight, offers a deal that purchases $$10%$$ of all the cars made from Lightbulb in the U.S. economy, currently purchasing $$$3$$ million worth of cars. In 2019, $$$5$$ million worth of Japanese-produced apples were purchased by consumers. Most domestic companies of the U.S. have purchased $$$10$$ million worth of Lightbulb U.S. produced cars for their employees. Finally, the Texas Government purchased $$$5$$ million worth of LightBulb U.S. cars for government employees working in the Police Department. What is the GDP of the U.S. economy? (3 marks.) ${ 43 _5 } million.
 * type="{}" coef="3"}
 * Although a Japanese company, Lightbulb is making cars inside the U.S. economy worth $$$30$$ million. As such, those cars are included in the U.S. GDP. BulbLight, a foreign company, is purchasing $$$3$$ million worth of domestically produced cars from Lightbulb. Because such purchases are considered exports, $$X$$, you are adding that to the GDP. If $$$5$$ million worth of foreign apples were purchased by domestic citizens, those purchases are considered imports, $$M$$, and would be subtracted from the U.S. GDP. If $$$10$$ million worth of Lightbulb domestically produced cars are purchased from companies, you are adding what is considered to be investments, $$I$$, to the U.S. GDP. Finally, if $$$5$$ million worth of Lightbulb domestically produced cars are purchased from a government institution, such purchases are considered Government purchases, $$G$$, and are added in the U.S. GDP. From the information we have, we substitute the information we have to $$GDP=C+I+G+(X-M)$$, to get $$12=0+10+5+(2-5)$$. Finally, because we need to add the $$$30$$ million worth from the Lightbulb company's final goods of cars, we get the final answer: $$$43$$ million.

{Sarah is a farmer. Sarah made $$500$$ apples in the U.S. She sold $$200$$ apples for $$$3$$ each at a U.S. farmer's market and used the remaining $$$900$$-worth of apples to make apple sauces. She sold the $$300$$ apple sauces at a farmer's market for $$$4$$ each. What is Sarah's contribution to the U.S. nominal GDP? (2 marks.) ${ 1.8 _5 } thousand.
 * type="{}" coef="2"}
 * Since Sarah sold $$200$$ apples for $$$3$$, she made $$$600$$ total revenue. Since the $$$900$$-worth of apples were used to make apple sauces, those apples are considered intermediate goods, which are not included in the GDP. She sold $$300$$ apple sauces (final goods) for $$$4$$ each, meaning she made $$$1,200$$ in total revenue. Adding the total revenues together, we get a GDP of $$$1,800$$ or $1.8 thousand.

title: Principles of Economics/GDP


text:
Template:Java Programming/Overview/Topic

 * About this book
 * History of Java
 * Overview of the Java programming language
 * The Java platform (JRE & JDK)


text:
Template:Java Programming/GettingStarted/Topic

 * Installing Java on Your Computer
 * Compiling programs
 * Running Java programs
 * Understanding a Java program
 * Java IDEs


text:
Linux Guide/Getting Linux

Use an Existing System
The easiest way to begin using a Linux system may be to use an already running system. For example, some systems may be available in various educational or work environments. In this case you only need to contact the appropriate administrator and obtain a user ID and password. You will only be able to explore the system to a certain extent, but the first steps can be taken without having go through the installation process.

Another trouble-free way of obtaining a Linux system is to buy a computer with Linux pre-installed. The number of vendors selling such systems is constantly increasing.

Download linux iso
After choosing a distribution, you should download it. Normally this will be an ISO image. An iso is all the data on a CD - after downloading the iso file, you will burn it to either a CD/DVD or a USB flash drive so you can use it. A USB is the recommended option these days as they are more reliable than CD/DVDs and virtually all modern systems support bootable USBs.

Creating a bootable USB on Windows, Mac OS X and Linux

 * 1) Go to http://unetbootin.sourceforge.net and download UNetbootin for Windows or Mac OS X and run it. Existing Linux users are recommended to download UNetbootin from their distro's repository.
 * 2) Once it is opened, click the   button to browse for your iso, next choose your drive letter in the "Type" column and click OK..
 * 3) The image will begin to be copied to your USB. Once it is done, your USB will be made bootable. You can now reboot the computer.

Creating a bootable USB on Linux (command line method)
 WARNING :This procedure will erase all data presently on the flash drive, make a backup first. 1. Launch a Terminal window. 2. Type. 3. Note that there will be an entry for your flash drive, similar to this : Note down the, in this example  , NOT   etc. 4. Unmount your USB with this command:

5. Browse to the directory where you downloaded the iso with the  command and type this command. (Assuming the iso image is  and your drive is  ) sudo dd if=ubuntu-gnome-16.04.1-desktop-amd64.iso of=/dev/sdb bs=1M 6. The command will work in the background, when you return to a prompt, it will be finished.

Creating a Live CD/DVD
A live CD/DVD is not recommended, use this procedure only if you do not have a computer that can boot from USB.

Windows (7 and later)

 * 1) Insert a blank disc in your drive
 * 2) Right click on the iso file and click "Burn image"
 * 3) Select your drive.
 * 4) Click Burn
 * 5) Wait for it to finish
 * 6) Done

Mac OS X

 * 1) Insert a blank disc in your drive
 * 2) Browse to your file in Finder
 * 3) Click "File" -> "Burn Disk Image to Disc"

Linux
K3b, Brasero etc. all have a function to burn images to CD/DVDs.

Boot from Live CD
Live CD distributions allow you to "get your feet wet" by running Linux on your own PC at home without worrying about installing it or losing data.

Live CDs don't need to be installed to your hard drive for you to use them. Instead, you simply load the Live CD into your CD-ROM drive, restart your computer and a complete running Linux system should boot up with little, if any, intervention. There are some difficulties for some distributions working with certain sets of hardware, but most systems will boot with little to no problems.

A system running a Live CD often tends to be a little slow. This is because information must be fetched from the CD-ROM (which is much slower than a hard drive) and because the Live CD must store a lot of information in memory that would normally stay on the hard disk. Don't let this fool you into thinking that Linux is a slow operating system though. Linux systems are normally very fast and reliable. If you try a Live CD, it is recommended (unless you are trying a MiniLinux) that the computer you use be a relatively recent one with a generous amount of memory (256MB or more). For most people, this should provide a trouble free way to begin to get to know Linux. Sometimes the entire Live CD can be loaded into RAM if a sufficient amount is available (say around 1GB) and this will offer excellent responsiveness.

Live CDs are a great way to test whether certain hardware is likely to be compatible with Linux. Just pop the disk into the CD-ROM drive of the system in question and reboot as described above. Most hardware problems (if there are any) should make themselves obvious during normal use.

If the Live CD didn't work
If your Live CD is ignored and you find yourself booting into your normal operating system, you may need to alter some settings in your BIOS. While this may sound daunting for some users, it's actually a lot easier than it sounds.

Begin by restarting your PC and when the boot process begins again you will need to strike a particular key on your keyboard. The key you need to strike will usually be displayed on the computer screen and is often the 'Del' key. Common alternatives are 'F1', 'F2', 'F10' and 'Esc'. The proper key will vary with your computers manufacturer. Once the proper key is struck your computer screen will display the 'BIOS' or 'Setup' editor. There are usually some simple instructions on the bottom of the screen, or off to one side, telling you how to navigate around the various choices and make changes. Be sure to read these before continuing, then look for something labeled 'Boot' or 'Boot order'. Using the instructions you read a moment ago, change this so that your CD-ROM is the first item in the boot order. If you think you've made a mistake, there is usually an option to 'Exit without saving changes'. If you don't see that option, holding down the 'Ctrl' and 'Alt' keys and pressing the 'Del' key should save the day. If all goes well 'Save and Exit' and your computer should boot up, checking the CD-ROM for your Live CD as it does so. If you have run a Linux Live CD and have rebooted to use your regular operating system and have arrived at a notice declaring "Missing Operating System" or "Error on System Disk", or any scary notice stopping you from loading up as normal, it is likely that the computer has "forgotten" that you normally load up from the hard drive and has started to look for your operating system in the CD Drive. To fix this, follow the instructions above accordingly to your system but instead of selecting your CD drive as the boot device, select your hard drive.

Install Linux
After testing the system, you'll want to install it to your hard drive permanently. This does not require you to get rid of the current operating system, even if you have only a single hard disk. We will explore this topic in more detail in the next chapter, Installation Walkthrough.

title: Linux Guide/Getting Linux


text:
Linux Guide/How Linux Works

The Linux Philosophy
Linux is built with a certain set of unifying principles in mind. Understanding these principles is very helpful in understanding how the system works as a whole. They are known as the "Linux Way", which is derived from the philosophy behind the UNIX system.

The Linux Way can be summarized as:
 * Use programs that do only one task, but do it well.
 * To accomplish complex tasks, use several programs linked together.
 * Store information in human-readable plain text files whenever it is possible.
 * There is no "one true way" to do anything.
 * Prefer commandline tools over graphical tools.

Most traits of Linux are a consequence of these principles. In accordance with them, a Linux system is built out of small, replaceable components. We will examine the most important of them in more detail. Those are: the boot loader, the kernel, the shell, the X window server, the window manager and the desktop environment. After that, we will have a look at the file system in Linux. Finally, we will discuss the security of a computer running Linux.

Boot loader
This is the part of the system that is executed first. When you have only one operating system installed, it simply loads the kernel (see below). If you happen to have multiple operating systems or multiple versions of the Linux kernel installed, it allows you to choose which one you want to start. The most popular bootloaders are GRUB (GRand Unified Bootloader) and Lilo (LInux LOader). Most users don't need to care about the boot loader, because it is installed and configured automatically. Actually, the boot Loader creates the boot sequence that the Linux Kernel requires, loading the kernel and some device drivers required for early boot process into memory (as part of so-called "initramfs"), and starting the kernel.

Kernel
The kernel is the central component of the system that communicates directly with the hardware. In fact, the name "Linux" properly refers to a particular kind of this piece of software. It allows programs to ignore the differences between various computers. The kernel allocates system resources like memory, processor time, hard disk space and external devices to the programs running on the computer. It separates each program from the others, so that when one of them encounters an error, others are not affected. Most users don't need to worry about the kernel in day-to-day use, but certain software or hardware will require or perform better with certain kernel versions.

Daemons
In a typical Linux system there are various services running as processes in the background, taking care of things like configuring your network connection, responding to connected USB devices, managing user logins, managing filesystems, etc. They are often called "daemons", because they are running silently and are mostly invisible to the user.

One of these "daemons", started by the kernel after it finishes booting itself, is called, and its role is to start the rest of the system, including all other "daemons" and graphical sessions.

Different Linux distributions use different  systems. The traditional init system used since the old Unix era, is Sys V init (referring to the System V Unix). But recently many distributions have switched to more modern init systems, such as.

Shell
The shell, sometimes also called "command line", implements a textual interface that allows you to run programs and control the system by entering commands from the keyboard. Without a shell (or something that can replace it, like a desktop environment) making your system actually do something would be difficult. The shell is just a program; there are several different shells for Linux, each of which offer somewhat different features. Most Linux systems use the Bourne Again Shell (Bash). Linux shells support multitasking (running several programs at once).

X Window Server
The X window server is a graphical replacement for the command shell. It is responsible for drawing graphics and processing input from the keyboard, mouse, tablets and other devices. The X server is network transparent; that is, it allows you to work in a graphical environment both on your own computer and on a remote computer to which you connect across a network. The X server that is most used today is X.Org. Most graphical programs need only the X server to run, so they can be used under any window manager and desktop environment.

Window Manager
The window manager is a program that communicates with the X server. Its task is managing windows. It is responsible for drawing the window borders, bringing a window to the front when you click it, moving it on the screen and hiding it when you minimize its program. Examples of popular window managers are:
 * Metacity - GNOME Desktop Environment window manager
 * KWin - KDE window manager
 * Xfwm - Xfce window manager, a lightweight manager designed to consume as little resources as possible without compromising usability
 * Compiz Fusion - an advanced window manager with lots of eye candy like customizable window animations, multiple desktops placed on a cube that you can rotate with your mouse, transparent window borders, wobbling windows while dragging them, etc.

Desktop Environment
Desktop environments such as GNOME Desktop Environment, KDE and Xfce are collections of programs designed to present a consistent user interface for most common tasks. They are what most people mean when they say "operating system" even though they are only a piece of the whole operating system. Multiple desktop environments can coexist on the same machine. They can be easily installed and after installation the user will be given a way to select which DE to start the session with.

File System
There are several file systems that Linux-based distributions use. They are BTRFS, EXT3/4, VFS, NILFS, and SquashFS.

The hard drive of your computer has a rather simple interface. It only accepts commands like "read block no. 550923 and put it in memory address 0x0021A400". Suppose you are editing a piece of text and want to save it on the disk. Using block numbers (addresses) to identify pieces of data, like your text, is awkward: not only would you have to tell your program where to save the file using raw block numbers, you would have to make sure that these blocks aren't already being used for family photos, your music collection, or even your system's kernel. To solve this, files were introduced. A file is an area of the disk which stores data and which has a name (like "example.txt"). Files are organized in collections called directories. Directories can contain other directories, in a tree-like structure. Each file can be uniquely identified by a "path," which describes its place in the directory hierarchy. For the remainder of this section, it will be assumed that you are familiar with files, directories, and paths.

In Linux, the top-level directory is called the root directory. Every file and directory in the system must be a descendant of the root directory. (It is common to talk about directories using the terminology of family relations, like "parent," "child," "descendant," "ancestor," "sibling," and so forth.) Names of files and directories can contain all characters except the null character (which is impossible to enter from the keyboard) and the "/" character. An example path would be:
 * /var/logs/apache/error.log

This path refers to a file called "error.log" which is found in a directory called "apache," which is a subdirectory of a directory called "logs," which is subdirectory of a directory called "var," which is a subdirectory of the root directory. The root directory doesn't have a name like the other; it is just denoted with a "/" character at the beginning of the path.

The root directory usually contains only a small number of subdirectories. The most important are:

 * bin - programs needed to perform basic tasks, i.e. change a directory or copy a file
 * dev - special files that represent hardware devices
 * etc - configuration files
 * home - contains private directories of users
 * media or mnt - Mount point for external drives connected to this computer, i.e. CDs or USB keys
 * tmp - temporary files
 * usr - programs installed on the computer
 * var - variable data produced by programs, like error logs

Devices as files
Just as files can be written to and read, devices in the computer system may send and receive data. Because of this, Linux represents the devices connected to the system as files in the /dev directory. These files can not be renamed or moved (they are not stored on any disk). This approach greatly simplifies application programming. If you want to send something to another computer through a serial port, you don't even need another program - you simply write to the file /dev/ttyS0, which represents a serial port. In the same manner the file representing the sound card (/dev/dsp) can be read to capture the sound from an attached microphone, or written to in order to produce sound through the speakers.

Where are the drive letters?
If you have used Windows, you might be surprised that there are no drive letters in Linux. The root directory represents the drive on which the system is installed (C: in Windows). Other drives can be "mounted" or "unmounted" in any directory (preferably, an empty one) in the file system. By mounting a disk, you attach the root directory of this disk to a directory in the file system. After that, you can access the disk like it were a part of your system disk. For example: if you have a disk that contains a directory text, which in turn contains a file called linux-intro.tex and you mount this drive in the directory /media/usbkey, you can access the file linux-intro.tex through the path /media/usbkey/text/linux-intro.tex.

In most Linux distributions, USB keys and CDs are automatically mounted when they are inserted or attached, and the  default mount directory is a subdirectory of /media or /mnt. For example, your first CD-ROM drive might be mounted at /media/cdrom0, while the contents of a USB key might be accessible through /media/usb0. You may manually change the mount directory, but you will have to learn two shell commands and know the device file that represents your drive to do that (the one we talked about in the preceding section - disks also get their file representation in the /dev directory). We will cover this subject later.

Users
The user is a metaphor for somebody or something interacting with the system. Users are identified by a user name and a password. Internally, each user has a unique number assigned, which is called a user ID, or UID for short. You only need to know your UID in some rare situations. Users can additionally be organized in groups. There is one special user in all Linux systems, which has the user name "root" and UID 0. It is also called the superuser. The superuser can do anything and is not controlled in any way by the security mechanisms. Having such a user account is very useful for administrative tasks and configuring the system. In some distributions (like Ubuntu) direct access to the root account is disabled and other mechanisms are used instead.

If you have more than one user account on a Linux system, you do not need to log out and back again to switch impersonations. There are special shell commands that allow you to access files and execute programs as other users, provided you know their user names and passwords. Thanks to this mechanism, you can spend most of the time as a user with low-privileges and switch to a higher-privileged account only if you need to.

The advantage of running as a non-privileged user is that any mistakes you happen to make are very unlikely to damage the system. System-critical components can only be altered by the root user.

File permissions
Users exist to control the extent to which people and programs using the system can control it. This is accomplished by a system of file permissions. Each file belongs to one of the users - that is, each file has an owner. Additionally, a file can be assigned to a group of users, but the owner must be a member of that group. Each file has three kinds of permissions: read, write and execute. These permissions can be assigned to three kinds of owner relations: owner, group and other. Other includes all users who are not the owner of the file and do not belong to the group which owns the file. Only the file owner or the superuser (root) can change the permissions or ownership of a file.

This system allows precise control over who can do what on a given computer. Users can be prevented from modifying system files by removing the "write" permission from them, or from executing certain commands by removing the "execute" permission. Notice that users may be allowed to execute programs but not alter them. This is very important, since most Linux systems include a compiler that allows you to create your own programs.

File permissions are usually given as three octal digits (each from 0 to 7). The digits represent the permissions for, respectively, owner, group and other users. Each digit is the sum of permission codes: 1 for execute, 2 for write and 4 for read. For example, "755" allows everyone to read or execute the file, but only its owner can write it. "400" allows the owner to read the file, and no one else is allowed to do anything. "540" allows the owner to read or execute the file, group members to only read the file and other users to do nothing.

chmod (change mode), chown (change owner), and chgrp (change group) are used to change file permissions.

title: Linux Guide/How Linux Works