OpenLLM-France/wikimedia huggingface dataset:
# Statistical Thermodynamics and Rate Theories/Translational partition function
### Derivation of Translational Partition Function

A Molecular Energy State or is the sum of available translational, vibrational, rotational and electronic states available. The Translational Partition Function gives a "sum over" the available microstates.
$q_{trans}=\left({\frac {2\pi mk_{B}T}{h^{2}}}\right)^{3/2}V$
The derivation begins with the fundamental partition function for a canonical ensemble that is classical and discrete which is defined as:
$q=\sum _{j}^{\infty }e^{-\beta \epsilon _{j}}$
where j is the index, $\beta ={\frac {1}{k_{B}T}}$ and $\epsilon _{j}$is the total energy of the system in the microstate
For a particle in a 3D box with length $L$, mass $m$ and quantum numbers $n_{x},n_{y},n_{z}$ the energy levels are given by:
$\epsilon _{n_{x},n_{y},n_{z}}={\frac {h^{2}}{8mL^{2}}}(n_{x}^{2}+n_{y}^{2}+n_{z}^{2})$
Substituting the energy level equation $\epsilon _{n_{x},n_{y},n_{z}}$ for $\epsilon _{j}$ in the partition function
$q_{trans}=\sum _{j}^{\infty }e^{-\beta [{\frac {h^{2}}{8mL^{2}}}(n_{x}^{2}+n_{y}^{2}+n_{z}^{2})]}$
$q_{trans}=\sum _{n_{x},n_{y},n_{z}=1}^{\infty }e^{-\beta [{\frac {h^{2}}{8mL^{2}}}(n_{x}^{2})]}e^{-\beta [{\frac {h^{2}}{8mL^{2}}}(n_{y}^{2})]}e^{-\beta [{\frac {h^{2}}{8mL^{2}}}(n_{z}^{2})]}$
Using rules of summations we can split the above formula into a product of three summation formulas
$q_{trans}=\sum _{n_{x}=1}^{\infty }e^{-\beta {\frac {h^{2}}{8mL^{2}}}(n_{x}^{2})}\sum _{n_{y}=1}^{\infty }e^{-\beta {\frac {h^{2}}{8mL^{2}}}(n_{y}^{2})}\sum _{n_{z}=1}^{\infty }e^{-\beta {\frac {h^{2}}{8mL^{2}}}(n_{z}^{2})}$
Defining the dimensions of the box (Particle In A Box Model) in each direction to be equivalent $n_{x}=n_{y}=n_{z}$
$q_{trans}={\Bigg\sum _{n=1}^{\infty }e^{-\beta {\frac {h^{2}}{8mL^{2}}}(n^{2})}{\Bigg ]}^{3}$
Because the spacings between translational energy levels are very small they can be treated as continuous and therefore approximate the sum over energy levels as an integral over n
$\sum _{n=1}^{\infty }e^{-\beta {\frac {h^{2}}{8mL^{2}}}(n^{2})}\approx \int _{0}^{\infty }e^{-\beta {\frac {h^{2}}{8mL^{2}}}(n^{2})}\,dn$
Using the substitutions $\alpha =\beta {\frac {h^{2}}{8mL^{2}}}$ and $n=x$ The integral simplifies to
$\int \limits _{0}^{\infty }e^{-\alpha x^{2}}\,dx$
From The list of definite integrals the simplified integral has a known solution:
$q_{trans}=\int \limits _{0}^{\infty }e^{-\alpha x^{2}}\,dx={\frac {1}{2}}{\sqrt {\frac {\pi }{\alpha }}}$
Therefore,
$q_{trans}={\Bigg{\frac {1}{2}}{\sqrt {\frac {\pi }{\alpha }}}{\Bigg )}^{3}$
Re-substituting $\alpha =\beta {\frac {h^{2}}{8mL^{2}}}$ and $\beta ={\frac {1}{k_{B}T}}$
$q_{trans}={\Bigg{\frac {1}{2}}{\sqrt {\frac {\pi }{\beta {\frac {h^{2}}{8mL^{2}}}}}}{\Bigg )}^{3}$
$q_{trans}={\Bigg{\sqrt {\frac {2\pi mk_{B}TL^{2}}{h^{2}}}}{\Bigg )}^{3}$
Since $L$ is length and $L^{3}=V$
$q_{trans}={\Bigg{\frac {2\pi mk_{B}T}{h^{2}}}{\Bigg )}^{3/2}V$
# Statistical Thermodynamics and Rate Theories/Vibrational partition function of a diatomic molecule

The general form of the molecular partition function is an infinite sum which is open form, making it difficult to calculate, this is why the sum is approximated as a closed form which leads to an algebraic equation. The derivation of the closed form on the equation is as follows:
The open form of the vibrational partition function:$q_{vib}=\sum _{j}g_{j}\exp \left({\frac {-\epsilon _{j}}{k_{B}T}}\right)$
solving for $\epsilon _{j}$
$\epsilon _{j}$$=E_{j}-E_{0}$
$\epsilon _{j}$$=$$h\nu$ $(j+{\frac {1}{2}})$$-h\nu$$(0-{\frac {1}{2}})$
$\epsilon _{j}$$=h\nu$$j$$-$ ${\frac {1}{2}}$ $h\nu$$-$${\frac {1}{2}}$$h\nu$$=h$$\nu$$j$
(where j=0,1,2...)
and by substituting $g_{j}$$=1$ (i.e., singly degenerate) into the summation for $q_{vib}$ the resulting equation is:
$q_{vib}=\sum _{j=0}^{\infty }$$\exp \left({\frac {-h\nu j}{k_{B}T}}\right)=\sum _{j=0}^{\infty }[\exp \left({\frac {-h\nu }{k_{B}T}}\right)]^{j}$ The j is taken outside the brackets by the common exponent rule: $\exp(ab)=\exp(a)\exp(b)$
Note that $E_{n}$$=$$h\nu (n+{\frac {1}{2}})$ is the equation that represents the energy levels of a harmonic oscillator which is used to approximate the vibrational molecular degree of freedom. The vibrational zero point energy is not negligible and must be defined at n=0.
Next, in order for the open system to be converted into the closed system, the equation must take the form of a geometric series identity, like in calculus.
if x<1, $\sum _{i=0}^{\infty }$$x^{i}$$=$ ${\frac {1}{1-x}}$
This is done by first letting $e^{\left({\frac {-h\nu }{k_{B}T}}\right)}$ $=x$
Then, $q_{vib}=\sum _{j=0}^{\infty }$ $x^{j}$
this converges when x<1, giving ${\frac {1}{1-x}}$ and by replacing x with the original expression, you have:
$q_{vib}=$${\frac {1}{1-\exp \left({\frac {-h\nu j}{k_{B}T}}\right)}}$
where $\nu$ is the vibrational frequency of the molecule, which can by found by the following equation: $\nu$=${\frac {1}{2\pi }}$$\left({\frac {k}{\mu }}\right)^{\frac {1}{2}}$
where k is the spring constant of the molecule and $\mu$ is the reduced mass

### Example

Calculate the population of the ground vibrational state of $N_{2}$ at 298.15 K. ($\nu =7.072\times 10^{13}s^{-1}$)
    $q_{vib}={\frac {1}{1-\exp \left({\frac {-h\nu j}{k_{B}T}}\right)}}$
$={\frac {1}{1-\exp \left({\frac {-(6.626068\times 10^{-34}Js\times 7.072\times 10^{13}s^{-1}}{1.3807\times 10^{-23}JK^{-1}\times 298.15K}}\right)}}=1.000011$
Next the Probability of the ground state can be calculated: $P_{0}={\frac {\exp \left({\frac {-E_{0}}{k_{B}T}}\right)}{q_{vib}}}={\frac {\exp(0)}{1.000011}}=0.999998$
This means that 99.9998% of all $N_{2}$ molecules are in the ground vibrational state at 298.15 K.
# Statistical Thermodynamics and Rate Theories/Tips for deriving relations with partition functions
## Use the rules of logarithms

You can use the rules of logarithms to isolate terms.
    ${\textrm {ln}}(ab)={\textrm {ln}}(a)+{\textrm {ln}}(b)$
    ${\textrm {ln}}\left({\frac {a}{b}}\right)={\textrm {ln}}(a)-{\textrm {ln}}(b)$

### Example
## Derivatives of Constants are Equal to Zero

If you are taking a derivative of a function, you can use the rules of logarithms to isolate a term that depends on that variable. Now, you only need to take the derivative on this term. the derivatives of all other terms will be zero
    ${\frac {\partial {\textrm {ln}}(xy)}{\partial x}}={\frac {\partial {\textrm {ln}}(x)}{\partial x}}+{\frac {\partial {\textrm {ln}}(y)}{\partial x}}$
    ${\frac {\partial {\textrm {ln}}(xy)}{\partial x}}={\frac {\partial {\textrm {ln}}(x)}{\partial x}}+{\frac {\partial {\textrm {ln}}(y)}{\partial x}}$
    ${\frac {\partial {\textrm {ln}}(xy)}{\partial x}}={\frac {\partial {\textrm {ln}}(x)}{\partial x}}+0$
    ${\frac {\partial {\textrm {ln}}(xy)}{\partial x}}={\frac {\partial {\textrm {ln}}(x)}{\partial x}}$
# World of Dinosaurs/Geoscience

Geoscience is the study of earth.
# World of Dinosaurs/Dinosaurs Through Time

Here we show a rough schematic of the TIMETREE of dinosaurs as they proliferated throughout the Mesozoic.
Fossils from Triassic rocks show few dinosaurs, and these animals are relatively small and basal in their anatomy. Dinosaur fossils are much more common, and show greater animal diversity, in Jurassic rocks. Finally, the most famous and culturally iconic dinosaurs (Tyrannosaurus, Triceratops, etc.) are known from fossils in Cretaceous rocks.
# World of Dinosaurs/Diplodocus
## Basics

Diplodocus means "Double Beam".
This refers to tail vertebrae having two chevrons on them.
Diplodocus lived during the Jurassic Period.

## Anatomy

They are one of the longest dinosaurs ever.
They have very small heads (2 feet) compared to the 85 feet of its total body.
They had peg shaped teeth.

## Phylogeny

Diplodocus are sauropods.
All sauropods are dinosaurs.
All dinosaurs are amniotes and all dinosaurs are tetrapods.
# World of Dinosaurs/Eoraptor
## Basics

A basal dinosaur related to the last common ancestor of sauropods and theropods.
# World of Dinosaurs/Genosaurs

The clade of dinosaurs that had the derived trait of chewing were called Genosaurs.

## Genosaurs

The name means "Cheek Lizards".
* Genosaurs include almost all the most recognizable herbivores except for the long-necked sauropods.
** Armored thyreophorans
** Duck-billed ornithopods
** Horned marginocephalians
For more information on these, see Dinosaur Clades of Interest.
# Turkish/Asking Questions

Don't worry about the length of the lesson this time. Unlike last lesson, this will just be a short, basic grammar lesson teaching you how to form questions in Turkish.

## Question words

Before we can start asking questions, let's learn some question words:
* Ne? - What?
* Nerede? - Where?
** Nereden? - From where?
** Nereye? - To where?
* Ne zaman? - When?
* Neden?/Niye? - Why?
* Hangi? - Which?
** Hangisi? - Which one?
* Kim? - Who?
** Kimin? - Whose (is it)?
** Kime? - To whom?
* Nasıl? - How?
** Ne kadar? - How much?/How many?
** Ne kadar zaman kaldı? - How long left?

### Incorporation

Let's try and incorporate these words into sentences.
* Senin adın ne? - What is your name?
* Kumanda nerede? - Where's the remote?
** Nereden geldin? - Where did you come from?
** Nereye gidiyorsun? - Where are you going (to)?
* O evden ne zaman çıktı? - When did he leave the house?
* Sen neden/niye kurabiyeyi kurabiye kavanozundan çaldın? - Why did you steal the cookie from the cookie jar?
* Bugün hangi elbiseyi giyineceğim? - Which dress am I going to wear today?
* Hangisi senin? - Which one is yours?
* O kim? - Who is that?
** O kimin? - Whose is that?
** O hediyeyi kime gönderiyorsun? - Who are you sending that present to?
* Onu nasıl göndereceksin? - How are you going to send it?
** O ne kadardı? - How much was it?
** Evden çıktığına kadar ne kadar zaman kaldı? - How long left until you leave the house?
Some of these examples are of the perfect (past) tense. We'll touch on those later.

## Conditional questions

In other words, a question which could be answered either with a positive or a negative response (e.g. Did you go shopping yesterday?).
In Turkish, it's a little different.
Let's use the verb gitmek-to go as an example for this demonstration.
Sen gidiyorsun is you're going.
All you do to make it are you going? is this:
You add a -mı-, a -mi-, a -mü- or a -mu- in between the -yor- and the suffix (-yum, -sun, etc.), depending on the vowel harmony, as so:
Sen gidiyor musun? - Are you going?
However, it's different with some other people. Let's conjugate it fully:
| to go | gitmek |
| Am I going? | (Ben) gidiyor muyum? |
| Are you going? | (Sen) gidiyor musun? |
| Is he/she going? | (O) gidiyor mu? |
| Are we going? | (Biz) gidiyor muyuz? |
| Are you (pl.) going? | (Siz) gidiyor musunuz? |
| Are they going? | (Onlar) gidiyor mu?, (Onlar) gidiyorlar mı? |
As you can see, the pattern applies to almost all cases, except for he/she, because it doesn't have a suffix. Therefore, all we do is add a mı, mi or mu afterwards, but as a separate word.
Now that we've covered all of this, let's continue to the next lesson. We'll learn more about questions later on.
# Turkish/Big Vocabulary
#### Nouns - İsimler

* Man - İnsan
* Family - Aile
* House - Ev
* Groceries - Yiyecek
* Hygiene - Hijyen
* Clothing - Giysi
* School - Okul
* Office - Ofis
* Professions - Meslekler
* Town - Şehir
* On the voyage - Yolculuğunda
* Plants - Bitkiler
* Animals - Hayvanlar
* Precipitation - Yağış
* Art, sport & fun - Resim, spor & eğlence
* Colors - Renkler
* Orientation - Oryantasyon
* 4 seasons - 4 mevsim
* Calendar - Takvim
* Astronomy - Astronomi
* Horoscope - Burç
* Some abstract nouns - Bazı soyut isimler

#### Adjectives - Sıfatlar

* Man - İnsan
* Some adjectives - Bazı sıfatlar
* Units for time - Zaman birimi
* The day - Gün

#### Verbs - Fiiller

* Some verbs in common use - Ortak kullanım bazı fiiller
# Turkish/Causative

The causative voice is the second productive voice in Turkish. It is very productive, meaning almost any verb can receive it. It is used to make an intransitive verb transitive, or to make an already transitive verb causative.

## Formation

The causative voice is quite irregular compared to other features of Turkish grammar. The main ending used for this is -dır-, with respect to 4-way vowel harmony as well as consonant harmony.
Verbs with more than one syllable that end in a vowel, r or l take the ending -t instead.
This doesn't apply to verbs with a single syllable.
There are around 30 irregular monosyllabic words that take a different ending instead.
Finally, there are some verbs with totally irregular causative forms.
Compound verbs with olmak use etmek as their causative form. When olmak means "to become", yapmak is used as its causative form instead, but old publications may use etmek and kılmak as well.
| Takımımız mağlup oldu. | Karşı takımı mağlup ettik. |
| Büyüyünce öğretmen olacağım. | Seni büyüyünce öğretmen yapacağız. |

### Combining with other suffixes

The causative suffix may combine with any other verbal suffix, and always comes first before any other suffixes.
* Yaptırılınca
* Söyletilemeyebilirmiş

## Usage

The causative is used to express that the subject isn't doing the action by themselves, but causing someone else to do it. It can be translated to English as let someone do, have something done, make someone do.

### With intransitive verbs

Intransitive verbs become transitive in the causative voice. The object, which is in accusative, is the thing actually performing the action, while the subject is merely causing the object to do the action.
* Bu film beni kusturacak. This film will make me throw up.
* Kedim tavşanımı öldürmüş. My cat has killed my rabbit.

### With transitive verbs

Transitive verbs in the causative voice take two objects instead. The real object is marked in accusative, and the entity performing the action is in the dative.
* Öğretmenin karneni bana okuttu. Your teacher has made me read your school report.
* Ahmet sodasını bir yabancıya açtırdı. Ahmet made some stranger open his bottle of soda.

### Double causative verbs

While it is very possible to attach the causative voice suffix twice to mean make someone make someone else do something, in casual speech, multiple causative endings may be attached to a verb for absolutely no reason whatsoever. This is especially preferred when the causee is expressed using a dative object.
* Ödevini bana yaptırtma. Don't make me do your homework.
# Turkish/Big Vocabulary/Family

Family is very important thing for every people. Turkish people, like every other people in the world, are very closed to each other in the family, especially in minor town. Here are the words which contains family members. Here it goes!
| brother | kardeş or abi |
| children | çocuklar |
| cousin | kuzen |
| daughter | kız (it also means girl) |
| father | baba |
| father-in-law (both for father's dad and mother's dad) | kayınbaba |
| granddaughter | kız torun |
| grandfather | dede or büyükbaba (it means literally big dad) |
| grandmother | büyükanne - it is good to now that if you are referring father's mother you will say babaanne and when you are referring mother's mother then you will say anneanne |
| grandson | torun |
| husband | koca |
| mother | anne or ana |
| mother-in-law | kaynana |
| nephew or niece | yeğen |
| parents | ebeveyn |
| relatives | akraba |
| sister | kız kardeş or abla |
| son | oğul - but when you referring my son you will say oğlum or his/her son oğlu or their son onların oğlusu |
| wife | karı or eş |
# Turkish/Big Vocabulary/House
### House - Ev

In this vocabulary chapter, you will see some common words which describes parts of a house. I will also give examples with adjectives and sentences. Some South Slavic languages have similarities with them.

#### Common - Genel

In this part of the lesson there are common terms about house, rooms etc.
| antechamber | ante |
| attic | tavan arası (in Serb-Croatian, attic is "tavan") |
| balcony | balkon |
| basement | bodrum (in Serb-Croatian, basement is "podrum") |
| door | kapı (in SC slang you can say door "kapija" (it sound like kapia)) |
| door handle | kapı kolu |
| family house | aile evi (as you know, aile means family) |
| flat | düz |
| floor | kat (it is same in SC) |
| garden | bahçe |
| ground floor | zemin kat |
| key | anahtar |
| lock | kilit (in some loanwords in some parts of Croatia, lock is translated as "ćilit" - pronounced like "chilit") |
| roof | çatı |
| yard | avlu (Yugoslavian Nobel laureate Ivo Andrić wrote the book "Prokleta avlija" - "The Damned yard") |

#### Living room - Salon

Here are some terms related to living room
| armchair | koltuk |
| carpet | halı "or" kilim |
| chandelier | avize |
| curtain | perde |
| sofa | kanape |
| television | televizyon |

#### Bedroom - Yatak odası

There are lot of subject in bedrooms like
| bed | yatak |
| blanket | battaniye |
| double bed | çift kişilik yatak |
| dresser | şifoniyer |
| lamp | lampa |
| pillow | yastık (in SC you say pillow "jastuk") |
| sheet | levha |
| wardrobe | dolap |

#### Dining room and kitchen - Yemek odası ve mutfak

It is very nice place in the house
| bib-cock | çeşme |
| chair | sandalye |
| cutlery | çatal bıçak takımı |
| fridge | buzdolabı |
| kitchen table | sofra |
| oven | fırın |
| washing-machine | çamaşır makinesi |

#### Bathroom and Toilette - Banyo ve tuvalet

And the last one...
| basin | lavabo |
| bath | banyo |
| towel | havlu |
| washing machine | çamaşir makinesi |
| WC | alafranga tuvalet |
# Turkish/Big Vocabulary/Groceries
### Groceries - Yiyecek

We are people and we love food very much. In this word lesson I will teach you some groceries. These groceries are used all over the world, also in Turkey. I will also give you a link of Turkish cuisine wikipage: http://en.wikipedia.org/wiki/Turkish_cuisine
# XQuery/Net Working Days
## Motivation

To calculate the "effective" age of many documents you want to count the number of working days they have been in various stages. This means you count the weekdays but not the weekend days. You can even discard the holidays if you want to have consistent aging reports.

## Approach

Since NetWorkingDays is a calculation that is shared by many systems, it makes sense to use a XQuery module to put the logic into.
The heart of this calculation is a NetWorkingDays algorithm that is passed two dates.

## Discussion

The recursive function works but it is slow. It has to call itself once for each date between the two dates. An alternative approach is to count the end days in each fraction of a week, count the weeks and multiply by five.
Code??

## Acknowledgments

An initial version of this was provided by Chris Wallace.
# XQuery/OAuth
## Motivation

You want to login to a web service that support the OAuth protocol.

## Background

OAuth is an open protocol to allow secure API authorization in a simple and standard method from desktop and web applications. Like OpenID, OAuth allows other web services to use your private data without giving out your passwords.

## Terminology

Consumer Key - When you register as a developer with a OAuth service provider they will send you an API key to use with their service. This is typically about a 65 character string composed of digits and letter.
Service Provider - an organization like LinkedIn, Google, or Twitter that has some of your data protected behind a web service.
Token - a somewhat long string of computer-generated letters and numbers use in AOuth data exchanges. These strings hard to guess, and are paired with a secret key to protect the token from being used by unauthorized parties. OAuth defines two different types of tokens: a request token and access token.

## Steps

We will perform this process in the following steps:
* Request a Token
* Sign
* etc.
Here is an example of the structure that contains OAuth information (from 28msec web site)

## References

* sample OAuth and Twitter XQuery modules from Joe Wicentowski
* Joe Wicentowski's excellent posting on how to use OAuth to access twitter using XQuery on eXist
* http://oauth.net/
* http://hueniverse.com/2007/10/beginners-guide-to-oauth-part-ii-protocol-workflow/
* http://sausalito.28msec.com/latest/index.php?id=working_with_oauth
* Examples of XML definitions for service Provider Structures
* MarkLogic Facebook OAuth module
* Norm Walsh on OAuth
* OAuth for BaseX
* Google Developer's API
# Trainz/Finding Missing Dependencies

Many assets in Trainz require other assets to function correctly. The assets required are known as 'dependencies' and are referenced in the kuid table within an asset's config.txt. A complicated locomotive may have many dependencies including the cab, horn sounds, doors, coronas and bogeys. A map/route may have hundreds of dependencies.
Finding missing dependencies should start with a search on the DLS in case it is easily available for download. CMP allows for searching via kuid numbers.
Searching in Google could also reveal the location for the download of missing dependencies as many assets are available on 3rd party sites only. Remember to reduce the search down to just the numbers.
Thirdly, publicly requesting for the dependencies on a Trainz related forum may also help. If you are able to identify the creator of the asset via their unique user-kuid then you may be able contact them via e-mail or PM for more information.
Lastly, the asset may simply not be available, i.e. it may never have been distributed by the creator. It may also be available only via payware sites.
If you are not able to locate missing dependencies, you can easily replace dependencies via the config.txt of the asset concerned, i.e. a missing cab could be swapped for a present cab in order to drive your locomotive with no errors.
# Trainz/Importing Across Platforms

Importing meshes/models across 3D modelling platforms is sometimes necessary in order for the creator to import their assets into Trainz or make use of various features available in different programs (e.g. bump mapping - not available in Gmax).
Various methods have been devised to move models across from one piece of software to another, but there is currently no program available to directly convert from one file format to another. Due to the nature of importing meshes from one program to another, some methods involve loss of detail, loss of texturing or loss of animation.

## 3DS Max>Gmax or 3DS Max>3DS Max via BFF Exporter

For users of 3DS Max v.7,8,9,2008,2009, the current lack of Trainz exporter has forced the use of a particularly useful freeware tool involving MaxScript to export and import between 3DS Max and Gmax freely. The BFF exporter and instructions are available at http://www.scriptspot.com/bobo/darkmoon/bff/ and although still in development allows complete transferability (minus animation) between two programs.