text:
C++ Programming/Programming Languages/C++/Code/Debugging

Debugging
Programming is a complex process, and since it is done by human beings, it often leads to errors. This makes debugging a fundamental skill of any programmer as debugging is an intrinsic part of programming.

For historical reasons, programming errors are called bugs (after an actual bug was found in a computer's mechanical relay, causing it to malfunction, as documented by Dr. Grace Hopper) and going through the code, examining it and looking for something wrong in the implementation (bugs) and correcting them is called debugging. The only help available to the programmer are the clues generated by the observable output. Other alternatives are running automated tools to test or verify the code or analyze the code as it runs, this is the task where a debugger can come to your aid.

Debugging can be quite stressful, especially multi-threaded programs that are extremely hard to debug, but it can also be a quite fun intellectual activity, kind of like a logic puzzle. Experience in debugging will not only reduce future errors but generate better hypothesis for what might be going wrong and ways to improve the design.

In debugging code there are already understood sections and situations that are prone to errors, for instance issues regarding pointer arithmetics is a well understood fragility inherited from C and in debugging, as any other methodology, there are already established techniques, procedures and practices that can make the detection of bugs easier (i.e.:Delta Debugging).

The field of debugging also covers establishing the security for the code (or the system it will run under). Of course this will all depend on the design limitations and requirements for the specific implementation.

Definition of bug
A bug in a program is defined by an unexpected behavior, unintended by the programmer. It happens when the behavior was not expected or intended in that program's code. A bug can also be described as error, flaw, mistake, failure, or fault.

Most bugs arise from programming mistakes, and a few are caused by externalities (compiler, hardware or other systems outside of the direct responsibility of the programmer). A program that contains a large number of bugs, and/or bugs that seriously interfere with its functionality, is said to be buggy.

Reports detailing bugs in a program are commonly known as bug reports, fault reports, problem reports, trouble reports, change requests, and so forth.

There are a few different kinds of bugs that can occur in a program, and it is useful to distinguish between them in order to track them down more quickly.

Categorizations for bugs regarding their origin:
 * Organizational
 * Conceptual error. Where the code is syntactically correct, but the programmer or designer intended it to do something else. These can occur due to differences between the documentation and the actual product.
 * Unpropagated updates; e.g. programmer changes "myAdd" but forgets to change "mySubtract", which uses the same algorithm. These errors are mitigated by the Do not Repeat Yourself philosophy.
 * Comments out of date or incorrect: many programmers assume the comments accurately describe the code.
 * External
 * Compiler bugs or unexpected results due to lack of a default behavior on the C++ language specifications.
 * Environmental bugs on external dependencies (libraries or other software) or Operating System bugs/undocumented behaviors.
 * Hardware bugs or undocumented behaviors.
 * Arithmetic bugs
 * Division by zero.
 * Arithmetic overflow or underflow.
 * Loss of arithmetic precision due to rounding or numerically unstable algorithms.
 * Logic bugs
 * Infinite loops and infinite recursion.
 * Off by one error, counting one too many or too few when looping.
 * Syntax bugs (Typos)
 * Resource bugs
 * Null pointer dereference.
 * Using an uninitialized variable.
 * Using an otherwise valid instruction on the wrong data type (see packed decimal/binary coded decimal).
 * Access violations.
 * Resource leaks, where a finite system resource such as memory or file handles are exhausted by repeated allocation without release.
 * Buffer overflow, in which a program tries to store data past the end of allocated storage. This may or may not lead to an access violation or storage violation. These bugs can form a security vulnerability.
 * Excessive recursion which though logically valid causes stack overflow
 * Co-processing bugs
 * Deadlock.
 * Race condition.
 * Concurrency errors in Critical sections, Mutual exclusions and other features of concurrent processing. Time-of-check-to-time-of-use (TOCTOU) is a form of unprotected critical section.

Common errors
Common programming errors are bugs mostly occur due to lack of experience, attention or when the programmer delegates too much responsibility to the compiler, IDE or other development tools.

 * Usage of uninitialized variables or pointers.
 * Forgetting the differences between the debug and release version of the compiled code.
 * Forgetting the  statement in a   when fall-through was not meant
 * Forgetting to check for null before accessing a member on a pointer.
 * This will cause access violations (segmentation faults) and cause your program to halt unexpectedly.

Typos
Typos are an aggregation of simple to commit syntax errors (in very specific situations where the C++ language is ambivalent). The term comes from typographical error as in an error on the typing process.

 * Forgetting the  at the end of a line. All-time classic !

 * Use of the wrong operator, such as performing assignment instead of equality test. In simple cases often warned by the compiler.

 * Forgetting the brackets in a multi lined loop or if statement.

Compile-time errors
The compiler can only translate a program if the program is syntactically correct; otherwise, the compilation fails and you will not be able to run your program. Syntax refers to the structure of your program and the rules about that structure.

For example, in English, a sentence must begin with a capital letter and end with a period. this sentence contains a syntax error. So does this one

For most human readers, a few syntax errors are not a significant problem, which is why we can read the poetry of E. E. Cummings without spewing error messages.

Compilers are not so forgiving. If there is a single syntax error anywhere in your program, the compiler will print an error message and quit, and you will not be able to run your program.

To make matters worse, there are more syntax rules in C++ than there are in English, and the error messages you get from the compiler are often not very helpful. During the first few weeks of your programming career, you will probably spend a lot of time tracking down syntax errors. As you gain experience, though, you will make fewer errors and find them faster.

Linker errors
Most linker errors are generated when using improper settings on your compiler/IDE, most recent compilers will report some sort of information about the errors and if you keep in mind the linker function you will be able to easily address them. Most other sort of errors are due to improper use of the language or setup of the project files, that can lead to code collisions due to redefinitions or missing information.

Run-time errors
The run-time error, so-called because the error does not appear until you run the program.

The third type of error is the logical or semantic error. If there is a logical error in your program, it will compile and run successfully, in the sense that the computer will not generate any error messages, but it will not do the right thing. It will do something else. Specifically, it will do what you told it to do.
 * Logic errors and semantics

The problem is that the program you wrote is not the program you wanted to write. The meaning of the program (its semantics) is wrong. Identifying logical errors can be tricky, since it requires you to work backwards by looking at the output of the program and trying to figure out what it is doing.

Compiler Bugs
As we have seen earlier, bugs are common to every programming task. Creating a compiler is no different, in fact creating a C++ compiler is an extremely complex programming task, more so since the language even if stable is always evolving and not only on the standard.

The liberty C++ permits enables programmers to push the envelope on what it is possible and expected and to an increase on the level of code complexity due to abstractions. This has lead to compilers to attempt to automating several low level actions to ease the burden to the programmer, like code optimization, higher level of interaction and control over the compiler components and the inclusion of very low level configuration possibilities. All these features increase the number of ways a compiler can end up generating incorrect (or sometimes technically correct but unexpected) results. The programmer should always keep in mind that compiler bugs are possible but extremely rare.

One of the most common bugs attributed to the compiler result from a badly configured optimization option (or an inability to understand them). If you suspect a compiler error turn optimizations off first.

Experimental debugging
One of the most important skills you should acquire from working with this book is debugging. Although it can be frustrating, debugging is one of the most intellectually rich, challenging, and interesting parts of programming.

In some ways debugging is like detective work. You are confronted with clues and you have to infer the processes and events that lead to the results you see.

Debugging is also like an experimental science. Once you have an idea what is going wrong, you modify your program and try again. If your hypothesis was correct, then you can predict the result of the modification, and you take a step closer to a working program. If your hypothesis was wrong, you have to come up with a new one. As Sherlock Holmes pointed out, "When you have eliminated the impossible, whatever remains, however improbable, must be the truth." (from A. Conan Doyle's The Sign of Four).

For some people, programming and debugging are the same thing. That is, programming is the process of gradually debugging a program until it does what you want. The idea is that you should always start with a working program that does something, and make small modifications, debugging them as you go, so that you always have a working program.

For example, Linux is an operating system that contains thousands of lines of code, but it started out as a simple program Linus Torvalds used to explore the Intel 80386 chip. According to Larry Greenfield, "One of Linus's earlier projects was a program that would switch between printing AAAA and BBBB. This later evolved to Linux" (from The Linux Users' Guide Beta Version 1, Page 10).

Endurance/Stress test
This sort of test is done to detect not only bugs but to mark opportunities for optimization. An endurance test is performed by analyzing multiple times the same actions as to gather statistical significant data. Note that this type of test is restricted to the selected set of actions and the projected variations, during the test, in regards to input processing.

Some automation is possible in this type of test, even dealing with simulating interaction with the users interface.

A stress test is a subtle variation of the endurance, the purpose is to determine and even establish the limits of the program as it processes inputs. Again the gathered metrics will only have significance in regards to the actions performed.

This tests and any variations will therefore depend on how they are designed and are extremely goal oriented, in the sense that they will only provide correct answerer to correctly asked questions. Reliance on results will have to be conservative, as the tester must acknowledge that some events may be absent from the scrutiny. This characteristic makes them more useful for optimization, since bottleneck in resource usage will provide a better starting point for analysis than for instance a crash or a deadlock.

Tracing
The technique of tracing evolved directly from the hardware to the software engineering field. In field of hardware it consists on sampling the signals of a given circuit to verify the consistency of the hardware implemented logic/algorithm, as such earlier programmers adopted the term and function to trace the execution of the software with one particularly distinction, tracing should not be performed or enabled in public release versions.

There are several ways to execute the tracing, by simply include into the code report faculties that would produce the output of its state at run time (similarly to the errors and warnings the compiler and linker generates), one can even use the compiler and linker to report special messages. Another way is to interact directly to a debugger in a specified debug mode the debugger to interact with the running code. One can even integrate full-fledged logging systems that can record that same information in volume, and in an organized fashion, it all depends on the levels of complexity and detail required for the pertinent functionality one requires.

Logging can be an objective of a final product, but rarely covering the direct internal functioning of the main program, providing debug information useful for diagnostics and auditing. The debug information is typically only of interest to the programmers for debugging purposes, and additionally, depending on the type and detail of information contained in a trace log, by experienced system administrators or technical support personnel to diagnose common problems with software. Tracing is a cross-cutting concern.
 * Event logging versus tracing

Debugger
Normally, there is no way to see the source code of a program while the program is running. This inability to "see under the covers" while the program is executing is a real handicap when you are debugging a program. The most primitive way of looking under the covers is to insert (depending on your programming language) print or display, or exhibit, or echo statements into your code, to display information about what is happening. But finding the location of a problem this way can be a slow, painful process. This is where a debugger comes in.

If you want to use a debugger and have never used one before, then you have two tasks ahead of you. Your first task is to learn basic debugger concepts and vocabulary. The second is to learn how to use the particular debugger that is available to you. The documentation for your debugger will help you with the second task, but it may not help with the first. In this section we will help you with the first task by providing an introduction to basic debugger concepts and terminology in regard to the language at hand. Once you become familiar with these basics, then your debugger's documentation/use should make more sense to you. Most software debugging is a slow manual process that does not scale well.

A debugger is a piece of software that enables you to run your program in debugging mode rather than in normal mode. Running a program in debugging mode allows you to look under the covers while your program is running. Specifically, a debugger enables you:
 * 1) to see the source code of each statement in your program as that statement executes.
 * 2) to suspend or pause execution of the program at places of your choosing.
 * 3) while the program is paused, to issue various commands in order to examine and change the internal state of the program.
 * 4) to resume (or continue) execution.

It is worth noting that there is a generally accepted set of debugger terms and concepts. Most debuggers are evolutionary descendants of a Unix console debugger for C named dbx, so they share concepts and terminology derived from dbx. Many visual debuggers are simply graphic wrappers around a console debugger, so visual debuggers share the same heritage, and the same set of concepts and terms. Programmers keep running into the same types of bugs that others have encountered (even across different languages by reusing code); one common example is buffer overruns.

Debuggers come in two flavors: console-mode (or simply console) debuggers and visual or graphical debuggers.

Console debuggers are often a part of the language itself, or included in the language's standard libraries. The user interface to a console debugger is the keyboard and a console-mode window (Microsoft Windows users know this as a "DOS console"). When a program is executing under a console debugger, the lines of source code stream past the console window as they are executed. A typical debugger has many ways to specify the exact places in the program where you want execution to pause. When the debugger pauses, it displays a special debugger prompt that indicates that the debugger is waiting for keyboard input. The user types in commands that tell the debugger what to do next. Typical commands would be to display the value of certain program variables, or to continue execution of the program.

Visual debuggers are typically available as one component of a multi-featured IDE (integrated development environment). A powerful and easy-to-use visual debugger is an important selling-point for an IDE. The user interface of a visual debugger typically looks like the interface of a graphical text editor. The source code is displayed on the screen, in much the same way that it is displayed when you are editing it. The debugger has its own toolbar or menu with specialized debugger features. And it may have a special debugger margin an area to the left of the source code, used for displaying symbols for breakpoints, the current-line pointer, and so on. As the debugger runs, some kind of visual pointer (perhaps a yellow arrow) will move down this debugger margin, indicating which statement has just finished executing, or which statement is about to be executed. Features of the debugger can be invoked by mouse-clicks on areas of the source code, the debugger margin, or the debugger menus.

How do you start the debugger?
How you start the debugger (or put your program into debugging mode) depends on your programming language and on the kind of debugger that you are using. If you are using a console debugger, then depending on the facilities offered by your particular debugger you may have a choice of several different ways to start the debugger. One way may be to add an argument (e.g. -d) to the command line that starts the program running. If you do this, then the program will be in debugging mode from the moment it starts running. A second way may be to start the debugger, passing it the name of your program as an argument. For example, if your debugger's name is pdb and your program's name is myProgram, then you might start executing your program by entering pdb myProgram at the command prompt. A third way may be to insert statements into the source code of your program statements that put your program into debugging mode. If you do this, when you start your program running, it will execute normally until it reaches the debugging statements. When those statements execute, they put your program into debugging mode, and from that point on you will be in debugging mode.

If you are working with an IDE that provides a visual debugger, then there is usually a "debug" button or menu item on your toolbar. Clicking it will start your program running in debug mode. As the debugger runs, some kind of visual pointer will move down the debugger margin, indicating what statement is executing.

Tracing your program
To explore the features offered by debuggers, let us begin by imagining that you have a simple debugger to work with. This debugger is very primitive, with an extremely limited feature set. But as a purely hypothetical debugger, it has one major advantage over all real debuggers: simply wishing for a new feature causes that feature magically to be added to the debugger's feature set!

At the outset, your debugger has very few capabilities. Once you start the debugger, it will show you the code for one statement in your program, execute the statement, and then pause. When the debugger is paused, you can tell it to do only two things: If the debugger is a console debugger, you must type these commands at the debugger prompt. If the debugger is a visual debugger, you can just click a Next button, or type a variable name into a special Show Variable window. And that is all the capabilities that the debugger has.
 * 1) the command print  will print the value of a variable, and
 * 2) the command step will execute the next statement and then pause again.

Although such a simple debugger is moderately useful, it is also very clumsy. Using it, you very quickly find yourself wishing for more control over where the debugger pauses, and for a larger set of commands that you can execute when the debugger is paused.

Controlling where the debugger pauses
What you desire most is for the debugger not to pause after every statement. Most programs do a lot of setup work before they get to the area where the real problems lie, and you are tired of having to step through each of those setup statements one statement at a time to get to the real trouble zone. In short, you wish you could set breakpoints. A breakpoint is an object that you can attach to a line of code. The debugger runs without pausing until it encounters a line with a breakpoint attached to it. The breakpoint tells the debugger to pause, so the debugger pauses.

With breakpoint functionality added to the debugger (wishing for it has made it appear!), you can now set a breakpoint at the beginning of the section of the code where the problem lies, then start up the debugger. It will run the program until it reaches the breakpoint. Then it will pause, and you can start examining the situation with your print command.

But when you're finished using the print command, you are back to where you were before single-stepping through the remainder of the program with the step command. You begin to wish for an alternative to the step command for a run to next breakpoint command. With such a command, you can set multiple breakpoints in the program. Then, when you are paused at a breakpoint, you have the option of single-stepping through the code with the step command, or running to the next breakpoint with the run to next breakpoint command.

With our hypothetical debugger, wishing makes it so! Now you have on-the-fly control over where the program will pause next. You're starting to get some real control over the debugging process!

The introduction of the run to next breakpoint command starts you thinking. What other useful alternatives to the step command can you think of?

Often you find yourself paused at a place in the code where you know that the next 15 statements contain no problems. Rather than stepping through them one-by-one, you wish you could to tell the debugger something like step 15 and it would execute the next 15 statements before pausing.

When you are working your way through a program, you often come to a statement that makes a call to a subroutine. In such cases, the step command is in effect a step into command. That is, it drops down into the subroutine, and allows you to trace the execution of the statements inside the subroutine, one by one.

However, in many cases you know that there is no problem in the subroutine. In such cases, you want to tell the debugger to step over the subroutine call that is, to run the subroutine without pausing at any of the statements inside the subroutine. The step over command is a sort of step (but do not show me any of the messy details) command. (In some debuggers, the step over command is called next.)

When you use step or step into to drop down into a subroutine, it sometimes happens that you get to a point where there is nothing more in the subroutine that is of interest. You wish to be able to tell the debugger to step out or run until subroutine end, which would cause it to run without pause until it encountered a return statement (or an implicit return of control to its caller) and then to pause.

And you realize that the step over and step into commands might be useful with loops as well as with subroutines. When you encounter a looping construct ( a statement or a do while statement, for instance) it would be handy to be able to choose to step into or to step over the execution of the loop.

Almost always there comes a time when there is nothing more to be learned by stepping through the code. You wish for a command to tell the debugger to continue or simply run to the end of the program.

Even with all of these commands, if you are using a console debugger you find that you are still using the step command quite a bit, and you are getting tired of typing the word step. You wish that if you wanted to repeat a command, you could just hit the ENTER key at the debugger prompt, and the debugger would repeat the last command that you entered at the debugger prompt. Lo, wishing makes it so!

This is such a productivity feature, that you start thinking about other features that a console debugger might provide to improve its ease-of-use. You notice that you often need to print multiple variables, and you often want to print the same set of variables over and over again. You wish that you had some way to create a macro or alias for a set of commands. You might like, for example, to define a macro with an alias of foo the macro would consist of a set of debugger print statements. Once foo is defined, then entering foo at the debugger prompt runs the statements in the macro, just as if you had entered them at the debugger prompt.

Persistence
Eventually the end of the workday arrives. Your debugging work is not yet finished. You log off of your computer and go home for some well-earned rest. The next morning, you arrive at work bright-eyed and bushy-tailed and ready to continue debugging. You boot your computer, fire up the debugger, and find that all of the aliases, breakpoints, and watchpoints that you defined the previous day are gone! And now you have a really big wish for the debugger. You want it to have some persistence. You want it to be able to remember this stuff, so you do not have to re-create it every time you start a new debugger session.

You can define aliases at the debugger prompt, which is great for aliases that you need to invent for special occasions. But often, there is a set of aliases that you need in every debugging session. That is, you'd like to be able to save alias definitions, and automatically re-create the aliases when you start any debugging session.

Most debuggers allow you to create a file that contains alias definitions. That file is given a special name. When the debugger starts, it looks for the file with that special name, and automatically loads those alias definitions.

Examining the call stack
When you are stepping through a program, one of the questions that you may have is "How did I get to this point in the code?" The answer to this question lies in the call stack (also known as the execution stack) of the current statement. The call stack is a list of the functions that were entered to get you to your current statement. For example, if the main program module is MAIN, and MAIN calls function A, and function A calls function B, and function B calls function C, and function C contains statement S, then the execution stack to statement S is:

MAIN A     B       C        statement S

In many interpreted languages, if your program crashes, the interpreter will print the call stack for you as a stack trace.

Conditional Breakpoints
Some debuggers allow you to attach a set of conditions to breakpoints. You may be able to specify that the debugger should pause at the breakpoint only if a certain condition is met (for example VariableX > 100) or if the value of a certain variable has changed since the last time the breakpoint was encountered. You may be able, for example, to set the breakpoint to break when a certain counter reaches a value of (say) 100. This would allow a loop to run 100 times before breaking.

A breakpoint that has conditions attached to it is called a conditional breakpoint. A breakpoint that has no conditions attached to it is called an unconditional or simple breakpoint. In some debuggers, all breakpoints have conditions attached to them, and "unconditional" breakpoints are simply breakpoints with a condition of true.

Watchpoints
Some debuggers support a kind of breakpoint called a watch or a watchpoint. A watchpoint is a conditional breakpoint that is not associated with any particular line, but with a variable. A watchpoint is useful when you would like to pause whenever a certain variable's value changes. Searching through your code, looking for every line that changes the variable's value, and setting breakpoints on those lines, would be both laborious and error-prone. Watchpoints allow you to avoid all of that by associating a breakpoint with a variable rather than a point in the source code. Once a watchpoint has been defined, then it "watches" its variable. Whenever the value of the variable changes, the code pauses and you will probably get a message telling you why execution has paused. Then you can look at where you are in the code and what the value of the variable is.

Setting Breakpoints in a Visual Debugger
How you create (or "set" or "insert") a breakpoint will depend on your particular debugger, and especially on whether it is a visual debugger or a console-mode debugger. In this section we discuss how you typically set breakpoints in a visual debugger, and in the next section we will discuss how it is done in a console-mode debugger.

Visual debuggers typically let you scroll through the code until you find a point where you want to set a breakpoint. You place the cursor on the line of where you want to insert the breakpoint and then press a special hotkey or click a menu item or icon on the debugger toolbar. If an icon is available, it may be something that suggests the act of watching for instance it may look like a pair of glasses or binoculars. At that point, a special dialog may pop up allowing you to specify whether the breakpoint is conditional or unconditional, and (if it is conditional) allowing you to specify the conditions associated with the breakpoint.

Once the breakpoint has been placed, many visual debuggers place a red dot or a red octagon (similar to an American/European traffic "STOP" sign) in the margin to indicate there is a breakpoint at that point in the code.


text:
Cookbook:Chalupa

| Mexican cuisine | Tex-Mex cuisine

A chalupa is a kind of tostada platter in Mexican cuisine. It is a specialty of South-central regions of Mexico, such as the states of Guerrero and Oaxaca. It is made by pressing a thin layer of masa dough around the outside of a small mold and then deep frying it to produce a crisp shallow corn cup. It is typically filled with shredded pork meat, a slice of onion, and a piece of chipotle pepper. In the Americanized form, described below, the tortilla is typically left flat.

Ingredients

 * Vegetable oil
 * 12 corn tortillas
 * 6 cups refried beans (pinto beans or black beans may be substituted)
 * ½ pound grated queso fresco cheese
 * Chopped onion
 * 1 large tomato, chopped
 * 3 cups shredded lettuce

Procedure

 * 1) In a small skillet, heat about ½ inch of vegetable oil. Test the oil for the correct temperature by putting in a small piece of tortilla. If the oil immediately bubbles frantically and the bread quickly becomes crisp then the oil is at the right temperature. This is important because a low temperature will produce an unpleasantly oily and soggy chalupa shell.
 * 2) Fry the tortilla completely flat in the oil, on both sides, until very crisp. Drain and keep the fried tortilla warm on a newspaper or paper towel-covered cookie sheet in a warm oven. Spread a layer of refried beans on each fried tortilla, about ¼ inch thick. Top with a generous amount of grated cheddar cheese and about 1 tablespoon of chopped onion.
 * 3) Place the assembled chalupas on a cookie sheet and brown under broiler until the cheese melts and begins to bubble. Watch them carefully at this stage, as they can burn quite quickly.
 * 4) Top with shredded lettuce and tomato, and serve immediately.

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

title: Cookbook:Chalupa


text:
Horticulture/Pest Control Methods

This is a template of sorts...

Barriers
Barriers prevent the pest from reaching the plant. It is mostly installed by pest control professionals. Termite treatment barrier is the most common form of pest barrier according to www.suburbanpest.com.au.

Repellents
Repellents are chemicals (or plants containing those chemicals) that make the pest avoid the plant.

Physical removal
Physical removal means removing the pests by hand, crushing them, blasting them with water, vacuuming them up, etc.

Trap crops
Trap crops are plants that the pest prefers over the plants you are trying to protect.

Poisons
Poisons are chemicals that kill the pest. Most poisons are specific.

title: Horticulture/Pest Control Methods


text:
Horticulture/Hand Cultivators

Hammer cultivators (sometimes called weeders) are similar to a small ../Mattock/, which are used for either digging out deep-rooted weeds or for large plantings.

/Tools

title: Horticulture/Hand Cultivators


text:
User talk:Formanda

=WECOME!= 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! Werdan7

title: User talk:Formanda


text:
User talk:Tedclaymore

=WECOME!= 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! Werdan7

title: User talk:Tedclaymore


text:
User talk:Sandymayank

=WECOME!= 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! Werdan7

title: User talk:Sandymayank


text:
User talk:Icyguy19

=WECOME!= 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! Werdan7

title: User talk:Icyguy19


text:
User talk:Humphreycork

=WECOME!= 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! Werdan7

title: User talk:Humphreycork


text:
User talk:Miangpellegri

=WECOME!= 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! Werdan7

title: User talk:Miangpellegri


text:
User talk:Huonggiangjune

=WECOME!= 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! Werdan7

title: User talk:Huonggiangjune


text:
Horticulture/Lamium amplexicaule

Henbit Deadnettle (Lamium amplexicaule) is a species of Lamium native to Europe, western Asia and northern Africa.

Description
It is a low-growing annual plant growing to 10–25 cm tall, with soft, finely hairy stems. The leaves are opposite, round, 2–3 cm diameter, with a lobed margin. The flowers are pink to purple, 1.5–2 cm long.

It flowers very early in the spring even in northern areas, and for most of the winter and the early spring in warmer areas such as the Mediterranean region. It propagates freely by seed and is regarded as a minor weed. Sometimes entire fields will be reddish-purple with its flowers before spring ploughing.

Ecology
It is widely naturalised in eastern North America and elsewhere, where it is considered to be an invasive weed.

Uses
Where common, is an important nectar and pollen plant for bees, especially honeybees, where it helps start the spring buildup.

title: Horticulture/Lamium amplexicaule


text:
Template:Ay prerequisite

Instructions and tips for earning the Adventist Youth Honors Answer Book// honor can be found in the Adventist Youth Honors Answer Book/ chapter. Prerequisite

title: Template:Ay prerequisite


text:
User talk:198.54.202.66

Afrikaans book
Hi~ Thanks for adding information on the Afrikaans Wikibook. I was hoping someone would start adding lessons to the wikibook before long. I was wondering if we can split the work. For example, I'll be in charge of the grammar afdeling while jy sal be in charge of the other sections... but thanks for helping! ;-) 71.163.70.76 17:52, 20 September 2006 (UTC) I hope to hear from you soon. Delano 10:33, 21 September 2006 (UTC)
 * Hi. I'm the one who has been editing the Afrikaans book, although I usually do it anonymously. Sure, a collaberation sounds good. Let us just establish a few rules. Let's also try to keep it simple. For example, the US Afrikaans site, run by Jacques du Plessis, is a good resource but is far too technical for the layman, and the structure leaves quite a lot to be desired. A fun and readable book should be:
 * Visually appealing. Nothing more dull than staring at page after page of bland text on white backgrounds. Try to make it colourful and interesting as I did.
 * Easy to read and follow. Don't assume the reader has several degrees in linguistics and proceed to bog them down with technical terms. Make it easy for everyone to understand.
 * Include examples. Everytime you make a statement, include an example, as I did whenever I compared an English sentence with an Afrikaans one.
 * Include excercises. Get the reader participating right away and get them to think. Once a student can start constructing increasingly complex sentences, their confidence and desire to learn further skyrockets.
 * Most importantly, have fan, and try to make the course fun too.

 * Hi Delano~ I forgot to tell you that I am also working on the Spanish Wikibook on Afrikaans. As you've said before, I have actually adopted some materials from the US Afrikaans site by Jacques du Plessis on the Spanish Wikibook, and I hope to do so for the English Afrikaans Wikibook as well. What sections would you like to be in charge of? Iman0613 16:51, 23 September 2006 (UTC)
 * I think I should be in charge of lesson structure. I disagree with Jacques' structure because, while it is informative, it is far too technical; not everyone visiting will know exactly what is a "third-verb-conjunctive".Delano 17:49, 23 September 2006 (UTC)
 * Okay. That is completely fine with me. So I guess I should start working on the grammar section then. 68.48.32.65 02:27, 24 September 2006 (UTC)
 * Unfortunately the recent storms in the East have completely flooded all my computer systems and I am unable to access the computer as frequently as I can. I'm sorry if this creates any trouble for you - I'm actually typing this messsage from South Africa. 71.163.62.227 15:35, 2 October 2006 (UTC)

MOre writing
Do you think you could write some more for the Afrikaans wikibook. I would, but I don't know the language very well and I wouldn't be able to write with that style of writing. Icelandic Hurricane 22:44, 7 May 2007 (UTC)

title: User talk:198.54.202.66


text:
Horticulture/Glechoma hederacea

Glechoma hederacea (Ground-ivy) is a an aromatic, perennial, evergreen creeper of the mint family, ../Lamiaceae/, native to Europe and southwestern Asia but introduced to North America and now common in most regions other than the Rocky Mountains. Its common names include Alehoof, Creeping Charlie (or Charley), Catsfoot (from the size and shape of the leaf), Field Balm, Run-away-robin, Ground Ivy, Gill-over-the-ground, and Tunhoof. It is also sometimes known as Creeping Jenny, but that more commonly refers to ../Lysimachia nummularia/.

Description
It can be identified by its round to reniform (kidney or fan shaped), crenate (with round toothed edges) opposed leaves 2–3 cm diameter, on 3–6 cm long petioles attached to square stems which root at the nodes. It is a variable species, its size being influenced by environmental conditions, from 5 cm up to 50 cm tall.

Glechoma is sometimes confused with common mallow (Malva neglecta), which also has round, lobed leaves; but mallow leaves are attached to the stem at the back of a rounded leaf, where ground ivy has square stems and leaves which are attached in the center of the leaf, more prominent rounded lobes on their edges, attach to the stems in an opposite arrangement, and have a hairy upper surface. In addition, mallow and other creeping plants sometimes confused with ground ivy do not spread from nodes on stems. In addition, ground ivy emits a distinctive odor when damaged, being a member of the mint family.

The flowers of Glechoma are bilaterally symmetrical, funnel shaped, blue or bluish-violet to lavender, and grow in opposed clusters of 2 or 3 flowers in the leaf axils on the upper part of the stem or near the tip. It usually flowers in the spring.

Ecology
Glechoma thrives in moist shaded areas, but also tolerates sun very well. It is a common plant in grasslands and wooded areas or wasteland. It also thrives in lawns and around buildings, since it survives mowing. It spreads by stolons or by seed. Part of the reason for its wide spread is this stoloniferous method of reproduction. It will form dense mats which can take over areas of lawn, and thus can be considered an invasive or aggressive weed. It can be a problem in heavy, rich soils with good fertility, high moisture, and low boron content. It thrives particularly well in shady areas where grass does not grow well, although it can also be a problem in full sun.

Uses
Glechoma is sometimes grown as a potted plant, and occasionally as a ground cover. A variegated variety is sometimes commercially available.

While often thought of as a weed because of its propensity for spreading, Glechoma has culinary and medicinal uses which were the cause of its being imported to America by early European settlers. The fresh herb can be rinsed and steeped in hot water to create an herbal tea which is rich in vitamin C. The essential oil of the plant has many potent medicinal properties; the plant has been used for centuries as a general tonic for colds and coughs and to relieve congestion of the mucous membranes. The plant has been demonstrated to have anti-inflammatory properties. It has also been claimed to increase excretion of lead in the urine.

Its medicinal properties have been described for millennia, Galen recommending the plant to treat inflammation of the eyes, for instance. John Gerard, an English herbalist, recommended the plant to treat tinnitus, as well as a "diuretic, astringent, tonic and gently stimulant. Useful in kidney diseases and for indigestion."

Glechoma was also widely used by the Saxons in brewing beer as flavoring, clarification, and preservative, before the introduction of hops for these purposes; thus the brewing-related names, Alehoof, Tunhoof, and Gill-over-the-ground.

title: Horticulture/Glechoma hederacea


text:
Talk:Horticulture/Glechoma hederacea

Transwiki notes
Copied from Glechoma hederacea 18:10, 20 September 2006 (UTC) using this version.

From WP
has also been described as effective, and Clopyralid, MCPP, and quinclorac as ineffective. have also been described as effective, but sales of both are restricted to professionals. Two applications ten to fourteen days apart are necessary; also, the ability of the surviving plants to regenerate after 24 days can require a second treatment four or five weeks later, and even more followups.

In addition, the timing of application may play a role in the effectiveness of the herbicide, as well as the perception of effectiveness. For instance, fall is usually the best time for use of broadleaf herbicides; however a slow acting herbicide like triclopyr applied in the fall may not appear to have been effective until the next growing season.

Other techniques reported effective are to fertilize with greater than two pounds of nitrogen per thousand square feet annually, and use of the preemergence herbicide, isoxaben. In extremely difficult cases, a short-lived full-spectrum herbicide such as glyphosate is used to kill the entire lawn, and it is reseeded from start.

title: Talk:Horticulture/Glechoma hederacea


text:
User talk:Erobi015evelynrobinson

--Derbeth talk 18:26, 20 September 2006 (UTC)

title: User talk:Erobi015evelynrobinson


text:
Talk:Social and Cultural Foundations of American Education

Featured book status
If anyone reads this book and thinks it should be one of the featured books then go to Featured books/Nominations and vote for it. RobinH 14:13, 8 August 2007 (UTC)


text:
XForms/Insert

This lab allows you to insert a new row into a tabular structure. We don't use a HTML table here, just a form that updates two items in the model.

Here is the input before you add any new data:

Discussion
This program has a model of the existing phone list and one additional NewPerson data element at the end of the list. The new person data is linked to the two field form at the end of the table. When you hit the insert button (the trigger) it will copy the data elements from the mini-form and copy them into a new location inside the existing model. The entire list will then be updated. The exact location of where the insert occurs is determined by the index function. The index is the number of the row you last selected.

There are two items to note. First of all, you can select any row just before you do an insert. The new item will be inserted just after this row.

The second thing to note is that you will still need to be able to delete a record. That is the next lab.

title: XForms/Insert


text:
Talk:Ukrainian Dancing/Bukovyna

Nobody refers to this place as Bukovynia. Ukrainians refer to it as Bukovyna and Romanians refer to it as Bucovina.--Tufkaa 19:49, 20 September 2006 (UTC)

title: Talk:Ukrainian Dancing/Bukovyna


text:
User:Tufkaa

See my Wikipedia page.

title: User:Tufkaa


text:
Video Production/Rss editor for win

Create an RSS feed with RSS editor [windows only]
For this we will be using “RSSeditor”. Start by filling in the information required in the “Settings” tab.

Title : Enter the name of your feed here. If you have a website that contains information which is summarized in the RSS feed, the title of the feed should be similar to the title of your website.
 * Basic Information

Link: The URL which leads to the website corresponding with this feed

Description: A short phrase or sentence describing the content of your feed

URL:  Enter the complete URL of a GIF, JPEG or PNG image that represents the channel. This image will be displayed by most RSS readers. Link:  If used, this should be the same as your feed link
 * Feed Image (optional)

Title: If used this should be the same as your feed title

The language of your channel. RSS readers and aggregators use this information to group feeds by language. Allowed values are e.g. en, fr, es, de... English is en
 * Additional feed information

Category: Here you can specify one or more categories that the channel belongs to.

TTL: Time To Live  -  Here you can enter the number of minutes this feed should live. This is the amount of time that RSS readers and aggregators will cache (store) your feed before they come back and refresh from your XML source file.

Number of entries: How many entries should be exported into the XML file? Always the youngest entries are used.

The Content tab is for details of which MP3s will be included in the feed. Use “New Entry” to add another MP3. Title: The name of  the MP3 Link: The URL address of where the MP3 is saved.

Ensure that there are no spaces or punctuation in the filenames of your MP3s before they are uploaded as this can cause problems.

Once an MP3 is added click Edit Enclosure. This will allow RSSeditor to generate the filesize and length required to be inserted into the RSS feed. Click Check URL, once it has detected the details of the file click OK.

FTP settings tab

Complete the FTP settings from the information that was emailed to you.
 * Local RSS File: This is the local file that will be transferred to your server. This field is filled automatically as soon as you load a feed and choose “Generate RSS File”.
 * FTP Server: This is the address of our icecast server and is included in the FTP information emailed to you after sign-up.
 * Remote Directory: If you haven’t created any sub-folders in your account on the icecast server then “Remote Directory” will be blank, if not it will be where you have placed the MP3s.
 * FTP Username and Password: These details were emailed to you on sign-up.
 * Ensure the “Passive FTP” box is ticked and click “Upload File”.

You should now get a “Successful upload” message. Save your RSS feed configuration for later editing. If you would like to, you can now open up SmartFTP and check that in addition to your uploaded MP3s there is also the RSS feed file.

title: Video Production/Rss editor for win


text:
Psychiatric Disorders/Mood Disorders/Manic episode

Mania, defined as “a state of heightened overall activation with enhanced affective expression together with lability of affect,” is fundamentally characterized by a pathological elevation of mood. Patients often report a sense of elation, and a euphoric mood has been traditionally associated with mania. However, the heightened mood can also be irritable; indeed, as the mania progresses, not only does irritability – which can eventuate in full-blown rage and dangerous hostility – become more prominent, but the mood is often labile, and patients may switch erratically between euphoria and irritability. Fleeting depressive symptoms may also be observed. The other cardinal features include flight of ideas and pressure of speech; and increased energy, decreased need for sleep, and hyperactivity. In addition, inflated self-esteem or grandiosity is almost always seen, as are distractibility, poor judgement and lack of insight, dishinibition, and “excessive involvement in pleasurable activities that have a high potential for painful consequences,” which can prove disastrous. Their thoughts are, at the least, rapid, and patients may complain of having thoughts that race in a disorganized progression, on pell-mell. When more severe, flight of ideas can degenerate into loosening of associations, wherein the connections between the patient’s successive ideas have no conceivable connection. Patients may also become psychotic.

A manic patient may appear well-groomed but display a dramatic change in appearance (e.g., a drastic change in wardrobe, make-up, or hairstyle; they may be festooned with ribbons and excessive jewelry). The manic will probably be extremely talkative and initially might seem more clever or entertaining; however, conversation eventually becomes tangential with puzzling leaps from one subject to another, and the patient’s speech may become incredibly rapid and almost unstoppable. Often, a manic patient has an inflated sense of self-confidence, to the point of feeling invincible. The patient may take on too many projects without actually bringing any of them close to completion, engage in risky sexual activities, spend too much money, and land into conflict with the law. Upon recovery, patients often feel remorse and shame over what they have done.

--Diagnostic Criteria—

For the mood disorders, DSM-IV describes several types of episodes. These episodes are not disorders in themselves, but descriptions of discrete syndromes, which can form the building blocks of actual disorders.

For a Manic Episode, DSM-IV lists the following criteria:

 * The symptoms must last for at least one week (or any duration if hospitalization is necessary)
 * Three or more of the following symptoms (at least 4 if the mood is only irritable):
 * grandiosity
 * decreased need for sleep
 * pressured speech
 * racing thoughts or flight of ideas
 * distractibility
 * increased activity or agitation
 * increased engagement in pleasurable but risky activities
 * The symptoms cause impairment in social or occupational functioning.
 * The symptoms are not secondary (the direct result of a substance or general medical condition)

Mania may occur secondary to a host of general medical or neurological conditions, or as a result of substance abuse or as a side-effect of certain medications. However, it is most commonly associated with bipolar I disorder, a severe mental illness characterized by the occurrence of at least one full manic or mixed-manic episode during the patient's lifetime.

In current DSM-5 nomenclature, although the same diagnostic criteria is used for both hypomanic and full manic episodes, hypomanic episodes are separated from manic ones, which, in turn, are characterized as either mild, moderate, or severe (with or without psychotic features). However, manic episodes may be "staged" as follows: hypomania, or stage I; acute mania, or stage II; and delirious mania, or stage III. This "staging" of a manic episode is very useful from a descriptive and differential diagnostic point of view, in particular allowing for a more thorough consideration of the more extreme manifestations, which in current nomenclature would simply be classed as "severe with psychotic features."

Allied to the "staging" of a manic episode are the cardinal symptoms: heightened mood (either euphoric or irritable); flight of ideas and pressured speech; and increased energy, decreased need for sleep, and hyperactivity. These cardinal symptoms are most plainly evident in hypomania; in stages II and III, however, these symptoms undergo a progressively severe exacerbation and become increasingly obscured by psychotic symptoms and disorganized or fragmented behaviour. However, once the peak of the severity of the individual patient's episode has been reached, patients retrace the symptoms seen in the earlier escalation: thus, a patient whose episode peaked in acute, or stage II, mania would gradually settle back into stage I, or hypomania, before more or less returning to euthymia.


text:
Psychiatric Disorders/Mood Disorders/Hypomanic episode

Hypomania is similar to mania, but with less severe symptoms, shorter duration, and less functional impairment.

The actual list of symptoms is identical to mania, except they are less severe in number and intensity. In addition, there is little or no functional impairment. Hypomanic episodes may actually result in increased productivity due to the person’s increased energy level. This contrasts with mania where the individual is too disorganized to accomplish much, despite a greatly augmented energy level. Psychiatric hospitalization (involuntary or voluntary) is not required and psychotic features, not uncommon in full-blown mania, are absent.

--Diagnostic Criteria—

For the mood disorders, DSM-IV describes several types of episodes. These episodes are not disorders in themselves, but descriptions of discrete syndromes, which can form the building blocks of actual disorders.

For a Hypomanic Episode, DSM-IV lists the following criteria:

 * The symptoms must last for at least 4 days
 * Three or more of the following symptoms (at least 4 if the mood is only irritable):
 * grandiosity
 * decreased need for sleep
 * pressured speech
 * racing thoughts or flight of ideas
 * distractibility
 * increased activity or agitation
 * increased engagement in pleasurable butt risky activities
 * The episode represents a clear change in the person’s normal behavior
 * The episode is observable by others
 * The episode is not severe enough to cause marked social or occupational dysfunction
 * The symptoms are not secondary (the direct result of a substance or general medical condition)

It is a key feature of Bipolar II disorder, wherein the patient has hypomanic episodes interspersed with major depressive episodes. Additionally, all patients with Bipolar I disorder experience hypomania before progressing to full-blown mania.


text:
Psychiatric Disorders/Mood Disorders/Mixed episode

Some bipolar patients experience an episode that consists of symptoms of both mania and depression. This complicates a simplistic view mood as “bipolar:” having a depressed and manic pole, as if the two moods were mutually exclusive.

The existence of such Mixed Episodes is important in that it can have ramifications for the course of the illness and for treatment. Patients with “mixed mania” seem to recover less quickly and less completely than patients with “classic” mania.

Diagnostic Criteria
For the mood disorders, DSM-IV describes several types of episodes. These episodes are not disorders in themselves, but descriptions of discrete syndromes, which can form the building blocks of actual disorders.

For a Mixed Episode, the Diagnostic and Statistical Manual, Fourth Edition (DSM-IV) requires that patients meet the full criteria both a Major Depressive Episode and Manic Episode.


text:
Psychiatric Disorders/Mood Disorders/Bipolar Disorder

Bipolar Disorder (Manic Depressive Disorder)

Phenomenology
There are two types of bipolar disorders recognized by DSM-IV: Bipolar I disorder and Bipolar II disorder.

The diagnosis of Bipolar I disorder is defined by a single manic episode lasting for at least a week (or less if hospitalization is required), but generally the course of the disorder involves a cycling between mania and depression. In between such episodes, the patient is generally without any psychiatric symptoms, and it is this episodic nature of the disorder, with interepisode normalcy, that Kraepelin and others thought distinguished this from other chronic psychiatric disorders.

In Bipolar disorder type II, the patient has experienced at least one major depressive episode and at least one hypomanic episode.

Epidemiology
According to the Epidemiological Catchment Area (ECA) Study, the lifetime prevalence of Bipolar I disorder is approximately 1%, with an equal ratio of men and women. The lifetime prevalence of Bipolar II disorder is approximately 0.5%, and is more common in women.

Etiology
Adoption, twin studies and family studies all suggest that Bipolar disorder has a strong genetic component. Various loci have been proposed, and some have been demonstrated in limited populations or families, however there is no consensus on these studies, and Bipolar disorder appears to be multiply determined.

Disturbances in biogenic amines have been implicated. While norepinephrine metabolite levels are normal during mania, other neurotransmitters such as dopamine, acetylcholine and serotonin have all been implicated in manic and hypomanic episodes, as well as in the depressive symptoms that follow. The administration of alpha-methyltyrosine, which blocks dopamine synthesis, and/or antipsychotics, which block dopamine receptors can shorten the duration of a manic episode. L-DOPA administration can induce hypomania in patients. Physostigmine, which increases cholinergic activity in the brain, decreases mania. From data regarding dopamine and acetylcholine during manic episodes, it has been suggested that mania can result from DA overactivity relative to acetylcholine. Some studies have associated serotonin receptor polymorphisms with bipolar disorder and it is known that serotonin agonists used as antidepressants can induce a switch to mania in bipolar patients.

Studies suggest that alterations in GABA receptor subunits and decreased GABA neuron density are involved in bipolar disorder. Increased glutamate activity may be associated with bipolar disorder, and antidepressants that increase glutamate receptor density can trigger a manic episode. Many of the anticonvulsants used to treat mania act to increase GABA and decrease glutamate functions.

Mania can be induced in predisposed patients in a variety of ways. As noted above, some drugs can trigger a manic episode, particularly antidepressants. Sleep deprivation has been known to cause mania. Light exposure, as with light therapy (for seasonal depression) has also been reported to trigger manic episodes. Several neurological injuries can also cause bipolar type symptoms.

The mechanism of depression in bipolar patients is presumably similar to the mechanism in major depressive disorder; however, this presumption has not been intensively studied. Some indirect data, particularly treatment studies, makes one wonder whether the depression in bipolar disorders is a different entity altogether.

Pathology
Some laboratory findings are abnormal in individuals with manic episodes versus normal individuals (although these are not diagnostic) including
 * Increased cortisol secretion
 * Polysomnographic abnormalities
 * Abnormalities in monoamine neurotransmitter systems

Diagnoses and Criteria (DSM-IV)
DSM Lists the following criteria for the different types of Bipolar Disorder

Bipolar I Disorder

 * At least one manic or mixed episode.
 * the mood episodes are not better accounted for by another disorder (such as Schizoaffective disorder) and the symptoms are not secondary to a Psychotic disorder. e

Bipolar II Disorder

 * At least one Major Depressive Episodes, and
 * At least one Hypomanic Episode
 * But never have had a Manic Episode

Cyclothymic Disorder

 * Essentially a minor version of bipolar disorder, with milder mood fluctuations and episodes of hypomania
 * No Manic, Major Depressive or Mixed Episodes.

Mood disorder due to a General Medical Condition
Mania can be, at times, directly traceable to a medical condition. For example, mania has been associated with injury to limbic areas on the right side of the brain, stroke, tumors and multiple sclerosis.

Substance Induced Mood Disorder
A number of drugs can cause a syndrome that resembles mania. Stimulant drugs, such as the amphetamines or cocaine, can cause euphoria, increased activity and pressured speech. In large doses or this chronic use, they can also cause irritability, agitation and delusions.

Antidepressant therapy can induce mania directly in a patient with a history of only unipolar depression, and corticosteroids can induce secondary mania.

Psychotic Disorders
Many psychotic disorders also share delusions, irritability and agitation. However, psychotic patients have psychotic symptoms independent of mood symptoms, whereas bipolar patients do not.

Personality disorders
While many bipolar patients have personality disorders, the diagnosis of personality disorder in the bipolar patient can be influenced by the patient's mood at the time and by other comorbid conditions. In addition, many of the symptoms of personality disorders, such as narcissism, anxiety and paranoia overlap with the symptoms of mania.

Anxiety disorders
Studies have shown a high comorbidity between bipolar disorder and anxiety disorders such as panic disorder, OCD, social phobia, and post-traumatic stress disorder.

Substance Abuse
It is estimated that 60% of people with bipolar disorder also have a substance abuse problem.

Course of Bipolar Disorder
Onset of bipolar disorder usually occurs in the late teens or early 20s. In a little greater than half of bipolar patients, the first episode is a depressive episode. At least 10% of those who experience a first lifetime event of major depression will eventually become bipolar, so it is important to monitor any patient with major depressive disorder for later onset of mania. Manic episodes begin with a rapid onset and can last weeks to months. Manic episodes are sometimes staged by the level of severity:

 * Stage I (hypomania). Stage I is defined by heightened mood, grandiosity, pressured speech, a rapid flow of ideas, decreased concentration, increased distractibility, hyperactivity, more energy and less need for sleep.

 * Stage II (acute mania). In Stage II all of the symptoms of Stage I are present and intensified, in addition, the patient experiences either delusions of grandeur or paranoia.

 * Stage III (delirious mania). In Stage III, all of the symptoms of Stage II are exacerbated, and the patient presents with hallucinations, incoherence and bizarre behavior.

While all manic episodes display Stage I and a majority progress to Stage II, only some reach Stage III. Recovery from an episode of mania is usually thought to be around 4 months, with great variance.

Predictors of recovery include:
 * Symptoms: Patients with "pure" mania seem to recover faster and more completely than patients with mixed or cycling symptoms.
 * A history of previous mood episodes (both depressive and manic episodes): In one long-term study (20 years), 85% of bipolar patients relapsed. The number of symptom free intervals tends to decrease over time (see below).

The predictors of relapse are not clear, however, some proposed predictors include
 * low vocational advancement at illness onset
 * depression
 * a larger number of previous episodes
 * mixed symptoms
 * comorbidity (especially with alcoholism)
 * psychotic features when manic
 * interepisode features

Bipolar disorder cannot only be debilitating, but it can be deadly. Approximately 10 to 15 percent of Bipolar I patients complete suicide.

There is some evidence that episode severity increases as a function of the number of episodes a person has had, in that for each recurrent episode to be more severe and to occur in closer succession than the previous one. This may represent a “kindling” phenomenon as has been seen in some models of epilepsy. This putative tendency for each affective episode to exacerbate the course of the disease is another reason for the emphasis that is placed on prophylactic treatment.


text:
User:Simonrdixon

yah

title: User:Simonrdixon


text:
User talk:Simonrdixon

yah yah

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 (Or here, if you like:-P )
 * 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! Werdan7

title: User talk:Simonrdixon


text:
Ada Programming/Libraries/GNAT.Bubble Sort

-- --                                                                         -- --                         GNAT RUN-TIME COMPONENTS                         -- --                                                                         -- --                     G N A T. B U B B L E _ S O R T                     -- --                                                                         -- --                                 S p e c                                  -- --                                                                         -- --                     Copyright (C) 1995-2005, AdaCore                     -- --                                                                         -- -- GNAT is free software;  you can  redistribute it  and/or modify it under -- -- terms of the GNU General Public License as published  by the Free Soft- -- -- ware Foundation;  either version 2,  or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the  implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received  a copy of the GNU General -- -- Public License distributed with GNAT;  see file COPYING. If not, write -- -- to the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, -- -- Boston, MA 02110-1301, USA. -- --                                                                         -- -- -- -- -- -- -- -- -- GNAT was originally developed  by the GNAT team at  New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc.     -- --                                                                         -- --

-- Sort Utility (Using Bubblesort Algorithm)

-- This package provides a bubblesort routine that works with access to --  subprogram parameters, so that it can be used with different types with -- shared sorting code.

-- See also GNAT.Bubble_Sort_G and GNAT.Bubble_Sort_A. These are older -- versions of this routine. In some cases GNAT.Bubble_Sort_G may be a -- little faster than GNAT.Bubble_Sort, at the expense of generic code -- duplication and a less convenient interface. The generic version also -- has the advantage of being Pure, while this unit can only be Preelaborate.

package GNAT.Bubble_Sort is  pragma Preelaborate;

-- The data to be sorted is assumed to be indexed by integer values from -- 1 to N, where N is the number of items to be sorted.

type Xchg_Procedure is access procedure (Op1, Op2 : Natural); -- A pointer to a procedure that exchanges the two data items whose -- index values are Op1 and Op2.

type Lt_Function is access function (Op1, Op2 : Natural) return Boolean; -- A pointer to a function that compares two items and returns True if   --  the item with index value Op1 is less than the item with Index value -- Op2, and False if the Op1 item is greater than or equal to the Op2 -- item.

procedure Sort (N : Natural; Xchg : Xchg_Procedure; Lt : Lt_Function); -- This procedures sorts items in the range from 1 to N into ascending -- order making calls to Lt to do required comparisons, and calls to   --  Xchg to exchange items. The sort is stable, that is the order of  --  equal items in the input is preserved.

end GNAT.Bubble_Sort;

|GNAT.Bubble Sort


text:
Ada Programming/Libraries/GNAT.Bubble Sort A

-- --                                                                         -- --                         GNAT RUN-TIME COMPONENTS                         -- --                                                                         -- --                   G N A T. B U B B L E _ S O R T _ A                   -- --                                                                         -- --                                 S p e c                                  -- --                                                                         -- --                     Copyright (C) 1995-2005, AdaCore                     -- --                                                                         -- -- GNAT is free software;  you can  redistribute it  and/or modify it under -- -- terms of the GNU General Public License as published  by the Free Soft- -- -- ware Foundation;  either version 2,  or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the  implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received  a copy of the GNU General -- -- Public License distributed with GNAT;  see file COPYING. If not, write -- -- to the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, -- -- Boston, MA 02110-1301, USA. -- --                                                                         -- -- -- -- -- -- -- -- -- GNAT was originally developed  by the GNAT team at  New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc.     -- --                                                                         -- --

-- Bubblesort using access to procedure parameters

-- This package provides a bubble sort routine that works with access to --  subprogram parameters, so that it can be used with different types with -- shared sorting code. It is considered obsoleted by GNAT.Bubble_Sort which -- offers a similar routine with a more convenient interface.

package GNAT.Bubble_Sort_A is  pragma Preelaborate;

-- The data to be sorted is assumed to be indexed by integer values from -- 1 to N, where N is the number of items to be sorted. In addition, the -- index value zero is used for a temporary location used during the sort.

type Move_Procedure is access procedure (From : Natural; To : Natural); -- A pointer to a procedure that moves the data item with index From to   --  the data item with index To. An index value of zero is used for moves -- from and to the single temporary location used by the sort.

type Lt_Function is access function (Op1, Op2 : Natural) return Boolean; -- A pointer to a function that compares two items and returns True if   --  the item with index Op1 is less than the item with index Op2, and False -- if the Op2 item is greater than or equal to the Op1 item.

procedure Sort (N : Natural; Move : Move_Procedure; Lt : Lt_Function); -- This procedures sorts items in the range from 1 to N into ascending -- order making calls to Lt to do required comparisons, and Move to move -- items around. Note that, as described above, both Move and Lt use a  --  single temporary location with index value zero. This sort is not -- stable, i.e. the order of equal elements in the input is not preserved.

end GNAT.Bubble_Sort_A;

|GNAT.Bubble Sort A


text:
Ada Programming/Libraries/GNAT.Bubble Sort G

-- --                                                                         -- --                         GNAT RUN-TIME COMPONENTS                         -- --                                                                         -- --                   G N A T. B U B B L E _ S O R T _ G                   -- --                                                                         -- --                                 S p e c                                  -- --                                                                         -- --                     Copyright (C) 1995-2005, AdaCore                     -- --                                                                         -- -- GNAT is free software;  you can  redistribute it  and/or modify it under -- -- terms of the GNU General Public License as published  by the Free Soft- -- -- ware Foundation;  either version 2,  or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the  implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received  a copy of the GNU General -- -- Public License distributed with GNAT;  see file COPYING. If not, write -- -- to the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, -- -- Boston, MA 02110-1301, USA. -- --                                                                         -- -- -- -- -- -- -- -- -- GNAT was originally developed  by the GNAT team at  New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc.     -- --                                                                         -- --

-- Bubblesort generic package using formal procedures

-- This package provides a generic bubble sort routine that can be used with -- different types of data.

-- See also GNAT.Bubble_Sort, a version that works with subprogram access -- parameters, allowing code sharing. The generic version is slightly more -- efficient but does not allow code sharing and has an interface that is --  more awkward to use. The generic version is also Pure, while the access -- subprograqm version can only be Preelaborate.

-- There is also GNAT.Bubble_Sort_A, which is now considered obsolete, but -- was an older version working with subprogram parameters. This version -- is retained for backwards compatibility with old versions of GNAT.

generic -- The data to be sorted is assumed to be indexed by integer values from -- 1 to N, where N is the number of items to be sorted. In addition, the -- index value zero is used for a temporary location used during the sort.

with procedure Move (From : Natural; To : Natural); -- A procedure that moves the data item with index value From to the data -- item with index value To (the old value in To being lost). An index -- value of zero is used for moves from and to a single temporary location -- used by the sort.

with function Lt (Op1, Op2 : Natural) return Boolean; -- A function that compares two items and returns True if the item with -- index Op1 is less than the item with Index Op2, and False if the Op2 -- item is greater than or equal to the Op1 item.

package GNAT.Bubble_Sort_G is  pragma Pure;

procedure Sort (N : Natural); -- This procedures sorts items in the range from 1 to N into ascending -- order making calls to Lt to do required comparisons, and Move to move -- items around. Note that, as described above, both Move and Lt use a  --  single temporary location with index value zero. This sort is stable, -- that is the order of equal elements in the input is preserved.

end GNAT.Bubble_Sort_G; |GNAT.Bubble Sort G