OpenLLM-France/wikimedia huggingface dataset:
# XQuery/Digital Signatures
## Motivation

You want to verify that a document sent to you has not been modified.

## Method

We will use the W3C Digital Signature standard. We will use the standard Java function to sign and verify the signature of a document.
Warning: This program is not working yet

## Creating a Local Keystore

To use the function you will need to create a local key store to store your information in. In production systems the key store is stored on an internal server but in this example we will store it in the eXist database as a binary file.
The following shell command shows how the keytool program that comes with the Java JRE can be used to generate a keystore file:
After you run this file put the /tmp/keystore.pem file into your file system /db/test/dig-sig/keystore.pem

## Adding a XQuery Function Wrapper Module

We will add a custom jar file to our $EXIST_HOME/lib/extensions area called x-krypt.jar. After this file has been loaded we need to add the following line to the $EXIST_HOME/conf.xml in the xquery/builtin-modules area (around line 780):

## Adding a Digital Signature to a File

After rebooting the server the following can be executed:

## Validating a Digital Signature

The same process that was used to sign an XML document can be used to verify its signature.
# XQuery/DocBook to HTML
## Motivation

You would like to convert DocBook documents to HTML format.

## Method

We will use an XQuery typewsitch transform that converts sample instance documents into an XQuery typeswitch module. To begin this process you can use any tool that generates an instance document from the XML Schema. You can then edit this document to include only the elements that you want to transform. You can then run this file through the tool to generate the typeswich XQuery module.

### Dispatch Function

Our main dispatch function will have the following structure:
Note the following:
* the transform function takes a sequences of nodes as a parameter and the typeswitch function is retuned for each of the nodes.
* the transform returns a sequence of items
* the default action is to copy the node from the input to the output. All nodes not in the case statement will be passed through without modification. You can change this default behavior by changing the type returned by default.
* for each of the elements, a separate function "element function" is called. If the elements are leaf elements they can just return the content of the leaf element. If they are not leaf elements the MUST call the transform for each subbranch they contain. By changing each function you can change what output is created by that element. This structure keeps your transform modular and easy to maintain.
* the namespace for each element is the Docbook namespace (db is the prefix associated with the DocBook 5 URL http://docbook.org/ns/docbook
* all elements not in the case statement will be returned with an "u" for unknown element wrapper. This makes them easy to spot when debugging.

### Structure of the element functions

Each element function has a simple structure. For example the <para> element might have the following structure:
This has the effect of converting all the <db:para> nodes into <p> nodes. Note that the input type is node and the return type is element. Also note that since <para> elements contain other sub nodes (elements and text) they are all processed by the recursive call to db2html:transform($node/node).
Here is a full list of the functions for the above module.

## Sample Conversion
### Input

To invoke the transform you simply pass the root node of the DocBook document to the function:
Note that you MUST put the root element that you want to transform after the doc function. Without this the doc function returns a document node that will not match any of the document case statements.

### Output
## References

Source code for this example on Google Code: http://code.google.com/p/xrx/source/browse/#svn%2Ftrunk%2F21-docbook-2-html
Chis Wallace has provided a tool that converts the XML Docbook into a typeswitch here: Generating Skeleton Typeswitch Transformation Modules
DocBook to HTML Typeswitch Transform
# The debugger

This section takes a brief look at the built-in debugger.
The key function is trace. To start and stop the debugger, use true or nil:
Used without arguments, it returns true if the debugger is currently active.
The trace-highlight command lets you control the display of the expression that's currently being evaluated, and some of the prompts. I'm using a VT100-compatible terminal, so I can use weird escape sequences to set the colours. Type this in at the newLISP prompt:
But since I can never remember this, it's in my .init.lsp file, which loads when you start newLISP. If you can't use these sequences, you can use plain strings instead.
The other debugging function is debug. This is really just a short-cut for switching tracing on, running a function in the debugger, and then switching tracing off again. So, suppose we want to run a file called old-file-scanner.lsp, which contains the following code:
This scans a directory and subdirectories for files previously modified 5 or more years ago. (Notice that the file ends with expressions that will be evaluated immediately the file is loaded.) First, switch tracing on:
Then load and start debugging:
Or, instead of those two lines, type this one:
Either way, you'll see the first expression in the walk-tree function highlighted, awaiting evaluation.
Now you can press the s, n, or c keys (Step, Next, and Continue) to proceed through your functions: Step evaluates every expression, and steps into other functions as they are called; Next evaluates everything until it reaches the next expression at the same level; and Continue runs through without stopping again.
If you're clever, you can put a (trace true) expression just before the place where you want to start debugging. If possible, newLISP will stop just before that expression and show you the function it's just about to evaluate. In this case, you can start executing the script with a simple (load...) expression - don't use debug if you want to skip over the preliminary parts of the script. I think newLISP usually prefers to enter the debugger at the start of a function or function call - you probably won't be able to drop in to a function part way through. But you might be able to organize things so that you can do something similar.
Here is how to drop into the debugger halfway through a loop. Here's a small portion of code:
Load it from file:
Notice how the function f1 appeared - you don't get a chance to see anything in f2. At the debugger prompt, you can type in any newLISP expression, and evaluate any functions. Here I've typed i to see the current value of that symbol. newLISP is happy to let you change the values of some symbols, too. You should be able to change the loop variable, for example. But don't redefine any functions ... if you try to pull the rug from underneath newLISP's feet you'll probably succeed in making it fall over!
The source code displayed by the debugger doesn't include comments, so if you want to leave yourself helpful remarks - or inspiration - when looking at your code, use text strings rather than comments:
# Introductory Agrometeorology/Agroclimatic Regionalization
## Agroclimate

It is defined as total of climatic condition rendering the possible economic cultivation of plant species, expressed either in the numerical value or qualitative terms based on their effects upon plant and soil.

## Agroclimatic regionalization

It is a scientific method or process of delineating the climatically homogenous area and evaluating the suitability of crops on those areas after full detail analysis of the climatic requirement of these crops.

## Crop Zonation

It is the process of distinguishing the area into different zones and classify them according to the suitability of different crops after the detail analysis of the climatic condition of that area and matching it with the climatic requirement of different crops.
← Micro-climate Modification · Human Influence on Climate →
# Introductory Agrometeorology
## About the book

This book has been created to provide theoretical knowledge in aspects of agrometeorology. Informations were extracted from different sources.
This book requires previous knowledge of science background. However, anyone interested can jump in and learn few topics.
Any comments in the discussion page will be cordially welcomed.
Happy Learning!!!

## Chapters

* Introductory Agrometeorology/Introduction
* Introductory Agrometeorology/Earth Atmosphere
* Introductory Agrometeorology/Solar radiation
* Introductory Agrometeorology/Atmospheric Temperature
* Introductory Agrometeorology/Atmospheric Pressure
* Introductory Agrometeorology/Soil temperature
* Introductory Agrometeorology/Soil moisture
* Introductory Agrometeorology/Wind and Humidity
* Introductory Agrometeorology/Evaporation and Precipitation
* Introductory Agrometeorology/Agrometeorological Normals for Crops
* Introductory Agrometeorology/Micro-climate Modification
* Introductory Agrometeorology/Agroclimatic Regionalization
* Introductory Agrometeorology/Human Influence on Climate
# Outdoor Education/Proposal
## Proposal
### The niche

There is a fairly small range of textbooks on the topic of outdoor education, typically North American. These books regularly go out of print, thus much good material is lost to the community. The proposed concept for this wikibook is to harness the outdoor education community knowledge to create a combined open outdoor education textbook for use in secondary- and tertiary-level outdoor education training.
Where good quality, freely usable content already exists online (e.g., on university websites), this book may simply link to that material. However, the book also provides a way to host materials which make appropriate textbook content.
Over time, books and articles which are out of print and/or for which copyright permission allows, may be converted and uploaded, providing they fit with the book structure. Original, intact previous publications are, however, probably best uploaded to WikiSource. Content uploaded into wikibooks should be editable and modifiable.

### What this book is

* An introduction to outdoor education.
* A free culture text which covers the major topics in outdoor education.
* Targetted for people studying outdoor education or training to be outdoor educators.

### What this book is not

* Commercial
* Lessons plans - such content would be more appropriate on the accompanying outdoor education wikiversity page.
# Outdoor Education/Groups and leadership

Whilst solo outdoor experiences and outdoor education do occur, most outdoor education occurs within the context of small groups guided by designated leaders. Thus, the study of group behaviour, leadership, and facilitation are important aspects of understanding outdoor education.
# Outdoor Education/Scope of outdoor education

This chapter describes what outdoor education is and isn't, definitions, similar terms and concepts, and how the meaning/interpretation of outdoor education may have varied over time and across cultures.

## Definitions

There are many definitions of outdoor education, e.g.,:
* Outdoor education involves experiential learning in, through, and about natural environments.
* Knapp stated that Place-Based Education is also known as environmental education, outdoor education, service learning, or experiential education (2005, p. 278).
Key sources for more information about the definition of outdoor education include:
* w:Outdoor education#Definitions
* Neill (2006) provides a list of definitions of outdoor education.
* Priest (2004) provides definitions of adventure programming terms.
* The Definitions project was a year long project of 26 USA Federal Agencies and Non-profit Associations looking at definitions related to environmental education, interpretation, experiential education, outdoor education and related terms.

## Tasks

* Revise w:Outdoor education#Scope
* Transfer relevant content to here
* Add refs from w:Outdoor education#Scope to here
# Outdoor Education/Definitions

There are many definitions of outdoor education, e.g.,:
* Outdoor education involves experiential learning in, through, and about natural environments.
* Knapp stated that Place-Based Education is also known as environmental education, outdoor education, service learning, or experiential education (2005, p. 278).
Key sources for more information about the definition of outdoor education include:
* w:Outdoor education#Definitions
* Neill (2006) provides a list of definitions of outdoor education.
* Priest (2004) provides definitions of adventure programming terms.
* The Definitions project was a year long project of 26 USA Federal Agencies and Non-profit Associations looking at definitions related to environmental education, interpretation, experiential education, outdoor education and related terms.
# Outdoor Education/History
## See also

* Outdoor education - history
# Outdoor Education/Experiential learning
## See also
### Wikibooks

* Foundations of Education and Instructional Assessment
* Learning Theories

### Wikipedia

* Experiential education
* Experiential learning
# Outdoor Education/Risk and safety
## Case studies

* New Zealand Canyoning tragedy, 2008

## See also

* First Aid
# Outdoor Education/Wishlist

* Copyright free images
** Wikimedia Commons, a repository of freely-licensed media
** flickr cc search
* Copyright free content
** US Government sources (training manuals for the military etc)
** Wilderdom provides free culture OE material
* Authors
* Editors
* Students to work on this as a project
* Reviewers
# Outdoor Survival
## Before you go

* Be ready. Tell people where you are going and how long you will be there before you leave.
* Bring a survival kit.

## In an outdoor survival emergency

* Do not panic — This can lead to making very bad choices. Sit down and relax or hug a tree. All is not lost — human beings are very resourceful, and many people have survived despite impossible odds. Think of home, family, and loved ones. Calmly take stock of your resources. (Even things like the stuffing in your car seat can save your life by helping to insulate your clothes.
* Deal with immediate first aid issues.
* Find a phone — Your next priority is to use a phone if you know for sure where one is.
* Keep warm — The most important priority in surviving outdoors is keeping warm. Thirst and hunger may kill you over the course of several days, but hypothermia can kill you in minutes. Furthermore, a low body temperature can severely impair your judgment, one of the worst things that can happen in a survival situation.
* If you are lost and have no idea where to go, stay where you are! The farther you move without knowing where you're going, the harder it will be for searchers to find you. If you must leave the area, leave a note about your plans or at least leave a sign indicating the direction you are traveling. If you don't know which way to go, walk downhill until you find water and then follow the water.
* Your next order of priorities is shelter, water, signals, and food. (note: fire when possible may be part of keeping warm, purifying water, and signaling)

## Contents

* Survival Kit
* Shelter
* Water
* Fire
* Signals
* Food
* Preparedness
* Emergency Situations
* First Aid

## Related Wikibooks

* First Aid
# Outdoor Education/Environment

The physical environment is an intrinsic and essential aspect of outdoor education. It is also one the most contested and discussed aspects, and has stimulated some of the most passionate and eloquent viewpoints and debates.
# Organic Chemistry/Organometallics

Organometallics is the branch of chemical science studying the chemistry of molecules that have direct carbon-metal bonds.  (Dec 30, 2005)

## Main group organometallic chemistry
### Alkali and alkaline earths organometallic

* Li, Na, K organyls
* Be organyls
* Mg organyls

### Silicon group

* Si organyls
* Ga organyls

### Pb, Sb, Sn, Hg
## Transition-metal organometallic chemistry

The organometallic chemistry of the transition elements is quite different from the main-group ones due to the availability for bonding of the n d orbitals with consequent ability for the central atom to change geometry and expand the octet.
Crystal field theory

### Single σ-bonding

* M-alkyl

#### β-elimination
### π-acceptor bonding
#### CO complexes

* σ *→d$_σ$
* d$_π$→π *
These interactions are synergicin increading the M-CO bond strength. In fact, the second interaction, as known as pi backbonding increases the available electron density on the CO.
The partial filling of the π* orbital leads to a weakened C-O triple bond, as showed from the stretching frequencies (in cm$^{-1}$) of CO free and in M/CO complexes.
| free CO | 2143 |
| V(CO)$_6$ | 1976 |
| Ni(CO)$_4$ | 2057 |
| Cr(CO)$_6$ | 2000 |

#### Carbenes and carbynes compounds
##### Fischer carbenes

By treatment of a CO complex with a strong nucleophile

##### Schrock carbenes
## Catalysis by organometallic compounds
### Metathesis

Richard Schrock(MIT, USA) and Robert Grubbs (CalTech, USA) received 2005 Nobel prize for their work on the subject. Metathesis is the exchange of the termination between two alkenes
It occurs via the carbene species nowaday known as Schrock's carbenes
* ^ Grubbs, Olefin metathesis, Tetrahedron

### Ziegler-Natta polymerisation

Ziegler-Natta catalyst Ziegler in the 40's worked on the oligomerisation of ethylene by aluminium alkyls via the reaction HAl-R + CH$_2$=CH$_2$ -> HAl-CH$_2$CH$_2$-R

### Enantioselective hydrogenation

Wilkinson's

### Hydroformylation

Hydroformylation Hydroformylation is the process that transforms an alkene into an aldehyde by reaction with CO.
The catalyst is a hydridocarbonyl complex, HCO(CO)$_5$

### Fischer-Tropsch synthesis

Fischer-Tropsch synthesis is the heterogeneously-catalysed formation of hydrocarbons (alkanes and alkenes) from CO and hydrogen (synthesis gas). It can be seen as the inverse of synthesis gas preparation (although this is usually from methane and lighter hydrocarbons). It is the heart of the gas-to-liquids processes developed commercially by big petrochemical firms in the 90's.

## Organometallics in living systems

The only example of a biological molecule containing direct carbon-metal bonds is cobalamin, as known as vitamin B$_{12}$
# Organic Chemistry/Introduction to reactions/Transition states

Introduction to Reactions

## Transition State

Many reactions occur in a single step when two reactant molecules collide with sufficient energy in the proper spatial orientation to create a product. Many other reactions, however, do not occur in a single step, and such reactions are said to have transition states. Multistep reactions have products that result from a series or chain of reactions, and these reactions are the kind that actually do pass through a transition state.

## Intermediate Molecules

Multi-step reactions have an intermediate molecule that forms as a sort-of halfway point between the reactant and the product. This intermediate molecule cannot be isolated in solution, because it is typically of much higher energy than either the reactants or the products. However it does have a finite lifetime before it reacts.
At a basic level of organic chemistry the intermediate molecule is often merely predicted or assumed, but many are also known to exist due to experimental observations in the laboratory. Racemization of molecular configuration without another, more plausible explanation is one type of proof that certain reactions pass through a transition state.
   EXAMPLE: In a 1st order nucleophilic substitution (S$_N$1 reaction) the chirality of a carbon is "flipped" from S to R configuration (or vice versa) 50% of the time, leading to a racemic product (assuming it is chiral). This is because the chiral carbon becomes achiral in the carbocation intermediate, due to the sp$^2$ carbon center that is flat and thus subject to nucleophilic attack from either the top or the bottom. If there were no intermediate, simple retention or inversion would be expected 100% of the time. This type of racemization during an S$_N$1 reaction may be seen as evidence of a carbocation intermediate.

## Energy Diagrams and Transition States

Observing energy diagrams of reactions, you may notice that instead of a single peak energy, the energy peaks, drops a little, peaks once again and then returns to a lower energy state for the product. The "saddle" (minimum) between the two peaks represents a reaction intermediate - a place where the reaction temporarily "rests" between energy peaks. The energy peaks (maxima) are defined as 'transition states' with no finite existence.
# Organic Chemistry/Isocyanate

Organic isocyanates have the formula R-N=C=O where R can be either alkyl or aryl. They can be solids or liquids. Isocyanates are generally toxic and must be handled with great care, especially the more volatile isocyanates where inhalation is a primary route of exposure.
Isocyanates are usually produced by reacting an amine with phosgene (COCl2):
${\ce {R-NH2 + COCl2 -> HCl + R-NH-(C=O)Cl -> HCl + R-N=C=O}}$
They are very reactive molecules, reacting with nucleophiles such as water, alcohols or amines. The reactions involve attack at the carbon of the isocyanate in a manner similar to that for carboxylic acid derivates such as esters or anhydrides.
Water reacts with isocyantes to give a carbamic acid. This reaction is catalyzed by tertiary amines. Carbamic acids are unstable and decompose to carbon dioxide and an amine, R-NH2
${\ce {R-N=C=O + H2O -> R-NH-(C=O)-OH -> RNH2 + CO2}}$
Alcohols react with isocyanates to give carbamates which are also known as urethanes. This reaction is catalyzed by tertiary amines or salts of metals such as tin, iron and mercury.
${\ce {R-N=C=O + R'-OH -> R-NH-(C=O)-O-R'}}$
Primary and secondary amines react with isocyanates to give substituted ureas.
${\ce {R-N=C=O + R'R''NH -> R-NH-(C=O)-NR'R''}}$
R' and R" can be H, alkyl or aryl
Isocyanates themselves to give dimers and trimers.
# Organic Chemistry/Phenols

Phenols are compounds consisting of a hydroxyl group (OH) and an aromatic carbon ring. Phenols can be found in nature as well as made synthetically. One simple example of a phenol compound is a compound aptly named phenol.

## Methods of preparation of phenol

When sodium benzene sulphonate is fused with sodium hydroxide at 573-673k ,sodium phenoxide forms. This on acidification gives phenol. Phenol can also be produced from coal tar.

## References

* Phenol on Encyclopedia Britannica
# Organic Chemistry/Introduction to reactions/Review of nucleophilic substitution

* Mechanism shared by S$_N$1 and S$_N$2
* R-X (electrophile) + Nu- (nucleophile) -> Nu-R (product) + X- (leaving group)
Remember, S$_N$1 and S$_N$2 are the same reaction just undergoing a different mechanism.
* S$_N$1 quick sheet
* rate-determining step is unimolecular
* has carbocation intermediate
* favored by tertiary carbons that can support carbocation
* works better in a polar protic solvent (solvation effect)
* tertiary >> secondary electrophile
* S$_N$2 quick sheet
* rate-determining step is bimolecular
* no carbocation intermediate
* nucleophile assists leaving group
* works better in a polar aprotic solvent
* methyl > primary >> secondary elecrophile
* steric effects important, favoring small nucleophiles
# Organic Chemistry/Introduction to reactions/Zaitsev's rule

Zaitsev's (sometimes spelled "Saytzeff") rule: In elimination reactions, the major reaction product is the most substituted alkene. The most substituted alkene is also the most stable.
Read about Alexander Mikhailkovich Zaitsev, the chemist on Wikipedia.
# Organic Chemistry/Introduction to reactions/THF

THF stands for Tetrahydrofuran, and is a common ether-type solvent.

## Structure

It is a 5 membered ring containing 4 carbons and one oxygen. It is very inert and thus makes a good solvent for many reactions.

## Reactions

* Oxymercuration/demercuration