text:
Lush/Beginning Lush

This chapter covers the basic syntax of lush. For discussion of classes, see Classes and Objects.

Getting Started
Like most interpreted languages, lush commands can be run interactively from the lush prompt, or as a batch of statements from a text file.

Hello World
To begin, start lush by typing "lush" or "lush.exe" (for windows) in a terminal: This will print a copyright notice, then put you in interactive mode with a lush prompt: The following line will print the familiar first words: Result: Like its parent language lisp, lush calls commands using a space-separated list of items within a pair of parentheses: Also notice that entering  not only printed "Hello world", but also returned a "Hello world" string. You can see this in the output above, where the terminal shows the result of the entered expression as being. This brings us to an important point: All lush statements have a return value. The closest equivalent to "void functions" in C/C++/Java are functions that return the empty list. Lush has a C-like  function which does just that: Result:

Interactive mode features
There are some usability features built into the lush shell:

Online help
The following command will bring up a GUI interface to a reference dictionary of all things lush. That is the first thing to try when looking for a particular function that you know must exist. Alternately, if you already know the function name, you can enter the following on the lush prompt:

Tab completion
If you can't remember the exact name of the function or variable, you can type the first few letters of its name and hit tab. If there is an unambiguous completion, lush will fill in the rest of the letters for you. If there are more than one symbols that fit the bill, hitting tab again will display a list of possible completions. For example, typing  and hitting tab twice will display the following:

Command history
Hitting the up-arrow key will cycle through previously entered statements.

UNIX shell commands
A few common shell commands familiar to UNIX/Linux weenies are available within lush, in the form of functions. For example:

Control-key shortcuts
Several keyboard shortcuts will be familiar to users of the bash shell or emacs:
 * ctrl-a, ctrl-e: Go to the beginning/end of the line.
 * ctrl-left, Ctrl-right: skip words.

Caret shortcuts
Some functions have shortcuts of the form _. These include: Remember not to put a space between the  and its argument.
 * ^Afunction_name: Prints help about the function.
 * ^Lsource_file.lsh : Loads and runs a source file (see "Running a source file" section below).

Running a source file
A series of lush statements constitutes a lush program, and can be saved in a text file and run in batch mode: hello-world.lsh To run hello-world.lsh from your shell, type: Alternately, you can run it from within the lush shell, using the  function: The ".lsh" suffix is optional. Alternately, you can use 's caret shortcut  : These filenames may also be tab-completed.

Just enough lisp to get by
Lush takes its list-based syntax straight from lisp. This section is for those with no lisp experience.

How lisp works
All lisp programs are a series of lists within lists, and the program proceeds by evaluating each list from left to right. This means that the first element in each list is treated as a function, and the rest of the elements are treated as the arguments. Once evaluated, a list returns a value (possibly, the empty list). In the above example, the innermost lists (the ones starting with the  functions) evaluate out to homework and exam grades: Their enclosing lists (starting with  evaluate out to these grades scaled by some factor: The next enclosing list (starting with   sums these scaled grades: And the outermost list  takes this sum and assigns it to the variable " ". It too returns a value, in this case the value of the assigned variable:

Creating lists
As shown above, all lists in lisp are evaluated. This can be unwelcome when you want to make a variable that is itself a list. Here's an example of a naive attempt at list creation: Result: The problem is that we never intended the string  to be treated as a function, but lisp doesn't know that. There are two ways around this. One is to use the quote operator by putting a single ' before the list: This works well enough in this case, where all the list elements are "literals", or expressions that can be used as-is, in a cut-and-paste manner. Sometimes, however, we want to put the results of calculations in our lists. In such a case, the above technique will produce the following undesired result: Result: So the quote operator not only prevents the first element from being used as a function, it prevents all list items from being evaluated. Thus, the quote operator is useful primarily for moving around unevaluated code snippets rather than constructing lists as variables (see Macros).

What we want instead is to use the  list-constructor: Result:

To summarize, use  to construct lists, and use the quote operator to manipulate unevaluated snippets of code. You'll probably use  most of the time.

List manipulation
Discuss car, cdr, cons and append

More
For the interested, there's more in the Lisp tricks section. These include things like passing around functions like variables, creating anonymous functions on the fly ("lambda functions"), and links to helpful lisp references.

Declaring global variables
Declaring and setting a global variable can be done using the  or   command: The two are identical except for one important detail: if a previous  statement has already set the value of a symbol, a second   on the same symbol name will do nothing. , on the other hand, will always set the value as told: should therefore be used with caution, especially when running lush programs from within the lush shell. If you run a program with a  statement, Edit the file to change the variable's value, then re-run the program, the variable will remain unchanged.

Declaring local variables
The  and   statements can be used to declare local variables. It consists of a list of  pairs, followed by a body of code that may use the declared variables: The following example declares four local variables, then uses them to make curry: defines the variables in the order they're listed, while  makes no such guarantees, allowing for possible parallelism. Unless you're sure that this is what you want, you should stick to. / statements return the last expression evaluated, making them handy for setting up function calls with lots of arguments without cluttering the current scope with the argument variables. The following example creates a list for dinner, consisting of milk, rice, and curry:

Setting values
Once declared, variable values can be changed using  from lisp. The following shows a numerical variable  being set to equal another variable. As shown above, applying setq on numerical values sets the first variable to be an equal but separate copy of the second variable. As in lisp, this is also true for variables containing lists. Variables pointing to objects are another story; the variables themselves are like pointers in C/C++, where assignment just changes the value of the pointer.

Booleans and conditionals
In lush, as in lisp, empty and non-empty lists represent the boolean "true" and "false". You can also use the literals  and. Unlike lisp, lush has many objects other than lists, and these all evaluate to "true".

The dreaded
Lush inherits some historical baggage from lisp in the form of the "true" literal. Such a short literal name is bound to be used by the occasional careless newbie as a local variable, to represent time for example. While lush will prevent a user from creating a global variable named, a local variable named   will likely cause subtle and silent errors.

Booleans in compiled Lush
Unlike in C/C++, the integer value of 0 or pointer value of  will not be considered 'false' in a lush conditional. To make a lush conditional understand an integer or C boolean expression, one must use the  function:

Loops
Lush provides the traditional for and while loops, and more specialized functions for iterating over arrays.

For loops
Syntax:

Here is an example of printing the number from 0 through 10 using a for loop:

The counter  iterates through all values between 0 and 10 including 10. The loop expression returns the last expression evaluated within the loop.

You can specify the step size with an optional third argument:

While loops
Syntax: While loops are useful for iterating through lists: Like the for loop, the while loop returns the last expression evaluated in body.

Numeric array loops
Most iterations will be done over elements of numerical arrays (vectors, matrices, or tensors). While one could do so using  or   loops, the following iterator functions provide a more convenient alternative.

idx-bloop
iterates through successive sub-arrays of an array by iterating through its first dimension. For example, the rows of a matrix can be printed as follows: Output:

You can iterate over multiple arrays simultaneously, so long as their first dimensions contain the same number of elements:

idx-gloop
is an extension of  that provides a counter variable, as in a   loop. Here is an  version of the row-printing example: Output:

idx-eloop
is simply an  that iterates over the last index rather than the first. For example, when applied to matrices, an  would iterate over its columns, not its rows.

Array iteration gotchas

 * Unlike the  or   loops, array loop expressions return the first array in the array list, not any of the expressions evaluated in the body.
 * The sub-arrays are allocated on the heap and should not be expected to persist outside of the loop, even when you assign them to an external symbol. Doing so can lead to fatal and mysterious memory errors.

title: Lush/Beginning Lush


text:
Wikijunior talk:How Things Work/Hard Drive

I'm a preservice teacher currently formulating a curriculum for teaching gifted 4th and 5th graders about how computers work. I'm not sure whether or not you've worked with 8-11 year olds, but the existing "how it works" section of this article is far too technical for such an age group. Kids at this stage of cognitive development are capable of handling abstractions to allow them to deal with strange new concepts, but they need to be based on things that they've had experience with; thus, I would argue that a host of metaphors would be needed to make this sort of information comprehensible.

If some spare time presents itself, I'll try to contribute to this project.
 * Great! Sounds like you have some valuable insight to share. --Xixtas 02:31, 12 September 2006 (UTC)

Hmm... Yes, far too technical. I don't know anything about hard-drive design, so somone look over my edits :-p I hope nothing is factually incorrect about them. But... yeah, someone look over my edits. I tried to write with an 8-12 year old in mind. --Dragontamer 16:46, 10 November 2006 (UTC)

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


text:
Isometric Pixel Art/Shading the Box

Isometric boxes, even if they're made of straight lines, can be made prettier through the use of shading.

Here we will learn about light sources and why the heck they're so important. If you leave off light sources, the whole picture will be off. So without further ado...

Let's Begin!

First draw a cube and pick your colors, each getting gradually lighter. There should be at least three, but you can toss in a fourth one if you want to do the last step (entirely optional). Shadows are usually less saturated than the other colours, but here i have kept the saturation high for stylistic purposes. Now pick your light source. I chose the upper right corner and drew a sun there to remind me where it is.

Flood-fill the spot that's facing away from the light source the most, in this case, the side I've labeled "1". Side "2" should have your next darkest color, and then side "3" should be lightest.

Swapping the light source should also swap your colors on the box. I put the sun in the left corner and mirrored the box to make it face the light source.

If you want to make it look a little different, take color number four and draw on all the black bits that ARE NOT touching the edge. The edges should remain black.

Hey, you did it!

Of course you can experiment with different positions for the light source. Remember to practice with the "sun" in different places so you get the hang of shifting the colors.

title: Isometric Pixel Art/Shading the Box


text:
XForms/Message Types

Motivation
With JavaScript you did not have much choice in how intrusive you were about alerting a user. The JavaScript alert function required the user to acknowledge a message before they proceeded in filling out a form. With XForms there are now three ways to proceed. Each has a different level of intrusiveness. There are three message options:
 * 1) ephemeral - a message that just appears briefly and goes away by itself
 * 2) modeless - a message you can ignore for now
 * 3) modal - a message the user must acknowledge before you go on

Screen Image
Here is a sceen image with the ephemeral message showing:

Link to working XForms Application
Simple Messages

Discussion
The data for the first and last message come from the body of the document. The modeless message is taken directly from the body by using an XPath expression into the model.

Note that the first event happens when you start to enter data in an input field. This is the   event. The other two use the   event which happens when you enter a return on the second example and press the button on the last example.

title: XForms/Message Types


text:
User:InglemoorViking

A Little About Me
Hi, I'm a sophomore at Inglemoor High School (Go Vikings!) in Washington State. I'm in the IB program, so I hope to be able to contribute to the IB pages at Wikibooks. I also edit and write a lot on Wikipedia, so I have a limited amount of experience on the way things work around here. I speak English and Mandarin fluently, and am learning Japanese. Additionally, I play the piano and the clarinet. I am in full IB, with a major in positive thinking.

title: User:InglemoorViking


text:
Psychiatric Disorders/Mood Disorders

The mood disorders are any disorder that can cause an increased or decreased mood. Most of the major mood disorders are characterized by the presence of one or more syndromes: a depressive episode, a manic episode, a hypomanic episode or a mixed episode.

One can picture the possible range of moods on a continuum from dysphoria on one pole to euphoria on the other. Euthymia or a “normal mood” would be in the middle.

Unipolar Disorders
Disorders that affect only one pole are sometimes called “unipolar disorders.” In theory these could affect either pole, however, in practice this term generally refers to depressive disorders.

The unipolar mood disorders include /Major Depressive Disorder/, Dysthmia, and the Secondary Depressions.

Bipolar Disorders
Bipolar Disorders can cause both euphoria and dysphoria. Disorders in this category include /Bipolar Disorder/, Cyclothymia, and the Secondary Manias.

title: Psychiatric Disorders/Mood Disorders


text:
Psychiatric Disorders/Mood Disorders/Major Depressive Disorder

Major Depressive Disorder (often simply called "Major Depression") is a common and yet very hidden disorder. It can be confusing at times: in normal conversation, we talk about being “depressed.” Major depression is different from the normal blues we might experience in that it is more severe, longer lasting (chronic) and less reactive to positive changes in our environment. It affects every aspect of our functioning: not only our mood, but also our physical functioning and even our thoughts. People who have major depression do not just feel “sad”—they feel truly sick.

Phenomenology
Major depression affects all areas of functioning. It is classically defined by its effect on mood: patients describe feeling sad or down. Alternately, they may also feel irritable or anxious.

It also affects our physical functioning: patients routinely describe a lack of energy and complain of feeling drained, exhausted, and tired. Others speak of a “nervous energy,” akin to agitation. Libido is often diminished. Other physical functions, as sleep and appetite, (two of what are known as “vegetative symptoms”) are affected. These tend to be decreased, although some patients, especially those who will later develop bipolar disorder, experience hypersomnia and/or an increased appetite.

Finally, it affects our thoughts: persons with major depression often seem overly negative or pessimistic in their thinking. This pessimistic outlook may include suicidal ideation. In the extreme, the thought distortions may be severe enough to be considered psychotic.

As one can imagine, depression can negatively affect all aspects of a person’s life: work performance, relationships. The combination of the effects on attitude and energy can spell disaster in the workplace. One should keep in mind that this disease often strikes people during their most productive years—young to middle adulthood—and it is not surprising that health economists consider this one of the most expensive diseases affecting humans.

Epidemiology
Major depression is very common. Figures vary, but it seems that about 5% of the general population suffers from this disorder during their lifetime. This disorder affects women twice as frequently as men—and this 2:1 ratio has been seen rather consistently throughout the world. In children, however, the ratio is equal between girls and boys.

Etiology
Major depression appears to be, in part, an inherited disorder. In dizygotic twins, the concordance rate for major depression is about 20%, and in monozygotic twins, it jumps to about 50%. Among the first-degree relatives of patients with major depression, the risk of major depression is 2 to 3 times higher than for the normal population. Adoption studies also support a genetic link. However, the actual locus has not been identified. It is very unlikely that we will discover a single “depression gene”: the genetics of depression are very complex and heterogeneous.

In addition to inheritance, the environment plays a role in the expression of depression. Early childhood losses, especially significant losses (such as that of a parent), are strong risk factors for future depression. It is interesting that the first episode of depression is more likely to be triggered by a stressful environment; with repeat episodes, the connection with the environment is less obvious.

The fact that antidepressants work leads one to assume that there must be some deficit in the normal functioning of monoamine neurotransmitters, such as norepinephrine and serotonin. In general, research in this area is confusing and inconsistent. Though there are some intriguing findings, it is likely that the relationship between neurotransmitters and mood is complex, and not simply a “chemical imbalance” as is sometimes suggested.

Major depression is likely a heterogeneous disorder. Patients with depression likely have an inherited abnormality that predisposes them to depression, through some effect on normal physiologic processes in the brain. The neurotransmitters serotonin and norepinephrine are likely affected in this process, though in a complicated way. Environmental stresses can trigger this predisposition. However, with time, the disorder becomes more autonomous and less related to stress.

Pathophysiology
On looking at the pathology of depression, the problem seems to be on of physiology rather than anatomy, and MRIs of depressed patients are usually normal. A number of physiological abnormalities are associated with depression. Most commonly reported are abnormalities in the hypothalamic-pituitary-adrenal axis. This is most commonly demonstrated by the fact that many patients have an abnormal dexamethasone suppression test—the normal suppression in response to administration of an exogenous corticosteroid is blunted in almost half of patients with major depression. Similarly, one sees blunting of the TSH response to TRH or blunting of the growth hormone response to clonidine.

Other physiologic abnormalities are common. Disturbances of sleep architecture are common, including shortened rapid eye movement latency, or REM latency, and increased REM density.

On direct observation, such imaging technologies as Positron Emission Tomography, or PET and Single Photon Emission Computed Tomography (SPECT) also show abnormalities in major depression. The most common finding is hypofrontality, which is usually bilateral, but sometimes is nondominant.

Normal Emotional Reactions
The question usually comes up, how does one differentiate major depression from “normal reactions” such as appropriate sadness or grief. Admittedly, this can be hard, especially on a cross sectional evaluation, however there are a number of things you should consider when deciding whether to make the diagnosis of major depression:

One would want to consider whether the severity of symptoms is out of proportion to the event. This is subjective, but if one thinks that the patient is greatly “overreacting” to a minor or moderate stress, one would be more inclined to diagnose major depression.

One should also consider the duration of symptoms. Do the depressive symptoms remain strong even after the crisis has passed? This would again suggest major depression, particularly if the symptoms last 6 months to a year.

One should look for unusual symptoms. Some symptoms are more common with major depression than with other forms of sadness or grief. Examples include self-deprecation or severe unwarranted guilty feelings. Other suspicious symptoms would include physical symptoms, such as psychomotor agitation retardation, or early morning awakening.

Finally, a personal or family history of depression is also suggestive that a person is more than just sad or grieving.

Other Mood Disorders
Major Depression can resemble a number of other illnesses. Of other mood disorders that may include depressive symptoms. Most differ in their course of illness. For example, dysthymia is a chronic depressive disorder, often lasting years, which consists of milder but unrelenting symptoms of depression. Post partum depression and premenstrual dysphoric disorder are all depressive episodes linked to certain times or events.

Depressive episodes of bipolar disorder can appear very similar to those occurring on the basis of major depression; a history of mania, however, rules out a diagnosis of major depression. Should this history be unavailable, then four ways are used to ascertain whether the depressed patient has bipolar disorder. A history of five or more depressive episodes, or a duration of a decade from the onset of the first to the onset of the current depressive episode, makes the future probability of mania very low. Secondly, a family history of mania is far more common in patients with bipolar disorder compared to major depression. Furthermore, patients with bipolar depression tend to be younger when presenting with their first depressive episode (teens or early twenties or, in some cases, even as children). Finally, bipolar depressions tend to come on acutely and be characterized by psychomotor retardation, hypersomnia, and hyperphagia, whereas major depressions come on insidiously and be characterized by agitation, insomnia, and anorexia with weight loss. Psychotic features (aka delusions and hallucinations) are also far more common in bipolar depression.

Other Psychiatric Disorders
Other psychiatric disorders can include depressive symptoms as part of a larger syndrome—one has to be careful to recognize the “big picture” for these disorders, and not get stuck just on the first symptoms that may present. For example, a number of anxiety disorders, including Obsessive Compulsive Disorder, or Generalized Anxiety Disorder can include symptoms that overlap with depression, such as dysphoria, irritability, poor sleep and appetite. Posttraumatic Stress Disorder may include significant depressive symptoms as part of the overall syndrome. Schizoaffective disorder often includes full-blown depressive episodes. However, unlike psychotic depression, where the psychosis improves with the mood, the psychosis of schizoaffective disorder persists beyond the improvement in depression.

Other Disorders
Finally, a number of disorders may cause a secondary depression. The term “secondary depression” implies that, although the depression is real, it is directly due to some other disease, and is best treated by treating the primary problem. Examples include the depression seen with alcoholism and drug abuse, depression secondary to anorexia nervosa, and depression secondary to medical syndromes, such as hypothyroidism or Cushing’ disease. In each case, antidepressant treatment is often used. However, antidepressants often do not work well as they do in uncomplicated major depression until the primary problem is also treated.

Course
Major depression tends to be a relapsing and remitting illness.

It can begin at any age. Most often, it begins in young to middle adulthood, though childhood and geriatric onsets do occur. The depression usually begins gradually. It may be triggered by a stressful life event, such as the loss of a loved one, though it can also seemingly begin for no reason.

An episode of untreated depression can last anywhere from 6 to 12 months. After that time, most persons return to their normal state. However, about 1/10 of people develop a more chronic disorder.

Most persons who recover from an episode of depression will have another episode during their lifetime. It is difficult to say just when it will recur. On average, the interval between episodes is about 5 years; however there is a wide variability in this.

The course is worsened in the presence of comorbid disorders. Such disorders as alcoholism and other drug abuse and anxiety disorders are common in persons with major depression. Suicide is also common—the overall suicide rate is about 4% in patients with major depression and in those severe enough to be hospitalized, the rate jumps to about 9% (the suicide rate in the normal population is only about 0.012%--so this represents a 1000-fold increase in risk).

Treatment
There are three phases of treatment for depression: the acute phase, the continuation phase and the maintenance phase. The goals of each phase are different.

Acute Treatment
The goal of the acute phase is to bring about a remission of symptoms, meaning to eradicate, or at least decrease the number and intensity of current depressive symptoms.

In the acute phase of treatment, a number of options are available for treating the current symptoms. One may use a medication, specifically an antidepressant to treat the symptoms. Alternately, a number of psychotherapies have been shown to be effective in treating depressive symptoms. As a general rule, medications are usually preferred for more severe episodes, including psychotic ones, whereas both medications and talk therapies may be equally effective for mild to moderate depression.

The details of medication and psychotherapy treatments will be covered elsewhere in more detail. For now, some generalities:

Medication Treatment
There are a number of classes of medications that are effective for depression. Classes of drug include first generation agents, such as tricyclic medications and monoamine oxidase inhibitors, or MAOIs. These were the original medications used for depression, and were discovered largely through serendipity. Examples of tricyclic antidepressants include amitriptyline and nortriptyline. They appear to work through the inhibition of norepinephrine reuptake into the neuronal synapse. Conversely, monoamine oxidase inhibitors, as the name implies, inhibit the enzyme most responsible for the catabolism of norepinephrine and other monoamines. An example of an MAOI is phenelzine.

Both the tricyclic antidepressants and the MAOIs are very effective antidepressants. However, they suffer from a number of unwanted effects, due to their lack of selectivity. For example, amitriptyline, in addition to inhibiting the reuptake of norepinephrine, is also a potent inbitor of acetyl choline in the brain. The result of these anticholinergic effects include dry mouth, dizziness and constipation. In addition, the tricyclics have an antiarrhythmic effect similar to quinidine, and cause cardiac arrhythmias in patients with preexisting conduction defects. For that reason, they are usually avoided in patients with cardiac disorder. The MAOIs, in addition to sharing significant anticholingic and other unwanted effects, inhibit the metabolism of tyramine, an amino acid which is common in cured, fermented or aged foods. The result of a tyramine build up is a syndrome called the “tyramine-cheese”reaction.

Newer agents include the second generation selective serotonin reuptake inhibitors, or SSRIS. These are "second generation" agents as an attempt was made to develop agents that were more specific in their actions. As they are selective, they tended to cause less side effects, and certainly less serious ones, and for that reason largely supplanted the first generation agents as first line treatments for depression. Example of an SSRI includes fluoxetine, sertraline, paroxetine, citalopram and escitalopram. Side effects of these include jitteriness, nausea and insomnia. More serious reactions can occur if they are concurrently given with another serotoninergic agent, causing the “Serotonin syndrome.”

The 3rd generation of agents often combine multiple effects in an attempt to improve efficacy. If they offer an advantage in efficacy at all, it is mild at best, however they are effective agents. Such agents include venlafaxine and duloxetine, which selectively inhibit both norepinephrine and serotonin reuptake and mirtazapine.

In general, all antidepressants have approximately equal efficacy. In choosing an antidepressant, one considers the patient’s history as well as side effects. A history of good response to an agent, or a family history of such response, is predictive of a good response for the patient. In addition, as many side effects can be predicted, one usually chooses agents that will be tolerant to a patient. For example, a patient who is troubled by insomnia might not tolerate an SSRI as well as another antidepressant less likely to cause insomnia.

Two particularly troubling side effects are weight gain and sexual side effects. Most antidepressants cause these side effects, at least in some degree. A notable exception is bupropion.

All antidepressants take about the same amount of time to work – anywhere from 2 to 6 weeks until one sees an effect, and sometimes longer. The average time to effect is perhaps 3 to 4 weeks, and one should wait that long after starting a medication before considering a treatment change, if the medication is already at a proper dose.

Adherence is a big problem. The major reason for a lack of response is that the medication is often not taken long enough and at a proper dose to allow for an effect.

There are several barriers to adherence. One is side effects. On average, newer agents are better tolerated than older ones, but all antidepressants have some measure of side effects. For example, the SSRIs can cause nausea, jitteriness and insomnia. Patients should be prepared for these side effects, and it is important to know the side effects of a particular drug in deciding whether a patient is going to be able to tolerate the drug.

Another barrier is a lingering bias against using medications for mood. The physician should both reassure and educate the patient that major depression is a real disease, and like all real diseases, it needs medical treatment.

Psychotherapy
Many types of psychotherapy have been shown to be effective for depression. The two that have the greatest weight of positive data are Cognitive Behavioral Therapy and Interpersonal therapy. However, many other therapies, including psychodynamic psychotherapy, couples therapy, group therapy and behavioral therapy also have some efficacy data.

A critical variable in considering therapy is intensity. When used, therapy should be frequent and of sufficient duration to have maximal effect. Once-weekly, hour-long therapy, lasting the length of the acute period, seems a minimum for patients with moderate depression.

Again, psychotherapy is not the treatment of choice for severe major depression or depression with psychotic features.

Other options
Electroconvulsive therapy or ECT has long been thought to be the most effective and rapidly acting treatment. It works through inducing seizures in the brain. It is likely that it is only the general bias against ECT that prevents wider use. For now, it is usually restricted to the most severe, meaning life threatening, or most treatment resistant cases of depression.

Continuation Treatment
In the continuation phase, the goal is to prevent relapse or a reemergence of symptoms once they have been treated.

Once the symptoms are controlled, the goal of therapy is to prevent the symptoms from coming back, or “relapsing.” In general, treatments that are effective in the acute period are thought to be effective in this continuation period as well, with the proviso that they should be continued at the same dose as was used in the acute period.

Maintenance Treatment
In the maintenance phase, the goal is prevent recurrence, or the emergence of new episodes of depression.

Generally, treatment of depression is continued for the likely length of a major depressive episode: 6 to 9 months. At that time treatment can often be discontinued. However, there are situations in which longer term, even indefinite treatment is recommended. These cases are as follows:

Recurrent Depression
Many patients who recover from an episode of depression will have a later episode. Patients with recurrent depression are those who have had at least 3 clear episodes of depression in their lifetime. Such patients have such a high likelihood of recurrence that ongoing treatment is often recommended.

Chronic depression
Some patients do not recover from their acute episode of depression. Some continue to have major depression. Others may recover from the severe episode, but may turn out to also have comorbid dysthymia. In these cases, ongoing treatment is recommended.

Severe Depression
There may be cases where, even after one episode of depression, the symptoms are so severe that the patient does not want to risk another episode. As with all treatment, one should always compare risks and benefits, and in some cases the risks of going off medication may just too risky.

Maintenance Treatment Options
Although the data is much more skimpy, is seems that most drugs used in the acute period also prevent recurrence. Usually they are continued at the same dose needed to achieve remission.

However, these drugs only work while one takes them. Once stopping, they confer no additional preventive benefit, and the risk of relapse returns.

ECT generally is used only for achieving acute remission of depression and has no longer lasting benefit. In some cases, such as patients who only respond to ECT, or prefer it to medication, maintenance ECT may be given, on a perhaps monthly basis for ongoing treatment.

Psychotherapy may be beneficial in that, even when discontinued; it may confer an ongoing benefit. This make sense when one thinks about it: in effective psychotherapy, one learns something, such as new ways to cope, or new ways to think about stress.


text:
Practical Electronics/SWG

The thickness of a wire is often given as a Standard Wire Gauge, or SWG. This is number from 0000000 or 7/0 (thickest) to 50 (thinnest). The gauge of most wire used in electronics is between 20 and 30. Often, a wire gauge will be stated followed by "swg", so 26 swg, etc.

It is very important that you do not confuse SWG with AWG, which means American Wire Gauge - although fairly similar, it is a different system of sizing wires.

The table below lists the SWG gauges, along with the diameter in inches and millimetres.

= '''WARNNIG!!! This table appears to be incorrect'''. From measurement and also from another website (that I am unable to link due to policies) a copper wire of about 0.127mm diameter has a resistance of 1426 Ohms/km, whereas this table above states that a thicker wire of 0.132mm diameter has a resistance of 4130 Ohms/km, much higher. I suggest that anyone using this table for important work should check elsewhere. WARNING!!! WRONG!!! = This table appears to be incorrect. From measurement and also from another website (that I am unable to link due to policies) a copper wire of about 0.127mm diameter has a resistance of 1426 Ohms/km, whereas this table above states that a thicker wire of 0.132mm diameter has a resistance of 4130 Ohms/km, much higher. I suggest that anyone using this table for important work should check elsewhere.

title: Practical Electronics/SWG


text:
Minix 3/Minix 3 on Qemu

Run MINIX 3 on Linux QEMU
The step below was successfully tried with MINIX on QEMU and it was running under on Fedora Core 3 Linux mkdir minix cd minix wget http://download.minix3.org/iso/minix_R3.2.1-972156d.iso.bz2 bunzip2 minix_R3.2.1-972156d.iso.bz2 mkdir /mnt/isoimage mount -t iso9660 -o loop minix_R3.2.1-972156d.iso /mnt/isoimage The above steps downloads, extracts and mounts a minix iso image in the directory /mnt/isoimage wget http://web.archive.org/20060831115225/fabrice.bellard.free.fr/qemu/qemu-0.8.2-i386.tar.gz mkdir temp cd temp tar -xvzf ../qemu-0.8.2-i386.tar.gz mkdir -p /usr/local/share cp -r usr/local/share/qemu /usr/local/share/ cp -r usr/local/share/doc/qemu /usr/share/doc/ cp usr/local/share/man/man1/* /usr/share/man/man1/
 * Download the latest minix ISO and this can be found on minix3 website minix_R3.2.1-972156d.iso.bz2.
 * Create a directory called "minix" and stored everything inside that directory. So simple steps command lines to do the above and few things more:
 * The following steps downloads and installs QEMU:

Installing MINIX: Create a local image file: cd minix qemu-img create minix3.img 2048M qemu -boot a -fda /mnt/isoimage/bootflop.img -hda "minix3.img" -cdrom minix_R3.2.1-972156d.iso -m 64 -localtime
 * This completes your installation of QEMU.

title: Minix 3/Minix 3 on Qemu


text:
Compiler Construction/Dealing with errors

Dealing with errors
Even experienced programmers make mistakes, so they appreciate any help a compiler can provide in identifying the mistakes. Novice programmers may make lots of mistakes, and may not understand the programming language very well, so they need clear, precise, and jargon-free error reports. Especially in a learning environment, the main function of a compiler is to report errors in source programs; as an occasional side-effect you might actually get a program translated and run.

As a general rule, compiler writers should attempt to express error messages in moderately plain English, rather than with reference to the official programming language definition (some language definitions use somewhat obscure or specialized terminology).

For example, a message "can't convert string to integer" is probably clearer than "no coercion found".

Historical Notes
In the 1960's and much of the 1970's, batch processing was the normal way of using a (large) mainframe computer (personal computers only started to become household items in the early 1980's). It could well be several hours, or even a day, from when you handed your deck of punched cards to a receptionist until you could collect the card deck along with a printed listing of your program, accompanied either by error messages or by some useful results.

Under such circumstances, it was important that compilers report as many errors as possible, so part of the job of writing a compiler was to 'recover' from an error and continue checking (but not translating) in the hope of finding more errors. Unfortunately, once an error has occurred (especially if the error affects a declaration), it is quite possible for the compiler to get confused and produce a host of spurious error reports.

Programmers then had the task of deciding which errors to try and fix, and which ones to ignore in the hope that they would vanish once earlier errors were fixed. Some compilers were particularly prone to producing spurious error reports. The only useful advice that helpdesk staff could provide was: fix the first error, since the compiler hasn't had a chance to confuse itself at that point.

A significant amount of compiler development effort was often devoted to attempts at error recovery. You could try and guess what the programmer might have intended, or insert some token to at least allow parsing to continue, or just give up on that statement and skip to the next semicolon. The latter action could skip an end or other significant program structure token and so get the compiler even more confused.

Integrated Development Environment (IDE)
Fast personal computers are now available, so IDEs are becoming more popular, with an editor and compiler tightly coupled and usable from a single graphical interface. Many IDEs also include a debugger as well. In some cases the editor is language-sensitive, so it can supply matching brackets and/or statement schemas to help reduce the number of trivial errors. An IDE may also use different colours for different concepts within a source language, e.g. reserved words in bold, comments in green, constants in blue, or whatever.

This speed and tight coupling allows the compiler writer to adopt a much simpler approach to errors: the compiler just stops as soon as it finds an error, and the editor then places the cursor at the point in the source text where the error was detected and displays some specific error message. Note that the point where an error was detected could well be some distance after the point where the error actually occurred.

There were line-mode IDEs back in 1964, many BASIC systems were examples of such systems; we are going to implement something like this in the book section Case study - a simple interpreter.

Compile-time Errors
During compilation it is always possible to give the precise position at which the error was detected. This position could be shown by placing the editor cursor at the precise point, or (batch mode) by listing the offending line followed by a line containing some sort of flag (e.g.'|') positioned under the point of error, or (less conveniently) by providing the line number and column number of that point.

Remember that the actual position of the error (as distinct from where it was detected) may well be at some earlier point in the program; in some cases (e.g. bracket mismatch) the compiler may be able to indicate the nature of the earlier error.

It is important that error messages be clear, correct, and relevant.
 * The worst counter-example that Murray Langton has encountered was a compiler which reported "Missing semicolon" when the actual error was an extra space in the wrong place. To further confuse matters, no indication was given as to where in the program the error was.  Just to add insult to injury, the source language didn't even use semicolons!

Errors during Lexical Analysis
There are relatively few errors which can be detected during lexical analysis.

Strange characters
 * Some programming languages do not use all possible characters, so any strange ones which appear can be reported. Note however that almost any character is allowed within a quoted string.

Long quoted strings (1)
 * Many programming languages do not allow quoted strings to extend over more than one line; in such cases a missing quote can be detected. Languages of this type often have some way of automatically joining consecutive quoted strings together to allow for really long strings.

Long quoted strings (2)
 * If quoted strings can extend over multiple lines then a missing quote can cause quite a lot of text to be 'swallowed up' before an error is detected. The error will probably then be reported as somewhere in the text of the next quoted string, which is unlikely to make sense as part of a program.

Invalid numbers
 * A number such as 123.45.67 could be detected as invalid during lexical analysis (provided the language does not allow a full stop to appear immediately after a number). Some compiler writers prefer to treat this as two consecutive numbers 123.45 and .67 as far as lexical analysis is concerned and leave it to the syntax analyser to report an error.  Some languages do not allow a number to start with a full stop/decimal point, in which case the lexical analyser can easily detect this situation.

Errors during Syntax Analysis
During syntax analysis, the compiler is usually trying to decide what to do next on the basis of expecting one of a small number of tokens. Hence in most cases it is possible to automatically generate a useful error message just by listing the tokens which would be acceptable at that point.

Source: A + * B   Error:       | Found '*', expect one of: Identifier, Constant, '('

More specific hand-tailored error messages may be needed in cases of bracket mismatch.

Source: C := ( A + B * 3 ;   Error:                    | Missing ')' or earlier surplus '('

Errors during Semantic Analysis
One of the most common errors reported during semantic analysis is "identifier not declared"; either you have omitted a declaration or you have mispelt an identifier.

Other errors commonly detected during semantic analysis relate to incompatible use of types, e.g. attempt to assign a logical value such as true to a string of characters. Some of these errors can be quite subtle, but again it is easy to automatically generate fairly precise error messages.

Source: SomeString := true; Error: Can't assign logical value to character string

The extent to which such type checking is possible depends very much on the source language.
 * PL/1 allows an amazingly wide variety of automatic type conversions, so relatively little checking is possible.
 * Pascal is much more fussy; you can't even assign a real value to an integer variable without explicitly specifying whether you want the value to be rounded or truncated.
 * Some writers have argued that type checking should be extended to cover the appropriate units as well for even more checking, e.g. it doesn't make sense to multiply a distance by a temperature.

Other possible sources of semantic errors are parameter miscount and subscript miscount. It is generally an error to declare a subroutine as having 4 parameters and then call that routine with 5 parameters (but some languages do allow routines to have a variable number of parameters). It is also generally an error to declare an array as having 2 subscripts and then try and access an array element using 3 subscripts (but some languages may allow the use of fewer subscripts than declared in order to select a 'slice' of the array).

Reporting the Position of Run-Time Errors
There is general agreement that run-time errors such as division by 0 should be detected and reported. However, there is considerable variation as to how the location of the error is reported.

 * Some systems merely provide the hexadecimal address of the offending instruction. If your compiler/linker produced a load map you might then be able to do some hexadecimal arithmetic to identify which routine it is in.

 * Some systems do tell you the name of the routine the error was in, and possibly the names of all the routines which were active at the time.

 * A few kind systems give you the source line number, which is very helpful. Note however that extensive program optimization can move code around and intermingle statements, in which case line numbers may only be approximate.  From the implementor's viewpoint there are several ways in which line number details or equivalent can be provided.
 * The compiled program can contain instructions which place the current line number in some fixed place; this makes the program longer and slower. Of course the compiler need only add these instructions for statements which can actually cause an error.
 * The compiled program can contain a table indicating the position at which each source line starts in the compiled code. In the event of an error, special code can then consult this table and determine the source line involved.  This makes the compiled code longer but doesn't slow it down.
 * In some unoptimized systems, it may be possible to deduce some source information from the compiled code, e.g. the Elliott 503 Algol 60 compiler could report: "divide by 0 at second division after third begin of routine 'xyz'". This doesn't affect code size or speed, but may not always be feasible to implement.

Run-Time Speed versus Safety
Some of the material in this section may be controversial.

There are some potential run-time errors which many systems do not even try to detect. The language definition may merely say that the result of breaking a certain language rule is undefined, i.e. you might get an error message, or you might get the wrong answer without any warning, or you might on some occasions get the right answer, or you might get a different answer every time you run the program, or you might trigger off World War III ('undefined' does mean that anything could happen).

In the past there have been some computers (Burroughs 5000+, Elliott 4130) which had hardware support for fast detection of some of these errors. Many current IDE's do have a debugging option which may help detect some of these run-time errors:

 * Attempt to divide by 0.
 * Overflow (and possibly underflow) during arithmetic operations.
 * Attempt to use a variable before it has been set to some sensible value (undefined variable).
 * Attempt to refer to a non-existent array element (invalid subscript).
 * Attempt to set a variable (defined as having a limited range) to some value outside this range.
 * Various errors related to pointers:
 * Attempt to use a pointer before it has been set to point to somewhere useful.
 * Attempt to use a nil pointer, which explicitly doesn't point anywhere useful.
 * Attempt to use a pointer which points outside the array it should point to.
 * Attempt to use a pointer after the memory it points to has been released.

Historically, the main reason for not doing these checks is the effect on performance. When FORTRAN was first developed (circa 1957), it had to compete with code written in assembler; indeed many of the optimizing techniques used in modern compilers were first developed and used at that time. C was developed (circa 1971) initially as a replacement for assembler for use by experienced system programmers when writing operating systems.

In both the above cases there was a justifiable reason for not doing these checks. Nowadays, computer hardware is very much faster than it was in 1957 or 1971, and there are many more less-experienced programmers writing code, so the arguments for avoiding checks are much weaker. Actually adding the checks on a supposedly working program can be enlightening/surprising/embarrassing; even programs which have been 'working' for years may turn out to have a surprising number of bugs.

Hoare (inventor of quicksort) was responsible for an Algol 60 compiler in the early 1960's; subscript checking was always done. Indeed Hoare has said in "Hints on Programming Language Design" that: "Carrying out checks during testing and then suppressing then in production is like a sailor who wears a lifejacket when training on dry land and then removes the lifejacket when going to sea."

In his book "The Psychology of Computer Programming", Wienberg recounts the following anecdote:
 * After months of effort, a particular application was still not working, so a consultant was called in from another part of the company. He concluded that the existing approach could never be made to work reliably.  While on his way home he realized how it could be done.  After a few days work he had a demonstration program working and presented it to the original programming team.
 * Team leader: How long does your program take when processing?
 * Consultant: About 10 seconds per case.
 * Team leader: But our program only takes 1 second. {Team look smug at this point}
 * Consultant: But your program doesn't work. If the program doesn't have to work then I can make it as fast as you like.

Wirth designed Pascal as a teaching language (circa 1972); for many Pascal compilers the default was to perform all safety checks. Some Pascal systems had an option to suppress the checks for some limited part of the program.

When a programming language allows the use of pointers and pointer arithmetic for accessing array elements, the cost of doing checks for access to non-existent array elements might be significant. Note that it can indeed be done: each pointer is large enough to contain three addresses, the first being the one which is directly manipulated and used by the programmer, and the other two addresses being the lower and upper limits on the first. This approach may have problems when the language allows interconversion between integers and pointers.

In the case of 'undefined variables', note that setting all variables initially to 0 is a really bad idea (unless the language mandates this of course). Such an initial setting reduces program portability and may also disguise serious logic errors.

Cheap detection of 'undefined'
Murray Langton (main author of this wikibook) has had some success in checking for 'undefined' in a 140,000 line safety-critical legacy Fortran program. The fundamental idea is to set all global variables to recognizably strange values which are highly likely to produce visibly strange results if used.

For an IBM mainframe, the strange values were:
 * REAL set to -9.87654E70
 * INTEGER set to -123456789
 * CHAR set to '?'

Note that the particular values used depend on your system, in particular the large number used for REAL is definitely hardware-dependent. For a machine with IEEE floating point arithmetic (most PC's) the best choice for REAL is NaN (not a number), with a possible alternative being -9.87654E37

The reason for choosing large negative numerical values is that they tend to be very obvious when printed or displayed as output, and they tend to cause numerical errors (overflow) if used for arithmetic. Also, in Fortran, all output is in fixed-width fields, and any output which won't fit in the field is displayed as a field full of asterisks instead, which is very easy to spot.

In the safety-critical example quoted above, a program was written which identified all global variables (by analyzing COMMON blocks), excluded those (in BLOCK DATA) which were explicitly initialized, and then wrote a Fortran routine which set all these silly values. If any changes were made to a COMMON block, it was a simple matter to rerun this analysis program.

During execution, the routine which sets silly values uses less than 0.1% of the total CPU time. When these silly values were first used, it took several months to track down and eliminate the resulting flood of asterisks and question marks which appeared in the output, despite the fact that the program had been 'working' for over 20 years.

How to check for 'undefined'
The basic idea is to ensure that all variables are flagged as 'undefined' when declared. Some languages allow simultaneous declaration and initialization, in which case a variable is flagged as 'defined'. Whenever a value is assigned to a variable the flag is changed to 'defined'. Whenever a variable is used the flag is checked and an error is reported if it is 'undefined'.

In the past a few lucky implementors have had hardware assistance in the form of an extra bit attached to each word in memory (Burroughs 5000+). On modern byte-addressable machines you could attach an extra byte to each variable to hold the flag. Unfortunately, due to alignment requirements, this would tend to double the amount of memory needed for data (many systems require 4-byte items such as numbers to have an address which is a multiple of 4; even if misalignment is allowed its use may slow the program down significantly).

The simplest way of providing a flag is to use some specific value which is (hopefully) unlikely to appear in practice. Particular values depend on the type of the variable involved.

boolean
 * Such variables are most likely to be allocated one byte of storage with 0 for false and 1 for true. A value such as 255 or 128 is a suitable flag.

character
 * When used for binary input/output, any value could appear, so no checking is possible. Hence it must be possible to switch off checking in such cases.
 * When used as a character there are many possible non-printing characters. 127 or 128 or 255 may be suitable choices.

integer
 * Most computer systems use two's complement representation for negative numbers which gives an asymmetric range (for 16-bits, range is -32768 to +32767). We can restore symmetry by using the largest negative number as the 'undefined' flag.

real
 * If you hardware conforms to the IEEE standard (most PC's do) you can use NaN (not a number).

How to check at compile-time
You may well be thinking that all this checking (for undefined, bad subscript, out of range, etc.) is going to slow a program down quite a lot. Things are not as bad as you think, since a lot of the checking can actually be done at compile-time, as detailed below.

First, some statistics to show you what can be done:
 * Just adding checking to an existing compiler resulted in 1800 checks being generated for a 6000-line program.
 * Adding a few hundred lines to the compiler allowed it do many checks at compile-time, and reduced the number of run-time checks to just 70. The program then ran more than 20% faster than the version with all checks included.

We have already mentioned that variables which are given an initial value when declared need never be checked for undefined.

The next few tests require some simple flow-control analysis e.g. variables which are only set in one branch of an if statement become undefined again after the if statement, unless you can determine that a variable is defined on all possible branches.

 * Once a variable has been set (by assignment or by reading it from a file) it is then known to be defined and need not be tested thereafter.
 * Once a variable has been tested for 'undefined', it can be assumed to be defined thereafter.

If your programming language allows you to distinguish between input and output parameters for a routine, you can check as necessary before a call that all input parameters are defined. Within a routine you can then assume that all input parameters are defined.

For discrete variables such as integers and enumerations, you can often keep track at compile time of the maximum and minimum values which that variable can have at any point in the program. This is particularly easy if your source language allows variables to be declared as having some limited range (e.g. Pascal). Of course any assignment to such a bounded variable must be checked to ensure that the value is within the specified range.

For many uses of a bounded variable as a subscript, it often turns out that the known limits on the variable are within the subscript range and hence need not be checked.

In a count-controlled loop you can often check the range of the control variable by checking the loop bounds before entering the loop which may well reduce the subscript checking needed within the loop.

Glossary
This glossary is intended to provide definitions of words or phrases which relate particularly to compiling. It is not intended to provide definitions of general computing jargon, for which a reference to Wikipedia may be more appropriate.


text:
CCNA Certification/Network Layer

= Network Layer = The network layer is the third layer out of seven in the OSI model and the third layer out of five in the TCP/IP model. In the TCP/IP reference model it is called the Internet layer. In all of the models, the network layer responds to service requests from the transport layer and issues service requests to the data link layer.

In essence, the network layer is responsible for end to end (source to destination) packet delivery, whereas the data link layer is responsible for node to node (hop to hop) frame delivery.

The network layer provides the functional and procedural means of transferring variable length data sequences from a source to a destination via one or more networks while maintaining the quality of service, and error control functions.

The network layer deals with transmitting information all the way from its source to its destination - transmitting from anywhere, to anywhere. Here are some things that the network layer needs to address:

 * Is the network connection-oriented or connectionless?
 * For example, snail mail is connectionless, in that a letter can travel from a sender to a recipient without the recipient having to do anything. On the other hand, the telephone system is connection-oriented, because the other party is required to pick up the phone before communication can be established. The OSI Network Layer protocol can be either connection-oriented, or connectionless. The IP Internet Layer (equivalent to OSI's Network Layer) supports only the connectionless Internet Protocol (IP); however, connection-oriented protocols, such as TCP, exist higher in the stack by enforcing reliability constraints through timeouts and resending packets.

 * What are the Global Addresses?
 * Everybody in the network needs to have a unique address which determines who he is. This address will normally be hierarchical, so you can be "Fred Murphy" to Dubliners, or "Fred Murphy, Dublin" to people in Ireland, or "Fred Murphy, Dublin, Ireland" to people anywhere in the world. On the internet, these addresses are known as IP Addresses.

 * How do you forward a message?
 * This is of particular interest to mobile applications, where a user may rapidly move from place to place, and it must be arranged that his messages follow him. Version 4 of the Internet Protocol (IPv4) doesn't really allow for this, though it has been hacked somewhat since its inception. Fortunately, the forthcoming IPv6 has a much better designed solution, which should make this type of application much smoother.

Internet protocol
Internet Protocol (IP) works in the network layer of the TCP/IP model. It is a connectionless protocol and does not guarantee the packet will reach the given destination. IP protocol has 2 versions 1)IPv4 2)IPv6.

The Internet Protocol is a data-oriented protocol used for communicating data across a packet-switched internetwork.

IP is a network layer protocol in the internet protocol suite and is encapsulated in a data link layer protocol (e.g., Ethernet). As a lower layer protocol, IP provides the service of communicable unique global addressing amongst computers. This implies that the data link layer need not provide this service. Ethernet provides globally unique addresses except it is not globally communicable (i.e., two arbitrarily chosen Ethernet devices will only be able to communicate if they are on the same bus).

Services provided by IP
Because of the abstraction provided by encapsulation, IP can be used over a heterogenous network (i.e., a network connecting two computers can be any mix of Ethernet, ATM, FDDI, Wi-fi, Token ring, etc.) and it makes no difference to the upper layer protocols.

All the data link layers can (and do) have their own set of addressing (or possibly the complete lack of it) and the need to resolve IP addresses to data link addresses is needed. This resolving is addressed by the Address Resolution Protocol (ARP).

Reliability
IP provides an unreliable service (i.e., best effort delivery). This means that the network makes no guarantees about the packet and none, some, or all of the following may apply:

data corruption out of order (packet A may be sent before packet B, but B can arrive before A) duplicate arrival lost or dropped/discarded In terms of reliability the only thing IP does is ensure the IP packet's header is error-free through the use of a checksum. This has the side-effect of discarding packets with bad headers on the spot, and with no required notification to either end (though an ICMP message may be sent).

To address any of these reliability issues, an upper layer protocol must handle it. For example, to ensure in-order delivery the upper layer may have to cache data until it can be passed up in order.

The primary reason for the lack of reliability is to reduce the complexity of routers. While this does give routers carte blanche to do as they please with packets, anything less than best effort yields a poorer experience for the user. So, even though no guarantees are made, the better the effort made by the network, the better the experience for the user.

IP addressing and routing
Perhaps the most complex aspects of IP are IP addressing and routing. Addressing refers to how end hosts become assigned IP addresses and how subnetworks of IP host addresses are divided and grouped together. IP routing is performed by all hosts, but most importantly by internetwork routers, which typically use either interior gateway protocols (IGPs) or external gateway protocols (EGPs) to help make IP datagram forwarding decisions across IP connected networks

Version history
IP is the common element found in today's public Internet. The current and most popular network layer protocol in use today is IPv4; this version of the protocol is assigned version 4. IPv4 was adopted by the United States Department of Defense as MIL-STD-1778.

IPv6 is the proposed successor to IPv4 whose most prominent change is the addressing. IPv4 uses 32-bit addresses (~4 billion addresses) while IPv6 uses 128-bit addresses (~3.4×1038 addresses). Although adoption of IPv6 has been slow, as of 2008, all United States government systems must support IPv6.[1]

Versions 0 through 3 were either reserved or unused; version 5 was used for an experimental stream protocol. Other version numbers have been assigned, usually for experimental protocols, but have not been widely used.

ICMP
The Internet Control Message Protocol (ICMP) is one of the core protocols of the Internet protocol suite. It is chiefly used by networked computers' operating systems to send error messages—indicating, for instance, that a requested service is not available or that a host or router could not be reached.

ICMP differs in purpose from TCP and UDP in that it is usually not used directly by user network applications. One exception is the ping tool, which sends ICMP Echo Request messages (and receives Echo Reply messages) to determine whether a host is reachable and how long packets take to get to and from that host.

ARP
In computer networking, the Address Resolution Protocol (ARP) is the standard method for finding a host's hardware address when only its network layer address is known.

ARP is not an IP-only or Ethernet-only protocol; it can be used to resolve many different network-layer protocol addresses to hardware addresses, although, due to the overwhelming prevalence of IPv4 and Ethernet, ARP is primarily used to translate IP addresses to Ethernet MAC addresses. It is also used for IP over other LAN technologies, such as Token Ring, FDDI, or IEEE 802.11, and for IP over ATM.

ARP is used in four cases of two hosts communicating:
 * 1) When two hosts are on the same network and one desires to send a packet to the other
 * 2) When two hosts are on different networks and must use a gateway/router to reach the other host
 * 3) When a router needs to forward a packet for one host through another router
 * 4) When a router needs to forward a packet from one host to the destination host on the same network

The first case is used when two hosts are on the same physical network (that is, they can directly communicate without going through a router). The last three cases are the most used over the Internet as two computers on the internet are typically separated by more than 3 hops.

Imagine computer A sends a packet to computer D and there are two routers, B & C, between them. Case 2 covers A sending to B; case 3 covers B sending to C; and case 4 covers C sending to D.

ARP is defined in RFC 826. It is a current Internet Standard, STD 37.

RARP
Reverse Address Resolution Protocol (RARP) is a network layer protocol used to obtain an IP address for a given hardware address (such as an Ethernet address). It has been rendered obsolete by BOOTP and the more modern DHCP, which both support a much greater feature set than RARP.

The primary limitations of RARP are that each MAC must be manually configured on a central server, and that the protocol only conveys an IP address. This leaves configuration of subnetting, gateways, and other information to other protocols or the user.

Another limitation of RARP compared to BOOTP or DHCP is that it is a non-IP protocol. This means that like ARP it can't be handled by the TCP/IP stack on the client, but is instead implemented separately.

RARP is the complement of ARP.

RARP differs from Inverse Address Resolution Protocol (INARP), which is designed to locate the IP address associated with another station's MAC address.

RARP is described in RFC 903.

title: CCNA Certification/Network Layer


text:
English in Use/Vocabulary/Data

=Animals=

=House=

=Automobiles= =Fruits=

title: English in Use/Vocabulary/Data


text:
User:I already forgot~enwikibooks

Just jumping over from wikipedia. wikipedia talk

title: User:I already forgot~enwikibooks


text:
User:Esuresh84

WELCOME

title: User:Esuresh84


text:
User talk:Esuresh84

Welcome
Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You can sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * Check out our help page if you need additional help.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Take a look at Naming policy
 * See list of templates which can save your time
 * 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.

Good luck! --Derbeth talk 10:04, 12 September 2006 (UTC)

Oracle PDF's
Why do you upload copyrighted materials like Image:PLSQL 9i Vol2.pdf? --Derbeth talk 09:39, 15 September 2006 (UTC)

title: User talk:Esuresh84


text:
Talk:Animal Care/Goldfish

Description
Your goldfish will develop black spots

Treatment
Replace 1/3 of the water in the tank until the water is full cycled.

The only contributor: 12:28, 5 June 2006 Abyab (Talk | contribs) Transwikied 10:42, 12 September 2006 (UTC) by SB_Johnny  | talk

"Gasping for air?"
The article mentions fish "gasping for air" -- don't fish always open and close their mouths? How does one know if they are gasping for air?
 * My fish hardly ever surface, they shouldn't be heading to the surface often and gulping air, and if you aren't sure you may as well get a few airation pellets anyways :)86.144.13.101 14:20, 12 May 2007 (UTC)

title: Talk:Animal Care/Goldfish


text:
Horticulture/Paper Mulch Barriers

One of the most effective ways to control perennial weeds in the organic garden is to use the Newspaper-and-Mulch Method. The action is quite simple: the newspaper acts as a physical barrier which prevents perennial weeds from growing above-ground, which over time starves the plant, since it is unable to photosynthesize. The results are very good if it’s done properly.

This method should not be used around some shallow-rooted shrubs (particularly some plants in ../Ericaceae/). Digging dogs and squirrels can undo the barriers as well, so the treated areas need to be monitored carefully if these animals are present in the garden.

Tools and Materials

 * Newspaper or cardboard: A large amount of newspaper of cardboard is needed, since to be effective the barrier beeds to be at least 1 cm (about 1/3 inch) thick when wet. Newspaper can often be attained from local recycling centers, cardboard from supermarkets (call the market first and ask them to save it).
 * Plastic or metal bins: Shallow, flat bottomed containers to hold water, large enough to fit a folded newspaper section. This might not be useful when using cardboard, depending on the size of the boxes.
 * Covering material: Mulch, compost, soil, or gravel needs to be put on top of the paper to keep it from blowing away (and to hide it from sight).

Site preparation
Once all the materials are together, it’s time to prepare the area for application. If it is a new bed (without ornamental plants already growing), start by mowing or weed-wacking as close to the ground as possible. Tilling is also an option, as long as you can get the soil good and smooth afterwards, and compact it a bit with a rake. Make sure that the outermost 6 inches or so of the bed are as weed-free as possible, so plants can't just grow around the barrier.

If there are already ornamental plants growing, more care is needed. Shrubs and small trees with shallow root systems will not appreciate having paper on their roots, so you’ll need to carefully hand-weed within their driplines. Outside the dripline, cultivate just as you would on a new bed. Perennials are usually OK with the newspaper laid within 4” of their crowns.

If the bed is badly invaded with running weeds like bindweed, thistle, goutweed, it’s usually better to just cut everything down to the ground, transplant and quarantine the shrubs, and apply newspaper to the entire area.

Application
Prepare the newspaper by thoroughly soaking it in water to give it weight and help it bind together. The easiest system for doing this is to have two tubs of water, so one tub can be used for soaking while you pull paper out of the other one.

Once the paper is thoroughly wet, begin laying it down on top of the soil. Use whole sections, not unfolded, and let them overlap by 1/2, so that the entire soil surface has 2 sections on it, at least 1/4 inch thick (1/2 inch is even better). Once the paper is down, pat the sections together so they’ll start to form a continuous layer. This layer will keep perennial weeds or turf from poking through, effectively smothering the weeds and denying them light. Leave at least 2 inches on the outer portion of the bed to allow for edging without having to cut through the paper.

Once the paper is down, and before it starts to dry, start laying down mulch on top. Don’t dump wheelbarrows on the paper, but instead place it by hand, to avoid disturbing the newspaper as much as possible (unlike mulching without a barrier, it's actually better to go from front to back, rather than back to front). Put on enough mulch to thoroughly cover the paper, as this will not only look nicer, but will also prevent the wind from blowing the paper around the yard.

If it’s a “must plant” location, use 6 inches of compost instead of mulch, and grow annuals and shallow rooting vegetables on top (keep in mind that you’ll need to water the bed more often than the surrounding soil, because soil moisture will not wick up through the paper barrier as much as it would if the paper wasn’t there). With that much compost sitting atop the bed, it’s a good idea to use some logs on the edge (on top of the paper) to keep it from washing into adjacent areas.

Maintenance
As a rule, you’ll want to leave the bed alone for about a year to ensure that the perennial weeds are completely smothered. Use the area in the meantime for containers, ornaments, to store new plant acquisitions in, or as the quarantine site for any shrubs you might have moved.

Make a regular inspection for tenacious weeds that might try to pop through the paper, and if you see any, brush the mulch aside, find the hole they’re using, and add a patch layer of newspapers to seal it up.

Once you’ve had a full year without any weeds poking through, it’s safe to till the bed and start growing in it. Keep in mind that there will still be weed seeds in the soil, but the pernicious perennials will be history, as long as you keep on top of the new seedlings. If using a tiller, remove any large pieces of paper and add them to the compost pile, as they are a carbon source and may divert nitrogen from the soil.

/Mulches

title: Horticulture/Paper Mulch Barriers


text:
Talk:Horticulture/Paper Mulch Barriers

This is copy-pasted from my old website. I hereby release it into public domain. -- SB_Johnny | talk 11:08, 12 September 2006 (UTC)

title: Talk:Horticulture/Paper Mulch Barriers


text:
User talk:59.93.34.35

Please do not add commercial links to Wikibooks. Wikibooks is not a vehicle for advertising or a mere collection of external links. Note that books may be collections of external links for educational purposes only. See the welcome page if you would like to learn more about contributing to our project. Thanks. --Derbeth talk 11:17, 12 September 2006 (UTC)

title: User talk:59.93.34.35


text:
Modern Greek/Lesson 6x

This is the last actual lesson teaching you how to read, write and pronounce Greek. After this lesson you will know all Greek letters and the only thing you'll still have to learn are a few letter combinations, which will be treated in the "Wrapping up" lesson.

The next letter you should learn is Theta:

Θ θ

Both the upper and lowercase letters look different from the Latin alphabet. This letter is pronounced as the th in thumb and coincidentally the IPA symbol for this sound is a lowercase Theta: [θ]. Here are some sample words that you should be able to read now:

μαθηματικά κιθάρα (a musical instrument) Θεσσαλονίκη θεραπεία απαθής αθλητής αμφιθέατρο ανθολoγία ανθρωπολογία αντιπαθητικός

Now for a letter that looks somewhat familiar again:

Χ χ

This is the letter Chi. The uppercase letter looks exactly like an X and the lowercase letter is slimmer and drops below the baseline like an English y. The pronunciation is not like X though. It's either of two sounds: when Chi is followed by a 'light' vowel sound such as e or i, it sounds like the h in English huge, (IPA [ç]) (which is equivalent to the ch in German Ich). When it is followed by any other vowel sound or by a consonant, it is pronounced like the ch in the Scottish word loch or the German word Bach (IPA [x]).

Some words for practise:

τεχνολογία Χιλή συγχρονίζω Χουάν (Spanish name) Χοσέ (another Spanish name) Κοπεγχάγη Ζυρίχη Νέο Δελχί Στοκχόλμη αραχνοφοβία

Now you're probably wondering how to write the x (ks) sound that is rather common in Greek. The answer is the letter Xi:

Ξ ξ

This letter looks unfamiliar, but it sounds exactly like the English x as in axe (IPA [ks]). Here are some examples:

ξενοφοβία Μεξικό Βρυξέλλες εξάγωνο Λουξεμβούργο Αλέξανδρος ορθόδοξος λεξικό οξυγόνο

The very last Greek letter to learn is Psi.

Ψ ψ

Psi is pronounced like ps as in apse (IPA [ps]). There are not that many English words with this letter combination, but in Greek it is more common. Practise reading:

ψυχολογία ψυχίατρος αποκάλυψη αυτοψία

Solutions

title: Modern Greek/Lesson 6x


text:
Horticulture/Planting Lawn Bulbs

There’s just nothing so spectacular in the early spring as a lawn planted with small bulbs for a colorful show. While very large lawns look good with larger bulbs such as daffodils, the average lawn owner wouldn’t want to wait that long to mow. This easy method is intended for use with the small spring bulbs, such as Crocus, the smaller grape hyacinths (Muscari), siberian squill (Scilla), early snowdrops (Galanthus), and the native spring beauties (Claytonia).

This sort of planting gives great results the following spring, and then even more over the long term, as the bulbs multiply and make the bloom more dense over time.

The best effect is achieved by planting a large number of bulbs...I prefer to have at least 2 bulbs per square foot of lawn (so for a 20’ X 25’ area, I order 1,000 bulbs). They’re really not all that expensive wholesale, and can be installed in no time using this method.

This all hinges upon the fact that most core aerating machines create holes the perfect size and depth for installing small bulbs (it won’t work with larger bulbs, which require larger, deeper holes). It’s not an appropriate thing to do on wet lawns, as bulbs won’t survive in very wet soils. The method works very well in combination with my Big Lawn Treatment in the fall.

Preparation:

There’s really not a lot of preparation to do, just have the bulbs ready to go, and make up the fertilizer mix for the holes. To make the mix, stir in about 1 lb of bone meal with 6 cubic feet of compost (a full wheelbarrow). That doesn’t sound like much, but the compost naturally has most of the nutrients the bulbs need. If you have eggshells saved up, use about a quart of crushed eggshells into the mixture and skip the bone meal (it never hurts to add more eggshells if you have a large supply).

Equipment:

Core Aerator Packing Rod (just a stick or piece of handle to pack down the compost mix over top of the bulb)

Materials:

Bulbs Bone Meal/Compost Mix or Eggshell/Compost Mix

Step 1: Run the Aerator

Run the aerator over the entire area to be planted. To make the blooms more randomly spaced, you can certainly run the aerator twice (all the holes won’t be used in either case).

Step 2: Clean up the plugs.

Though normally one would leave the plugs from the aerator to break down into the soil, I find them distracting when doing a bulb planting, as you might end up forgetting where some of the bulbs are if they’re laying amid the plugs.

Step 3: Place the bulbs

Don’t just start planting, because once the bulbs are in the ground, it's easy to forget where you’ve already planted, and where you still need to work. Place the bulbs around, on the grass, to get an even distribution. Try to avoid planting in rows or in a regular “grid”, since it looks much nicer if they’re a bit more randomly spaced, which gives the blooming lawn a “natural look”.

Step 4: Plant the bulbs

This is the easy part. Just put a pinch of the mix in the bottom of the hole, stick a bulb in, and firmly pack in more mix over top, bringing it up to the level of the soil.

Step 5: Help the rest of the lawn

Either do a big lawn treatment, or just add some grass seed (fall is the time to do that anyway), and water well.

/Techniques

title: Horticulture/Planting Lawn Bulbs


text:
Talk:Horticulture/Planting Lawn Bulbs

This is copy-pasted from my old website. I hereby release it into public domain. -- SB_Johnny | talk 11:56, 12 September 2006 (UTC)

title: Talk:Horticulture/Planting Lawn Bulbs