text:
Artificial Intelligence/Definition

Over the past few years, you might have come across the term artificial intelligence and have imagined it to be a vivid personification of extraterrestrial beings or robots. But, what is artificial intelligence in fact? In this section, we will explore the meaning and semantics of the term artificial intelligence.

Overview
Artificial intelligence is the search for a way to map intelligence into mechanical hardware and enable a structure into that system to formalize thought. No formal definition, as yet, is available for as to what artificial intelligence actually is. Over the course of this section, we will try to formulate a working definition, reasoning and articulating facts and preferences of various other authors and practitioners of the field. To start with, we would think of the word artificial and intelligence as main sources of inspiration and come up with a brief description of the same as follows:

Artificial Intelligence is the study of human intelligence such that it can be replicated artificially.

With our first set of formal declaration of the concept, we tread gradually through different semantics of it and try to explore a much broader definition for AI. In their book Artificial Intelligence: A Modern Approach, authors Russell and Norvig tried to establish a clear classification of the definition of the field into distinct categories based on working definitions from other authors commenting on AI. The demarcation of concepts holds true to these clauses for systems that:

 * Think and act like humans
 * Think and act rationally
 * Learn new concepts and tasks

So, one would be tempted to improve upon the definition given above to include these facts into perspective such that the definition that we end up with says that:

Artificial Intelligence is the study of human intelligence and actions replicated artificially, such that the resultant bears to its design a reasonable level of rationality.

What is A.I.?
There are numerous definitions of what artificial intelligence is.

We end up with four possible goals:
 * 1) Systems that think like humans (focus on reasoning and human framework)
 * 2) Systems that think rationally (focus on reasoning and a general concept of intelligence)
 * 3) Systems that act like humans (focus on behavior and human framework)
 * 4) Systems that act rationally (focus on behavior and a general concept of intelligence)

What is rationality?  -> "doing the right thing" - simply speaking.

Definitions:

For (1.): "The art of creating machines that perform functions that require intelligence when performed by humans" (Kurzweil). Involves cognitive modeling - we have to determine how humans think in a literal sense (explain the inner workings of the human mind, which requires experimental inspection or psychological testing)

For (2.): "GPS - General Problem Solver" (Newell and Simon). Deals with "right thinking" and dives into the field of logic. Uses logic to represent the world and relationships between objects in it and come to conclusions about it. Problems: hard to encode informal knowledge into a formal logic system and theorem provers have limitations (if there's no solution to a given logical notation).

For (3.): Turing defined intelligent behavior as the ability to achieve human-level performance in all cognitive tasks, sufficient to fool a human person (Turing Test). Physical contact to the machine has to be avoided, because physical appearance is not relevant to exhibit intelligence. However, the "Total Turing Test" includes appearance by encompassing visual input and robotics as well.

For (4.): The rational agent - achieving one's goals given one's beliefs. Instead of focusing on humans, this approach is more general, focusing on agents (which perceive and act). More general than strict logical approach (i.e. thinking rationally).

Strong AI vs. Weak AI

 * Strong AI = machine-based artificial intelligence that can truly reason and becomes self-aware (sentient), either human-like (thinks and reasons like a human mind) or non-human-like (different form of sentience and reasoning) - coined by John Searle: "an appropriately programmed computer IS a mind" (see Chinese Room Experiment).

 * Weak AI = machine-based artificial intelligence that can reason and solve problems in a limited domain. Hence it acts as if it were intelligent in that domain, but would not be truly intelligent or sentient.

Turing Test
A human judge engages in a natural language conversation with two other parties, one a human and the other a machine; if the judge cannot reliably tell which is which, then the machine is said to pass the test. It is assumed that both the human and the machine try to appear human.

Objections

 * 1) A machine passing the test could simulate human behavior, but this might be considered much weaker than intelligence - the machine might just follow a set of cleverly designed rules. Turing rebutted this by saying that maybe the human mind is just following a set of cleverly designed rules as well.
 * 2) A machine could be intelligent without being capable of conducting conversations with humans
 * 3) Many humans might fail this test, if they're illiterate or inexperienced (e.g. children)

Chinese Room Experiment
Tried to debunk the claims of "Strong AI". Searle opposed the view that the human mind IS a computer and that consequently, any appropriately construed computer program could also be a mind.

Outline
A man who doesn't speak Chinese sits in a room and is handed sheets of paper with Chinese symbols through a slit. He has access to a manual with a comprehensive set of rules on how to respond to this input. Searle argues, that even though he can answer correctly, he doesn't understand Chinese; he's just following syntactical rules and doesn't have access to the meaning of them. Searle believes that "mind" emerges from brain functions, but is more than a "computer program" - it requires intentionality, consciousness, subjectivity and mental causation.

Mind-Body Problem
The problem deals with the relationship between mental and physical events. Suppose I decide to stand up. My decision could be seen as a mental event. Now something happens in my brain (neurons firing, chemicals flowing, you name it) which could be seen as a physical, measurable event. How can it be, that something "mental" causes something "physical". Hence it's hard to claim that both are completely different things. One could go on and claim that these mental events are, in fact, physical events: My decision is neurons firing, but I'm not aware of this - I feel like I made a decision independently from the physical. Of course this works the other way round too: everything physical could, in fact, be mental events. When I stand up after having made the decision (mental event), I'm not physically standing up, but my actions cause mental events in my and the bystanders minds - physical reality is an illusion.

Frame Problem
It is the question of how to determine which things remain the same in a changing environment.

Problem-Solving
Occurs whenever an organism or artificial intelligence is at some current state and does not know how to proceed in order to reach a desired goal state. This is considered to be a problem that can be solved by coming up with a series of actions that lead to the goal state (the "solving").

Overview
In general, search is an algorithm that takes a problem as input and returns with a solution from the searchspace. The search space is the set of all possible solutions. We dealt a lot with so called "state space search" where the problem is to find a goal state or a path from some initial state to a goal state in the state space. A state space is a collection of states, arcs between them and a non-empty set of start states and goal states. It is helpful to think of the search as building up a search tree - from any given node (state): what are my options to go next (towards the goal), eventually reaching the goal.

Uninformed Search
Uninformed search (blind search) has no information about the number of steps or the path costs from the current state to the goal. They can only distinguish a goal state from a non-goal state. There is no bias to go towards the desired goal.

For search algorithms, open list usually means the set of nodes yet to be explored and closed list the set of nodes that have already been explored.

 * 1) Breadth-First-Search
 * 2) * Starts with the root node and explores all neighboring nodes and repeats this for every one of those (expanding the "depth" of the search tree by one in each iteration). This is realized in a FIFO queue. Thus, it does an exhaustive search until it finds a goal.
 * 3) * BFS is complete (i.e. it finds the goal if one exists and the branching factor is finite).
 * 4) * It is optimal (i.e. if it finds the node, it will be the shallowest in the search tree).
 * 5) * Space: $$O(b^d)$$
 * 6) * Time: $$O(b^d)$$
 * 7) Depth-First-Search
 * 8) * Explores one path to the deepest level and then backtracks until it finds a goal state. This is realized in a LIFO queue (i.e. stack).
 * 9) * DFS is complete (if the search tree is finite) and incomplete (if the search tree is infinite)
 * 10) * It is not optimal (it stops at the first goal state it finds, no matter if there is another goal state that is shallower than that).
 * 11) * Space: $$O(bm)$$ (much lower than BFS).
 * 12) * Time: $$O(b^m)$$ (Higher than BFS if there is a solution on a level smaller than the maximum depth of the tree).
 * 13) * Danger of running out of memory or running indefinitely for infinite trees.
 * 14) Depth-Limited-Search / Iterative Deepening
 * 15) * To avoid that, the search depth for DFS can be either limited to a constant value, or increased iteratively over time, gradually increasing the maximum depth to which it is applied. This is repeated until finding a goal. Combines advantages of DFS and BFS.
 * 16) * ID is complete.
 * 17) * It is optimal (the shallowest goal state will be found first, since the level is increased by one every iteration).
 * 18) * Space: $$O(bd)$$ (better than DFS, d is depth of shallowest goal state, instead of m, maximum depth of the whole tree).
 * 19) * Time: $$O(b^d)$$.
 * 20) Bi-Directional Search
 * 21) * Searches the tree both forward from the initial state and backward from the goal and stops when they meet somewhere in the middle.
 * 22) * It is complete and optimal.
 * 23) * Space: $$O(b^{d/2})$$.
 * 24) * Time: $$O(b^{d/2})$$.

Informed Search
In informed search, a heuristic is used as a guide that leads to better overall performance in getting to the goal state. Instead of exploring the search tree blindly, one node at a time, the nodes that we could go to are ordered according to some evaluation function $$h(n)$$ that determines which node is probably the "best" to go to next. This node is then expanded and the process is repeated (i.e. Best First Search). A* Search is a form of BestFS. In order to direct the search towards the goal, the evaluation function must include some estimate of the cost to reach the closest goal state from a given state. This can be based on knowledge about the problem domain, the description of the current node, the search cost up to the current node BestFS optimizes DFS by expanding the most promising node first. Efficient selection of the current best candidate is realized by a priority queue.

 * 1) Greedy Search:
 * 2) * Minimizes the estimated cost to reach the goal. The node that is closest to the goal according to $$h(n)$$ is always expanded first. It optimizes the search locally, but not always finds the global optimum.
 * 3) * It is not complete (can go down an infinite branch of the tree).
 * 4) * It is not optimal.
 * 5) * Space: $$O(b^m)$$ for the worst case.
 * 6) * Same for time, but can be reduced by choosing a good heuristic function.
 * 7) A* Search:
 * 8) * Combines uniform cost search (i.e. expand node on path with lowest cost so far) and greedy search. Evaluation function is $$f(n) = g(n) + h(n)$$ (or estimated cost of the cheapest solution through node n). It can be proven that A* is complete and optimal if $$h$$ is admissible - that is, if it never overestimates the cost to reach the goal. This is optimistic, since they think the cost of solving the problem is less than it actually is.
 * 9) * Examples for $$h$$:
 * 10) ** Path-Finding in a map: Straight-Line-Distance.
 * 11) ** 8-Puzzle: Manhattan-Distance to Goal State.
 * 12) ** Everything works, it just has to be admissible (e.g. $$h(n) = 0$$ always works, but transforms A* back to uniform cost search).
 * 13) * If a heuristic function $$h_1$$ estimates the actual distance to the goal better than another heuristic function $$h_2$$, then $$h_1$$ dominates $$h_2$$.
 * 14) * A* maintains an open list (priority queue) and a closed list (visited nodes). If a node is expanded that's already in the closed list, stored with a lower cost, the new node is ignored. If it was stored with a higher cost, it is deleted from the closed list and the new node is processed.
 * 15) * $$h$$ is monotonic, if the difference between the heuristics of any two connected nodes does not overestimate the actual distance between those nodes. Example of a non-monotonic heuristic: $$n$$ and $$n'$$ are two connected nodes, where $$n$$ is the parent of $$n'$$. Suppose $$g(n)=3$$ and $$h(n)=4$$, then we know that the true cost of a solution path through $$n$$ is at least 7. Now suppose that $$g(n')=4$$ and $$h(n')=2$$. Hence, $$f(n')=6$$.
 * 16) ** First off, the difference in the heuristics (that is, 2) overestimates the actual cost between those nodes (which is 1).
 * 17) ** However, we know that any path through $$n'$$ is also a path through $$n$$ and we already know that any path through $$n$$ has a true cost of at least 7. Thus, the f-value of 6 for $$n'$$ is meaningless and we will consider its parent's f-value.
 * 18) * $$h$$ is consistent, if the h-value for a given node is less or equal than the actual cost from this node to the next node plus the h-value from this next node (triangular inequality).
 * 19) * If $$h$$ is admissible and monotonic, the first solution found by A* is guaranteed to be the optimal solution (open/close list bookkeeping is no longer needed).

Finding Heuristics:
 * Relax the problem (e.g. 8-puzzle: Manhattan distance).
 * Calculate cost of subproblems (e.g. 8-puzzle: calculate cost of first 3 tiles).

Adversarial Search (Game Playing)
Minimax is for deterministic games with perfect information. Non-deterministic games will use the expectiminimax algorithm.

 * 1) Minimax Algorithm:
 * 2) * A two player zero-sum game, in which both players make a move alternately, is defined by an initial state (e.g. board positions), a set of operators that define legal moves, a terminal test that defines the end of the game and a utility function that determines a numeric value for the outcome of the game (e.g. "1" for win, "-1" for loss).
 * 3) * If it was a search problem, one would simply search for a path that leads to a terminal state with value "1". But the opponent (Min) will try to minimize one's (Max's) outcome. The minimax algorithm generates the whole game tree and applies the utility function to each terminal state. Then it propagates the utility value up one level and continues to do so until reaching the start node.
 * 4) * Propagation works like this: Min is assumed to always choose the option that is the worst for Max (minimum utility value). If one has three terminal states in one branch with 1, 2 and 3 as their utility values, then Min would choose 1. Hence, "1" is propagated to the next level and so forth. Max can then decide upon his opening move on the top level (the "minimax decision" = maximizing utility under the assumption that the opponent will play perfectly to minimize it).
 * 5) * For games that are too complex to compute the whole game tree, the game tree is cut off at some point and the utility value is estimated by a heuristic evaluation function (e.g. "material value" in chess).
 * 6) Alpha-Beta Pruning
 * 7) * We don't have to look at each node of the game tree: Minimax with alpha-beta pruning yields the same result as a complete search, but with much greater efficiency (reduces its effective branching factor to its square root).
 * 8) * Here we store the best value for Max' play found so far in alpha and the best value for Min's play found so far (i.e. the lowest value) in beta.
 * 9) * If, at any given point, alpha becomes smaller than beta, we can prune the game tree at this point. Therefore, it is required to evaluate at least on set of leaf nodes branching off of one of the deepest Min nodes and then use the acquired alpha-value to prune the rest of the search.
 * 10) Chance:
 * 11) * Introduces "chance nodes" to the decision points, based on what kind of chance is introduced (e.g. a 50/50 chance for flipping a coin), which yield the "expected value" (average - add up utility values weighted by the chance to achieve them).
 * 12) * Example: 3 leaf nodes, values 5, 6 and 10 = 21 altogether - the chance to get to any one of them is 1/3 - hence the expected value is $$ 21 * 1/3 = 7$$

Constraint Satisfaction Problems
For CSPs, states in the search space are defined by the values of a set of variables, which can get assigned a value from a specific domain, and the goal test is a set of constraints that the variables must obey in order to make up a valid solution to the initial problem.

Example: 8-queens problem; variables could be the positions of each of the eight queens, the constraint to pass the goal test is that no two queens can be such that they harm each other.

Different types of constraints:
 * unary (value of a single variable)
 * binary (pairs of variables, e.g. x > y)
 * n-ary

In addition to that, constraints can be absolute or preference (the former rules out certain solutions, the latter just says which solutions are preferred). The domain can be discrete or continuous. In each step of the search, it is checked if any variable has violated one of the constraints - if yes: backtrack and rule out this path.

Forward checking checks if any decisions on yet unassigned variables would be ruled out by assigning a value to a variable. It deletes any conflicting values from the set of possible values for each of the unassigned variables. If one of the sets becomes empty - backtrack immediately.

There are also heuristics for making decisions on variable assignments.

Selecting the next variable:
 * Most-constrained-variable works together with forward checking (checking which values are still allowed for each unassigned variable)
 * the next variable to be assigned a value is the one with the fewest possible values (reduces branching factor).
 * Most-constraining-variable assigns a value to the variable that is involved in the largest number of constraints on other yet unassigned variables.

After selecting the variable: variables connected to the current variable through constraints.
 * Least-constraining-value assigns a value that rules out the smallest number of values in

CSP's that work with iterative improvement are often called "heuristic repair" methods, because they repair inconsistencies in the current configuration. Tree-structured CSPs can be solved in linear time.

Other

 * 1) Hill Climbing
 * 2) * Evaluate all neighboring nodes and move to the best one.
 * 3) * If there is no better node than the current node, declare this node to be the optimum and halt.
 * 4) * Risk of getting stuck at local maxima.
 * 5) Simulated Annealing
 * 6) * Escape local maxima by allowing "bad" moves (descent), but gradually decrease their size and frequency.

title: Artificial Intelligence/Definition


text:
User talk:59.183.4.104

Hello and welcome to Wikibooks!

Here are some tips to help you get started:

 * 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.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 13:33, 24 Jun 2005 (UTC)

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

title: User talk:59.183.4.104


text:
User:Bleh fu~enwikibooks

See my Wikipedia profile.

title: User:Bleh fu~enwikibooks


text:
Blender 3D: Noob to Pro/Bones

Bones are used for shifting models and making them posable. If you are not ready for this yet and wish to continue simply modeling, please skip this tutorial to the next section.

Bones are a modeling tool that are especially important for animating characters. Bones allow you to move characters' limbs in a way that is much simpler than trying to re-arrange the vertices every time.

It works by associating a bone with particular vertices, causing them to move along with the bone when the position is changed in pose mode. Using bones is fairly simple once you get the hang of it, but, like many things in Blender, can be a little daunting at first sight.

Bones don't do much on their own; in fact, they turn invisible at render time. For this following module we'll use the character that we had made by the end of the module Putting Hat on Person. You will have to have completed all the modules in Section 2B. Note that while we will be using bones on a simple person, the process can be used with any creature or body type you imagine!

Laying down bones

''Note: This just shows the basics of adding bones to an object. Go to the advanced animation page for a more comprehensive guide on this.''

First of all, we'll need a model to put some bones on! For this tutorial, we're going to use a humanoid model. Open the model that you had created by the end of the Putting Hat on Person tutorial, or download a pre-made model from here.

Here's our setup, with Block Dude standing on a plane. You can add a plane by pressing → Mesh → Plane. Scale the plane to an appropriate size and move it so that it is approximately underneath the person.

Noob note: You will be placing armatures ("bones") inside your humanoid, so you must work in "wireframe mode", not "solid mode". Otherwise, you will not be able to see the armatures when you place them. To toggle between "solid" and "wireframe", press. You may find it helpful to make the wireframe less complex by hiding the subsurface mesh. You can do this by going to the Modifier context panel of the Properties window  and deselecting the eye button.

Note: An alternative to working in "wireframe mode" is to turn "X-Ray" on for the armature. To do this, select the armature. In the properties panel under object there is a display menu. Click "X-Ray" in the second field of buttons. This will allow the armature to show through other objects.

Add a bone

Now, let's put some bones on Block Dude! In Object Mode press → Armature → Single Bone.

What we are looking at is an armature. This is a single bone. Now, we need to put the bone in Block Dude! Move and rotate the bone so that it's in the middle of Block Dude's chest. If your bone does not have the correct length, then change the size of the bone by moving one of the ends of the bone: switch to Edit Mode, select one of the ends of the bone, then move it using. Alternatively, you can scale it using

Extrude a second Bone
To create a second bone starting from one of the ends of the first bone, switch to Edit Mode with the bone selected, select the end of the bone, then extrude the end. A second bone appears, with its start point on the selected end of the first bone. Move the mouse to position the end point, then press, , or. Scale the bone as needed to fit it in his body, and continue adding bones by extruding the end points. These operate much the same way as vertices: you can extrude, rotate, move, and even subdivide. Your finished result should look something like this:

Name the bones
Now, just to make things easier, we're going to name the bones. For example, my bones are named "Right Forearm", "Left Forearm", "Right Upper Arm", etc. While in Edit mode, select the bone you want to rename. In the Outliner, the bone you have selected will be visible with a circle around it. You may need to expand the Armature Object, Armature Data Object and any parent bones before being able to view the selected bone. In the Bone context panel of the Properties window click the name field to edit the name.

Noob Note: When you are naming the bones remember that if you are looking at the person from the front, your left is the person's right. To make the naming easier switch to viewing the person from behind using .)

Parent the bones
Now, we need to parent the bones to the mesh. Go back into Object Mode and select Block Dude (and the Hat, assuming you made one). Now, select the Armature as well, so that it is the last object selected, and press. The Parenting Menu will pop up. Select Armature Deform → With Automatic Weights. The person (and hat) are now children of the armature.

Noob Note: The selection order is important in defining which object is the parent, so you cannot select both objects at the same time. You must select the armature last to make it the parent. Also please note if you have problems with deformation you need to rest the rest position of the bones this is easily achieved by going to pose edit mode select all bones and CTRL -A  then  apply pose as rest position.

Moving the Bones
To move individual bones, you have to go into Pose Mode. Select the Armature in Object Mode and switch to Pose Mode by pressing or selecting the mode in the mode selection menu of the 3D Viewer. Try moving a bone around by pressing (sic) to select it, and then hitting  or  to move it.

If you've done everything correctly, your mesh should move when you move the bones! If this doesn't happen, scale the bones up so that they fit better in the mesh, and scale up the bones until they do what you want (read comment in the parenting section above on adjusting the bones envelopes if you do not get an effect while moving/rotating the bones). With the bones now, you can put Block Dude into a lot of different positions without moving individual vertices.

To the right is an example of how you can move Block Dude with the bones.

Also while in pose mode if after a (Right Mouse Button) click you can't move bones with or, check the "Move Object Centers Only" button (just to the right of the Rotation/Scaling Pivot button).

Add/remove mesh from bone control
Noob Note: If you've been adding bones to your simple person from the previous lessons, you will have likely noticed that the hat seems to stretch when you move the arms in pose mode. To fix this, you will need to remove the hat from the forearm vertex groups created in the Parenting step.

To manually change the mesh areas that the bones control, go to Object Mode and select the object you want to add/remove (if the mesh is inside the same object, then select only the areas of the mesh you want to work with in Edit Mode).

In this case, select the Hat.

Switch to the Object Data context panel in the Properties window and scroll to the "Vertex Groups" submenu.

Now pick the bone group from the dropdown above the Assign/Remove buttons, and then hit Assign (or Remove) as necessary. Usually vertices will be assigned to one group, but can be assigned to multiple groups. In this case, we want to remove the Hat from the Forearm vertex groups. Select the Forearm vertex groups and press the remove button, as pictured. With both of the Forearm vertex groups removed from the hat, it should be able to move properly with the rest of the armature.

Mesh deforms like it's far away from the bones
If the mesh is properly assigned to the bones they will move regardless of whether the bones are inside the volume of the mesh or not (HOW they deform WILL be affected however). The most common mistake in this step is creating and (more importantly) parenting the mesh to the armature while the armature is outside the mesh, which causes Blender not to assign vertices to any bone groups at all.

You can check this by editing the object (i.e. select the mesh and switch to Edit Mode, then un-select all vertices by pressing A until nothing is selected). Pick the Object data context then select a vertex group in the Object data tab, press Select'. This will select the vertices associated with the bone group. If the wrong vertices appear selected, you need to assign them manually as explained above.

If there is no effect, in Edit mode select that bone (or bones) and choose Envelope display mode (Properties window, Armature context panel → Display → Envelope), then press and increase its area of influence to cover all faces that should be influenced by the bone.

title: Blender 3D: Noob to Pro/Bones


text:
Cookbook:Dry Rub

| Spices and herbs | Texas cuisine

A dry rub useful for ribs, pork roast or whatever you like. After rubbing on the meat, let it sit in the refrigerator for about an hour.

Ingredients

 * ¼ cup paprika
 * ¼ cup light brown sugar
 * 3 tbsp salt
 * 1 tsp dry mustard
 * 1 tsp ground black pepper
 * ½ tsp cayenne pepper
 * ½ tsp ground cumin

Procedure

 * 1) Combine ingredients in a Zip-Lock bag, shaking thoroughly.
 * 2) Store in airtight container.

title: Cookbook:Dry Rub


text:
Chess/Puzzles/Directmates/Three-move 7/Solution

1.Nd5! Kxd5

1... d3 leads to 2.Rh4+ Kxd5 3.b4#

2.Rh4! d3

2... e4 leads to 3.Rh5#

3.b4#


text:
Chess/Puzzles/Directmates/Three-move 6/Solution

1. Rh2!! gxh2+

''1... g2 leads to 2. Rh1 gxh1=Q+ 3. Qxh1#''

2. Kf1! h1=Q+

3. Qxh1#


text:
Chess/Puzzles/Directmates/Three-move 4/Solution

1.Rf4! Kg3

''1... Kxh1 leads to 2. Kf2 Kh2 3.Rh4#''

2.0-0! Kh3

3.R1f3#

The alternative solution is:

1.Rhg1+ Kh3

''1... Kh2 leads to 2. Rg5 (2.Rg6, 2.Rg7 or 2.g8 are also possible) Kh3 3. Rh1# (after 2... Kh3 3. Rh5, 3. Rh6, 3. Rh7 or 3. Rh8 are mates respectively) 2. Rf2! Kh4

3.Rh2#


text:
Cookbook:Cuisine of Nepal

| South Asian cuisines

Nepali cuisine is variable, influenced by Tibetan cuisine in the north of the country and northern Indian cuisine in the south. dal-bhat-tarkari (Nepali: दाल भात तरकारी ) is eaten throughout the country. Dal is a soup made of lentils and spices. It is served over boiled grain, bhat -- usually rice but sometimes another grain—with vegetable curry, tarkari. Typical condiments are a small amount of extremely spicy chutney (चटनी) or achaar (अचार). These can be made from fresh ingredients, or may be a kind of fermented pickle. The variety of these preparations is staggering, said to number in the thousands.[1] Other accompaniments may be sliced lemon (kagati) or lime (nibua) and fresh chili peppers, khursani, cucumber slices, radish and onion slices. Some foods are hybrid of Chinese/Tibetian and Indian foods, like momo, Tibetian dumplings with Indian spices, found generally in Newa cuisine, originally filled with buffalo meat, but now also with goat, chicken meat as well as different vegetables and cottage cheese. There are also foods eaten during festivals like Sel roti, Patre, etc., eaten generally in tihar. New food varieties have also been made like Taas, (made first by a restaurant (Bhet Ghat) owner from Narayanghat Chitwan) which have gained wide popularity around the country, eaten generally with muri/bhuja (puffed rice), it is like Sekuwa (barbecued goat meat).

Hill Bahun (Brahmins), Chhetris Have traditionally eaten Goat meat (Khasi) and fish. However with land suitable for irrigated rice paddies in short supply, other grains supplement or even dominate. Wheat becomes unleavened flat wheat bread (roti or chapati). Maize (makai), buckwheat (fapar), barley (jau) or millet (kodo) become porridge-like (dhido or ato). Tarkari can be spinach or greens (sag), fermented and dried greens (gundruk or sinki), daikon radish (mula), potatoes (alu), green beans (simi), tomatoes (golbeda), cauliflower (kauli), cabbage (bandakopi)), pumpkin (pharsi), etc. Fruit traditionally grown in the hills include mandarin orange (suntala), kaffir lime (kaguti), lemon (nibuwa), Asian pear (nashpati), and bayberry (kaphal). Yogurt (dahi) and curried meat (masu) or fish (machha) are served as side dishes when available. Chicken (Kukhura), and fish are usually acceptable to all but the highest Brahmin (Bahun) caste, who limit meat to Goat (Khasi). Observant Hindus never eat beef (gaiko masu), except untouchables (dalit) possibly eating animals that have died of natural causes. In Pahari communities, domestic pork (sungurko masu) was traditionally only eaten by Magars, Kirats and Dalits, However bangur ko masu wild boar was traditionally hunted and eaten by Chhetris. A strain derived from wild boar is now raised in captivity and used for meat that is increasingly popular with Pahari ethnicities and castes that did not traditionally eat pork.

The central Nepal, including the Kathmandu Valley, specially newar community,is reach in variety of dishes. The newari cuisines includes the buff meat as main ingredient in non-veg cooking which is used to prepare various traditional "newari" dishes like "chhoyala", "kachila", "kawaf", "janla", "takha", "nya-khunha", "takula","chikula", "la wo lapi", "khago", "syapumhicha", "tisya", "nhepu", "chohi", "soo" etc. The veg items include "woo","chatamari", (can be varied as minced meat stuffed, simple, with egg, and with vegetable), "Yomari", "Paun kwa", "pancha kwa" , "mee kwa","hyela", and others with various vegetables and beans. The widely used "achar" includes the mixed salad like pickle made up of mixing potatoes,sesame seeds, cucumber and other seasonal raw vegetables. The other famous "achar" are made of tomatoes and dried fish for non-veg. For vegetarians, dried fish can be replaced by fried tofu or cottage cheese. "Lapsi" is another ingredient that is used for "achar", which can be mixed with seasonal vegetables and fruits or it can alone make it. For soft drink, a rice-beer known as "tho" is used. For hard drink, it is "aela".

Terai cuisine - Food in Outer Terai grades into cuisines of adjacent parts of India such as Maithili[4] cuisine in the east, Bihari and Bhojpuri cuisine in the center and near west. Further west there is Uttar Pradeshi and even Mughlai-influenced Awadhi cuisine—particularly eaten by the substantial Muslim population around Nepalganj and beyond. Terai diets can be more varied than in the Middle Hills because of greater variety of crops grown locally plus cash crops imported from cooler microclimates in nearby hill regions as well as from different parts of India. Fruit commonly grown in the Terai include mango (aap), litchi, papaya (mewa/papeeta), banana (kera/kela) and jackfruit (katahar/katahal).

Nepali cuisine uses spices such as cumin, fenugreek, and coriander; and rice and lentils are eaten as staples. This southern-influenced brand of Nepali cuisine is different from Indian cuisine mainly in the much more moderate usage of oil and spices.

Influences from the north include bamboo-shoots, preserved vegetables (various pickled/fermented vegetables), and dried vegetables (gundruk and sinki), which are regularly and commonly eaten. Also popular are steamed dumplings (momos), usually eaten with a sauce made, variably, of tomatoes, cilantro, and sesame seeds.

title: Cookbook:Cuisine of Nepal


text:
User:Cymydog Naakka~enwikibooks

w:User:Cymydog Naakka

title: User:Cymydog Naakka~enwikibooks


text:
Reaktor/Modules/IC Send

 * Use of IC Send module with any sequencer

title: Reaktor/Modules/IC Send


text:
Reaktor/Modules/IC Receive

 * Tutorial: Use of IC Send module with any sequencer

title: Reaktor/Modules/IC Receive


text:
User:Vkdasari

Vijay Dasari

SCDJWS :

title: User:Vkdasari


text:
Raising Chickens

This book is intended for small scale raising of chickens often referred to as "Hobby Farming". Raising chickens can be very entertaining. They also make a good environmentally friendly way of disposing of organic waste; there is very little that a chicken won't eat. Chickens are flock birds and you'll probably get more than one.

Since this is a wiki, editing is allowed and indeed encouraged. If you don't feel comfortable about editing but would still like to contribute please see the |discussion page for this book.

Table of contents

 * Editing instructions

Starting up

 * Building a shelter (chicken/hen house)
 * Building a pen
 * Pen maintenance
 * Choosing a breed
 * Finding a hatchery
 * Local regulations

Taking care of your chickens

 * /Chicks/ (specific to chicks)
 * /Feeding/
 * /Watering/
 * /Winters/
 * /Keeping your chickens happy/
 * Dealing with death (unfortunately, it happens)
 * Butchering chickens

Other information

 * Information that doesn't fit elsewhere

Links

 * Urban chickens A great poultry web site

 * Chicken House Plans Build your own easy to build backyard chicken coop

title: Raising Chickens


text:
Talk:PHP Programming/Arrays

You haven't explained what

while (list($key, $val) = each($accessories)) {

does yet. Try to use only code that you've already shown. People who are just learning (like myself) need to be able to follow it, appending one thing at a time to their knowledge. - Omegatron 20:59, 24 Jun 2005 (UTC)

Array Examples
Somebody changed examples from Toyota to Toyota. THIS IS INVALID WE ARE NOT EVALUATING HTML HERE!!! PHP IS JUST A SCRIPT INTERPRETER, OUTPUTTING DATA. IT DOESN'T OUTPUT BOLD TEXT, DOES IT? Wykis 18:13, 22 March 2006 (UTC)

the BOLD tag element does exist in XHTML. w3

Added the missing </b> closing tags for model, color, and year. 71.110.195.21 19:26, 1 May 2006 (UTC) Randall - whizman.com - 2006/05/01

Example 3
I think that it wasn't explained in any page so far the curly braces in double-quoted strings notation for using variables... It's very confusing if you don't know it yet. They should be either replaced for. concatenating, or an explanation of how they work should be added below the example. - Roma emu 15:41, 7 September 2006 (UTC)

Example #3 HTML rendering
The third example

is output in both Google Chrome 39.0.2171.99 m (64-bit) & Microsoft Internet Explorer 11.0.9600.17498 (64-bit) as

Manufacturer: Toyota Brand: Celica Colour: black Year Manufactured: 1991

In other words, the commands between the ampercent and the semicolon is not executed, like it is the case for the carriage return. If these commands are converted to text,

it works in these browsers properly. The same is true for the multidimensional array example.--Sae1962 (discuss • contribs) 13:44, 21 January 2015 (UTC)

title: Talk:PHP Programming/Arrays


text:
ProLaw

About ProLaw
ProLaw is a case law management and Accounting software package designed for law firms... but also quite usable by government agencies! ProLaw stores data in a Microsoft SQL Server database and is a Thomson Elite product.

The latest versions (v2018 & v2017) are quite stable and are used by a majority of ProLaw firms. There are still firms running v11, which was released in roughly 2008.

ProLaw is also very customizable. Although it doesn't have an API--and having worked at ProLaw/Thomson-Elite for 8 years, the word was always that they would never create an API--ProLaw allows a wide variety of automation and customization. Examples of ProLaw automation and ProLaw tools demonstrate the types of ProLaw automation and ProLaw customization possible.

Contents

 * Front Office
 * [[image:ProlawContactsButton.gif]]Contacts
 * Matters
 * Events
 * Back Office
 * Reports

title: ProLaw


text:
ProLaw/Front Office

Front Office
Front Office is the case management portion of Prolaw. It is comprised of four major tools. They can be found on the toolbar:
 * [[image:ProlawContactsButton.gif]]Contacts. Tools for managing contact information for all of the individuals related to a case.
 * Matters. Customizable tools for managing the data in the cases themselves.
 * Events. The Tasks, Reminders, Hearings, and Documents related to a case.
 * Files. Tools for tracking physical case-related material.

title: ProLaw/Front Office


text:
User:RandalSchwartz

http://www.stonehenge.com/merlyn/

title: User:RandalSchwartz


text:
User talk:202.76.170.20

Welcome:

Hello and welcome to Wikibooks!

Here are some tips to help you get started:

 * Remember that copyrighted works cannot be accepted by Wikibooks.
 * Check out our help page if you need additional help.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 02:38, 25 Jun 2005 (UTC)

title: User talk:202.76.170.20


text:
User:WAS~enwikibooks

Go to Wikipedia:User:WAS

title: User:WAS~enwikibooks


text:
Bartending/Alcohol/Mead

=Mead= Mead (IPA:ˈmiːd) is an alcoholic beverage produced from fermented honey. Its strength can vary, but most commercial mead varieties have a similar alcohol percentage to wines. It tends to be quite sweet, with an obvious honey flavour.

title: Bartending/Alcohol/Mead


text:
User talk:132.239.89.176

This ip usually belongs to User:Kellen.

Welcome:

Hello and welcome to Wikibooks!

Thanks for helping to fight vandalism, every bit helps.

Here are some tips to help you get started:

 * 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.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 03:07, 25 Jun 2005 (UTC)

title: User talk:132.239.89.176


text:
User talk:Oracleoftruth~enwikibooks

Welcome:

Hello and welcome to Wikibooks!

Thanks for helping to fight vandalism, every bit helps.

Here are some tips to help you get started:

 * 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.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 03:43, 25 Jun 2005 (UTC)

Your account will be renamed
Hello,

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

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

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

Sorry for the inconvenience.

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

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:19, 19 April 2015 (UTC)

title: User talk:Oracleoftruth~enwikibooks


text:
User talk:12.73.179.40

Welcome:

Hello and welcome to Wikibooks!

Here are some tips to help you get started:

 * 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.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 03:49, 25 Jun 2005 (UTC)

title: User talk:12.73.179.40


text:
User talk:WAS~enwikibooks

Welcome and linking to Wikipedia
Make sure you log in before editing. I'm assuming that that was you editing your user page. To answer your question try linking to the English Wikipedia like this:

WAS.

Anyway, hello and welcome to Wikibooks!

Here are some tips to help you get started:

 * 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.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 04:02, 25 Jun 2005 (UTC)

Your account will be renamed
Hello,

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

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

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

Sorry for the inconvenience.

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

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:38, 19 April 2015 (UTC)

title: User talk:WAS~enwikibooks


text:
Radiation Oncology/CALGB

See the CALGB webpage

See also:
 * PMID 16740797 (2006) — "Radiation oncology research in the cancer and leukemia group B." Bogart JA et al. Clin Cancer Res. 2006 Jun 1;12(11 Pt 2):3628s-34s.

title: Radiation Oncology/CALGB


text:
Chess/Puzzles/Middlegame/Match 1

Starting from the following position, white starts and wins.

A. Karpov v. E. Gyk (1968).

/Solution/

PGN
[Event ""] [Site ""] [Date "2010.06.10"] [Round ""] [White ""] [Black ""] [ECO ""] [Result "*"] [SetUp "1"] [FEN "r4k2/pp1b1p1Q/3pp1n1/7R/4P3/1B3q2/P1P1N3/1K6 b - - 0 1"]

title: Chess/Puzzles/Middlegame/Match 1


text:
Chess/Puzzles/Middlegame

Actual matches

 * 1) A. Karpov vs. E. Gyk (1968)
 * 2) M. Tal vs. M Botvinnik (1960)
 * 3) W. Steinitz vs. J. Rock (1863)
 * 4) W. Steinitz vs. G. Thomas (1911)

title: Chess/Puzzles/Middlegame


text:
Chess/Puzzles/Endgame

Puzzles

 * 1) Puzzle by R. Reti
 * 2) Puzzle by M. Tal and E. Pogosyants

title: Chess/Puzzles/Endgame


text:
Chess/Puzzles/Endgame/Puzzle 1

White to play and draw.

Authored by R. Reti.

/Solution/

title: Chess/Puzzles/Endgame/Puzzle 1


text:
Chess/Puzzles/Directmates/Three-move 8

Starting from the following position, white starts and wins in three moves.

Authored by Sam Loyd (1869).

/Solution/

title: Chess/Puzzles/Directmates/Three-move 8


text:
Chess/Puzzles/Directmates/Three-move 8/Solution

1.Qf1! g3

''1...Bb2 leads to 2.Qb1! and 3.Qxh7# or 3.Qxb2#(if 2... g6)''

1...Bc3(Bd4) leads to 2.Qd3!, and then similar to the above

1...Be5(Bf6) leads to 2.Qf5!, and then similar to the above

1...g5(g6) leads to 2.Qxa1#

2.Ng6+! hg

3.Qxh3#


text:
Chess/Puzzles/Endgame/Puzzle 1/Solution

1.Kg7! h4 (or 1...Kb6 Kf6 2.Kxc6 Kg5)

2.Kf6! Kb6

2... h3 leads to 3.Ke6 h2 4.c7 Kb7 5.Kd7 and White draws.

3.Ke5 Kxc6

3... h3 leads to 4.Kd6 h2 5.c7 and White draws.

4.Kf4 h3

5.Kg3 h2

6.Kxh2

This classic study is an excellent illustration of the fact that the King can take many alternative routes to the same square, each of which use the same amount of tempi. By moving to the center of the board while still chasing the Black pawn, White is able to create a promotion threat of his own. If Black ignores this threat, both pawns will queen and the ending will be drawn, but if Black spends moves with his king to stop the white c-pawn, White's king will be able to catch the h-pawn.

title: Chess/Puzzles/Endgame/Puzzle 1/Solution


text:
Chess/Puzzles/Middlegame/Match 1/Solution

1.Rf5!! (threatening Qxf7#) Qxb3+

1... exf5 brings the bishop on b3 into play, and 2.Qxf7# follows

2.cxb3 exf5

3.Nf4 Rd8

4.Qh6+ Ke8

5.Nxg6 fxg6

6.Qxg6+ Ke7

7.Qg5+ Ke8

8.exf5 Rc8

9.Qg8+ Ke7

10.Qg7+

Black Resigns (cannot stop f5 from promoting)

You were corect??

Jes - No

PGN
[Event ""] [Site ""] [Date ""] [Round ""] [White ""] [Black ""] [ECO ""] [Result "*"] [SetUp "1"] [FEN "r4k2/pp1b1p1Q/3pp1n1/7R/4P3/1B3q2/P1P1N3/1K6 w - - 0 1"]

1.Rf5 Qxb3+ 2.cxb3 exf5 3.Nf4 Rd8 4.Qh6+ Ke8 5.Nxg6 fxg6 6.Qxg6+ Ke7 7.Qg5+ Ke8 8.exf5 Rc8 9.Qg8+ Ke7 10.Qg7+ *


text:
Chess/Puzzles/Middlegame/Match 2

Starting from the following position, white starts and wins.

M. Tal v. M. Botvinnik (1960).

/Solution/

title: Chess/Puzzles/Middlegame/Match 2


text:
Chess/Puzzles/Middlegame/Match 2/Solution

1.Rxa6+! Kb8

1...bxa6 leads to 2.Qb6+ Ka8 3.Qxa6+ Ra7 4.Qxc8#

2.Qa4

Black Resigns

There is a defense against 2.Qa4 and prevents Ra8+ and Qa5#, but it is still a loss for black. Analysis by Gordon B. Elo rating 2681 Starting from original position 1.Rxa6+! Kb8 2.Qa4 Rxc5!! 3.dxc5 Qxc5+ 4.Kh1 Kc7 5.Ra7 Kd6 6.Ra5 Qxa5 7.Qxa5 Ke7 8.Qc5+ Ke8 9.Rxb7 Rd1+ 10.Ng1 Nd7 11.Qb4 Rd3 12.Qa4 Rd5 13.Nf3 f6 14.Nd4 Ke7 15.Kg1 g5 16.Qa7 Ke8 17.Nxe6 Rd1+ 18.Kf2 Rd2+ 19.Ke1 Rd3 20.g4 g6 21.Ke2 Rd6 22.Nc5 Rd5 23.Nxd7 Rd2+ 24.Kxd2 Ke7 25.Qc5+ Kf7 26.Nxf6+ Kxf6 27.Qe7#

You were corect??

Jes - No


text:
Raising Chickens/Building a Pen

Building a pen can be easier than you think. You will need to know what type of chicken you are getting before you begin construction.

If your chickens are going to be larger, heavier, and less prone to flying away (like mine) then a simple post and wire design will work. However, most chickens are more airborne and you will need to design a pen with really high fences (if not with a wired roof) or get used to seeing your chickens on your roof.

No matter what design you choose, you will need to customize based on chicken type, local by-laws, and geography. Before proceeding, it is recommended that you check with your municipality to see how many chickens you may keep. In rural counties you will probably find that keeping livestock (including chickens) is OK. However, in more urban areas there may even be TOTAL restrictions on chickens. It should be noted that as recently as the 1960s people have been allowed to keep reasonable numbers of chickens in urban areas.

Choosing an Area
A very important factor in choosing an area to raise chickens should not be overlooked. There are many predators out there who want to get to the chickens as an easy meal. You might come out one morning and your chicken have been scavenged by night predators who enjoyed a big feast. This can be devastating. Therefore it is imperative that they are locked in at night. Predators also can come during the day. For example Hawks like to snatch chickens. And they can shoot down from the sky very fast. You need to make sure you have a tight mesh on top of the roaming area, where they are fenced in. I have seen large mirrors placed in the roaming area too, which serve to distract the predators very well.

Post and Wire Design
A post and wire design is the simplest way of building a pen. Just as the name suggests, all you need are some fence posts, the right kind of wire, fence staples, and appropriate tools (a regular hammer, sledgehammer, crowbar, and wire cutters will do). Do a simple survey of the area you want your chickens to live in, measuring the distance on all your fence lines. Anyone using a fence pounder should replace the next few steps with ones for a fence pounder as appropriate.

Once your survey is complete, it is time to buy your materials. Fence posts can be purchased from a variety of lumber stores. You may find that you can only order them in large bundles as the primary consumers of fence posts are farmers who need a lot of them. If this is the case, don't worry; you will find that fence posts are incredibly useful for many purposes including support beams for storage sheds and the chicken house.

Although you could use chicken wire for containing your chickens, I recommend stucco wire. Stucco wire is usually used for holding stucco to the sides of buildings. It is stronger and taller than chicken wire. You will also need fence staples for attaching the wire to the posts. These can be found at most hardware stores. If you can't find actual fencing staples, then staples used for attaching electrical wire to walls will do. I must stress that you shouldn't skimp on your staples. You will need a lot, even if you have a small pen. Not only do you need lots during construction, you will need a supply for emergency repairs.

Now that you have your fence materials, you will need tools for building the fence. You will need a regular hammer for the staples, a crowbar for making holes for the posts, and a sledgehammer for pounding the posts in.

When selecting a sledgehammer you should keep the weight in mind. It should be heavy enough so that you are doing less of the work for pounding the post in and more is done by the hammer. However, if it weighs too much, and you have trouble lifting it, then you might not be able to pound as efficiently as with a hammer that has a more comfortable weight. A crowbar is needed to dig a hole to start the post. You should select a pole that comes to a point at the end. Now we have all the materials and tools needed; let’s get to the actual construction.

Construction
Building the pen is very simple to do. There are, however, some tricks that aren’t obvious that are only learned from experience. Some hidden tricks that are specific to chickens (cattle don't need these on fences to contain them) will be covered here.

If the ground is dry or frozen you should bring a bucket of water along to soften the ground. Use the pointed end of your crowbar to pound a hole in the ground. When a hole starts to form, pour water into it occasionally to soften the soil. You should also leave your crowbar in the hole and use it to widen the hole by pulling you body weight against it. A 20 cm deep hole should be sufficient. The hole should be wide enough to hold a post. When you have finished making your hole, put your post, pointed end first, into the hole. Use your sledgehammer to pound the post into the ground until it is firm. On days when the soil is dry, having the post a little loose might work as the soil will slowly soften around it. To stabilize the post and allow the energy of your pounding to be used more effectively, it may be useful to have someone on the side opposite yours to hold the post while you pound. Be CAREFUL as, if you miss the post, you could injure your assistant. Space your posts about a meter apart. You should add two posts that are about a wheelbarrow width apart. This will be your gate later.

Once you have enough posts to put a fence around the area you choose to build your pen at, you can put wire up around it. To do this bring your stucco wire to a corner post. You should probably have more than one person do this as stuco wire is heavy. Hold the end of the wire to the post and hammer in with fence staples. Once your end is secured unroll your wire to the next post in line. Don't wrap your wire around this one. Instead unroll the wire a little beyond the post and staple what wire touches the post. Continue doing this until either the pen is complete or you run out of wire. If you run out of wire then you can continue on with another roll. If the first roll ran out just after a post then wrap it around the post as best you can and move on. Do not wrap the second wire around this post instead have it share the last post of the roll that ran out. Once that is done then continue in the same way as before.

If the wire runs out before reaching a post then you should probably pound a new post in so that the end of the wire can be attached. Then continue with the next roll sharing this new post.

To make a gate all you need is some particle board, hinges and a latch.

Cut the particle board to fit between the gate posts, and attach the hardware appropriately. Get a heavy-duty latch and lock for your gate. Animals are not the only predators that may helps themselves to your birds or their eggs.

It is also possible to raise free range chickens. If you do that, you might want to mix in with the regular birds several Guinea hens. They are not that large a bird and are not that good a meat producer or egg producer, but are good 'watch dogs' for the flock. The bugs and greens the free ranging birds get make very good eggs and meat. Guinea hens are good collectors of bugs. Free ranging birds also need protection at night.

Additional Resources
Urban chickens A great poultry web site
 * "poultryOne's Guide to Building Chicken Coops" - Comprehensive article on constructing your own chicken coop.

Additional Notes
If you have any suppliers to add (even if they don't have a website) feel free to add them to the list or to the discussion page for this section. You can also suggest alternative methods of fence construction over there as well.

title: Raising Chickens/Building a Pen


text:
Chess/Puzzles/Endgame/Puzzle 2

White to play and win.

Authored by M. Tal and E. Pogosyantz.

/Solution/

title: Chess/Puzzles/Endgame/Puzzle 2


text:
Chess/Puzzles/Directmates/Two-move 7

Starting from the following position, white starts and wins.

Author: L. Kubbel

/Solution/

title: Chess/Puzzles/Directmates/Two-move 7


text:
Chess/Puzzles/Directmates/Two-move 7/Solution

1. Bb3 (threatens Ne6#)

1... Kf4 2. Qc4#

1... f4 2. Nf5#

1... Nf4 2.Rg3#

1... Bf4 2.Bc1#

1... Rxh5 2.Nxh5#

1... Be5 2. Qxf5#

1... Ne5 2. Qxf5#


text:
User:ArcticFlame~enwikibooks

My Wikipedia page: ArcticFlame

title: User:ArcticFlame~enwikibooks


text:
Chess/Puzzles/Endgame/Puzzle 2/Solution

1.Nd4+ Ke1

1...Kd1 leads to 2.Qb1#

2.Qh2! Kd1!

2...Qf2 3.Nc2+ Ke2 (3...Kf1 4.Qh1+, 3...Kd1 4.Qh1+) 4.Qh5+ transposes to 4...Qf2

2...Qa6 leads to 3.Nc2+ Kd1 4.Nxe3+ Ke1 (4...Kc1 5.Qc2#) 5.Qd2#

Other moves lose the queen or allow 3.Qe2#

3.Qh7! Ke1!

''White's threat is 4.Qb1#. 3...Kc1 leads to 4.Qc2#''

3...Qe1+ leads to 4.Kb3 transposing to 6.Kb3 in the 4...Kd1 line

4.Qh4+

''4.Qe4? leads to 4... Kf2 5.Qf3+ Kg1 6.Ne2+ Kh2 7.Qxf1 (stalemate!!)''

The problem now branches into two main possibilities

a)4...Kd1

5.Qe4! Qe1+

6.Kb3 Qf2

6...Qd2 leads to 7.Qh1+ Qe1 8.Qh5+ e2 (8...Kd2 9.Nf3+; 8...Kc1 9.Qc5+ followed by Qc2# or winning the Black queen) 9.Nf3 and Black must loses his queen or allow 10.Qd5+ Kc1 11.Qd2+ Kb1 12.Qb2#

Other Queen moves lose the queen or allow 7.Qc2+ Ke1 8.Qe2#

7.Qb1+ Kd2

8.Qc2+ Ke1

9.Qc1#

b)4...Qf2

5.Nc2+ Ke2

5...Kf1 leads to 6.Qh1+ transposing to 7.Qh1+

5...Kd1 leads to 6.Qh1+ Qg1 (6...Ke2 7.Nd4#) 7.Qxg1+ Ke2 8.Nd4#

6.Qh5+ Kf1

6...Qf3 leads to 7.Nd4+ forking king and queen

7.Qh1+ Qg1

7...Ke2 leads to 8.Nd4#

8.Qf3+ Qf2

9.Nxe3+ Kg1

9...Ke1 leads to 10.Qd1#

10.Qd1+ Kh2

11.Ng4+, and white has a queen and king v. king situation.

You were correct??

Yes - No

title: Chess/Puzzles/Endgame/Puzzle 2/Solution


text:
Chess/Puzzles/Directmates/Fourteen-move 1

Starting from the following position, white starts and wins in fourteen moves.

Authored by I. Kling.

/Hint/ - /Solution/


text:
Chess/Puzzles/Directmates/Fourteen-move 1/Hint

Starting from the following position, white starts and wins in fourteen moves.

Authored by I. Kling.

Hint: The only piece that white moves is the queen, and the first 13 moves are all checks.

Solution


text: File:8 ic send to cut.gif

title: File:8 ic send to cut.gif


text:
Talk:Raising Chickens

I have 9 laying Rhode Island Red Hens Up till now I've been feeding them on layena and scratch with the occasional other scraps, greens etc. I have been told that layena is not all that good for them,that I would be better off to feed them more vegetable scraps instead.

Maybe you could comment.

Linda Slasberg

Minor complaints
Post minor complaints about information (or lack of it) in the book, formatting, or non-compliance with Wikibooks here. Klingoncowboy4 18:42, 29 July 2005 (UTC)

death
I used to work as a meatcutter, if you want some info about cutting them into sections or whatever I can type something up. But sorry I'm not graphically talented enough to do clean diagrams. --Andymussell 01:59, 31 July 2005 (UTC)

That would be great. Diagrams are not nesesry if you have trouble creating them. We need something to cover this and if we choose to add them, diagrams can always be added later. Klingoncowboy4 17:00, 31 July 2005 (UTC)

I have just created a section for this. Klingoncowboy4 17:09, 31 July 2005 (UTC)

title: Talk:Raising Chickens


text:
Chess/Puzzles/Directmates/Fourteen-move 1/Solution

Note that all of Black's moves are forced:
 * Black king cannot escape on a7 because of the white b6 pawn;
 * Black queen cannot parry an a-file check on a7 because Qxa7 checkmates Black;
 * Black king cannot escape on c8 because the white queen is checking at either f4, g3 or h2 when Black king is on b8. As such if escaping to c8,  Qf8/Q(x)g8/Qh8 will checkmate the black king next move.  Note that c7 and d7 are both guarded by white pawns.

If 13... Kb7 then 14. Qa6#

If 13... Qa7 then 14. Qxa7#


text:
Bicycles/Maintenance and Repair/Tools and Supplies/Crank Puller

A crank puller is a tool for removing cranks from the bottom bracket spindle. There are two main types of cranks: square taper and spline drive. Most modern bicycles have moved to spline drive and away from the square taper design. One crank puller will not pull both styles of cranks unless it includes an interchangeable accessory for this purpose.


text:
Bicycles/Maintenance and Repair/Bottom Brackets/Bottom bracket overhaul

Identify bottom bracket type

There are two main bottom bracket types. More common on older bikes is the cup and cone style shown to the left. On modern bikes the most common is the sealed cartridge bearing shown to the right. The easiest way to identify which you have is to look at the bottom bracket on the non-drive side of the bike. A cup and cone bottom bracket will have a lockring and adjustable cup. A cartridge will just have a cup with a splined interface.

For a detailed analysis of the varying types of bottom bracket see the Wikipedia article.

Cartridge
A cartridge bottom bracket is a sealed unit and once worn out the whole thing is replaced.

Cartridge bottom bracket replacement:
 * 1) Remove both crank arms
 * 2) Use a bottom bracket tool to remove old unit. Remember most modern bikes use English threads so the drive side cup will be reverse threaded and unscrews clockwise.
 * 3) Clean bottom bracket threads in frame with degreaser and rag.
 * 4) Apply grease to the frame threads and bottom bracket threads.
 * 5) Insert the bottom bracket into the frame. Make sure it is oriented correctly, left and right should be marked on the shell. Typically the drive side cup will be fixed to the shell and have a raised flange. Take care when threading the bottom bracket into the frame, it is easy to cross thread.  If the cup has a raised flange tighten until the flange is tight against the frame.
 * 6) Fit the other cup again taking care to avoid cross threading. Tighten until it is tight against the shell.
 * 7) Reinstall cranks.

Cup and cone
Remove the lock ring of the adjustable (left side) cup. There are several ways to do this, the best of which is to use a large Sugino or Campagnolo (or equivalent) lockring spanner, which looks like a curved finger that fits around the lockring with a hangnail that goes into the lockring slot. In a pinch, an adjustable pin spanner can also be used to grip the lock ring. The direction to turn depends upon the style of adjustable cup; English/French, Italian, or Swiss.

There are a few types of adjustable cup: One type has holes in it designed for a pin spanner to unscrew. This tool looks like a giant pair of tweezers with one pin on each tang. A picture of this can be seen here http://www.sheldonbrown.com/tooltips/images/bbtools5.jpg The other type looks like an adjustable spanner would fit, but in practice a chisel and a mallet is often the only way to turn it round and out.

Once the left cup is out, remove the ball bearings (usually in a retainer) and the bottom bracket spindle, and then the right side bearings. Note which way the retainer comes out and be sure to replace it the same way round. It is not necessary to remove the fixed cup over on the right hand side, and because of the difficulty and chance of damaging the fixed cup flats, removal is not recommended if you want to keep it.

Clean all bearing surfaces using a penetrating solvent to dissolve congealed grease. Inspect for pits and discard and replace any pitted cups or a pitted spindle. Remove individual balls from the retainer and clean thoroughly before replacing them.

Grease the cups and bearings liberally using a good quality commercial grease made for this purpose. Use copper grease ONLY on the screw-threads and reinstall the right side bearings and bottom bracket spindle. If the spindle is asymmetric be sure to orient the longer side of the spindle on the right (drive side) of the bike. Place left side bearings into the cup and gently screw the cup back onto the frame. Take your time and use only your fingers until you're certain that it is not cross-threaded. Do not force it! It is easy to strip or foul the bottom bracket threads by mistake. Continue screwing with the pin tool (or adjustable spanner) once the cup gets deep into the bottom bracket shell.

When the bottom bracket feels tight, check for play by grasping the spindle and yanking in and out on the spindle and listening / feeling for play. It is better to be a little bit too tight than too loose. When the lockring is secure the play will increase ever so slightly. When all the play is removed, thread on the lockring and tighten with lockring spanner (here, a pin spanner cannot provide enough force to secure the lockring permanently.) Tighten the lockring until it can go no further.

Symptoms of a bottom bracket needing overhaul
Listen to your bike, and take notice of what it feels like, when you are riding. Through your feet, via the pedals, you can diagnose many power-drive-related problems, including whether the bottom bracket is in need of maintenance.

If you can hear or feel a periodic (i.e. once per crank revolution) creak or ticking noise when the system is under high or even normal load, it could be time to regrease or replace the bottom bracket. The creak, click, or rough feeling usually occurs as the crank arms pass through one particular point in their cycle; if it does, then you have a problem with either the bottom bracket or possibly the pedals themselves (check this latter simply by spinning the pedals with your hand; they should spin freely). The creaking in the bottom bracket can be caused by the on-set of corrosion (due to frequent exposure of this part of the bike to water and dirt).

For total confirmation of a worn bottom bracket, remove the crank arms and spin the spindle by hand; you will quickly be able to tell if it is in need of maintenance or replacement.

Beware of damaging the threads in the frame
Great care and cleanliness is necessary to protect the thread of the bottom bracket in the frame. This is the only part of the whole bicycle that is vulnerable to "wearing out", sometimes by running in a loosened condition. Or, perhaps more commonly, be damaged beyond repair by carelessness (eg cross-threading) in the workshop. The common practice of tightening the locking ring with a hammer and chisel will damage the ring (no great problem, it is replaceable) but is also ineffective in providing sufficient torque.


text:
User talk:80.43.29.135

Hello and welcome to Wikibooks!

Here are some tips to help you get started:

 * 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.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 14:19, 25 Jun 2005 (UTC)

title: User talk:80.43.29.135


text:
Mambo Open Source/Different ways of loading modules

Load the modules means to put a piece code in the templates index.php file that will be replaced with the modules when run through mambo's template engine. There are some parameters that you can use when loading these modules that load them in different ways.

In this article, all code examples are for the "left" module position. This can be replaced with any position you want.

There are many ways (plain, tableless, wrapped) to load the modules in mambo.

The normal, plain mode
This is the most common way to do it, and has no additional parameters, and will load the module in a table. This is how it should look:

This loads a table with the class "moduletable". The module header, if present, is loaded in a th-cell, whilst the content of the module is loaded in a td-cell.

Without the "moduletable"-table
This method echoes the modules content only, without the moduletable-table. This means that the header will be gone too, as the whole table that wraps around the content in the normal, plain mode is gone.

This is the output it produces:

Wrapped in div-tags
This method is identical to the previous one, but wraps it in three addidional div tags. With the right css code applied to it, it is possible to create graphical modules that are dynamic in width and height.


text:
Mambo Open Source/Mambo for a beginner

This article/essay is an introduction written for a total beginner that has no experience with CMS systems at all. You should have some skills in web sites, however, to fully understand this article.

It is recommended to read the article from top to bottom.

What is mambo?
Mambo is a content management system, which, as the phrase suggests, manages content. Mambo manages the text, images, links, documents and interaction - the main elements of every website. This means that instead of using an application like Dreamweaver, FrontPage or a similar visual website management tool, you use Mambo to maintain and update a site. Mambo utilizes a browser based system to do this - the administration is a securely accessed back end of the website. You log in, and use the browser to add content, publish articles, approve submissions and perform countless other functions involved in maintaining an active growing website.

How does mambo work?
Mambo is based on three elements: a web server, a script language and a database. The webserver is connected to the internet and makes the site available there, the script language consists of the programs and functions, and the database stores the content.

First, a user requests the mambo page by entering the URL. The browser then connects to the webserver. The URL contains the parameters of the content - what section, which article and so on. Based on those parameters, mambo's script system contacts the database and gets the content. Then, the content and the template are merged together, and this returns as a plain HTML and CSS page.

Those terms..
Mambo has many special words and phrases that a beginner might not understand. They are used very often in the community and may not be self-explanatory, so knowing what these words mean can be very useful for a beginner.

../Components/
The Components are supplements and additions to mambo's core functions. Mambo can publish text, upload images, manage users, etc., but Components provide additional functionality that can perform specialized tasks. Examples include: download managers, forums, commerce, galleries, guestbooks, wikis, newsletters - the list is almost endless.

These components are installed with an installer in Mambo, found under "components > install/uninstall" in the Mambo Administration panel. This is how most of the Components are installed, but it should be noted that some of them will need modification to core files. However, that is very seldom needed, as the components installer is usually sufficient.

../Modules/
Modules are the side blocks in mambo. Among these are the main menu module, login, poll, syndicate - all the stuff around the content. Mambo has predefined positions for these Modules. The most common are the left and right positions. The designer of a template (see below) can place these positions wherever he/she wants, so there is no rule that says the left position will be on the left of the template. But templates are commonly set up so that this corresponds to the actual layout.

There are also more Module positions. There are top positions, which are usually over both left and right modules, and also content. This position is good for newsflashes etc. There are many more positions to choose from, and one can create as many as one likes - you can have 30 different positions if you want to.

../Templates/
The Templates are exactly the same as a skin. The Templates are predefined looks, which make mambo look a certain way. The Templates do not control the behavior, though, as in other systems that use Templates - it is a look-only definition.

Explained very simply, a Template is a HTML/CSS document that has code in it which makes it compatible with Mambo. For example, they contain is code for loading the modules of a certain position, code for loading the main body (main content) and so on.

../Mambots/
The Mambots are small scripts that act upon the elements within Mambo. This can be any elements - components, content and all other aspects of the site.

There are many forms of Mambots. The most frequent are content Mambots. These are used like this: you insert {mambot_name} into some content, and the Mambot replaces this tag with the functions of the Mambot. This can be embedding Flash, linking to other content, inserting images etc.

title: Mambo Open Source/Mambo for a beginner


text:
Artificial Intelligence/Symbolic Programming

Algorithms in PROLOG

 * Subset of First Order Logic
 * restricted to Horn Clauses
 * Inference by resolution theorem proving
 * Unification
 * Depth-First-Search
 * Backward-Chaining Approach

Inner workings
Resolution is semi-decidable for First Order Logic: KB = P(f(x)) -> P(x) <=> ~P(f(x) v P(x) and let's say we're trying to prove P(a). Resolution refutation assumes the negated goal - ~P(a) and from ~P(f(x)) v P(x) we can derive P(f(a)) by substituting "a" for "x". But then we can go on and resolve again to get P(f(f(a))) etc. Does this contradict the claim that resolution refutation is complete? NO - because completeness states that any sentence Q that can be derived by resolution from a set of premises P must be entailed by P. If it is not entailed by P, then we might no be able to proof that!

Propositional calculus is decidable.

Horn Clause = clause with at most one positive literal (in Prolog: "q :- p_1, p_2, ..., p_n" stands for the Horn Clause "q v ~p_1 v ~p_2 v ... v ~p_n".

Prolog syntax is based on Horn clauses, which have the form of "p_1,p_2,...,p_n -> q". In Prolog, this is mapped to an "if-then"-clause: q :- p_1,p_2,...,p_n (i.e. "q, if p_1 and p_2 and ... and p_n)

This can be viewed as a procedure:
 * 1) A goal literal matches (unifies) with q;
 * 2) The tail of the clause "p_1 ... p_n" is instantiated with the substitution of values for variables (unifiers) derived from this match;
 * 3) The instantiated clauses serve as subgoals that invoke other procedures and so on.

Theorem-proving method of Prolog is resolution refutation (assume the negated hypothesis and try to resolve the empty clause) - if you succeed, then it's safe to assert the hypothesis, otherwise not. Resolution simply works on contradictory literals (e.g. {~p,q},{p} stands for "if socrates is a man (p) then he is mortal (q)" in CNF (p implies q is equivalent to ~p or q); now if we assume that socrates is indeed a man, then by resolution, this implies q).

If we have a goal q, then it might make sense to assert the negated goal for resolution refutation, which is essentially proof by reductio. This is a form of backward reasoning with sub-goaling: we assert the negated goal and try to work backwards, unifying and resolving clauses until we get to the empty clause, which allows us to claim that the theory implies our original hypothesis (by reductio).

Outline
Input = Query Q and a Logic Program P; Output = "yes" if Q follows from P, "no" otherwise; Initialize current goal set to {Q} While(the current goal set is not empty) do        Choose a G from the current goal set (first) Look for a suitable rule in the knowledge-base; unify any variable if necessary to match rule; G :- B1, B2, B3, ... If (no such rule exists) EXIT Else Replace G with B1, B2, B3...     If (current goal set is empty) return NO.    Else return YES. (plus all unifications of variables)

Cuts
Cuts (!) in Prolog are NOT sound!

Prolog itself (even if not considering the "failure by negation" (\+) and the cut is NOT complete.

Prolog uses Linear Input Resolution (resolve axiom and goal, then axiom and newly resolved subgoal, etc. and never resolve two axioms).

Algorithms in LISP
CDR yields rest of the list, CAR yields head of the list. Lisp programs are S-expressions containing S-expressions. So basically, a LISP program is a linked list processing linked lists.

Factorial
Prolog: factorial(1,1). factorial(N,Result) :- NewN is N-1, factorial(NewN,NewResult), Result is N * NewResult.

Tail recursion: factorial(N,Result) :- fact_iter(N,Result,1,1). fact_iter(N,Result,N,Result) :- !. fact_iter(N,Result,I,Temp) :- I < N,                              NewI is I+1, NewTemp is Temp * NewI, fact_iter(N,Result,NewI,NewTemp).

Lisp: (defun factorial (n)    (cond ((<= n 1) 1) (* n (factorial (- n 1)))))

Tail recursion: (defun fact_tail (n)    (fact_iter 1 1 n)) (defun fact_iter (result counter max)    (cond ((> counter max) result) (T (fact_iter (* result counter) (+1 counter) max))))

Fibonacci
Prolog: fib(1,1). fib(2,1). fib(N,Result) :- N > 2, N1 is N-1, N2 is N-2, fib(N1,F1), fib(N2,F2), Result is F1 + F2.

Tail recursion: fibo(N,Result) :- fib_iter(N,Result,1,0,1). fib_iter(N,Result,N,_,Result) :- !. fib_iter(N,Result,I,F1,F2) :- I < N,                  NewI is I+1, NewF1 is F2, NewF2 is F1+F2, fib_iter(N,Result,NewI,NewF1,NewF2).

Lisp: (defun fib (n)    (cond ((<= n 2) 1) (+ (fib (- n 1)) (fib (- n 2)))))

Tail recursion: (defun fib-tail (n)    (fib_iter 1 1 0 1 n)) (defun fib-iter (result counter f1 f2 max)    (cond ((> counter max) result) (T (fib-iter (+ f1 f2) (+1 counter) f2                     (+ f1 f2) max)))

Standard Recursion
Program calls itself recursively from within the program. Uses a stack to store intermediate states that "wait" for a result from a lower level. The recursion goes down to a stopping condition, which returns a definite result that is passed on to the next higher level until we reach the top level again. The final result is computed along the way.

Tail Recursion
In tail recursion, the recursive call is the last call in the program. This allows us to build up the result while we're going down in the recursion until we hit the bottom level; along the way, we compute the final result, such that it is available once we reach the stopping condition. "Smart" compilers recognize tail recursion and stop the program once we hit the bottom - but some compilers "bubble" the result up to the top level before returning it.

Other Examples
Flatten (defun flatten (thelist)       (if ((null thelist) nil) ((atom thelist) (list thelist)) (t (append (flatten (car thelist)))         (flatten (cdr thelist)))))

REVERSE (defun myrev (thelist)       (if ((null thelist) nil) (append (myrev (cdr thelist)) (list (car thelist))

DELETE ELEMENT (Prolog) del(X,[X|Tail],Tail). del(X,[Y|Tail],[Y|Tail1]) :- del(X,Tail,Tail1).

FLATTEN (Prolog) flat([],[]). flat([Head|Tail],Result) :- is_list(Head), flat(Head,FlatHead), flat(Tail,FlatTail), append(FlatHead,FlatTail,Result). flat([Head|Tail],[Head|FlatTail]) :- \+(is_list(Head)), flat(Tail,FlatTail).

Union set union([],Set,Set). union([Head|Tail],Set,Union) :- member(Head,Set), union(Tail,Set,Union). union([Head|Tail],Set,[Head|Union]) :- \+(member(Head,Set)), union(Tail,Set,Union).


text:
Talk:Spanish/Lesson 9

Please, write the full index, so we can complete it or edit

I am suggesting that the verb "ir" be taken out of the irregular past participle conjugation because "ido" is in fact created by dropping the infinitive ending ("ir" in this case), and adding "ido."

title: Talk:Spanish/Lesson 9


text:
JavaScript/Lexical structure

Summary

 * All elements of the language are case-sensitive, e.g.:  defines two different variables;   leads to a syntax error.
 * Single line comments are introduced by . Multi-line comments are surrounded with.
 * Semicolons for ending a statement are optional - with few exceptions.
 * The first character of a variable name cannot be a number:  leads to a syntax error.

Case Sensitivity
JavaScript is case-sensitive. This means that all keywords, variable names, and function names must be written consistently. If you create a function  it is different from the function ,  , or. Or, the statement  leads to a syntax error because the keyword   is defined in lower-case.

Whitespaces
Whitespace includes spaces, tabs, and line breaks. If there is a sequence of multiple whitespaces, JavaScript reduces them to a single whitespace, e.g: '   ' -> ' ', '\n\t' -> '\n'. This single remaining whitespace delimits the language elements like keywords and variable names, ... from each other. The resulting source code is hard to read for people but (a little) easier to parse by the browser. The main advantage is the smaller size of the code which must be transferred between server and client.

The following script is an example with very little whitespace.

The following is the same script with a typical amount of whitespace.

The following is the same script with a typical amount of whitespace.

The following is the same script with a lot of whitespaces.

Comments
Comments are parts of the source code that will - per definition - not be executed.

They allow you to leave notes in your code to help other people understand it. They also allow you to comment out code that you want to hide from the parser but you don't want to delete.

A double slash  turns all of the following text on the same line into a comment that will not be processed by the JavaScript interpreter.
 * Single-line comments

 * Multi-line comments

Multi-line comments start with  and end with the reverse. Multi-line comments don't nest.

Here is an example of how to use the different types of commenting techniques.

Semicolons
In many programming languages, semicolons are required at the end of each code statement. In JavaScript, the use of semicolons is optional, as a new line indicates the end of the statement (with some exceptions). This is called automatic semicolon insertion.

But the exceptions can be quite surprising. Automatic semicolon insertion can create hard to debug problems.

The above code is not interpreted as two statements. Because of the parentheses on the second line, JavaScript interprets the above as if it were

when instead, you may have meant it to be interpreted as

Even though semicolons are optional, it's preferable to end statements with a semicolon to prevent any misunderstandings from taking place.

Literals
A literal is a hard-coded value. Literals provide a means of expressing specific values in your script. For example, to the right of the equals sign:

There are several types of literals available. The most common are the string literals, but there are also numeric literals, booleans, undefined, null, regex literals, array literals, and object literals.

Examples of an object, a boolean, and a string literal:

Details of these different types are covered in Variables and Types.

Identifiers
An identifier is a name for a piece of data, such as a variable, array, or function. There are rules:
 * Letters, dollar signs, underscores, and numbers are allowed in identifiers.
 * The first character cannot be a number.

Examples of valid identifiers:

is an invalid identifier, as it starts with a number.

An example of 'identifiers' are variable names. They obey such rules.

 * Uppercase and lowercase letters, underscores, and dollar signs can be used.
 * Numbers are allowed after the first character.
 * Non-latin characters like "á" can be used in variable names as long as they have the Unicode properties "ID_Start" or "ID_Continue" for the start or rest of the name respectively. Special characters are not allowed.
 * Variable names are case sensitive: different case means a different name.
 * A variable may not be a reserved word.

Exercises

 * ... are available on another page (click here).

title: JavaScript/Lexical structure


text:
JavaScript/Bookmarklets

Bookmarklets are one line scripts stored in the URL field of a bookmark. Bookmarklets have been around for a long time so they will work in older browsers.

JavaScript URI scheme
You should be familiar with URL that start with schemes like http and ftp, e.g. http://en.wikibooks.org/. There is also the JavaScript scheme, which is used to start every bookmarklet.

Media controls
The values in these examples can be adapted as desired. One may replace  with   where applicable, meaning where an   tag is embedded.

 * Loop the video

Can be switched off using  or.

 * Jump to ten minutes (using multiplication):

 * Jump forward by one minute (sixty seconds):

 * Jump back by half a minute (using division):

 * Get duration of a video on the page in console:

 * Alert the duration:

 * Alert the playback time:

 * Set audio volume to 50%:

Unmute using  or.
 * Mute audio

 * Double the playback speed:

 * Ask for playback speed:

is necessary to prevent setting the value to zero if the dialogue window is closed without user input.

 * Ask for playback position in seconds:

 * Ask for playback position in minutes:

 * Ask for playback position in percentage (0 to 100):

Using multiple lines of code
Since you cannot have line breaks in bookmarklets you must use a semicolon at the end of each code statement instead.

The JavaScript Protocol in Links
The JavaScript protocol can be used in links. This may be considered bad practice, as it prevents access for or confuses users who have disabled JavaScript. See ../Best Practices/.

Examples
A large quantity of links may be found on bookmarklets.com, which show a variety of features that can be performed within JavaScript.

JavaScript/Skryptozakładki

title: JavaScript/Bookmarklets