OpenLLM-France/wikimedia huggingface dataset:
# Learning Clojure/Data Structures
## Sets

A set is a collection containing no duplicate items. Clojure has two set types:
* a hash set is implemented as a hashmap and so has (near) constant lookup, insertion, and removal times.
* a sorted set is implemented as an ordered binary tree and so has logarithmic lookup, insertion, and removal times.
The reader recognizes a literal syntax for hash sets:

## Lazy sequences

Many sequence functions produce lazy sequences, which are sequences not actually backed by their own data: the items of a lazy sequence are produced on request from a function or retrieved from some other source, such as another collection. For example, the sequence representing the first 8 items of a pre-existing vector can be lazy because there's no need to copy the items: if we, say, request the 3rd item of the lazy sequence, we get back the 3rd item of the vector.
A lazy sequence based on a function produces items based on the index passed to the function. Because such sequences are backed by no actual data at all, they can be infinite in size. For instance, the function cycle returns a lazy sequence representing the endless repetition of another sequence:
[hmm, under what scenarios does a lazy seq keep around the items as they're produced? I assume a cycle doesn't end up backed by a huge actual list or vector, but doseq does seem to keep around the produced values. What other cases are like doseq?]

## StructMaps

What Clojure calls a structmap (as in "structure-map") is simply a variant of a persistent hashmap, but one in which a pre-defined set of keys have optimized storage and lookup.
A structmap is created by first calling clojure/create-struct to define a blueprint called a basis. The function clojure/struct-map is then used to create actual structmaps using a basis:
You can create a structmap by specifying only the values for the keys using clojure/struct:
# Learning Clojure/Leiningen

Leiningen is a build tool for Clojure based on Maven. It can do everything that Maven does, but it adds further support for Clojure and streamlines common Clojure tasks.
Like Maven, Leiningen favors convention over configuration, and thus automates many of the build, test and deployment steps without lots of complex configuration.

## Getting started with Leiningen

The official home page for Leiningen is at https://github.com/technomancy/leiningen. Like Maven, Leiningen can download and install dependencies as needed, so to install it all that is necessary is to download and run a small bootstrap script that will install all the additional modules as needed.

### Installing on Linux

Download the shell script from https://github.com/technomancy/leiningen/raw/stable/bin/lein. Put it somewhere in your path and make it executable. A convenient place to put it is in ~/bin, if that is on your $PATH. You should then be able to run lein commands:

### Installing on Windows

* Download the Windows distribution from https://github.com/downloads/technomancy/leiningen/leiningen-1.4.1-win32.zip.
* Unzip it to a folder of your choice
* Modify your path to include the 'lein' directory
# Learning Clojure/Destructuring

The special forms let, loop, and fn are actually macros: the real special forms are named let*, loop*, and fn*. The macros are most commonly used in place of the actual special forms because the macros add a convenience feature called destructuring.
Often a function expects to receive a collection argument out of which it means to use particular items:
Having to extract out the values we want can get quite verbose, but using destructuring can help in many cases:
Above, where a parameter name is normally specified in the argument list, we put a vector followed by a parameter name: the items in the collection passed to the parameter s are bound to the names a and b in the vector according to position. Similarly, we can destructure using a map:
[I have to say this feels backwards to me: shouldn't it be (let [{:apple x} m] x)? I like to think of the destructuring expression as mirroring the collection being destructured.]
Destructuring can also be used to pull out the value of collections within collections. Hickey gives more complete coverage here.
# JavaScript/Links

Featured weblinks:
* JavaScript portal at developer.mozilla.org
* JavaScript Reference at developer.mozilla.org
* JavaScript Guide at developer.mozilla.org
* Gecko DOM Reference at developer.mozilla.org
* Wikipedia:JavaScript
* Wikipedia:ECMAScript
* Wikipedia:JavaScript engine
* Wikiversity: Topic:JavaScript
* Wikiversity: Advanced JavaScript
* JavaScript Tutorial at w3schools.com
* JavaScript Reference at w3schools.com
* About: Focus on JavaScript from Stephen Chapman at javascript.about.com
* ecmascript.org
* ecma-international.org
* http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
Discussion forums, bulletin boards:
* HTML, CSS and JavaScript at coderanch.com
* JavaScript Workshop forums at jsworkshop.com
* Forum: Client-side technologies at webxpertz.net
More Web sites:
* JavaScript tutorials at webreference.com
* Videos from w:Douglas Crockford on JavaScript
* JavaScript at epanorama.net
* JavaScript Tutorials at pickatutorial.com
* JavaScript Essentials at techotopia.com - An online JavaScript book designed to provide Web developers with everything they need to know to create rich, interactive and dynamic Web pages using JavaScript.
* JavaScript Tutorials at yourhtmlsource.com
* www.quirksmode.org - over 150 useful pages for CSS and Javascript tips & cross-browser compatibility matrices.
* Wiki: I wanna Learn JavaScript at c2.com - A list of links to Web resources on JavaScript
* Unobtrusive JavaScript at onlinetools.org - a guide on how to write JavaScript so that your site degrades gracefully (i.e., if the browser does not support or has turned off JavaScript, your site is still usable).
# JavaScript/LocalStorage
## Introduction

Localstorage is an option to store JSON in localstorage of the browser. This could be used to store a language setting (e.g. from english language to german language in the user profile) and when the user revisits the page the setting of pages are restored according to previous selection of the user (e.g. the selection of the language),

## Activities

* Compare the approach for the language selection of the user interface with JavaScript/Cookies that can be used for the same purpose.
* Analyze simple WebApp of Javascript BubbleBreaker by bobak7 and identify how the highscores are stored and loaded from the Local Storage.
# JavaScript/Introduction to the Document Object Model (DOM)

HTML pages are internally implemented by a tree that contains the HTML elements (and CSS styles) as its nodes. This tree is called Document-Object Model, or DOM. JavaScript has full access to the DOM. It can navigate through the tree, modify the tree and nodes, ranging from simply adding new nodes to rearranging several areas on the page.
A hint about the terminology: Because of its closeness to XML, HTML uses the term element; and because of its structure as a tree, DOM uses the term node.

## Nodes

When loading into the browser, the HTML document is broken down into a tree of nodes. For example, take a look at the following HTML snippet:
Through DOM, JavaScript sees this snippet as four nodes.
* The div, from its start tag through its end tag, is one node. This div happens to have a property assigned inside its start tag. This property is named "id" and has the value "exampleDiv".
    The three other nodes in this example are inside the div. They are called child nodes of the div, because the div contains them. Conversely, the div is their parent node.
* The first child of the div is a text node, with the value "This is an". Text nodes contain only text; they never contain tags, which is why the tree stops here.
* The br tag is another node.
* The rest of the text is another text node.
Since the text nodes and the br tag all share the same parent, they are said to be sibling nodes.

## Accessing nodes

You can access nodes of the DOM tree by various methods. One of them is getElementById.
When clicking on the button, the function go is called. It accesses the element with the id 'p2' and shows its content.

## Accessing content

If you want to get access to the content of a node, you can use different properties of different classes: Node.textContent, HTMLElement.innerText, or Element.innerHTML. But they are not equal; please consider the differences. To keep our examples clear and easy, we use Element.innerHTML whenever possible because it is very close to the HTML source code.

## Changing content

After accessing a node, you can change its content by assigning a new value to its content.
When clicking on the button, the function go is called. Again, it accesses the element with the id 'p2' and changes its content.

## Modifying the tree structure

JavaScript can manipulate the structure of the DOM tree.
When clicking on the button, the function go is called. It accesses the elements 'body' and 'p2', then, it moves the 'p' element to the end of the 'body'.

## See also

* MDN DOM
# JavaScript/JS at server

JavaScript was initially introduced to run in web browsers. Nowadays, it is also heavily used on the server side within web servers, frameworks, libraries, and applications. We list some popular examples.
Node.js is a JavaScript runtime environment using the JavaScript engine V8. Some parts are written in C and C++. Node.js applications often create a web server and offer resources to the public.
* Website: nodejs.org
* Wikipedia: Node.js
Angular is a framework for developing web applications. It is written in TypeScript. TypeScript is a syntactical superset of JavaScript, adding static typing.
* Website: Angular
* Wikipedia: Angular
Vue.js is a JavaScript framework for building user interfaces.
* Website: Vue.js
* Wikipedia: Vue.js
React is a JavaScript library for building user interfaces - standard HTML elements like div or button, as well as your own JSX components.
* Website: React
* Wikipedia: React
JSX is an extension to the JavaScript language to create complex HTML fragments dynamically. You can use expressions (variables, function calls, loops, ...) to build them.
... will render to:
# JavaScript/JScript in Microsoft WSH

Using just a file with the ".js" extension in Windows, it's possible to run JScript code. Of course within this environment many of the commonly known HTML, DOM and DHTML elements are not available. Instead, you have access to a different set of default tools, for system administrative tasks.
This topic is covered better at Windows Programming/Windows Script Host, from a non-JScript-specific perspective.
# Section 2. Dietary Guidelines

Please use this HELP:EDITING link for information about contributing and editing the book.

## 2.2.4.1.1 Average Macronutrient Distribution Range=

Overview Carbohydrates Proteins Lipids

### 1.4.1.2 Dietary Reference Intakes

Estimated Average Requirement Recommended Dietary Allowance Adequate Intakes Tolerable Upper Limit

### 1.4.1.3 Diet Planning

Dietary Guidelines for Americans USDA Food Patterns Food Labels
# JavaScript/Optimization
## JavaScript optimization
### Optimization Techniques

* High Level Optimization
** Algorithmic Optimization (Mathematical Analysis)
** Simplification
* Low Level Optimization
** Loop Unrolling
** Strength Reduction
** Duff's Device
** Clean Loops
* External Tools & Libraries for speeding/optimizing/compressing JavaScript code

## Common Mistakes and Misconceptions
### String concatenation

Strings in JavaScript are immutable objects. This means that once you create a string object, to modify it, another string object must theoretically be created.
Now, suppose you want to perform a ROT-13 on all the characters in a long string. Supposing you have a rot13 function, the obvious way to do this might be:
Especially in older browsers like Internet Explorer 6, this will be very slow. This is because, at each iteration, the entire string must be copied before the new letter is appended.
One way to make this script faster might be to create an array of characters, then join it:
Internet Explorer 6 will run this code faster. However, since the original code is so obvious and easy to write, most modern browsers have improved the handling of such concatenations. On some browsers the original code may be faster than this code.
A second way to improve the speed of this code is to break up the string being written to. For instance, if this is normal text, a space might make a good separator:
This way the bulk of the new string is copied much less often, because individual characters are added to a smaller temporary string.
A third way to really improve the speed in a for loop, is to move the [array].length statement outside the condition statement. In face, every occurrence, the [array].length will be re-calculate For a two occurrences loop, the result will not be visible, but (for example) in a five thousand occurrence loop, you'll see the difference. It can be explained with a simple calculation :
"x = 0" is evaluated only one time, so it's only one operation.
"x < myArray.length" is evaluated 5000 times, so it is 10,000 operations (myArray.length is an operation and compare myArray.length with x, is another operation).
"x++" is evaluated 5000 times, so it's 5000 operations.
There is a total of 15 001 operation.
"x = 0" is evaluated only one time, so it's only one operation.
"l = myArray.length" is evaluated only one time, so it's only one operation.
"x < l" is evaluated 5000 times, so it is 5000 operations (l with x, is one operation).
"x++" is evaluated 5000 times, so it's 5000 operations.
There is a total of 10002 operation.
So, in order to optimize your for loop, you need to make code like this :
# JavaScript/Primitive data types/Exercises

Topic: Primitive Data Types
1. Write a script with the following steps (the 'power'-operator is '**'):
* Compute the value of 2$^{50}$. Store it in the variable x1.
* Compute the value of 2$^{50}$ + 1. Store it in the variable x2.
* Compare x1 with x2. Are they equal?
2. Repeat the previous exercise with 2$^{60}$ instead of 2$^{50}$.
3. Repeat the previous exercise with 1000 instead of 1.
4. Discuss the results of exercises 1 - 3 with your colleague.
5. Write a script with the following steps:
* Compute the value of one divided by three. Store the result in the variable x1.
* Show x1.
* Multiply x1 by three and store the result in x2.
* Show x2. Which value do you expect?
6. Write a script that shows that 5 and 5.0 are identical values.
7. Write a script that
* asks the user how old he is: prompt(...)
* prompt always returns a string. To perform the calculation, it's necessary to convert the answer to number parseInt, parseFloat, Number
* if his answer is a numeric value, show how often his heart has beaten since his birth (approximately once per second)
* else, give a message like "Sorry. We need a numeric value to perform the computation."
8. Create a HTML page for the previous exercise and embed the solution into the HTML. You can refer to this example.
# JavaScript/Rabbit Trails

We dropped a few links here and there throughout the text of this tutorial to pages which were not essential to learning the basics of JavaScript but might interest the more curious or advanced readers. This is a list of those, in case someone missed them but would like to read them anyway:
* Not Java
* Other Script Types
* Other Places
# JavaScript/Operators/Exercises

Topic: Operators
# JavaScript/Other Script Types

The script element will work in most browsers, because JavaScript is currently the default scripting language of the world wide web. In HTML5, the current spec says that developers should omit the type attribute from script tags, although previously it was recommended to specify what type of script you are using in case the default scripting language changes.
Instead of specifying the scripting language individually in the script element itself, you may also use a meta tag in the head of the document to specify a default scripting language for the entire page.
While the text/javascript was formally obsoleted in April 2006 by RFC 4329 in favour of application/javascript, it is still preferable to continue using text/javascript due to HTML validators' and Internet Explorer web browsers' inability to understand application/javascript

## References

* ↑ https://html.spec.whatwg.org/dev/scripting.html#attr-script-type
* ↑ RFC 4329: Scripting Media Types
* ↑ "application/javascript" and "application/ecmasscript" media types not recognized.
# HKDSE Geography/M2a

HKDSE Geography
* Objectives
* Living with our physical environment
** M1: Opportunities and Risks
** M2a: Rivers
** M2b: Coasts
* Facing changes in the human environment
** M3: Industry
** M4: Sustainable City
development mutually exclusive?
* Confronting global challenges
** M5: Famines and Agriculture
** M6: Tropical Rainforests
** M7: Global Warming
* Elective modules
** E1: Dynamic Earth
** E2: Climate
** E3: Transport
** E4: Zhujiang Delta

## Table of Contents

* Fluvial Processes - What are the major processes operating at different parts of a river?
* Fluvial Landforms - What are the major features created as a result of such variation?
* Human Activities at Rivers - How can human activities influence and alter the river environments? What are the consequences
of this?
* River Management - How does the management of river and coastal systems pose a continuing challenge for people?
# HKDSE Geography/M2a/Fluvial Morphometry

Fluvial morphometry describes what rivers are shaped like. You don't have to know the word - it's just that a title was needed for this section.

## Stream order

The stream order is counted from streams flowing from the source.
* When two first-order streams meet, they form a second-order stream.
* When two third-order streams meet, a fourth-order stream is formed.
* When a second-order stream meets a third-order stream, a fourth-order stream is formed.
* etc.

## Drainage Density

This may appear in map-reading questions.

## Drainage Pattern

A drainage pattern is the 'shape' of the river system. Usually, it suffices to be able to identify each. The formation of each pattern is included, just in case.
| Name | Description | Image | Formation |
| Dendritic | Looks like tree branches; tributaries join at acute angles | | Uniform rock structure (same type/resistance) |
| Rectangular | Tributaries join at right angles (streams are not located at valleys) | | Lines of weakness intersecting at right angles (perpendicular joint sets) |
| Trellis | Tributaries join the main stream at right angles (streams are located at valleys) | File:Trellis drainage pattern.JPG | Alternate layers of resistant and non-resistant rock (soft rocks are eroded to form valleys and thus tributaries) |
| Radial | Rivers flow in all directions from a centre down the sides of a hill | | At a hill (conical/volcano) |
| Centripetal | Rivers flow from different directions towards central depression | still needs one | Inland basins |
# HKDSE Geography/M1/Stay-Leave Decisions

As one can see from the map below, many earthquake-prone areas are densely populated, e.g. Java, Japan, eastern US and New Zealandː
What are the factors that induce people to stay?
* Opportunities are benefits brought by an area.
* Risks encourage people to move away from an area.
* They are also influenced by their own perceptions of hazards, their knowledge and experiences with the hazard, and attributes like age, sex, religious beliefs, traditional values, etc.
̺
# HKDSE Geography/M1/Tectonic Hazards

A hazard is a natural event that brings about great casualties and economic loss to an area.
* Is it a hazard?
* A small earthquake bringing no damage is not a hazard as it does not bring damage to humans.
* A major volcanic eruption in a remote region with no settlements is not a hazard as it does not bring damage to humans.
There are several types of hazards:
* Tectonic hazards include earthquakes, volcanic eruptions and tsunamis.
* Biological hazards include locust swarms, epidemics, pandemics...
* Climatic hazards include tropical cyclones, tornadoes, thunderstorms, cold surges, droughts, heat waves...
* Geologic hazards include landslides, mudflows, earthflows, avalanches...
In this chapter, we shall cover tectonic hazards.
# HKDSE Geography/M2a/Fluvial Landforms

Note that in this section, you should only give examples along the Chang Jiang and in Hong Kong. Nobody is interested in the Huang He, the Nile or the Amazon.
Fluvial landforms are classified into erosional and depositional landforms. Most erosional landforms are concentrated on the upper course; most depositional landforms are concentrated on the lower course.
* Deposition: The 'principle' process in the lower course??
* Do not be misled into thinking that deposition is the most important process in the lower course. It only occurs in specific parts of the lower course, such as inner banks, estuaries, lakes, etc., or under specific situations, such as dry season.
# HKDSE Geography/M2a/Drainage Basins

There are many definitions in the following chapters. You need not recite them! Simply learn what they mean, as well as the associated keywords. There are a few definitions that you should recite, and those are put in definition boxes.
There are also many processes on this page, marked with arrows like ↑ and →. You should know them flexibly apply them to MCQs and DBQs related to this topic. Remember, these processes are used throughout the whole module, so there is no excuse not to know them. You don't have to recite them like you recited the 三字經; if you are familiar with the concepts, they should become 'second nature'.
A drainage basin is, basically, a river system, including the physical land and the water inside.
These words should be recited:
* A drainage basin (catchment area) is the area occupied by the river system.
* A watershed is the boundary if a drainage basin. It is determined by the ridge surrounding the system.
* A confluence point is where tributaries join together.
* Rivers flow from a point called the source.
* A tributary is a smaller stream that joins the main river/main stream.
* Distributaries where when the main river branches out.
* A mouth is where the main river flows into the ocean.
Here are the inputs, processes and outputs of a drainage basin:
| Inputs | Processes | Outputs |
| Precipitation, solar energy, weathered materials | Erosion, deposition, transportation (infiltration, channel flow) | Channel flowing into the sea, runoff, water vapour (in evapotranspiration), sediments (CE90Q20) |