OpenLLM-France/wikimedia huggingface dataset:
# Lua in SpringRTS/Lua integration with Spring

The Spring engine provides a rich amount of functions and variables that can be used to develop a mod, a map or a widget. It is possible to make mods and maps by just replacing existing 3d models with your own or just tweaking some parameters in the map/mod files. That is the simpliest way to create a new map or mod but doesn't give much freedom. That's where Lua comes to let the user change things dynamically. With Lua you can add script files to perform any kind of task. You can have a script to handle better artificial intelligence, a script to handle effects, a script to handle unit animations and more. The only limitations are the ones given from the language itself(Lua). If you are developing a map or a mod the script files are just the so called Gadgets. With Lua you can communicate with the Spring engine. That communication takes place with callins, callouts, global variables and global constants.
# Lua in SpringRTS/Callins/UnitSeismicPing
## UnitSeismicPing
### Return values

x, y, z, strength
# Lua in SpringRTS/Callins/WorldTooltip
## WorldTooltip
### Return values

ttType, data1, data2, data3
# Lua in SpringRTS/Gadgets

Gadgets are script files that must be present from all players. That's the reason gadgets are used in mods and maps as those should always have exactly the same data. Gadgets can use callins and callouts from both synced and unsynced mode but you need a special way to let synced and unsynced code to communicate with each other.
When making a gadget, always separate synced code from the unsynced code. That can be done with using:
That makes sure that the code blocks are in the right place. Not using the gadgetHandler:IsSyncedCode will result in executing the code in both synced and unsynced mode. That in many occasions will create errors so it's not wise to do so. Specify whether the code should be used in synced mode or unsynced.
When making a gadget you should always place the game events(UnitCreated, UnitDestroyed, ...) in the synced block of code and the events that just has with Lua graphic to do should be placed in the unsynced block of code. An easy way to determine if something should be placed in unsynced or synced is to determine if the code should have the same effect on all users or only you. The reason Lua graphics are placed in the unsynced code is that even if one user doesn't get the right graphics it doesn't mean that other players are having the same issues. So doing so makes the gameflow go smooth. Think if UnitDestroyed for example was in the unsynced code. Then a player with a slower computer would probably get the event a bit slower thus not making the game playable for him as he would get events a bit delayed.

## Sync/Unsynced communication
### Using globals:

One way to communicate between synced and unsynced code is to use globals. We use the _G table from Lua to add a variable as global:
Here follows a demonstration of synced/unsynced communication via globals:
In the example we declare a local variable in the synced part of the code and try to change the value of it while still in synced mode. Then we save the value as a global. After that if we want to read the value in the unsynced code we just use the "SYNCED." table.

### Using SendToUnsynced function

A second way to do this is to use the SendToUnsynced function.
# Lua in SpringRTS/Callins/UnitTaken
## UnitTaken
### Return values

unitID, unitDefID, unitTeam, newTeam
# Lua in SpringRTS/Callins/UnitUnloaded
## UnitUnloaded
### Return values

unitID, unitDefID, teamID, transportID
# Lua in SpringRTS/Callins/UnitPreDamaged
## UnitPreDamaged
### Return values

unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, attackerID, attackerDefID, attackerTeam
# Java Programming/Database Programming

* Navigate Advanced topic: ( v • d • e )
* Networking
* Database programming
* Regular Expressions
* Libraries, extensions and frameworks
* 3D programming
* Java Native Interface
* Invoking C
* Byte Code
Java uses JDBC, an API that defines how a client may access a database. Its drivers may be installed first.

## Connecting to Microsoft Access databases

The following is used to open an ODBC connection to an Access database. Note that the username (and password, if applicable) are given in the DSN rather than the getConnection call. This is a MS Windows-only example, due to the requirement for the Microsoft Access Driver.

## Connecting to Oracle Database

This script returns the database size:

## Known errors
### package oracle.jdbc does not exist

If you have Oracle Database on your PC, just add to the classpath its following files:
* C:\oracle12\app\oracle\product\12.1.0\dbhome_1\jdbc\lib\ojdbc7.jar
* C:\oracle12\app\oracle\product\12.1.0\dbhome_1\sqlj\lib\runtime12.jar
Otherwise, ojdbc7.jar can be downloaded from http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html, and add it to the compilation. Eg:

### ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Just add " as sysdba" after your Oracle account name, eg:

## References

* ↑ http://www.cloudera.com/documentation/archive/cdh/4-x/4-7-0/CDH4-Installation-Guide/cdh4ig_topic_13_7.html
* ↑ http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
* ↑ http://docs.oracle.com/database/121/IMURG/ch_appdev.htm#IMURG11551
# Java Programming/EJB

* Navigate Concurrent Programming topic: ( v • d • e )
* Threads and Runnables
* Basic Synchronization
* Client Server Programming
* Remote Method Invocation (RMI)
* Enterprise JavaBean Programming (EJB)
* Java Spaces Programming (Jini)
Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform, Enterprise Edition (Java EE). EJB technology enables to create distributed, transactional, secure and portable application component objects.
EJB supports the development and deployment of component based business applications. Applications written using the Enterprise JavaBeans architecture are scalable, transactional, and multi-user secure. These applications may be written once, and then deployed on any server platform that supports the Enterprise JavaBeans specification.

## EJB Features

* Security Management
* Persistence Management
* Transaction Management
* Distributable Interoperable Management
* Exception Management

## Types of EJB

* Session Beans
** StateFull Session Beans
** Stateless Session Beans
* Entity Beans
* Message Driven Beans

## Problems with EJB as a component based development

EJBs are an attempt to create component based application development. With EJBs it is easier to develop components, but the same basic and fundamental maintenance problem will still be there. That is the dependencies between the client and the components. The usage of a component is fixed, changes on the component interface cause to break the client code. The same client/server problem comes back, that is as the users of a component increases the maintenance of that component getting harder and harder until it goes to impossible.
For a true component based application development we need to standardize the usage of a component. The client must somehow flexibly figure out automatically how to use a component, so component changes don't affect any of the clients using that component. Without that flexibility, a true component based application development will remain as an idea, a dream, a theory without significant practical use. If we had that flexibility, it could cause a paradigm shift in the software development industry.
JINI was an attempt from Sun to address this flexibility problem. In JINI, the client download the component interface implementation and execute it in the client space.
So we need to mix (somehow) EJB and JINI technologies to come up with a true flexible component based technology.

## References

* Sun EJB Home

## See also

* EJB in Jakarta EE

## External links

* EJB 2 Tutorial, interactive Java Lessons
# Java Programming/Exceptions

* Navigate Exceptions topic:( v • d • e )
* Throwing and catching exceptions
* Checked exceptions
* Unchecked exceptions
* Preventing NullPointerException
* Stack trace
* Nesting exceptions (chained exceptions)
* Topics:
* Preface
* Getting started
* Language fundamentals
* Classes and objects
* Aggregate
* Exceptions
* Concurrent Programming
* Javadoc & Annotations
* Designing user interfaces
* Advanced topics
The ideal time to catch an error is at compile time, before you even try to run the program. However, not all errors can be detected at compile time. The rest of the problems must be handled at run time through some formality that allows the originator of the error to pass appropriate information to a recipient who will know how to handle the difficulty properly.
Improved error recovery is one of the most powerful ways that you can increase the robustness of your code. Error recovery is a fundamental concern for every program you write, but it's especially important in Java, where one of the primary goals is to create program components for others to use. To create a robust system, each component must be robust. By providing a consistent error-reporting model using exceptions, Java allows components to reliably communicate problems to client code.

## Flow of code execution

In Java, there are two main flows of code executions.
* Normal main sequential code execution, the program doing what it meant to accomplish.
* Exception handling code execution, the main program flow was interrupted by an error or some other condition that prevent the continuation of the normal main sequential code execution.

### Exception

    Exceptions are Java's way of error handling. Whenever an unexpected condition occurs, an exception can be thrown with an exception object as a parameter. It means that the normal program control flow stops and the search for a catch block begins. If that is not found at the current method level the search continues at the caller method level, until a matching catch block is found. If none is found the exception will be handled by the JVM, and usually the java program terminates.
    When a catch "matching" block is found, that block will be executed, the exception object is passed to the block as a parameter. Then normal program execution continues after the catch block. See Java exception handling syntax.

### Exception Object

    This is the object that is "thrown" as a parameter from the error, and passed to the catch block. Exception object encapsulates the information about the error's location and its nature. All Exception objects must be inherited from the java.lang.Throwable. See the UML diagram below.

### Matching rule

    A thrown exception object can be caught by the catch keyword and specifying the exception object's class or its super-class.

### Naming convention

    It is good practice to add Exception to all exception classes. The name of the exception should be meaningful, and should represent the problem. For example, CustomerNotFoundException may indicate that a customer was not found.
# Java Programming/Glossary

This is a glossary of the book.

## A
### annotation

    A means of attaching metadata to methods and classes directly in the source code.

## B
### byte code

    Code interpreted by the Java virtual machine; the target code of Java compilation.

## G
### generics

    A means of passing a data type as an argument of another type, such as Vector<JButton>;

## P
### primitive type

    One of the types that do not require allocation on stack, such as int, byte, or long.

## R
### reflection

    A way of treating classes and methods as objects on their own, to be referred to during runtime, for instance by quering a particular class about its methods and their parameters.
# Java Programming/Design Patterns

A design pattern is not a finished design, it is a description of a solution to a common problem. A design pattern can be reused in multiple applications, and that is the main advantage of using it. It can also be seen as a template for how to solve a problem that can occur in many different situations and/or applications. It is not code reuse as it usually does not specify code, but code can be easily created from a design pattern. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved.
Each design pattern consists of the following parts:

## Problem/requirement

    To create a design pattern, we need to go through a mini analysis design and may be coding to test out the solution. This section state the requirements the problem we want to solve. This is usually a common problem that will occur in more than one application.

## Forces

    This section states the technological boundaries, that helps and guides the creation of the solution.

## Solution

    This section describes how to write the code to solve the above problem. This is the design part of the design pattern. It may contain class diagrams, sequence diagrams, and or whatever is needed to describe how to code the solution.
A design pattern can be considered as block that can be placed in your design document, and you have to implement the design pattern with your application.
Using design patterns speeds up your design and helps to communicate your design to other team members.

# Terminology

The design patterns are not always simple to understand as it is a theoretical vision of programming. You must distinguish the abstraction and the representation. For example, we have a method that implements an addition:
* public int add(int a, int b) {
* return a + b;
* The abstraction is only the visible part of your code outside. It is the contract between the provider and the client code. In Java, this theoretical concept is mostly the signatures of the methods of a class or an interface.
* The representation is the way a problem is resolved. It follows the contract of what is given as input and what is expected to be returned. In Java, this theoretical concept is mostly the code lines in a class and any internal calls to other methods or classes.
| public abstract int add(int a, int b); | public int add(int a, int b) { return a + b; } |
| abstraction | representation |
# Meitei Culture/Mythology/Goddesses/Thoudu Nungthen Leima

Goddess Thoudu Nungthen Leima, also known as Thoudu Nungthel Leima, was born on a stone slab in a riverbed, as a divine incarnation of supreme mother earth goddess Leimalen. She was destined to be found out by God Koupalu and his good lady Goddess Kounu, on their way. She was adopted as their own daughter by two divine couple. As time went by, she grew up into a beautiful maiden. She was given hand in marriage to God Loiyalakpa (also known as Tollongkhomba), the son of God Marjing. Thoudu Nungthen Leima's beauty knew no bounds. For this reason, even after her marriage, she was desired by another young God Khoiriphaba. To prevent any further problem, God Koupalu and God Marjing tricked Khoiriphaba to give up the idea of Thoudu Nungthen Leima.
# Meitei Culture/Mythology/Goddesses/Panthoibi

Panthoibi, also known as Nongpok Leima, was an ancient princess of the Ningthouja dynasty, married to a prince of the Khaba dynasty, later eloped to Nongpok Ningthou, a King of the Selloi Langmai people, living in the Nongmaiching Mountains. She was later deified as a divine figure, and worshipped as a motherly goddess of love, romance, lust, sex, fertility, prosperity and civilization. She was later characterised in many legends, including the Numit Kappa, as a statesman, who negotiated with the Sun King God, to come out of his hiding spot inside a cave, and to shine once again in the sky. Panthoibi's cult and pantheon spreads across all the Meitei realms. Many goddesses and deified ladies were associated with the identity of Panthoibi. Phouoibi, the goddess of agriculture, Nongthang Leima, the goddess of seduction, Leimalen, the mother earth goddess, are usually related to Panthoibi. She is often compared as related to Thoibi, an ancient princess of the Moirang dynasty of the Kege Moirang (Keke Moilang) kingdom.
# Meitei Culture/Mythology/Goddesses/Thongak Leima

Goddess Thongak Leima, also known as Thongak Lairembi, is a gatekeeper of the entrance door to reach the land of death of the underworld kingdom, ruled by her husband Thongalen. She is predominantly worshipped in the Langgol Hills (also spelled as Langol Hills) in the outskirts of Imphal city since ancient times by the Meitei people, due to which she is also known as Langgol Lairembi, literally meaning Langgol Goddess, or Langgol Leima, literally meaning Langgol Queen. She controls entry and exit to and from the land of death and the land of living. Even if any superior God orders for the departure or arrival of anyone to and from the netherworld and the earthly human world, she has the authoritative powers to open or close the gate for or against them. For this reason, in early times, ancient Meitei people used to worship her to give long life, to close the door of death for them, to close the door of bad health for them.
# Meitei Culture/Non-Meiteis

The concept of someone being a non-Meitei (alias non-Meetei) is very complex if they are indigenous to Kangleipak, because the Meitei language term "Meitei" (or "Meetei") means "an amalgamation of people". However, the group of people who are identified as "Meitei people" in today's world, are based on their mother language, being the so called Meitei language, in most cases.
However, anyone who follows the traditional Meitei religion (known as "Sanamahism" or "Lainingthouism" in present times), irrespective of their mother language, may also be identified as a Meitei.
Irrespective of their mother language and religion, any person who has a Meitei family name (or surname) or ancestral roots, may also be identified as a Meitei.
Therefore, any person who isn't fitted in any of the above mentioned conditions are classified as a non-Meitei.
# Meitei Culture/Mythology/Goddesses/Nganu Leima

Goddess Nganu Leima, also known as Nganureima, is the queen of all the ducks, geese, swans and other waterfowls (water birds), living in the world. She is one of the noble princesses of the Heavenly Realm. She is one of the most favorite daughters of Sky Father Salailen. She has the freedom of roaming in the earthly realm according to her own wish. She once happened to fell in love with a mortal man, who was about to be killed by a selfish evil king. She intervened the situation and rescued her lover using her divine powers. Many legends say that she could call all the water birds of the entire world to a single spot at a single time. She shares many of her adventures with two of her sisters, Khunu Leima, the goddess of pigeons, and Shapi Leima, the goddess of rodents.
# Meitei Culture/Mythology/Goddesses/Thumleima

Goddess Yoibu Noinu Thumleima, also known as Thumkhong Lairembi, is a goddess of salt and natural salt wells (salt brines). She is one of the noble princesses of the celestial realm. She is one of the daughters of the Sky God Salailen, the Heavenly Father. She was sent down to earth to prosper the human civilization. Obeying her Supreme Father's divine orders, she and her sisters descended from the celestial realm to the earthly realm. On her way, she had a lot of adventures. Afterwards, she used to live in the natural salt brines (salt wells). Since early times, ancient Meitei people used to worship her to get blessings of good salt yield from the brines. Salt was considered as a wealth in ancient Meitei civilization. People were often rewarded for good works in the form of lumps of salt.
# Meitei Culture/Mythology/Goddesses/Yumchao Leima

Goddess Yumchao Leima, also known as Yumjao Leima or Yumjao Lairembi, is the all time ruling supreme queen mother goddess of the royal houses of ancient Meitei kings. She is usually depicted as a gentle kindhearted mother, sitting on a grand throne.
# Meitei Culture/Mythology/Goddesses/Phouoibi

Goddess Phouoibi, also known as Phouleima, is a divine female personification of the paddy plant, growing in the agricultural lands. She is one of the noble princesses of the Celestial Realm. She is one of the favorite daughters of Heavenly Father, Salailen, the Sky God. She was sent by her father down to earth to prosper the human civilization. She, along with her other sisters, descended from the heavenly realm to the earthly realm, obeying the divine orders of their Supreme Father. On her way, she used to face multiple adventures. She even fell in love with Akongjamba, a mortal handsome noble man of Kege Moirang (Keke Moilang) kingdom. But fate did not permit them to unite. So, she and her mortal lover reincarnated six further rebirths, thereby enacting the divine seven epic cycles of rebirths (incarnations). Goddess Phouoibi (as Phouleima) and her husband God Phouningthou are worshipped as deities of agricultural fertility and harvesting, by the ancient Meitei people.
# Meitei Culture/Mythology/Goddesses/Shapi Leima

Goddess Shapi Leima, also known as Shabi Leima, is the queen of all the rodents living in the world. She is one of the noble princesses of Heavenly Realm. She is one of the most favorite daughters of Sky Father Salailen. She has the freedom of roaming in the earthly realm according to her own wish. She once happened to fell in love with a mortal man, who was about to be killed by a selfish evil king. She intervened the situation and rescued her lover using her divine powers. Many legends say that she could call upon all the rodents of the entire world to a single spot at a single time. She has other two sisters, Nganu Leima, the goddess of water birds, and Khunu Leima, the goddess of pigeons, with whom she shares numerous adventures.
# Meitei Culture/Mythology/Goddesses/Nongthang Leima

Goddess Nongthang Leima, also known as Nongthang Lairembi, was a primordial deity, born from the thunder and lightning in the primeval chaos (or void), known as Atingkok. She was a daughter of Heavenly Father Salailen (who's the Atingkok himself). Her foremost duty was to seduce Prince Haraba (another name for Pakhangba) to divert his attention from disturbing his elder brother Sanamahi (alias Ashiba) in the creation of the world. Nongthang Leima used dance and music, along with her feminine physical beauty, to entice Haraba. She succeeded in her task. She was one of the earliest priestesses of the mythical world. She was both a goddess as well as a priestess (nun). She was one of the noble princesses of the Celestial Realm. She was one of the favorite daughters of the Sky Father Salailen. In later times, the identities of numerous historically deified ladies got merged to her cult and pantheon. She was often associated with Lady Panthoibi, another deified ancient ancient Meitei princess of the Ningthouja dynasty.