OpenLLM-France/wikimedia huggingface dataset:
# HKDSE Geography/M3/Situation Factors
## Factors Related to Inputs
### Access to Labour

Related industry type: Labour-oriented industry, labour-intensive industry
* Suburbs have better access to quality labour.
* Labour-intensive industries - Industrial areas near residential ones have access to a large amount of labour.

### Access to Raw Materials

Related industry type: Raw material-oriented industry
* Industries for which raw materials are important include metal refining, etc.

### Access to Power

Related industry type: Power-oriented industry Industries that need a huge amount of energy for daily operations tend to be located near to the source of energy to reduce energy loss and leakage during transport and reduce costs. Coal, in particular, is heavy and bulky and thus coal-based industries tend to locate near power sources. Oil and natural gases can be transported by oil tankers and pipelines. Other sources of electricity may be transported through power lines or even the electricity grid.

## Factors Related to Markets
### Proximity to Markets

Related industry type: Market-oriented industry Industries that tend to be located near markets include:
* Perishable products, e.g. fresh food
* Fragile products, e.g. expensive vases
* Timely products that go out of date quickly, e.g. newspapers
* Heavy and bulky products, e.g. iron and coal
The significance of market depends on:
* Individual demand of consumers (incl. their purchasing power)
* Number of consumers

### Proximity to Clients

Some industries need to be close to the clients to meet their needs individually, e.g. property agencies and insurance companies.

### Proximity to Suppliers

Some industries need close connections with suppliers to tell them their needs, e.g. fashion outlets.

### Access to Management

Some industries need efficient management to run effectively. Functions of management including:
* Planning production methods and locations
* Organising workers and assigning posts
* Coordinating various departments in the firm
* Monitoring other departments
* Formulating strategies, such as expansion, integration or changing plant location

## Inputs vs. Markets: Which is more important?

* Procurement costs are the costs of transporting inputs (raw materials and power) to the plant.
* Distribution costs are the costs of distributing final outputs to the markets.
* When procurement costs exceed distribution costs, the firm is raw-material- or power-oriented.
* When distribution costs exceed procurement costs, the firm is market-oriented.
* In general, weight-losing industries such as processing are raw-material or power-oriented because procurement costs exceed distribution costs. (e.g. sugar cane, iron and steel, copper smelting...)
* In general, weight-gaining industries such as assembly are market-oriented because distribution costs exceed procurement costs. (e.g. car manufacturing...)
# HKDSE Geography/M3/China's Iron and Steel Industry Before the 1950s
## Characteristics

The iron and steel industry is a weight-losing processing industry. The procurement costs are higher than the distribution costs. To be exact, it is:
* Raw material-oriented: Iron ore was used to produce pig iron in a blast furnace, which would then be converted into steel in a steel furnace.
* Power-oriented: Coal was burnt in large amounts to produce energy for the production of iron and steel.
Therefore, China's iron and steel plants tended to be located near these plants.

## Distribution

* In the Northeast, particularly Anshan
* In the eastern coastal cities, particularly Shanghai

## Factors

| Favourable factor | Explanation |
| Raw materials | Anshan iron ore fields Ma'anshan iron ore fields |
| Power | Fushun and Fuxin provided coal for Anshan Huainan area produced coal for Shanghai |
| Transport, infrastructure and amenities | During the occupation of treaty ports in eastern China by Western powers and of Northeast China by Russia and Japan, infrastructure and transport networks such as railway were developed intensively. Therefore, it was convenient to develop manufacturing there. |
| Labour | Coastal cities were densely populated and provided a huge labour supply for the industry. |
| Land | Coastal flat land provide ample space for expansion. |
| Market/Agglomeration economies | The ship-building industry in Dalian and car manufacturing industry in Shenyang and Chanchun provided great demand for steel in Liaoning. |
# HKDSE Geography/M3/Classification of Manufacturing

There are several ways to classify manufacturing industries. This page covers three ways. We will discuss the fourth later.

## Heavy vs Light

* Heavy industries use heavy and bulky inputs and produce heavy and bulky outputs.
* Light industries use light and small inputs and produce light and small outputs.
Examples of heavy: ship-building, car manufacturing
Examples of light: electronics, watches, toys, textiles

## Capital-Intensive vs Labour-Intensive

Capital-intensive industries mainly rely on capital. Labour-intensive industries mainly rely on labour.
* Capital is not just about money
* There are two kinds of capital. Working capital refers to money, financial assets like bonds, inventory, etc. Fixed capital refers to machinery, tools, equipment, etc.
Examples of capital-intensive: Information technology, silicon chip manufacturing
Examples of labour-intensive: Watches, toys, textiles...

## High-Technology vs Low-Technology

Examples of hi-tech: Silicon chips, pharmacy
Examples of lo-tech: Watches, toys
# HKDSE Geography/M3/Industrial Location
## Industry

Production means creating value or adding value to something. For example, a piece of wood that costs $30 can be made into a chair costing $40.
An industry refers to a single sector of economic production and is divided into four types:
* Primary industries, which focus on the extraction of natural raw materials;
* Secondary industries, which turn raw materials and intermediate goods into intermediate goods and final goods;
* Tertiary industries, which provide services to other industries and to conumers;
* Quartenary industries, which deal with information.

## Industrial Location

The focus of this module is the factors that cause firms to move in or out an area.
* Push factors are factors that discourage firms from locating in an area.
* Pull factors are factors that encourage firms to locate in an area.

## Single-Plant Firms and Multi-Plant Firms

A firm that that has a single site is a single-plant firm. Its headquarters, production activities, etc., are all performed in a single plant.
Characteristics:
* It is usually in an early state of development and of small scale.
* Few inputs and few outputs.
* It serves local markets rather than international ones.
A firm that has multiple sites is called a multi-plant firm. Different production processes are located in regions with different locational factors. This mode of production is multi-point production.
Sometimes, the firm has different processes spread to different countries. This mode of production is called multinational production and such enterprises are multinational enterprises (MNEs) or transnational corporations (TNCs).
# HKDSE Geography/M3/Historical Development of Hong Kong's Manufacturing Industry

Note: The focus is not in the economic aspect but the spatial distribution changes.

## Before the 1950s

* Mostly limited to small workshops
* Shipbuilding (plus related industries like ship reparing) and light industries (textile, shoes) were the main industries
* Around Victoria Harbour, in the inner city (Hung Hom, Kennedy Town)
Favourable factors:
* [Transport] Good accessibility because of the deep, wide Victoria Harbour
* [Access to Markets] High local demand
* [Government] Free port policy supports entrepôt trade

## Industrialisation period: 1950s-1960s

* Still mostly cottage industries
* More light industries developed (food processing, plastics, wigs)
* Expanding around Victoria Harbour
Favourable factors:
* [Capital/Labour]

## Diversification period: 1960s-1970s

Different types of light industries were developed. They were located along Victoria Harbour, from Kwun Tong to Tsuen Wan on the northern side, and from Chai Wan to the Western District on the southern side. Some industries had been set up in industrial estates in the new towns.
# HKDSE Geography/M3/Manufacturing System
## Inputs

Inputs of a manufacturing system are diverse. (Here, the economic classification of 'land, labour, capital, entrepreneurship' is used.)
* Land
* Raw materials
* Power
* Labour supply (skilled? unskilled?)
* Fixed capital
* Working capital
* Venture capital
* Management
* Technology
* Government policies/Institutional factors
* Markets

## Processes

For manufacturing system, the main processes are:
* Processing - making raw materials ready, e.g. iron and steel making, aluminium smelting industry
* Fabrication - making final goods directly from raw materials
* Assembly - making final goods from intermediate goods

## Output

The outputs include:
* Useful outputs: Finished products, which are sold in the market for money.
* Useless outputs, such as solid waste, polluted air, etc.
Money is used to buy more inputs. This results in a positive feedback loop.
# Java Persistence/EclipseLink

EclipseLink is the open source Eclipse Persistence Services Project from the Eclipse Foundation. The product provides an extensible framework that allows Java developers to interact with various data services, including databases, XML, and Enterprise Information Systems (EIS). EclipseLink supports a number of persistence standards including the Java Persistence API (JPA), Java API for XML Binding (JAXB), Java Connector Architecture (JCA), and Service Data Objects (SDO).
EclipseLink is based on the TopLink product, which Oracle contributed the source code from to create the EclipseLink project. The original contribution was from TopLink's 11g code base, and the entire code-base/feature set was contributed, with only EJB 2 CMP and some minor Oracle AS specific integration removed. This differs from the TopLink Essentials Glassfish contribution, which did not include some key enterprise features. The package names were changed and some of the code was moved around.
The TopLink Mapping Workbench UI has also been contributed to the project.
EclipseLink is the intended path forward for persistence for Oracle and TopLink. It is intended that the next major release of Oracle TopLink will include EclipseLink as well as the next major release of Oracle AS.
EclipseLink supports usage in an OSGi environment.
EclipseLink was announced to be the JPA 2.0 reference implementation, and announced to be the JPA provider for Glassfish v3.
* EclipseLink Home
* EclipseLink Newsgroup
* EclipseLink Wiki
# Lingwa de planeta/Simple sentence - keys

1.1
* we live - nu jivi
* they (pl.) live - li jivi
* he hopes - ta nadi / lu nadi
* she hopes - ta nadi / ela nadi
* they (pl.) know - li jan
* I know - me jan
* you talk - yu shwo
* you all talk - yu oli shwo
* I talk - me shwo
1.2
* Do you love? - Ob yu lubi?
* I don't love. - Me bu lubi.
* Doesn't she love? - Ob ela bu lubi?
* She doesn't know. - Ela bu jan.
* Doesn't he hope? - Ob lu bu nadi?
* He lives. - Lu jivi.
* Don't you understand? - Ob yu (oli) bu samaji?
* We hope. - Nu nadi.
* Do they talk? - Ob li shwo?
* They don't know. - Li bu jan.
1.3
* Did you love? - Ob yu lubi-te?
* I will love. - Me ve lubi.
* Will he understand? - Ob ta ve samaji? / Ob lu ve samaji?
* Does she hope? - Ob ela nadi?
* She hoped. - Ela nadi-te.
* She won't hope. - Ela bu ve nadi.
* We will live. - Nu ve jivi.
1.4
* I didn't know. But you talked. Now I know. - Me bu jan-te. Bat yu shwo-te. Nau me jan.
* She believes and hopes. - Ela kredi e nadi.
* They don't see and don't hear, but they talk. - Li bu vidi e bu audi, bat shwo.
* They don't understand, but they work. - Ta bu samaji, bat gun.
* I talk so you understand. - Me shwo dabe yu samaji.
* She hopes because she loves. - Ela nadi bikos ela lubi.
* You don't know or don't understand. - Yu bu jan o bu samaji.
* She didn't think, she did knew. - Ela bu dumi-te, ela ya jan-te.
* Don't you believe? Yes, I do believe! - Ob yu bu kredi? - Doh, me kredi ya!
Back to lesson 1
# JPEG - Idea and Practice/The decoding and drawing

The program that draws the picture from the file must do all the things that we have done in the opposite order. The width and the height of the picture and the quality factor(s) must be read from a header.
Let us sum up what must be done in the construction of the data part of the file:
    Divide up the picture in sxs-squares
    For each square:
       For each point, convert the RGB values to YCbCr values
       For the Y, Cb and Cr component, cosine transform the s$^2$ numbers
       Order these 3 x s$^2$ numbers after the zigzag principle
       Replace the first number of an s$^2$-sequence (the DC term) by its derivation from the analogues number for the preceding square
       Quantize the 3 x s$^2$ numbers
    In the resulting sequence of integers, replace each unbroken sequence of zeros by its length (possibly 0)
    Write each integer as a sequence of bits (having two parts: a code and a digit expression), so that the sequences can be joined together into a continuous stream of bits.
After the header (stating the width and the height and the quality factor) has been read, we must convert each read byte of the file to an 8-block of bits, and then decode the resulting stream of bits. Each sequence of bits determining an integer consists of two parts. The first part forms a code, which is designed so that we can see where it ends. We decode it, and in this way get a natural number m. The second part of the sequence is the next m bits in the stream, and these m bits are the binary digit expression of an integer. However, if this sequence begins with 0, this indicates that the integer is negative, and the 0 must be replaced by 1. Every second integer (being non-negative) states a number of zeros, and we (imagine that we) write down these zeros. We do this until we have numbers enough to draw an sxs-square of the picture, namely 3 x s$^2$ numbers. These 3 x s$^2$ numbers are obtained by cosine transform and by quantization of the s$^2$ colour values for the three components. They must first be de-quantized by multiplying by the numbers we have divided by. After this the very first number of each s$^2$-sequence (the DC term) must be added to the corresponding number for the preceding sxs-square, as these numbers represent differences. By the inverse zigzag procedure, each of the three s$^2$-sequences is converted to a sxs-matrix of numbers g(u, v), u, v = 0, 1, ..., s-1, and to this matrix the inverse cosine transform is applied, giving a matrix f(i, j), i, j = 0, 1, ...,s-1, of colour values for the Y, Cb and Cr component. For each point (i, j) in the sxs-square, the three colour values f(i, j) make up an YCbCr triple, which is converted to a RGB triple, and the point in the picture corresponding to the point (i, j) in the square is coloured with these RGB values.
# JPEG - Idea and Practice/References

* Information Technology - Digital Compression and Coding of Continuous-Tone Still Images - Requirements and Guidelines/Recommendation T.81 (1992), ITU (International Telecommunication Union). at W3.org
* JPEG File Interchange Format/Version 1.02 (1992) by Eric Hamilton, C-Cube Microsystems. at W3.org
* Official Joint Photographic Experts Group site
# JavaScript/Exercises

You can solidify your JavaScript knowledge with some additional exercises and games. The pages don't offer additional information; they use the already shown language aspects plus access to the DOM tree.
To keep everything manageable within a WikiBook, we put the source code always into one file. You may divide it into different files on your computer, e.g., separate HTML-, CSS-, JS-, and image-files. For the same reason, the examples don't use any games engine, framework, library, or server access. They are standalone scripts that need nothing but a browser.
The examples are divided into two groups. The first group doesn't use a graphical context. They rely purely on events and pure HTML elements like text, buttons, links, or colors. The second group additionally contains a canvas. Within such a canvas, you can use graphical elements like circles, rectangles, lines, ...

### Non-graphical examples

* Guess a number
* Check your reaction time
* TicTacToe

### Examples with graphic

* Introduction
* Speed; Detect collisions
* Moving Walls
# JavaScript/Exercises/ReactionTime

Check your reation time

## HTML + CSS

The app shows a grid of 16 green areas. When the game starts, two of these fields change their color to red. Try to click them as fast as possible. Your reaction time is shown at the bottom.
First, we need an HTML file plus CSS to realize the user interface. It shall contain:
* A caption.
* A 4 x 4 grid with 16 areas.
* A button to start the game.
* A feedback area where the reaction time is shown.
The HTML might look like this:

## JavaScript

Next, we have to implement the game's functionality within JavaScript. We need:
* Variables to store the start and end timestamp.
* Event handler(s) to react on 'click' events to the areas. It's helpful if all areas use the same event handler instead of having 16 individual event handlers.
* An event handler to react to the 'Start' button.
* A function that randomly selects an area and changes its color to red.
* A function that counts how many areas are red.
The JavaScript part may look like this:

## Extensions

You can extend the app in different ways.
* Make it more complicated by using more areas, smaller areas, or more than two red areas.
* Show a list of all attempts, possibly sorted by the reaction time.
# JavaScript/Development Tools

When working with JS (or HTML, CSS, ...) you need some tools for handling the source code and becoming more productive. First, there are tools helping you to develop the source code. Second, the code can be validated against syntax rules. Next, the code can be 'beautified' (indentations, line breaks, empty lines, ...). And lastly, the code can be optimized - in regard to size, performance, or encryption.

## Development Stage
### Locally installed Tools

The simplest way to write the code is using a pure text editor like Notepad++, Vim, or Gnome gedit or Gnome Text editor. You shall create a subdirectory where all the files of your project are located, e.g. .../firstProject. There you can create the files, e.g. excercise_1.1.html. Start the files as described in the chapter First program. The result shall be seen in your browser.
This approach has its pros and cons. The tools are easy to install, and they have simple user interfaces. But they don't give you much help; they just collect the text you write. Sometimes they support syntax highlighting or automatic indentation, mostly no hints concerning syntax errors. The user is forced to know the syntax of the language with which he is currently working. We believe that this approach is well suited for beginners: they shall perform their exercises at a low level.
At the next level, you can use a more complex tool, e.g. Visual Studio Code. In addition to text handling, they offer additional features from syntax highlighting up to debugging or extensive support for developer teams.

### Online

As an alternative to locally installed tools, you can work with an online JS tool, e.g. JsFiddle, W3Schools, or PlayCode. They usually offer an integrated environment for HTML, CSS, and JS, including a browser preview and access to the browser's console.

## Validation

It's likely that in a first step your code contains some syntactical errors, e.g. f0r instead of for. Browsers are very lenient and try to repair or ignore simple errors silently. Of course, all your source code shall conform to the given syntactical rules. But because the browsers offer limited access to validate it or to locate the erroneous line, it's necessary to use a tool for locating and explaining syntactical errors.
Such validators sometimes offer not only validation but also some more features like formatting or a preview, e.g. JS validator, JS + HTML validator, W3C validator for HTML, FreeFormatter.

## Optimization, Obfuscating

The time necessary to transfer HTML and JS code from a server to a browser can be shortened by stripping out all unnecessary blanks, newlines, tabs, etc. .
When JS code is loaded into a browser, it can easily be viewed by the user. If you want to hide your source code, you can use the obfuscating technique. It generates a more or less unreadable code (for humans) out of the original code.
The previous JS + HTML validator offers all of these techniques.
# JavaScript/Exercises/MovingWalls

The example combines some of the shown features:
* It contains a class Rect and its sub-class Smiley.
* Some walls with a rectangular shape move from right to left across the scene. They reappear on the right side after reaching the left border.
* Two smileys populate the scene.
* One smiley can be moved by using the buttons or the keyboard keys 'ArrowRight', ... .
* Two helper-functions support the detection of rectangles: detectBorderCollision and detectRectangleCollision. The first one detects the collision of a graphical object with a surrounding rectangle, e.g., the canvas. The second one detects a collision of two rectangles.
You can extend the example in various ways:
* Create walls randomly Math.random.
* Introduce some kind of a 'level' by changing the speed, the number, the size, or the shape of walls.
# JavaScript/Exercises/GuessNumber

Guess a hidden number
The app chooses a random number and asks the user to guess it. The user has a limited number of attempts.
First, we need an HTML file plus CSS to realize the user interface. It shall contain:
* A caption
* A short description of the game
* A text area to read the user's attempts plus a button to send the user's input to the app
* Another text area where the app gives a response to the user, e.g.:
    * The hidden number is smaller
    * The hidden number is greater
    * Bingo! That's the hidden number
* A button to 'reset' the game
* A button to unfold the random number
The HTML might look like this:
Next, you develop the app's logic by adding events to buttons and functions within the script element.
* To generate a random number you can use Math.floor(Math.random * 60) + 1.
* The HTML body element shall contain an onload event whose event handler initializes the game. The same function is called when 'reset' is pressed.
* To get access to the two text areas, they must have an id attribute.
* Read from and write to the text areas via 'value': document.getElementById("...").value.
All in all, the app might look like this:
Hint: The user can find the number with a maximum of 6 questions if he uses the strategy of BinarySearch: he always has to answer with the average of the current known lower and upper limit, which is 30 in the beginning. If the hidden number is greater, he shall answer 45. If it's smaller 15, ... .
# JavaScript/Dates/Exercises

1. You can show the offset between your timezone and UTC by using getTimezoneOffset. Show this offset.
2. Show the offset again, but don't use getTimezoneOffset. Instead, work with Date.now and Date.UTC.