OpenLLM-France/wikimedia huggingface dataset:
# Ruby Programming/XML Processing/REXML

REXML is a XML processing API. As of Ruby 1.8, it is included in the Standard API.
REXML can read and write XML documents. Validation against a DTD or a schema is not yet fully implemented.
Strong XML parsing gems exist as well, such as nokogiri and the hpricot gems. They work faster than REXML typically.

## Basics
### DOM
#### Definitions

Using the DOM API, REXML can parse documents and build a tree containing the elements, attributes, and texts.
For example, this might be used to save a wikibook:
In this case, the chapter is an element. It has an attribute title with the value Overview and a text with the value "Ruby is a programming language [...]".
The section is also an element. It has an attribute, too, but no text. Instead, it has an element, the chapter element.
In short, elements can have attributes, text and child elements.

#### Representation in REXML

When parsing a XML document, an instance of the REXML::Document class is created. (The new message of REXML::Document just has to be fed with a REXML::Document itself, or a String, or an IO.) This represents the whole document, including the <?xml...?> tag. REXML::Document itself is a subclass of REXML::Element, an important class.
When using DOM, instances of the Element class are representing the elements of the XML document. They might have attributes, accessible using the attributes message, text, and child elements.
The Document is an Element itself, but usually, you might be more interested in the root element of the XML document. As defined in the XML specification, any document has only one root element; it can be easily obtained calling REXML::Document.root.
Once you have obtained the root Element, you can go down the tree using the elements message defined in Element, which returns a collection of all child elements, or access attributes or texts, whatever you need.
The tree can be modified, too. In addition, the to_s methods have been overridden to return the XML code of elements, attributes and text. Element.to_s returns the XML code of the whole element, including attributes, text, and child elements' XML code. You can call that on the Document, too.

## External links

Standard API Documentation at ruby-doc.org, including the rexml package
# Ruby on Rails/ActionController
## ActionController - The Controller

* Actions
       Deal with different actions and see how URL can be translated to actions
* Parameters
       Learn how the user given data can be processed
* Sessions
       Manage sessions to store infos
* Cookies
       Handle cookies the "Rails way"
# Ruby on Rails/ActionController/Cookies
## Cookies

Of course you can work with cookies inside your Rails application. This is, again very similar to working with parameters or sessions. Consider the following example:
# Ruby on Rails/ActionController/Sessions
## Session

For a technical explanation of a Session take a look at the Wikipedia article about Sessions.
In Rails you have some options to store the session. Most of the time you want to store the session on the server, but with security-relevant data, you might want to consider storing the session inside a database. To change the session storage, edit config/initializers/session_store.rb and be sure to read on the RoR Website carefully.

### Work with your session

As with the parameters, Rails provides a simple way of accessing your session. Consider following example:
As you can see, you access the session in a similar way to the parameters. Storing a session isn't much more complicated:
To destroy the session, just assign it a nil-value

### Displaying a Flash-message

Flashes are very special and useful part of a session. You may have already found it in one of the view files. Here is how they work: As said, Flashes are special. They exist only once and are destroyed after each request. Flashes are useful to display error messages or notices to the user (e.g. when he tries to log in or if his request resulted in an error)
Inside an action flashes can be used similar to:
Inside the view you can access it like:
As illustrated in the example, you are not limited to a single flash. Multiple flashes can be accessed by their name you have defined inside the controller.
# Ruby Programming/Writing methods

← Data types | Classes and objects →

## Method definition

A method definition is started with the def keyword and ended with the end keyword. Some programmers find the method definition notation in Ruby very similar to the one of Python.
To define a method that takes a parameter, you can put the name of the variable in parantheses after the method name. When the method is invoked, the code in the method will be run with a local variable with the name of the specified parameter.
If you need multiple parameters you can separate them with a comma.

## Invoking methods

You can invoke methods with or without parentheses although it can be considered bad style if you omit them, so the safe way is to always write them in the beginning until you know when it's safe to leave them away.
If you want to invoke a method with parameters you need to put the parameter(s) between the brackets (or if you omit them, between the invisible brackets) and separate them with commas if there are more than one.
You can also use the value of a variable as a parameter.

## Default values

Often, a method may have parameters of which many, if not all, could have clever defaults. Having to specify all of the parameters every time you invoke the method can be an inconvenience. Because of this, it's possible to define default values. This can be actually quite easily; simply assign the parameter a value in the definition. You can combine parameters with and without default values.

## Returning values

You often want a method to return a value. You can do so by using the return statement.
However, because Ruby developers are lazy, they developed a feature that always returns the last evaluated statement (sometimes it's a bit tricky to know which one this is). Knowing this, you can turn the above example into the following:
Note that a return statement finishes the execution of a method. Combined with the fact that you can return without a value this is often useful to stop a method from further execution if certain conditions are met.

## See also

This page was only meant to give some introduction how to work with methods in Ruby because this is a very important concept. However there is a more detailed page about methods and some other cool things that weren't mentioned here.
# Ruby on Rails

Welcome to the Ruby on Rails book.
If you are interested in learning more about the Ruby language, then please go to the Ruby Programming book.
Ruby on Rails, or often seen as RoR is a contemporary web framework used by many web companies such as Twitter, Hulu and Kongregate. It allows developers to easily create and maintain applications with very little effort but huge functionality.

## Important Note

Rails command start with "rails" and not "ruby/script".

## Preface

* Introduction
* Contributors

## Getting Started
### Installation

* Install on Windows
* Install on OS X
* Install on Linux

### Concepts

* Don't repeat yourself
* Model-View-Controller
* Convention over Configuration

### First Application

* Creating the application
* Running the Server

## Built-In Rails Tools
### Generators

* Generators
* Make a generator

### Rake

* What is Rake anyway?
* Convenient Rake tasks
* Make your own rake tasks
* Command-Line Reference

## ActiveRecord - The Model

* Naming
* Migrations
* Associations
* Callbacks
* Validations
* Attributes
* Aggregations
* Calculations
* acts_as

## ActionView - The View

* Rendering and Redirecting
* Layout Files
* Forms
* Uploads
* Custom Helpers

## ActionController - The Controller

* Actions
* Parameters
* Sessions
* Cookies

## Routing

* Routing

## ActiveSupport

* ActiveSupport

## ActionMailer

* ActionMailer

## Examples

* Examples
* Generating valid HTML4.01

## Other Resources

* Other Resources
# Ruby Programming/XML Processing

REXML is the built-in library for this, strong gem competitors exist, such as nokogiri and the hpricot gems.
# DESCRIPTION:

If condition is TRUE, evaluates the block.
IF is a native value.

# ARGUMENTS:

* condition -- (Type: any)
* then-block -- (Type: block)

# REFINEMENTS:

* /else -- If not true, evaluate this block
** else-block -- (Type: block)
# DESCRIPTION:

Returns TRUE for image values.
IMAGE? is an action value.

# ARGUMENTS:

* value -- (Type: any-type)
# DESCRIPTION:

Evaluate a block while in a directory.
IN-DIR is a function value.

# ARGUMENTS:

* dir -- Directory to change to (changed back after) (Type: file)
* block -- Block to evaluate (Type: block)

# (SPECIAL ATTRIBUTES)

* throw
# DESCRIPTION:

Returns the index number of the current position in the series.
INDEX? is an action value.

# ARGUMENTS:

* series -- (Type: series port)

# REFINEMENTS:

* /xy -- Returns index as an XY pair offset.
# DESCRIPTION:

Converts HSV (hue, saturation, value) to RGB
HSV-TO-RGB is a native value.

# ARGUMENTS

* hsv -- (Type: tuple)
# Rebol Programming/info.gif

INFO.GIF is an image of value:
# DESCRIPTION:

Returns information about a file or url.
INFO? is a function value.

# ARGUMENTS:

* target -- (Type: file url)

# (SPECIAL ATTRIBUTES)

* catch
# DESCRIPTION:

Constructs an email object from an email message.
IMPORT-EMAIL is a function value.

# ARGUMENTS:

* data -- The email message (Type: string)

# REFINEMENTS:

* /multiple -- Collect multiple fields in header
** parent -- (Type: object)
# DESCRIPTION:

Returns the word in the object's context.
IN is a native value.

# ARGUMENTS:

* object -- (Type: object port)
* word -- (Type: any-word)
# DESCRIPTION:

Return true if a window contains a given face.
IN-WINDOW? is a function value.

# ARGUMENTS:

* window -- (Type: any)
* face -- (Type: any)
# Super Mario World/Enemies/Blurp

Blurp is a fish that can be found in all underwater courses. It will only swim in one direction and is often found to swim in formations. Fireballs and cape spin can defeat it, Yoshi can also eat it but it's harmless to Yoshi stomping into him.
# Super Mario World/Enemies/Bullet Bill

Bullet Bills are nefarious bullets fired at Mario or Luigi, either from a launcher, or randomly from the sides. They can be defeated by a regular jump or a cape spin.
# Super Mario World/Enemies/"Boo" Buddy

The Boo Buddies are small white ghosts found in Ghost Houses. If Mario is facing them, they will cover their faces and won't move. Turn away, and they will chase Mario. Boo Buddies sometimes appear in large numbers and can not be destroyed by any means. Some Boo Buddies turn into grey blocks when Mario faces them and he can use them as stepping stones.

## Resistance to attacks

* Normal Jump: Ineffective, will injure Mario.
* Spin Jump: Ineffective, but will not harm Mario.
* Jump with Yoshi: Ineffective. Yoshi is not allowed in Ghost Houses, but is allowed on the Sunken Ghost Ship.
* Fireballs: Ineffective
* Cape Spin: Ineffective.
* Yoshi's Tongue: N/A; Yoshi is not allowed in Ghost Houses.
* Yoshi's Fireballs: N/A; Yoshi is not allowed in Ghost Houses.

## Locations

* Ghost Houses
* Sunken Ghost Ship
# Super Mario World/Enemies/Blargg

Blargg is a bizarre dragon-like creature that dwells in lava. They usually appear in levels where Mario has to cross large lava expanses on skull rafts. Blargg usually announces his presence when his large white eyes peek out of the lava (some say the eyes look like a piranha plant). Blargg will make a lunge toward Mario, which can easily be avoided with a jump. If Mario is on Yoshi, Blargg is no threat because Yoshi can step over him, and if timed properly Yoshi can turn backward and swallow Blargg whole before he sinks into the lava again.
# Super Mario World/Enemies/Amazing Flyin' Hammer Brother

The Amazing Flyin' Hammer Brother is a Koopa that sits on a pair of flying blocks and throws hammers to both sides every time Mario comes near. The best attack is to time the approach and jump on the blocks from underneath.
# Super Mario World/Enemies/Bob-omb

Bob-ombs are tiny wind-up bombs. After a few seconds, they will explode harming Mario if he is on the blasts radius. They can be shot out of cannons. Use the spin jump to kill.
# Super Mario World/Enemies/Ball 'n' Chain

Ball 'n' Chain is exactly what the name suggests: a spiked ball attached to a block by a chain. The ball rotates around the block slowly. Mario can be damaged by the ball, but the chain has no effect at all. The block that the chain is attached to functions the same as any other solid block in the game.

## Locations

* Castle 2 (Morton's Castle)
* Castle 4 (Ludwig von Koopa's Castle)
* Castle 7 (Larry's Castle)
# Super Mario World/Enemies/Bony Beetle

Bony Beetle is an enemy found in castles and fortresses. It walks around and then hides pulling out spikes form it's back. If Mario touches the spikes, he is harmed. Invulnerable to fireballs and inedible by Yoshi. Best to avoid all together.
# Super Mario World/Enemies/Bowser

Bowser is the final boss of Super Mario World. He shoots five fireballs, and then throws Mecha-Koopas.
In the battle, Toadstool appears giving the message "HELP!"
# Structural Biochemistry/Protein function/Heme group/Hemoglobin/AHSP
## AHSP Prevents Excess Free Alpha-globin Chains

Because alpha chains are coded for by four loci, compared to the two that code for beta chains, excess alpha chains are produced and must be stabilized in order to keep them in solution and prevent them from precipitating out. This is achieved by the production of an alpha hemoglobin stabilizing protein (i.e.-AHSP). This protein binds to the alpha chains in the same manner that the beta chains do and creates a soluble complex. It binds to the alpha hemoglobin as it’s produced and is then displaced by the beta hemoglobin produced which forms a more favorable and stable dimer. This way there is no excess alpha hemoglobin which would accumulate and precipitate out of solution.

## AHSP Assists in Tetramer Assembly

AHSP is important not only for dealing with newly synthesized excess α-globin, but also in the assembly of normal Hb tetramers. Studies now show that mice infected with mild α-Thalassemia, a condition which causes a deficit of α-globin and an excess of β-globin, still utilize AHSP. No AHSP was expected to be needed by these mice because there was no risk of excess α-globin accumulating and precipitating out, however, when the mice with no AHSP and α-Thalassemia were compared to both normal mice, and mice with α-Thalassemia and intact AHSP, they were far more anemic, showing AHSP has other roles besides stabilizing excess α-globin.

## Other Functions of AHSP

Besides being an important molecular chaperone in Hb assembly, AHSP may also provide an additional selective advantage to red cells under conditions of oxidative stress induced by drugs, because of its effects on preventing α-globin denaturation and promoting renaturation. AHSP may also be useful to red cells in iron deficiency in which heme availability is limited and apo-α-globin levels are increased and help stabilize red blood cells in the presence of environmental factors that alter Hb’s critical equilibrium.

## Sources

http://www.pubmedcentral.nih.gov/
Berg, Jeremy M. John L. Tymoczko. Lubert Stryer. Biochemistry Sixth Edition. W.H. Freeman and Company. New York, 2007.
# Structural Biochemistry/Protein function/Heme group/Hemoglobin/Affinity Constant

The affinity constant (also known as the association constant), K$_a$, is a numerical constant used to describe the bonding affinity of two molecules at equilibrium. In other words, this constant measures the molecular binding strengths between enzymes and substrates - more specifically: protein to protein, protein to ligand, protein to DNA, protein to metal ions, etc.
The binding of molecules can be described as
    $\mathrm {[S]+[E]} \rightleftharpoons \mathrm {C}$
the corresponding affinity constant would be
    $K_{a}={\frac {[C]}{[S][E]}}$
where [C] is the complex formed, [S] is the substrate, and [E] is the enzyme, ligand, or ion. Note that the affinity constant K$_a$ is not the acid equilibrium constant K$_a$. They are completely different constants.
The converse and more widely used of the two constants is the dissociation constant defined as K$_d$ and is the inverse of the affinity constant.
# Structural Biochemistry/Protein function/Heme group/Hemoglobin/Dissociation Constant

Equilibrium constant used in chemistry, biochemistry, and pharmacology. This constant describes the ability for a large complex to come apart — the larger the constant, the less likely the complex will stay together; the smaller the constant, the more likely the complex will stay together.
In acid and base studies, K$_a$ is used to describe the dissociation of hydrogen from an acid.
    $\mathrm {HA} \rightleftharpoons \mathrm {H} +\mathrm {A}$
Where HA is the acid (most of the time it is used to represent weak acids), H is the hydronium ion (H$^+$), and A is the conjugate base. The equilibrium constant equation for this reaction would be:
    $K_{a}={\frac {[H][A]}{[HA]}}$
In the study of proteins, K$_d$ is used to describe the interactions between either protein to protein, protein to ligand, and protein to DNA. The binding propensity can be described with the formula and the equation below:
    $\mathrm {C} \rightleftharpoons \mathrm {S} +\mathrm {E}$
where C is the complex, S is the substrate and E is the particular protein or material. This formula can be described with an equilibrium equation:
    $K_{d}={\frac {[S][E]}{[C]}}$
The inverse of the dissociation constant is the affinity constant.
# Structural Biochemistry/Protein function/Heme group/Globins

It is an ancient and diverse family of protein. The globins of microorganisms were ignored and discovered in 1930s and rediscovered in 1950. Modern focus on them has been inspired by their structural diversity and fine-tuning to fulfill discrete functions. at least three classes of microbial globin are recognized, all have the classic globins’ protein fold.
First is the myoglobin like haemprotein Vgb from the bacterium vitreoscilla, which is unique because of its ability to improve growth and metabolism for biotechnological gain in a variety of host cells, even though its physiological function is not well understood yet. It has roles in oxygen but the metabolism has not been proposed yet for the 2nd type of globin- truncated globins, that is disguished because it is 20-40 residues shorter than Vgb. the third and the most well understood one is called flavohaemoglobins, it was partly characterized in yeast. they are characterized by the presence of an additional domain with binding sites for FAD and NAD(P)H. they are widely spread in bacteria.
A full understanding of microbial globins promises advances in controlling the interactions of pathogenic bacteria with their animal and plant hosts, and manipulation of microbial oxygen transfer with biotechnological applications.

## References

http://www.ncbi.nlm.nih.gov/pubmed
# Tok Pisin/Verbs/traim

Tok Pisin > Verbs > traim

## Traim as a verb

Traim (alternate spellings: traiim, traeim) is a Tok pisin verb basically meaning to try.
Here are some examples of its use:
Sampela man i kisim ol prut na traim planim klostu long haus bilong ol. Some men took the fruits and tried to plant them next to their houses. (Masalai bilong Ailan Lep).
Planti man bilong Baluan i laik traim long painim dispela Ailan Lep. Many men from Baluan wanted to try to find this island called Lep. (Masalai bilong Ailan Lep).
Please note that here, the same author is using traim once without long, once with long.
Other examples:
Ol i bin traim long givim halivim... They tried to bring help... (Taim bilong toktok, Redio Ostrelia).
Ol wok ol i traim bilong mekim ol gavman i abrusim ... pasin bilong bagarapim rait bilong pipol. They tried to make the officials renounce... to their disrespect of people's rights. (Taim bilong toktok, Redio Ostrelia).
Here, the same speaker is using traim once with long, once with bilong.

## Traim as a noun

Traim can be nominalized. It then becomes a noun meaning: a try, a challenge, an ordeal, and in the Scriptures, temptation.
Examples:
Mipela i save yupela i painim kainkain traim long laip bilong yupela We know that you meet all kinds of ordeal in your life. (Catholic Bishop's Conference of PNG & SI, 2001).
Sambai long mipela long taim bilong traim, na rausim olgeta samting nogut long mipela. Protect us when we are in a time of temptation and take all bad things away from us. (The Lord's Prayer in Pidgin, litteral translation from Tok Pisin).
# Tok Pisin/Verbs

Tok Pisin > Verbs

## Verbs in Tok Pisin

There are basically two types of verbs in Tok Pisin: transitive and intransitive.
* In general, transitive verbs end in -im. Example: kisim (sampela samting), take, receive smth. They are exceptions.
* In general, intransitive verbs do not end in -im. Example: slip (long nait), sleep (at night)

### Transitive verbs

more about transitive verbs

### Intransitive verbs

more about intransitive verbs

### Some very common verbs of difficult use

Most verbs are easy to use for English speakers, but some of them may be puzzling because of their unexpected meaning or use.
Here are some of them:
* ken
* kolim
* save
* stap
* traim, traiim

## Nominalized verbs

Verbs can be nominalized. Examples:
* traim > 1. to try (smth); 2. a try, an ordeal
* askim > 1. to ask (smth); 2. a question.
# Tokelauan/Phrases
## You are a good child

    te tamalelei oo koe

## Listen here

    fakalogo mai

## You are a good girl

    te teine lelei oo koe