OpenLLM-France/wikimedia huggingface dataset:
# JavaScript/Generators

The term generator denotes a technique to generate a sequence of 'anything': numbers, strings, rows of database queries, elements of an array, nodes of a DOM tree, ...
It's used to avoid any memory overloading, by splitting the data in small chunks.
To use them, you must define a generator function first. Such functions are notated with an asterisk * directly behind the keyword function, e.g., function* myGenerator{...}.
When called, the function will not run instantly. It only runs just before the first occurrence of a yield statement and returns a 'Generator object'. This 'Generator object' offers a next method. Calling next again and again returns the sequence elements one after the next. The elements arise by each yield that is reached within the generator function.

## Examples

* The script generates a sequence of 4 integers.
* Every next call returns not only a value; there is also a boolean done. Hence you can call the generator in loops.
* Generation out of an array, a database request, or a tree traversal.
* Creation of the infinite sequence of all even numbers.

## Parameters

The generator function may receive parameters. In this example, the 'pageSize' defines the number of array elements to be returned.

## References

* ↑ MDN: Generator function
# JavaScript/Bookmarklets

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

## JavaScript URI scheme

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

## Example uses
### Media controls

The values in these examples can be adapted as desired. One may replace video with audio where applicable, meaning where an <audio> tag is embedded.

#### Loop the video

Can be switched off using 0 or false.

#### Mute audio

Unmute using 0 or false.

#### Ask for playback speed

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

#### Ask for playback position in percentage (0 to 100)
## Using multiple lines of code

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

## The JavaScript Protocol in Links

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

## Examples

A large quantity of links may be found on bookmarklets.com, which show a variety of features that can be performed within JavaScript.
# JavaScript/Changing element styles/Exercises

Topic: CSS style
We use the HTML page of the previous page for the exercises.
1. Modify the function toggle.
* If the background color of 'div_1' is green, change it to aqua; else, change it back to green.
* If the background color of the button is red, change it to yellow; else, change it back to red.
2. Be creative. Modify the function toggle so that other CSS properties change, e.g., div's text size, body's padding or background color, ... .
3. Modify the function toggle.
* Ask the user prompt which background color he prefers for the first div.
* Change the background color of the first div to this color.
# JavaScript/Changing elements

On this page, we show how to change two different things of an HTML element, respectively, DOM node.
* Its content (there is only one - or none)
* Any of its attributes (there may be many)
Please take note of this distinction between content and attributes.

## Example page

We use the following example HTML page to demonstrate the possibilities.
Clicking on the button invokes the function show. The examples should be included there.

## Change the content

We use the example of a paragraph p. To change its content, the text, just assign the new value to its innerHTML.
Or, to do the same with a different HTML element, we change the SVG graphic.
Because the new text is HTML code, you can 'misuse' this approach to add child nodes.
The script inserts two more paragraphs, but not behind the first one. They are within the first one.

## Change an attribute

In general, the syntax to change attributes is as follows:
The HTML element a knows a href attribute: <a id="refToSomewhere" href="https://www.example.com">...</a>. This href attribute can be changed:
First, the element is located. Second, the function assigns a new value to its attribute 'href' (and to the innerHTML).
The following example changes the src attribute of img element and the value attribute of button element

### setAttribute

The modification of attributes can also be done via the function setAttribute.

## See also

* MDN setAttribute

## Exercises

    ... are available on another page (click here).
# JavaScript/Async/Exercises

Topic: Asynchronous functions
1. Define a function that
* reads the users via the jsonplaceholderapi of the previous page
* shows all ten usernames together with their hometown
* include log-messages to observe the program flow
Expected output:
# JavaScript/Changing element styles

As you have seen in previous chapters, the attributes of an element can be modified by JavaScript. Two attributes, the class and style, influences the visual representation of an element. They contain CSS code.
The class attribute identifies a CSS class that is created in the style element of HTML. The style attribute defines CSS rules inline (locally).
To modify them, handle them like any other attribute. They do not have special rules or exceptions.

## An example

We use the above HTML file; only the JavaScript function is changed. When the button is clicked, the function assigns the CSS class 'divClassRed' to 'div_1' and it changes the inline 'style' attribute of 'div_2' to a different value.
The 'style' attribute stores the CSS properties like 'color' or 'padding' in its own properties. This correlates with the general JavaScript object rules. Therefore the following syntax is equivalent to the previous div_2.setAttribute call.

## Properties of 'style'

In CSS, some properties are defined with a hyphen in their name, e.g., 'background-color' or 'font-size'. When you use them in JavaScript in the syntax of a property of style, the names change slightly. The character after the hyphen must be written in upper-case, and the hyphen disappears: 'style.backgroundColor' or 'style.fontSize'. This is called camel-case.
All other places where such names appear in CSS do not change. Especially the shown syntax with hyphens inside the HTML <style> element, as well as the use in the form of an inline definition, keeps unchanged.

## Exercises

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

## See also

* MDN: CSS basics
# JavaScript/Changing elements/Exercises

Topic: Change element's content and attributes
We use the HTML page of the previous page for the exercises.
1. Modify the function show in a way that it disables the button. Its text shall change to "I'm disabled". Hint: To disable a button, its attribute disabled must be set to true.
2. Modify the function show in a way that it opens the link in a new window: target="_blank".
# JavaScript/Automatic semicolon insertion

Automatic Semicolon Insertion (ASI)
In languages of the C-family, the semicolon denotes the end of a statement. Unlike other C-like languages, JavaScript doesn't enforce that. Instead, the semicolon is optional, and the interpreter adds missing semicolons - mostly at the end of a line - to terminate statements. Doing so, it takes complex rules into account. This may conflict with the intended purpose.
If you write your code without semicolons at the end of statements you must take care of problematic situations. Here are some rules-of-thumb to avoid problems. But there are many more rules.
* The expression after one of the keywords return, throw, or yield must be on the same line as the keyword itself.
* The label identifier after break or continue must be on the same line as the keyword.
* If a line starts with one of (, [, `, +, -, or /, end the previous line with a semicolon. Examples
| Entered code .. | .. interpreted as | intended code |
| return 2a + 1 | return; 2a + 1; | return 2*a + 1; |
| function getObject { return { // some lines } } | function getObject { return; { // some lines }; } | function getObject { return { // some lines }; } |
| i ++ | i; ++; | i++; |
In the first case, the programmer intended 2*a + 1 to be returned; instead, the code returned undefined. Similarly, in the second case, the programmer intended to return the lines enclosed by the braces, but the code returned undefined. Due to this oddity in JavaScript, it is considered a best practice never to have lines break within a statement and never have the opening brace on a separate line.

## See also

* MDN reference
* ECMA reference
* Whitespaces & semicolons in JavaScript
# Haskell/Time and space profiling

In every language, profiling is the first crucial step of performance optimization. Otherwise, it is difficult to understand correctly what is the cause of bad performance, even for many experienced programmers. In addition, in Haskell, space leaks are a frequent source of problems with laziness. This means that learning to use profiling is important.
Currently, we just link to external references on the subject.

## References

* http://book.realworldhaskell.org/read/profiling-and-optimization.html
* https://www.haskell.org/ghc/docs/latest/html/users_guide/profiling.html
* http://www.haskell.org/haskellwiki/How_to_profile_a_Haskell_program
# Java Programming/Classes and Objects

* Navigate Classes and Objects topic: ( v • d • e )
* Defining classes
* Inheritance
* Interfaces
* Overloading methods and constructors
* Object Lifecycle
* Scope
* Nested classes
* Generics
* Topics:
* Preface
* Getting started
* Language fundamentals
* Classes and objects
* Aggregate
* Exceptions
* Concurrent Programming
* Javadoc & Annotations
* Designing user interfaces
* Advanced topics

## Classes and Objects

An object-oriented program is built from objects. A class is a "template" that is used to create objects. The class defines the values the object can contain and the operations that can be performed on the object.
After compilation, a class is stored on the file system in a '(class-name).class' file.
The class is loaded into memory when we are about to create the first object from that class, or when we call one of its static functions.
During class loading all the class static variables are initialized. Also operations defined in a static { ... } block are executed. Once a class is loaded it stays in memory, and the class static variables won't be initialized again.
After the class is loaded into memory, objects can be created from that class. When an object is created, its member variables are initialized, but the class static variables are not.
When there are no more references to an object, the garbage collector will destroy the object and free its memory, so that the memory can be reused to hold new objects.
# Linux Networking/IP Accounting (for Linux-2.2)
## IP Accounting (for Linux-2.2)

The new accounting code is accessed via ``IP Firewall Chains. See the IP chains home page for more information. Among other things, you'll now need to use ipchains instead of ipfwadm to configure your filters. (From Documentation/Changes in the latest kernel sources).
# Linux Networking/Glossary of Terms used in this document
## Glossary of Terms used in this document.

The following is a list of some of the most important terms used in this document.
# Linux Networking/IP- and Ethernet-Related Information

This section covers information specific to Ethernet and IP. These subsections have been grouped together because I think they are the most interesting ones in the formerly-called Technology Specific Section. Anyone with a LAN should be able to benefit from these goodies.

## Ethernet

Ethernet device names are `eth0', `eth1', `eth2' etc. The first card detected by the kernel is assigned `eth0' and the rest are assigned sequentially in the order they are detected.
By default, the Linux kernel only probes for one Ethernet device, you need to pass command line arguments to the kernel in order to force detection of further boards.
To learn how to make your ethernet card(s) working under Linux you should refer to the Ethernet-HOWTO.
Once you have your kernel properly built to support your ethernet card then configuration of the card is easy.
Typically you would use something like (which most distributions already do for you, if you configured them to support your ethernet):
Most of the ethernet drivers were developed by Donald Becker, becker@CESDIS.gsfc.nasa.gov.
# Linux Networking/IP Accounting (for Linux-2.0)
## IP Accounting (for Linux-2.0)

The IP accounting features of the Linux kernel allow you to collect and analyze some network usage data. The data collected comprises the number of packets and the number of bytes accumulated since the figures were last reset. You may specify a variety of rules to categorize the figures to suit whatever purpose you may have. This option has been removed in kernel 2.1.102, because the old ipfwadm- based firewalling was replaced by ``ipfwchains.
Kernel Compile Options:
After you have compiled and installed the kernel you need to use the ipfwadm command to configure IP accounting. There are many different ways of breaking down the accounting information that you might choose. I've picked a simple example of what might be useful to use, you should read the ipfwadm man page for more information. Scenario: You have an ethernet network that is linked to the internet via a PPP link. On the ethernet you have a machine that offers a number of services and that you are interested in knowing how much traffic is generated by each of ftp and World Wide Web traffic, as well as total tcp and udp traffic.
You might use a command set that looks like the following, which is shown as a shell script:
The names ``ftp-data and ``www refer to lines in /etc/services. The last command lists each of the Accounting rules and displays the collected totals.
An important point to note when analyzing IP accounting is that totals for all rules that match will be incremented so that to obtain differential figures you need to perform appropriate maths. For example, if I wanted to know how much data was not ftp nor www I would substract the individual totals from the rule that matches all ports.
# Linux Networking/FDDI
## FDDI

FDDI device names are `fddi0', `fddi1', `fddi2' etc. The first card detected by the kernel is assigned `fddi0' and the rest are assigned sequentially in the order they are detected.
Larry Stefani, lstefani@ultranet.com, has developed a driver for the Digital Equipment Corporation FDDI EISA and PCI cards.
Kernel Compile Options:
When you have your kernel built to support the FDDI driver and installed, configuration of the FDDI interface is almost identical to that of an ethernet interface. You just specify the appropriate FDDI interface name in the ifconfig and route commands.
# Linux Networking/IPX (AF IPX)
## IPX ( AF_IPX )

The IPX protocol is most commonly utilized in Novell NetWare(tm) local area network environments. Linux includes support for this protocol and may be configured to act as a network endpoint, or as a router for IPX.
Kernel Compile Options:
The IPX protocol and the NCPFS are covered in greater depth in the IPX-HOWTO.
# Linux Networking/IP Aliasing
## Multiple IP addresses

There are some applications where being able to configure multiple IP addresses to a single network device is useful. Internet Service Providers often use this facility to provide a "customized" what to their World Wide Web and ftp offerings for their customers.
For example, assume you have an Ethernet network that supports two different IPv4 subnetworks simultaneously and you wish your machine to have direct access to both, you could use something like:
Adding an address also automatically adds a route to the accompanying network.
To delete an alias, simply replace add by del:
All routes associated with that address will also be deleted automatically.
# Linux Networking/Frame Relay
## Frame Relay

The Frame Relay device names are `dlci00', `dlci01' etc for the DLCI encapsulation devices and `sdla0', `sdla1' etc for the FRAD(s). Frame Relay is a new networking technology that is designed to suit data communications traffic that is of a `bursty' or intermittent nature. You connect to a Frame Relay network using a Frame Relay Access Device (FRAD). The Linux Frame Relay supports IP over Frame Relay as described in RFC-1490.
Kernel Compile Options:
Mike McLagan, mike.mclagan@linux.org, developed the Frame Relay support and configuration tools. Currently the only FRAD supported are the Sangoma Technologies S502A, S502E and S508.
To configure the FRAD and DLCI devices after you have rebuilt your kernel you will need the Frame Relay configuration tools. These are available from ftp.invlogic.com. Compiling and installing the tools is straightforward, but the lack of a top level Makefile makes it a fairly manual process:
Note that the previous commands use sh syntax, if you use a csh flavour instead (like tcsh), the for loop will look different.
After installing the tools you need to create an /etc/frad/router.conf file. You can use this template, which is a modified version of one of the example files:
When you've built your /etc/frad/router.conf file the only step remaining is to configure the actual devices themselves. This is only a little trickier than a normal network device configuration, you need to remember to bring up the FRAD device before the DLCI encapsulation devices. These commands are best hosted in a shell script, due to their number:
# High School Earth Science/Weather

* Weather and Atmospheric Water
* Changing Weather
* Storms
* Weather Forecasting
← Air Movement · Weather and Atmospheric Water →
# High School Earth Science/Volcanoes

* Volcanic Activity
* Volcanic Eruptions
* Types of Volcanoes
* Volcanic Landforms and Geothermal Activity
← Staying Safe in Earthquakes · Volcanic Activity →
# History of Chile/Contents

| Prehispanic history | Mapuche chief Lloncon (1890). |
| Discovery | Diego de Almagro. |
| Conquest | Pedro de Valdivia, Spanish conqueror. |
| The Colony | |
| Independence | Manuel Rodríguez. |
| Patria Nueva (The New Motherland) | Bernardo O'Higgins. |
| Conservative Republic | Diego Portales. |
| Liberal Republic | Naval Combat of Iquique. |
| Parliamentarian Republic | Former Congress. |
| Presidential Republic | Salvador Allende. |
| Military Regime | |
| Transition to Democracy | Patricio Aylwin. |
| Michelle Bachelet, Sebastián Piñera and 2010 earthquakes | Piñera's propaganda. |
# History of China/Han Dynasty

The Han Dynasty (漢朝), divided into the earlier Western Han (202 BC - 9 AD) and later Eastern Han Dynasties (25 AD - 220 AD), was one of the most influential time periods in Chinese history. Its impact can be seen in the name of the dominant ethnic group of modern day China, Han Chinese and in the name they call their language, Hanyu (漢語), amongst others. During this period, China reached one of its territorial peaks in ancient times, as well as a golden age of culture and prosperity. This period also solidified Confucianism as the main national policy for centuries to come. The Han Dynasty was headed by the Liu (劉) family.
# History of China/Jin Dynasty

The Jìn Dynasty (晉朝), not to be confused with Jīn dynasty (金朝), was divided into the earlier Western Jin (266 - 316 AD) and later Eastern Jin Dynasty (317 - 420 AD). The Western Jin Dynasty was marked with internal strife and foreign invasions, while the Eastern Jin was forced out of the Chinese heartland of the Yellow River Basin and into the south. This was a significant period in Chinese history, as it was the first time non-Chinese controlled vast areas of Chinese lands. This resulted in a mixture of Chinese and northern cultures. The migration of the political center and influential families towards the south also sped up southern development. Cities like Jianye (current day Nanjing) and Suzhou developed greatly because of this. The Jin Dynasty was headed by the Sima (司馬) family.
# History of China/Ming Dynasty

The Ming dynasty (明朝), lasting from 1368 AD to 1644 AD, was the second-last imperial dynasty in China and the last to be ruled by ethnic Chinese. The Ming established the custom in English of referring to an emperor by his year name since they only had 1 during their entire reign, rather than their posthumous or temple names. This custom was adopted in Chinese during the later Qing dynasty. After overthrowing the Mongols and driving them back to the north, the Ming established order back in China and restored the ancient Great Wall to defend against northern invaders. Also noteworthy were the 7 naval expeditions by the Muslim eunuch admiral Zheng He (鄭和). Sent by Emperor Yong'le (永樂皇帝), these expeditions comprised of huge fleets of ships with massive crews unparalleled in Europe at the time, whose mission was to trade with locals, increase prestige of China, and bring back representatives from states willing to be tributaries. These voyages followed known trade routes, yet they reached India, Arabia and East Africa. The later half of Ming was plagued by power struggles between eunuch factions in the court, and was conquered by the Manchus in 1644 AD.
# History of China

Welcome to the History of China Wikibook!

# Before you use this book

Here are some basic knowledge you need to know before learning Chinese history. Introduction

# Prehistoric

Prehistoric

# Kingdom (22nd century B.C.~ 222 B.C.)

Xia Dynasty Shang Dynasty Zhou Dynasty

# Imperial (221 B.C.~ 1911 A.D.)

Qin Dynasty Han Dynasty The Three Kingdoms Period Jin Dynasty The Southern and Northern Dynasties Sui Dynasty Tang Dynasty The Five Dynasties and Ten Kingdoms Liao Dynasty Song Dynasty Western Xia Dynasty Jīn Dynasty Yuan Dynasty Ming Dynasty Qing Dynasty

# Republic (since 1912 A.D.)

The Republic of China The People's Republic of China
# History of Brazil/Introduction

This is a book about the history of Brazil, designed to be read by almost anyone who wants to know more about the history of that country. The book includes history before Europeans, the discovery of Brazil, colonization, independence, regime change, the events of the 20th and 21st centuries.
Find out how historical events in Brazil shaped the way the country is today.