OpenLLM-France/wikimedia huggingface dataset:
# PHP Programming/Daemonization

A daemon is an application that runs in the background, as opposed to being directly operated by the user. Examples of daemons are Cron and MySQL.
Daemonizing a process with PHP is very easy, and requires PHP 4.1 or higher compiled with --enable-pcntl.

## Building a Daemon

We'll start with set_time_limit(0) to let our script run indefinitely. Next, we fork the PHP process with pcntl_fork. Finally, we use posix_setsid to tell the child process to run in the background as a session leader.
The code inside the while statement will run in the background until exit or die is explicitly called.

## Applications

While daemonizing a script can be useful, it is not appropiate for every script. If a script only needs to be executed at a certain time, it can take advantage of Cron for scheduled execution.

## See also

* Nanoserv
* Sonic Server Daemon
# PHP Programming/Contributors

* ahc: Significant editing to existing sections.
* banzaimonkey: Formatting changes and editing.
* Bolo: working on Flat Frog section.
* Bumppo: Started object-oriented PHP section
* Charles Iliya Krempeaux: Added PHP CLI section. Minor cleanups on existing sections. Added PHP-GTK section.
* Douglas Clifton: New editor. Hoping to add more soon!
* IBB: See profile.
* immortalgeek: Added some php web links to Resource section.
* JackPotte: added the pages: images, reserved words, regex, HTTP headers, encryption and the print version.
* James Booker: Minor corrections. Hoping to add more content in time.
* Jatkins: PHP 4 & 5 examples, and PHP 5 only examples.
* Justin Kestelyn: Added a link in Resources.
* Kander: Minor edits to the PHP and MySQL section.
* KGR Sajid: PHP5 editor. Also edited some other minor things.
* Liu Chang: Added "Setting up PHP" section. Hoping to add more in time
* Meemo: Some small edits, fixing a few scripts and the spelling of Rumpelstiltskin. ;)
* Monkeymatt: Fixed some typos, fixed the templating section.
* programmabilities: Minor edits.
* Qrc: Started initial page for Configuration:Register Globals.
* Sae1962: Added navigation template & made minor corrections/edits.
* Sam Wilson: Elaboration on session fixation.
* scorphus: Fixes in installation procedures on Debian systems (to conform standards - we now use aptitude)
* Spoom: Original for and switch...case articles, various reformatting and additions.
* Wykis: Working on Smarty section, foreach, arrays, sessions, all basic programming
# PHP Programming/Cross Site Scripting Attacks
## Problem

Cross site scripting (or XSS) is a basic description of a script sending sensitive information (such as cookies or other session identifiers) to other websites.
Usually, these attacks affect websites that content can be edited or added to. In most cases, session identifiers or even usernames/passwords are stored inside cookies. In the case somebody knows the session identifier, they can easily use it on their machine to do any malicious tasks that you would not be happy about.
Right now, if you are logged in on wikibooks or any other websites, go to that page and type this into the address bar:
These are cookies that are sent to the website each time to identify you. Easily, if your site is not XSS proof - the cracker will write anything like this:
that will send the cookie information to their website.

## Prevention

There are no chances to protect yourself from XSS attacks without removing malicious HTML/JavaScript code that would be submitted to another website.
As far, the most common way is to use htmlentities or htmlspecialchars to filter the coding so nobody would add any HTML to your site (e.g. blog comments):
Another way to do this is to overall create any kind of "protected mode" code, such as MediaWiki, BBCode or others that have been invented for purpose of easily styling/formatting user's content.
# PHP Programming/DBAL
## What is a database abstraction layer?

A database abstraction layer (DBAL) is a couple of functions or a class which deals with every aspects of database handling.
First of all you have a function to connect and to disconnect to/from the database. You also have some functions to submit a query, and to get the results and finally you need to have some error-handling functions too.

## Why to use a DBAL instead of the regular php functions?

Of course you do not replace the php-functions, you just connect them to get a better performance when you need to develop your code, validate the data, etc.
If you use a really flexible DBAL, then you do not need to change every line of your code if you switch from one database type to the other.

## How to write a DBAL?

Most users should not be writing their own DBAL, since there are several ready-to-use open-source DBALs available. One of the benefits of a DBAL is to make code more reusable, and writing your own DBAL (unless it achieves wide acceptance in the PHP community) is counterproductive. The most common one is the PEAR:DB package which is already installed on the majority of web servers.
You can find some less sophisticated DBALs in the source files of some well written open-source CMS sites also.

## References

* ↑ http://pear.php.net/package/DB
# PHP Programming/Comparison

The operators for comparison in PHP are the following:
| Operator | Name | Returns true, if… |
| == | equal | left & right side equals |
| === | identical | == is true, and both sides have the same type |
| != | not equal | left & right are not equal after type juggling |
| <> | not equal | synonym of != |
| !== | not identical | != is true, or their types differ |
| <> | not equal | synonym of != |
| < | less than | left side is strictly less than right side |
| > | greater than | left side is strictly greater than right side |
| <= | less than or equal to | left side is less than or equal to right side |
| >= | greater than or equal to | left side is greater than or equal to right side |
| <=> | spaceship | integer less than, equal to, or greater than zero when left side is respectively less than, equal to, or greater than right side (≥ PHP 7). |
| $a ?? $b ?? $c | null coalescing | first operand from left to right that exists and is not NULL. NULL, if no values are defined and that not NULL (≥ PHP 7). |

## Example of comparisons

PHP Code:
PHP Output:
HTML Render:

## External Links

* PHP Manual on Comparison Operators
# On 2D Inverse Problems/Y-Δ and star-mesh transforms

The effective conductivities b/w boundary nodes and the Dirichlet-to-Neumann map of a network are invariant under the following star-mesh transform and Y-Δ move (a special case of the star-mesh transform in which the center is an interior node and has the degree 3), illustrated by the following drawings from Wikipedia:
Exercise (**). Let d be a diagonal entry of the Kirchhoff matrix K of a network G, corresponding to an interior node. Use the Schur complement formula $\Lambda _{G}=K/C=(K/d)/(C/d)$ for the Dirichlet-to-Neumann map to prove the invariance.
The series or parallel connection rules for replacing conductors follow from the invariance property of the Y-Δ move and can be viewed as its special cases, as also erasing an interior spike or a loop.
# On 2D Inverse Problems/Two models

Certain properties common to discrete and continuous Dirichlet-to-Neumann maps are

### kernel and matrix

schreaded

### Dropped glass of wine
## Embedded graphics and printed counts

DVD206 (discuss • contribs) 18:13, 4 November 2019 (UTC)
# On 2D Inverse Problems/Variation diminishing property
### Total positivity

    Exercise (***). Use the Gauss-Jordan elimination algorithm to prove that every square totally positive matrix can be factorized into the matrices of the following simple types:
    ${\begin{pmatrix}1&0&\ldots &0\\0&x&\ldots &0\\\vdots &\vdots &\ddots &\ldots \\0&0&\ldots &1\end{pmatrix}}{\mbox{ and}}{\begin{pmatrix}1&0&\ldots &0\\x&1&\ldots &0\\\vdots &\vdots &\ddots &\ldots \\0&0&\ldots &1\end{pmatrix}},$
where x > 0.
    Exercise (**). Use the previous exercise to show that multiplying a vector by a totally positive matrix decreases the number of sign changes in the vector. That is, totally positive matrices have variation diminishing property.

### Compound matrices

It follows from the Cauchy-Binet formula that:
    $C(MN)=C(M)(C(N)$
Since the compound matrix of a diagonal matrix is also diagonal, one can obtain the spectral decomposition of a compound matrix from the spectral decomposition of the original matrix. That is, if
    $M=SDS^{-1},$
then
    $C(M)=C(S)C(D)C(S)^{-1}.$
    Exercise (*). Let M be an n by n square matrix and C$_k$(M) it's compound matrices of order k. Express the entries of the inverse M$^{-1}$ of M in terms of the entries of C$_n$ and C$_{n-1}$.
    Exercise (**). Suppose, M is a square matrix that has a spectral decomposition as above. Prove that the eigenvalues of its compound matrix C(M) of order n are equal to products of all possible n-tuples of the eigenvalues of the original matrix.

### Spectral properties

    Exercise (***). Use the Perron-Frobenius theorem applied to the compound matrices of a totally positive matrix to prove the statement above, see [GK].
The eigenvectors of a totally positive matrix form linearly independent Chebyshev system.
# On 2D Inverse Problems/Triangulations of surfaces

Let G be a graph embedded to a surface such that all faces of G are triangular. Such an embedding is called triangulation.
Exercise (***). Generalize the examples to prove that the spectra of G* and M(G) are equal, except possibly the eigenvalue {6}.
    $\sigma (G^{*})\backslash \{6\}=\sigma (M(G))\backslash \{6\}$
# On 2D Inverse Problems/Two new spectral theorems

The existence of the paths in a graph and its dual with the following properties plays an important role in the connection between global and local properties of the graph: Two sets of paths between two subsets of boundary nodes in the graph and its dual are Hamiltonian if the paths go through every edge of the graph or its dual.
The following identity connects the weights of the paths of a network and its dual, an integral of conductivity over the network and the determinants of the Laplacians of the dual graphs, that admit Hamiltonian paths.
    ${\frac {\det \Lambda (P,Q)}{\det \Lambda ^{*}(P^{*},Q^{*})}}=\prod _{e\in E}\gamma (e){\frac {\det(C^{*})}{\det(C)}}.$
Let G be a graph embedded to a surface such that all faces of G are triangular. Such an embedding is called triangulation. The vertices of the dual graph G$^*$ of triangulation have degree 3.
    Exercise (***). Generalize the following example to prove that the spectra of G$^*$ and M(G) are equal, except possibly the eigenvalue {6}: $\sigma (G^{*})\cup \{6\}=\sigma (M(G))\cup \{6\}$
# On 2D Inverse Problems/ An infinite example

The following construction provides an example of an infinite graph, which Dirichlet-to-Neumann operator satisfies the operator equation in the title of this chapter.
    $\Lambda (G)={\sqrt {L}}.$
The operator equation reflects the self-duality and self-symmetry of the infinite graph.
Exercise (**). Prove that the Dirichlet-to-Neumann operator of the graph with the natural boundary satisfies the functional equation. (Hint) Use the fact that the operator/matrix is the fixed point of the Schur complement
    $\Lambda (G)={\begin{pmatrix}2I&B\\B^{T}&\Lambda +2I\end{pmatrix}}/(\Lambda +2I),$
where
    $B={\begin{pmatrix}-1&0&0&\ldots &-1\\-1&-1&0&\ldots &0\\0&\vdots &\ddots &\ddots &\vdots \\\vdots &\vdots &\ddots &-1&0\\0&0&\ldots &-1&-1\\\end{pmatrix}}$
is the circular matrix of first differences.
# On 2D Inverse Problems/redial

"Why do mathematicians celebrate dec.25th on oct.31st?"
# On spies and stratagems

Information has been and will always continue to be the most important factor in any endeavor. It is what permits the distinction of friends and foes, how to proceed and what to expect, where we are and how to reach our goals, even in determining what goals should be pursued.
The purpose of this book is to provide the reader insight over intelligence operational planning, procedures, terms, nomenclature and surrounding history and its impact on today's society. It can serve as a guide to writers or educational guide for those interested in pursuing a career in the security field, investigative journalism and many other fields that run parallel with the subject of keeping or unraveling secrets.
Know the enemy, his capabilities, his movements, his aspirations and the best methodology to subvert his will.
* It is all about secrets
* The agency
* The agent
* Targets and operations
# On 2D Inverse Problems/Zolotarev problem

The elliptic function can be defined by the following integral equation:
    $u=\int _{0}^{\xi }{\frac {dt}{\sqrt {(1-t^{2})(1-\kappa ^{2}t^{2})}}}.$
The following rational approximation problem demonstrates how fast the considered discrete models converge to their continuous analogs. The problem of optimal rational approximation of the square root on an interval was solved by Russian mathematician Zolotarev with the closed form solutions in terms of elliptic integrals, see [DIK] & [PP]. The optimal rational approximation function of order (k-1,k). is given. Exercise (**). Use the interlacing of zeros property to prove that the function
    $s(\lambda )=\lambda {\tilde {r}}(\lambda ^{2})$
can be written as a Stieltjes continued fraction. The optimal approximation converges exponentially fast with the degree of the rational function.
# Pinyin/Cholesterol

Special:search/cholesterol prefix:Pinyin/
Cholesterol is a molecule that is found in animal cells and body fluids. Cholesterol is not found in plant sources. It is a type of lipid which is a fat or fat-like molecule. Cholesterol is a soft waxy substance. It is a special type of lipid that is called a steroid. Steroids are lipids that have a special chemical structure. This structure is made of four rings of carbon atoms. Cholesterol is found especially in animal fats.
dǎngùchún shì dòngwù xìbāo hé tǐyè d fēnzǐ. Zhíwù méiyǒu dǎngùchún. Tā shì zhīfánglèi de yīzhǒng lèixíng, shì zhīfáng huò lèisì zhīfáng de fēnzǐ. Dǎngùchún shì yī zhǒng róuruǎn de làzhuàng wùzhì. Tā shì zhīfánglèi de yīzhǒng tèshū lèixíng, jiàozuò lèigùchún. Lèigùchún shì yīzhǒng jùyǒu tèshū huàxué jiégòu de zhīfánglèi. Cǐ jiégòu yóu sì gè huánxíng de Tàn yuánzǐ zǔchéng. Dǎngùchún duōshù cúnzài yú dòngwù zhīfáng.
# Pinyin/Chronic obstructive pulmonary disease (COPD)

Chronic obstructive pulmonary disease (COPD) is a lung ailment that is characterized by a persistent blockage of airflow from the lungs. It is an under-diagnosed, life-threatening lung disease that interferes with normal breathing and is not fully reversible. The more familiar terms of chronic bronchitis and emphysema are no longer used; they are now included within the COPD diagnosis.
Mànxìng zǔsèxìng fèibìng (COPD) shì yīzhǒng yǐ chíxù zǔsè láizì fèibù de qìliú wéi tèzhēng de fèibù jíbìng. Gāi jíbìng shì yīzhǒng zǔ'ài zhèngcháng hūxī érqiě zhěnduàn bùzú, wēixié shēngmìng de fèibìng, érqiě bùshì wánquán kěnì de. Wǒmen shúxī de shùyǔ mànxìng zhīqìguǎnyán hé fèiqìzhǒng jiāng bù zài shǐyòng; tāmen xiànzài bāohán zài mànxìng zǔsèxìng fèibìng de zhěnduàn zhīzhōng.
# Pinyin/Chinese Mainland

Search Pinyin Chinese
Search Pinyin mainland
# Pinyin/Chinese language

Search Pinyin Chinese
Search Pinyin language
# Pinyin/Cholera

Cholera is an acute intestinal infection caused by ingestion of food or water contaminated with the bacterium Vibrio cholerae. It has a short incubation period, from less than 1 day to 5 days, and produces an enterotoxin that causes a copious, painless, watery diarrhoea that can quickly lead to severe dehydration and death if treatment is not promptly given. Vomiting also occurs in most patients.
Huòluàn shì yóu shèrù shòu huòluàn Hújūn zhèzhǒng gǎnjūn wūrǎn de shíwù huò shuǐ yǐnqǐ de yīzhǒng jíxìng chángdào gǎnrǎn. Huòluàn de qiánfúqī duǎn, cóng bùzú 1 tiān zhì 5 tiān, bìng chǎnshēng chángdúsù, zàochéng dàliàng wútòng shuǐxiè, rú bù jíshí gěiyǐ zhìliáo, kě xùnsù dǎozhì yánzhòng tuōshuǐ hé sǐwáng. Dàduōshù huànzhě hái chūxiàn ǒutù.
# Pinyin/Chronic disease

Search Pinyin disease
# Pinyin/China

Search Pinyin China

## Proper noun

* China: a country located in eastern Asia
** Zhongguor: dong Yahzhou 1'g guorjia

## Noun

* china: plates, cups, etc. made from porcelain clay
** cirqih: yohng cirtuu zhihzaoh d dier'zi, bei'zi, deeng
China is a cultural region, an ancient civilization, and a nation in East Asia.
Zhongguor shih wernhuah dihqu, guudaih wernmirng, Dong Yah guorjia.
China is situated in the east of Asia. In narrow sense, it means the People's Republic of China, also means the Republic of China. In broad sense, it includes the Chinese Mainland, Hong Kong, Macau and Taiwan.
ZG zài Yàzhōu d dōngbù. Xiáyì d ZG zhǐ Zhōnghuá Rénmín Gònghéguó, yě zhǐ Zhōnghuá Mīnguó. Guǎngyì d ZG bāokuò ZG Dàlù, Xiānggǎng, Àomén hé Táiwān.
After China's last civil war, it spitted in 2 parts:
* The People's Republic of China (PRC), commonly known as China, has control over Chinese Mainland, Hong Kong (since 1997) and Macau (since 1999).
* The Republic of China (ROC), commonly known as Taiwan, has control over the islands of Taiwan, Penghu, Jinmen and Mazu.
ZG shahngcih neihzhahn zhihouh fenweir 2 buhfehn:
* Zhonghuar Rernmirn Gohngherguor (PRC), surcheng Zhongguor, kohngzhih ZG Daluh, Xianggaang (corng 1997 niarn) her Aohmern (corng 1999 niarn).
* Zhonghuar Mirnguor (ROC), surcheng Tairwan, kohngzhih d daaoyuu baokuoh Tairwan, Pernghur, Jinmern her Maazuu.
China has one of the world's oldest civilizations and has the oldest continuous civilization. It has archeological evidence over 5,000 years old. It has one of the world's oldest writing systems, and had many major inventions.
ZG yoou shihjieh zuih guulaao d wernmirng zhiyi, her zuih charng d liarnxuh wernmirng. ta yoou kaaoguu zhehngmirng chaoguoh 5000 niarn d lihshii. ta yoou shihjih zuih guulaao d wernzih zhiyi, her yoou heenduo zhohngyaoh d famirng.
# Pinyin/Chronic

charngqi d; mahnxihng d
# Pokémon/Pokédex/Dragapult
## Description

A ghostlike Pokémon.

## Base Statistics

A Dragon and Ghost type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Dragapult: ice, dragon, fairy, ghost, dark Moves that deal 50% of their damage to Dragapult: fire, water, grass, electric, poison, bug Moves that deal 0% of their damage to Dragapult: normal, fighting
# Pokémon/Pokédex/Drakloak
## Description

A ghostlike Pokémon.

## Base Statistics

A Dragon and Ghost type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Drakloak: ice, dragon, fairy, ghost, dark Moves that deal 50% of their damage to Drakloak: fire, water, grass, electric, poison, bug Moves that deal 0% of their damage to Drakloak: normal, fighting
# Pokémon/Pokédex/Dreepy
## Description

A ghostlike Pokémon.

## Base Statistics

A Dragon and Ghost type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Dreepy: ice, dragon, fairy, ghost, dark Moves that deal 50% of their damage to Dreepy: fire, water, grass, electric, poison, bug Moves that deal 0% of their damage to Dreepy: normal, fighting
# Pokémon/Pokédex/Donphan
## Basic Statistics

* National Index: 232
* Johto Index: 196
* Hoenn Index: 166
* Stage: Stage 1
* Height: 1.1m/3'7"
* Weight: 120kg/265.0lb
* Gender Distribution: 50% Male
* Ability: Sturdy
* Type: Ground
* Species: Armor
* Egg Group: Ground
* Hatch Steps: 5120
* Catch Rate: 60
* Base Experience: 189
* Max Experience: 1000000
| | HP | Attack | Defense | Speed | Special Attack | Special Defense |
| Base Stats (RB/Y) | - | - | - | - | - | - |
| Base Stats (GS/C) | 90 | 120 | 120 | 50 | 60 | 60 |
| Base Stats (RS/FL/E) | 90 | 120 | 120 | 50 | 60 | 60 |
| Base Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Base Stats (BW/B2W2) | – | – | – | – | – | – |
| Base Stats (XY/ORAS) | – | – | – | – | – | – |
| Base Stats (SM/USUM) | – | – | – | – | – | – |
| Base Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Max Stats (RB/Y) | - | - | - | - | - | - |
| Max Stats (GS/C) | 383 | 338 | 338 | 198 | 218 | 218 |
| Max Stats (RS/FL/E) | 384 | 372 | 372 | 218 | 240 | 240 |
| Max Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Max Stats (B/W/B2W2) | – | – | – | – | – | – |
| Max Stats (X/Y/ORAS) | – | – | – | – | – | – |
| Max Stats (SM/USUM) | – | – | – | – | – | – |
| Max Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Effort Points (Sword/Shield/BDSP) | – | – | – | – | – | – |

## Type Matching

Move types which are good on Donphan: Grass, Ice, Water Move types which are bad on Donphan: Poison, Rock Move types which don't effect Donphan: Electric
All other move types are normal effectiveness on Donphan.

## Moveset

| Level | Gold / Silver | Crystal | Ruby / Sapphire Emerald XD / Colosseum | Fire Red / Leaf Green |
| Start | Horn Attack Growl | Horn Attack Growl | Odor Sleuth Tackle Growl | Odor Sleuth Tackle Growl |
| 9 | Defense Curl | Defense Curl | Defense Curl | Defense Curl |
| 17 | Flail | Flail | Flail | Flail |
| 25 | Fury Attack | Fury Attack | Fury Attack | Fury Attack |
| 33 | Rollout | Rollout | Rollout | Rollout |
| 41 | Rapid Spin | Rapid Spin | Rapid Spin | Rapid Spin |
| 49 | Earthquake | Earthquake | Earthquake | Earthquake |

### TM/HM

* GS/C/RS/FL: Attract, Double Team, Earthquake, Frustration, Hidden Power, Hyper Beam, Protect, Rest, Return, Roar, Rock Smash, Sandstorm, Strength, Sunny Day, Toxic
* GS/C: Curse, Defense Curl, Endure, Headbutt, Mud-Slap, Rollout, Sleep Talk, Snore, Swagger
* RS/FL: Facade, Iron Tail, Rock Tomb, Secret Power

### Evolution

* GS/C/RS/FL: Ancientpower, Body Slam, Focus Energy
* RS/FL: Counter, Fissure, Snore
* C: Water Gun

## Trading Cards

* Neo Genesis #21 - Donphan
* Neo Destiny #3 - Dark Donphan
* Aquapolis #7 - Donphan
* EX Ruby & Sapphire #17 - Donphan
* EX Deoxys #30 - Donphan
| Basic: Phanpy | Stage 1: Donphan | (No Stage 2) |
# Pokémon/Pokédex/Drapion
## Description

A scorpionlike pokémon.

## Base Statistics

A Poison and dark type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Drapion: ground, psychic, fighting Moves that deal 50% of their damage to Drapion: grass, poison, ghost, dark Moves that deal 0% of their damage to Drapion: psychic
# Pokémon/Pokédex/Drednaw
## Base Statistics

A water and rock type

## Type Matching

Moves that deal 400% of their damage to Drednaw: grass Moves that deal 200% of their damage to Drednaw: electric, fighting, ground Moves that deal 50% of their damage to Drednaw: ice, normal, poison, flying Moves that deal 25% of their damage to Drednaw: fire

## Name

A combination of "Dreadnaught" and "Gnaw".
# Pokémon/Pokédex/Dragalge
## Description

An algae clad Pokémon.

## Base Statistics

A Poison and Dragon type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Dragalge: ground, psychic, ice, dragon Moves that deal 50% of their damage to Dragalge: fighting, poison, bug, fire, water, electric Moves that deal 25% of their damage to Dragalge: grass
# Pinyin/Realizing

See also
# Pinyin/Record

See also
# Pinyin/Red Blood Cell

Hóngxuèqiú
# Pinyin/Red Sea

Search Pinyin Red Sea
Search Pinyin sea
The Red Sea is a sea between the Arabian Peninsula of Asia in the northeast and Africa in the southwest. It is a part of the Indian Ocean.
Horng Haai shih Yahzhou d Arab Bahndaao xinarn-ahn her Feizhou dongbeei-ahn zhijian d haai. ta shih India Yarng d 1 buhfehn.
# Pinyin/Recession

See also
# Pinyin/Record By Video

See also