OpenLLM-France/wikimedia huggingface dataset:
# A Beginner's Guide to D/Short Introduction to Programming

Written by Derek Parnell.

## What Is Programming

Computers are machines that simply execute the instructions given to it by a program, and programming is the process that creates the set of instructions that make up a program (or part of one). Computers do not think in the same sense that we do, they do not ponder the instructions given to them, nor do they decide to disregard them or alter them. Computers blindly follow the set of instructions, that you as a programmer give it.
And this is what makes programming a challenge. It is not so easy to create the exact set of instructions to get a specific task done.

## How to Cook a Pancake

Let's tell a really, really stupid, but capable, person how to cook pancakes.
* In a bowl, put in a cup of flour, one egg, and enough milk to make a smooth mixture.
* Mix it with a wooden spoon until it is smooth.
* Heat a frying pan with a small knob of butter until melted.
* Place a cup of the mixture into the frying pan and cook one side until bubbles form.
* Carefully turn the half-cooked pancake over and continue cooking the other side until it is firm.
* Place cooked pancake on a plate and repeat these steps until all the mixture is used.
Simple and obvious, no?
No, not really. For example, I didn't say to tip the flour out of the cup into the bowl, so a computer would have done literally what I said to do - "put a cup of flour" into the bowl. Then there is the egg; I didn't say to crack the egg and only put its contents (yolk and white) into the bowl, so the shell would have also gone in. And what exactly is a "smooth" mixture?
Further literal execution of these instructions would have the computer trying to mix a bowl rather than the contents of the bowl. And this assumes that it knows what "mixing" is! And have you ever tried to use a knob of butter to heat a frypan? And what is a "knob" of butter? Will the computer wait until the butter is melted or the frypan is melted? Again with the cup; are we cooking it or its contents? How many bubbles do we wait for - two, three, ... ? What if no bubbles show up - do we keep cooking it while it rapidly burns to a cinder? The last instruction tells us to repeat but literally that includes all the steps, in a never ending frenzy of pancake making.
I don't mean to scare you but it is important to realize that computers take your programs literally, and thus you have a responsibility to be accurate and precise. That is the challenge of programming.

## What is Programming (revisited)

It is the process of writing algorithms and describing data so that a computer can correctly perform the task required of it.
# A Beginner's Guide to D/Templates and Generic Programming/Mixins

D's classes only support single inheritance and interfaces. While interfaces are sufficient to reproduce many of the uses of multiple inheritance, there are some things they don't suffice for. Mixins were originally added to the language to fill in many of these other cases.

## Regular Templates

Before discussing mixins, it is necessary to discuss the normal syntax for templates. The class and function template syntax discussed in the previous two chapters is actually a shorthand for the regular syntax. A "normal" template looks like this:
A template consists of a name (Foo), a parameter list (A, B, C), and a series of declarations (a, b, c). When a template is instantiated, the parameters are replaced with the arguments provided by the instantiation. The declarations are placed at the same scope as the template.
Since the above example is not very useful, here's what the long form of the "min" function from the previous section looks like.
This also shows another interesting feature of D's templates. If a template contains a single declaration, and that declaration has the same name as the template, then one can refer to that single member implicitly. Combined with implicit function template instantiation (discussed in the previous section), the following are all equivalent:

## Mixins

Normally, when a template is instantiated, its declarations are inserted into whatever scope the template exists in. With a mixin, the declarations may be inserted into the current scope. A trivial example looks like this:
(Note that if the template's parameter list is empty, then the mixin may elide the !.) The result is that the struct S has two members: int i and char s.
Mixins may also be named, allowing the same mixin to be mixed-in to the current scope more than once. Here's a more complex example.
# A Beginner's Guide to D/Templates and Generic Programming

Written by Kirk McDonald.
This chapter covers D's generic and meta-programming features.

## Table of Contents

* Template Classes
* Template Functions
* Mixins
* Advanced Templates
# A Beginner's Guide to D/The Basics

This chapter introduces some fundamentals of the D programming language. When you are finished with it, you will be able to do some very simple interaction with the user.

## Table of Contents

* The Structure of D
* Start at the Beginning
* Introduction to Modules
* Types and Math
* Basic Output
* Basic Input
# A Beginner's Guide to D/The Basics/Basic Output

One of the most basic operations you can do with a program is to print out some text in a console window (sometimes also called DOS-box). Even if you later only use graphical environments to show nice windows on the screen, writing to a console is always helpful to tell the programmer what the program is currently doing so he/she can check if it does the right thing and can find bugs (mistakes in the source code) in the program.
Very versatile functions to write something to the console are writef and writefln.
First of all, these functions are placed in a separate module named "std.stdio", so you have to import it, as you have learned in Introduction to Modules.
Here is a very simple program that only writes a single string literal to the console:
If you compile and run it, you will see the text
on the screen.
As you have learned in Types and Math you can use escape sequences, also in writefln:
Output:
The difference between writef and writefln is only that the latter automatically appends a "\n" after the output. Everywhere where you use writefln you can instead use writef and append the newline yourself, this is just less practical.
Output:
There was no space after the "all" in the source, therefore there isn't a space in the output either.
It is a good idea to always have a newline after the last output of a program.

## Printing Variables

writef and writefln are useful for more than just printing string literals. They can print any combination of variables with one of the basic numeric types or string types or arrays of such items.
Output:
As you can see in the last output of the example, you can also write multiple expressions as a comma-separated list of parameters to writef and writefln.
This last line can also be written in another way with a format string which is more common to C programmers. A format string is a single string containing some fixed text and placeholders for data which is contained in variables or expressions. The values which must be placed in the format string are appended as additional parameters after the format string itself.
A placeholder in the format string begins always with a percent sign % and ends with a letter which defines how to output the value (the format character). For some letters there can be additional characters between percent sign and letter to control the output more precisely (especially for numbers).
The default all-purpose format character is the 's' which can be used everywhere. So the line above can be rewritten as
with exactly the same output.
[TODO: More details] (stub)
# Ada Programming/Libraries/Ada.Containers.Indefinite Multiway Trees

This language feature has been introduced in Ada 2012.
Ada.Containers.Indefinite_Multiway_Trees is a unit of the Predefined Language Environment since Ada 2012.

## See also
### Wikibook

* Ada Programming/Libraries/Ada
* Ada Programming/Libraries/Ada.Containers

### External examples

* Search for examples of Ada.Containers.Indefinite_Multiway_Trees in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Indefinite_Multiway_Trees in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2012

* A.18.17: The Generic Package Containers.Indefinite_Multiway_Trees

### Open-Source Implementations

FSF GNAT
* Specification: a-cimutr.ads
* Body: a-cimutr.adb
# Ada Programming/Libraries/Ada.Containers.Hashed Sets

This language feature is only available from Ada 2005 on.
Ada.Containers.Hashed_Sets is a unit of the Predefined Language Environment since Ada 2005.

## See also
### Wikibook

* Ada Programming/Libraries/Ada

### External examples

* Search for examples of Ada.Containers.Hashed_Sets in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Hashed_Sets in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2005

* A.18.8: The Package Containers.Hashed_Sets

#### Ada 2012

* A.18.8: The Generic Package Containers.Hashed_Sets

### Open-Source Implementations

FSF GNAT
* Specification: a-cohase.ads
* Body: a-cohase.adb
drake
* Specification: containers/a-cohase.ads
* Body: containers/a-cohase.adb
# Ada Programming/Libraries/Ada.Containers.Indefinite Hashed Maps

This language feature is only available from Ada 2005 on.
Ada.Containers.Indefinite_Hashed_Maps is a unit of the Predefined Language Environment since Ada 2005.

## See also
### Wikibook

* Ada Programming/Libraries/Ada

### External examples

* Search for examples of Ada.Containers.Indefinite_Hashed_Maps in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Indefinite_Hashed_Maps in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2005

* A.18.12: The Package Containers.Indefinite_Hashed_Maps

#### Ada 2012

* A.18.13: The Generic Package Containers.Indefinite_Hashed_Maps

### Open-Source Implementations

FSF GNAT
* Specification: a-cihama.ads
* Body: a-cihama.adb
drake
* Specification: containers/a-cihama.ads
* Body: containers/a-cihama.adb
# Ada Programming/Libraries/Ada.Containers.Indefinite Ordered Sets

This language feature is only available from Ada 2005 on.
Ada.Containers.Indefinite_Ordered_Sets is a unit of the Predefined Language Environment since Ada 2005.

## See also
### Wikibook

* Ada Programming/Libraries/Ada

### External examples

* Search for examples of Ada.Containers.Indefinite_Ordered_Sets in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Indefinite_Ordered_Sets in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2005

* A.18.15: The Package Containers.Indefinite_Ordered_Sets

#### Ada 2012

* A.18.16: The Generic Package Containers.Indefinite_Ordered_Sets

### Open-Source Implementations

FSF GNAT
* Specification: a-ciorse.ads
* Body: a-ciorse.adb
drake
* Specification: containers/a-ciorse.ads
* Body: containers/a-ciorse.adb
# Ada Programming/Libraries/Ada.Containers.Generic Sort

This language feature has been introduced in Ada 2012.
Ada.Containers.Generic_Sort is a unit of the Predefined Language Environment since Ada 2012.

## See also
### Wikibook

* Ada Programming/Libraries/Ada
* Ada Programming/Libraries/Ada.Containers

### External examples

* Search for examples of Ada.Containers.Generic_Sort in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Generic_Sort in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2012

* A.18.26: Array Sorting

### Open-Source Implementations

FSF GNAT
* Specification: a-cogeso.ads
drake
* Specification: containers/a-cogeso.ads
# Ada Programming/Libraries/Ada.Containers.Indefinite Doubly Linked Lists

This language feature is only available from Ada 2005 on.
Ada.Containers.Indefinite_Doubly_Linked_Lists is a unit of the Predefined Language Environment since Ada 2005.

## See also
### Wikibook

* Ada Programming/Libraries/Ada

### External examples

* Search for examples of Ada.Containers.Indefinite_Doubly_Linked_Lists in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Indefinite_Doubly_Linked_Lists in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2005

* A.18.11: The Package Containers.Indefinite_Doubly_Linked_Lists

#### Ada 2012

* A.18.12: The Generic Package Containers.Indefinite_Doubly_Linked_Lists

### Open-Source Implementations

FSF GNAT
* Specification: a-cidlli.ads
* Body: a-cidlli.adb
drake
* Specification: containers/a-cidlli.ads
* Body: containers/a-cidlli.adb
# Ada Programming/Libraries/Ada.Containers.Indefinite Ordered Maps

This language feature is only available from Ada 2005 on.
Ada.Containers.Indefinite_Ordered_Maps is a unit of the Predefined Language Environment since Ada 2005.

## See also
### Wikibook

* Ada Programming/Libraries/Ada

### External examples

* Search for examples of Ada.Containers.Indefinite_Ordered_Maps in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Indefinite_Ordered_Maps in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2005

* A.18.13: The Package Containers.Indefinite_Ordered_Maps

#### Ada 2012

* A.18.14: The Generic Package Containers.Indefinite_Ordered_Maps

### Open-Source Implementations

FSF GNAT
* Specification: a-ciorma.ads
* Body: a-ciorma.adb
drake
* Specification: containers/a-ciorma.ads
* Body: containers/a-ciorma.adb
# Ada Programming/Libraries/Ada.Containers.Hashed Maps

This language feature is only available from Ada 2005 on.
Ada.Containers.Hashed_Maps is a unit of the Predefined Language Environment since Ada 2005.

## See also
### Wikibook

* Ada Programming/Libraries/Ada

### External examples

* Search for examples of Ada.Containers.Hashed_Maps in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Hashed_Maps in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2005

* A.18.5: The Package Containers.Hashed_Maps

#### Ada 2012

* A.18.5: The Generic Package Containers.Hashed_Maps

### Open-Source Implementations

FSF GNAT
* Specification: a-cohama.ads
* Body: a-cohama.adb
drake
* Specification: containers/a-cohama.ads
* Body: containers/a-cohama.adb
# Ada Programming/Libraries/Ada.Containers.Indefinite Hashed Sets

This language feature is only available from Ada 2005 on.
Ada.Containers.Indefinite_Hashed_Sets is a unit of the Predefined Language Environment since Ada 2005.

## See also
### Wikibook

* Ada Programming/Libraries/Ada

### External examples

* Search for examples of Ada.Containers.Indefinite_Hashed_Sets in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Indefinite_Hashed_Sets in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2005

* A.18.14: The Package Containers.Indefinite_Hashed_Sets

#### Ada 2012

* A.18.15: The Generic Package Containers.Indefinite_Hashed_Sets

### Open-Source Implementations

FSF GNAT
* Specification: a-cihase.ads
* Body: a-cihase.adb
drake
* Specification: containers/a-cihase.ads
* Body: containers/a-cihase.adb
# Ada Programming/Libraries/Ada.Containers.Indefinite Holders

This language feature has been introduced in Ada 2012.
Ada.Containers.Indefinite_Holders is a unit of the Predefined Language Environment since Ada 2012.

## See also
### Wikibook

* Ada Programming/Libraries/Ada
* Ada Programming/Libraries/Ada.Containers

### External examples

* Search for examples of Ada.Containers.Indefinite_Holders in: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook.
* Search for posts related to Ada.Containers.Indefinite_Holders in: Stack Overflow, comp.lang.ada or any Ada related page.

### Ada Reference Manual
#### Ada 2012

* A.18.18: The Generic Package Containers.Indefinite_Holders

### Open-Source Implementations

FSF GNAT
* Specification: a-coinho.ads
* Body: a-coinho.adb
drake
* Specification: containers/a-coinho.ads
* Body: containers/a-coinho.adb
# Animating Weapons for Counter-Strike Source/Rigging the Hands

Note: You can skip rigging the hands by downloading the following files:
* FK: https://gkquestioninhindi.com
* IK: (insert IK hands)
* Fully IK: (insert fully IK hands)

## Rigging the Model

Purpose: To be able to control a specific set of vertices when animating.
* Open XSI Mod Tool 4.2
* Go to ValveSource>Import SMD
* Check the import materials box.
* Open up the hands file. (It is usually found in the folder of the decompiled default model.)
** If you don't see a hands file, you will have to decompile a different weapon and used that weapon's hands_reference.smd file.
* On the right hand side of XSI Mod Tool, click Scene.
* Navigate through the hierarchy starting at v_weapon until you find a gun name followed by parent. (such as xm1014_parent)
* Right click the parent object and press delete on the keyboard.
Explanation: This gets rid of duplicate bones since you do not want them in your rig.
* Go to File>Save As and save your file in your folder as css-[projectname]-part1.exp
# Animating Weapons for Counter-Strike Source/Setting up the Source SDK
## Setting up the Source SDK

Purpose: To simplify access to studiomdl for compiling
In experienced user terms:
* Install the Source SDK.
* Add a new filetype called QC.
* Associate a batch file that takes the first input of studiomdl and pauses when you right click a QC file and click compile.
* Unhide extensions for known file types.
* Change the Source SDK's startup options to -engine ep1
Otherwise:
* Log into Steam.
* Click the "Tools" tab.
* Install Source SDK if you have not done so already.
* Right click Source SDK.
* Click properties.
* Click set launch options.
* Enter the following into the text box:
(This makes sure you can change what game for which you are compiling.)
* Press OK and close as necessary to exit the windows.
* Go Start>Run and type in %sourcesdk%. This is the location of your Source SDK directory.
* Navigate to sourcesdk\bin\ep1\bin folder. Here you will find all of the programs that are included with the Source SDK.
* Create a new file called compile.bat in this folder.
* In a text editor, add the following code to compile.bat.
* Drag any file onto compile.bat. If it says studiomdl.exe is not recognized, then replace "studiomdl.exe" in compile.bat with the full path of your studiomdl.exe in quotes. Example:
changes into:
* Press windows key + E. This opens up windows explorer.
* Go to Tools>Folder Options.
* Click the file types tab.
* Click New and enter QC in the box.
* Click the Change... button and choose a text editor.
* Click the Advanced button.
* Click New.
* Under Action, type in Compile.
* Under Application used to Perform Action, select the compile.bat that you just made.
* Keep clicking OK or close as necessary until you have closed the windows explorer window.
* Now you can right click a QC file and click compile whenever you want to compile your model.
# Animating Weapons for Counter-Strike Source/Setting up the Camera

Please save the scene periodically.
* Open css-lr300-rig.exp.
* Go to File>Save as.
* Save it as css-lr300-idle.exp
* Maximize the User viewport.
* The camera is hidden in the scene. To unhide it, open the Scene Explorer. (You should know how to do this by now.)
* Select Camera_Root and press H.
* Expand Camera_Root and press H on Camera and Camera_Interest.
* Select Camera and press Shift+Ctrl+R. This will produce the same effect as clicking Transform and clicking Reset All Transforms.
* Select Camera_Root and Camera_Interest and reset all of their transforms.
* Select Camera_Interest and translate it arbitrarily across the positive Z axis.
* Double click Camera in the Scene Explorer.
* Under Projection, click Perspective.
* Under Field of View change the Angle value to 75.
* Set the starting frame to zero in the scene. Look at the bottom of the screen for a bunch of vertical lines with numbers at certain intervals. Click anywhere on it and drag it all the way to the left. This will set the current frame to number one using the red marker. Near the left you should see the number 1. Change this to the number 0. Now drag the red marker to frame zero.
* Open the Scene Explorer.
* Right click Camera_Root
* Open the scene's schematic view by pressing 9.
* Find the camera that is selected. It should be white with two gray rectangles underneath it.
* Hold SHIFT and drag a rectangle around the three rectangles.
* Close the schematic view.
* Press the following key sequence: VKCK.
** V is a shortcut for accessing object(s) translation. Its equivalent is pressing the letter t under the Transform panel on the right hand side of the screen.
** K is a shortcut to set a key for object(s). Its equivalent is pressing the button that looks like a key on the bottom right of the screen.
** C is a shortcut for accessing object(s) rotation. Its equivalent is pressing the letter r under the Transform panel on the right hand side of the screen.
* Press the ESCAPE key.
* Press H to hide the camera and its children.
* To view the camera, change any viewport to Cameras>Camera. To access Cameras>Camera, click the colored bar at the top of the viewport.
* If you accidentally move the camera, just move the frame marker around and it will reset back to its position.
* Save the scene. Now you should be able to change any viewport to whatever you want it to be.
# Animating Weapons for Counter-Strike Source/Extracting Files From GCFs
## Extracting files from GCFs

Purpose: To retrieve the default model for decompiling
* Close Steam if it is running.
* Open GCFScape.
* Go to File>Open
* Open counter-strike source shared.gcf. It is found in your SteamApps folder. (Try C:\Program Files\Valve\Steam\SteamApps\ or C:\Program Files\Steam\SteamApps\)
* In the interface navigate to cstrike\models\weapons\
* For this tutorial we will animate an sg552.
* Select all of the files that begin with v_rif_sg552. This includes:
** v_rif_sg552.dx80.vtx
** v_rif_sg552.dx90.vtx
** v_rif_sg552.mdl
** v_rif_sg552.sw.vtx
** v_rif_sg552.vvd
* Drag these files into your "default" folder.
* Extract cstrike\materials\models\weapons\v_models\hands\v_hands.vtf as well.
* If you are actually going to work with a default model, extract the vtf files from cstrike\materials\models\weapons\v_models\*weapon_name*\