OpenLLM-France/wikimedia huggingface dataset:
# Coordinate systems/Derivation of formulas/Differential normal areas
## Why this formula for surface area element seems either wrong or misleading
### The question

The question is whether it is appropriate to write the vector surface element as the sum of three perpendicular elements.
* $dy\,dz{\hat {\mathbf {x} }}+dx\,dz{\hat {\mathbf {y} }}+dx\,dy{\hat {\mathbf {z} }}$
* $\rho \,d\phi \,dz{\hat {\boldsymbol {\rho }}}+d\rho \,dz{\hat {\boldsymbol {\phi }}}+\rho \,d\rho \,d\phi {\hat {\mathbf {z} }}$
* $r^{2}\sin \theta \,d\theta \,d\phi {\hat {\mathbf {r} }}+r\sin \theta \,dr\,d\phi {\hat {\boldsymbol {\theta }}}+r\,dr\,d\theta {\hat {\boldsymbol {\phi }}}$

### Answer

Changing notation a bit, we work in Cartesian coordinaes:
(1) $d{\vec {A}}=dxdy{\hat {z}}+dydz{\hat {x}}+dzdx{\hat {y}}$
is not how the w:surface integral is usually set up. Instead one uses a cross product and a surface defined in parametric form:
(2) $d{\vec {A}}=d{\vec {\ell }}_{\alpha }\,\times d{\vec {\ell }}_{\beta }\,$ $=(dy_{\alpha }\,dz_{\beta }\,-dz_{\alpha }\,dy_{\beta }\,){\hat {x}}+(dz_{\alpha }\,dx_{\beta }\,-dx_{\alpha }\,dz_{\beta }\,){\hat {y}}+(dx_{\alpha }\,dy_{\beta }\,-dy_{\alpha }\,dx_{\beta }\,){\hat {z}}$
Nevertheless, it is possible to force $d{\vec {A}}$ as shown in (1) to a vector area element with the following constraints:
(3) $dz_{\alpha }\,=0\qquad dz_{\beta }\,<0\qquad dx_{\beta }\,=0$
(4) $d{\vec {A}}=d{\vec {\ell }}_{\alpha }\,\times d{\vec {\ell }}_{\beta }\,$ $=dy_{\alpha }\,dz_{\beta }\,{\hat {x}}-dx_{\alpha }\,dz_{\beta }\,{\hat {y}}+dx_{\alpha }\,dy_{\beta }\,{\hat {z}}$
In this context, writing (1) is putting the proverbial round peg into a square hole. This can be seen by if we examine both differentials:
(5) $d{\vec {\ell }}_{\alpha }\,=dx_{\alpha }\,{\hat {x}}+dy_{\alpha }\,{\hat {y}}$ , and $d{\vec {\ell }}_{\beta }\,=dy_{\beta }\,{\hat {y}}+dz_{\beta }\,{\hat {z}}$
The paths $d{\vec {\ell }}_{\alpha }\,$ and $d{\vec {\ell }}_{\beta }\,$ must follow the contour of the surface like a net. But one path cannot move in the z direction, while the other is similarly confined to a plane at constant x. Hence we can form a area differential of the form given by (1), but it cannot be integrated over any surface not confined to a flat plane. Hence, we conclude that (1) describes a differential surface element that cannot be integrated over any curved surface. Ultimately, there is no strong reason to replace (1) by
(6) $d{\vec {A}}=dxdy{\hat {z}}\ \dots or\dots \ dydz{\hat {x}}\ \dots or\dots \ dzdx{\hat {y}}.$
Equation (6) has the advantage of not misleading the reader that the differential can be integrated over a surface, while (1) has the advantage of allowing the surface to be a flat plane at any orientation.
* ↑ The requirement that a differential be negative simple means that the sign of the differential and the component of the area element in the associated direction are opposite.
# Coordinate systems/Derivation of formulas/Spherical from Cartesian unit vectors

From Wolfram Mathworld, we have the following relations for the unit vectors in a Spherical coordinate system:
${\begin{aligned}{\hat {\mathbf {r} }}&=\cos \phi \sin \theta {\hat {\mathbf {x} }}+\sin \phi \sin \theta {\hat {\mathbf {y} }}+\cos \theta {\hat {\mathbf {z} }}\\{\hat {\boldsymbol {\theta }}}&=\cos \phi \cos \theta {\hat {\mathbf {x} }}+\sin \phi \cos \theta {\hat {\mathbf {y} }}-\sin \theta {\hat {\mathbf {z} }}\\{\hat {\boldsymbol {\phi }}}&=-\sin \phi {\hat {\mathbf {x} }}+\cos \phi {\hat {\mathbf {y} }}\end{aligned}}$
Next, we need to change all the $\phi$ and $\theta$ to $x,y,z$. We use the following relations, also available on the same page:
${\begin{aligned}r&={\sqrt {x^{2}+y^{2}+z^{2}}}\\\theta &=\arccos({\frac {z}{r}})\\\phi &=\arctan({\frac {y}{x}})\end{aligned}}$
Using these, we can find the following quantities:
${\begin{aligned}\cos \theta &={\frac {z}{r}}={\frac {z}{\sqrt {x^{2}+y^{2}+z^{2}}}}\\\sin \theta &={\sqrt {1-\cos ^{2}\theta }}={\sqrt {1-{\frac {z^{2}}{x^{2}+y^{2}+z^{2}}}}}={\sqrt {\frac {x^{2}+y^{2}}{x^{2}+y^{2}+z^{2}}}}\\\cos \phi &={\frac {x}{\sqrt {x^{2}+y^{2}}}}\\\sin \phi &={\frac {y}{\sqrt {x^{2}+y^{2}}}}\end{aligned}}$
Lastly, we simply need to substitute these relations into our first set of equations to obtain our desired result:
${\begin{aligned}{\hat {\mathbf {r} }}&={\frac {x}{\sqrt {x^{2}+y^{2}}}}{\sqrt {\frac {x^{2}+y^{2}}{x^{2}+y^{2}+z^{2}}}}{\hat {\mathbf {x} }}+{\frac {y}{\sqrt {x^{2}+y^{2}}}}{\sqrt {\frac {x^{2}+y^{2}}{x^{2}+y^{2}+z^{2}}}}{\hat {\mathbf {y} }}+{\frac {z}{\sqrt {x^{2}+y^{2}+z^{2}}}}{\hat {\mathbf {z} }}={\frac {x{\hat {\mathbf {x} }}+y{\hat {\mathbf {y} }}+z{\hat {\mathbf {z} }}}{\sqrt {x^{2}+y^{2}+z^{2}}}}\\{\hat {\boldsymbol {\theta }}}&={\frac {x}{\sqrt {x^{2}+y^{2}}}}{\frac {z}{\sqrt {x^{2}+y^{2}+z^{2}}}}{\hat {\mathbf {x} }}+{\frac {y}{\sqrt {x^{2}+y^{2}}}}{\frac {z}{\sqrt {x^{2}+y^{2}+z^{2}}}}{\hat {\mathbf {y} }}-{\sqrt {\frac {x^{2}+y^{2}}{x^{2}+y^{2}+z^{2}}}}{\hat {\mathbf {z} }}={\frac {xz{\hat {\mathbf {x} }}+yz{\hat {\mathbf {y} }}-\left(x^{2}+y^{2}\right){\hat {\mathbf {z} }}}{{\sqrt {x^{2}+y^{2}}}{\sqrt {x^{2}+y^{2}+z^{2}}}}}\\{\hat {\boldsymbol {\phi }}}&=-{\frac {y}{\sqrt {x^{2}+y^{2}}}}{\hat {\mathbf {x} }}+{\frac {x}{\sqrt {x^{2}+y^{2}}}}{\hat {\mathbf {y} }}={\frac {-y{\hat {\mathbf {x} }}+x{\hat {\mathbf {y} }}}{\sqrt {x^{2}+y^{2}}}}\end{aligned}}$
# DevOps/Kubernetes/kubectl

Kubectl is a command line interface for running commands against Kubernetes clusters.
To install in MacOS execute: brew install kubernetes-cli

## kubectl info commands

* Verify running Pods:
** kubectl get pods
** kubectl get pod PODNAME
** kubectl get pod PODNAME -n MY_NAMESPACE
** kubectl get pod PODNAME -n MY_NAMESPACE --watch
* Fetch metrics for PODNAME pod kubectl top pod PODNAME

## kubectl operation commands

* Connect to a Pod: kubectl exec -it YOUR_POD_NANE -- /bin/bash

## kubectl delete/destroy commands

* kubectl delete namespace MY_NAMESPACE

## kubectl Command Reference

The following table includes short descriptions and the general syntax for all of the kubectl operations:
* Apply kubectl apply -f FILENAME [flags]. Apply a configuration change to a resource from a file or stdin. Allows to create a Pod.
* Attach kubectl attach POD -c CONTAINER [-i] [-t] [flags]:Attach to a running container either to view the output stream or interact with the container (stdin)
* Auto Scale kubectl autoscale (-f FILENAME \| TYPE NAME \| TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [flags]: Automatically scale the set of pods that are managed by a replication controller
* Cluster Info kubectl cluster-info [flags] :Display endpoint information about the master and services in the cluster
* Create kubectl create -f FILENAME [flags]: Create one or more resources from a file or stdin
** kubectl create namespace myexamplenamespace
** kubectl create sa my_new_user (Create service account for your my_new_user)
** kubectl create -f mypod.yaml
* Config: kubectl config .../...
** kubectl config view
* Delete kubectl delete (-f FILENAME \| TYPE [NAME \| /NAME \| -l label \| --all]) [flags] :Delete resources
** kubectl delete --all namespaces
* Describe kubectl describe (-f FILENAME \| TYPE [NAME_PREFIX \| /NAME \| -l label]) [flags] : Detailed state of one or more resources.
** kubectl describe pod MyPodName
** kubectl describe pods
** kubectl describe replicaset MyReplicaName
* Edit kubectl edit (-f FILENAME \| TYPE NAME \| TYPE/NAME) [flags] : Edit and update the definition of one or more resources on the server by using the default editor.
* Execute kubectl exec POD [-c CONTAINER] [-i] [-t] [flags] [-- COMMAND [args...]]: Execute a command against a container in a pod
* Logs kubectl logs POD [-c CONTAINER] [--follow] [flags]: Print the logs for a container in a pod.
** kubectl logs -l app=elasticsearch (using labels: -l)
* Get:
** kubectl get apiservices
** kubectl get nodes
** kubectl get pods
** kubectl get pod PODNAME -n NAMESPACE -o yaml | kubectl replace --force -f -
* Replace: kubectl replace --force -f yml_file_describing_pod.yml
* Proxy: kubectl proxy --port=8080
* Rolling-update: kubectl rolling-update
* Run kubectl run NAME --image=image [--env="key=value"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [flags]: Run a specified image on the cluster.
* Scale: kubectl scale deployment YOUR_DEPLOYMENT_NAME
* Stop kubectl stop
* Version kubectl version [--client] [flags]: Display the Kubernetes version running on the client and server.
# DevOps/Terraform

Terraform is an open source software first released in July 2014 that allows to create new resources in Cloud providers, also called Infrastructure as Code (IaC). Supported Cloud providers includes AWS, IBM Cloud, Google Cloud Platform, Linode, Microsoft Azure, Oracle Cloud Infrastructure, VMware vSphere and OpenStack.
Other infrastructure as code software software is AWS Cloudformation
It supports services/providers that can be managed by APIs, such as OpenStack VMWare vSphere or CloudStack.
And since September 2019 also offers a Cloud Service: Terraform Cloud .

## Installing

* MacOS: brew install terraform
* Check version: terraform -v (See Changelog)

## Activities

* Read Terraform Changelog: https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md
# DevOps/Terraform/Read Terraform Changelog

Read Terraform Changelog: https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md
# Developing Data Redistribution Algorithms
## Purpose

* Developing Communication Models that can represent the characteristics about each communication link and its bandwidth.
* Developing Data Redistribution Algorithms using AI techniques.
* Verifying Algorithms by using NOC SystemC Simulators.

## Idea Sketch

* Idea.1.A (pdf)

## Communication Patterns and Models
### Parallel Prefix Sum

* ParaPrefix.1.A (pdf)
* MPI implementation (pdf)
* OpenMP implementation (pdf)
* CUDA implementation (pdf)

### FFT
## Redistribution Algorithms using a Generalized Circulant Matrix
### Applying Sudoku Problems to Data Redistribution
#### Sudoku Codes in Haskell

from [ Haskell_programming_in_plain_view ]
* Sudoku Background (pdf)
* Bird's Implementation
    - Specification (pdf)
    - Rules (pdf)
    - Pruning (pdf)
    - Expanding (pdf)

#### Sudoku Codes in Prolog
### Finding relationship with other algorithms
#### FFT Algorithms using a Mixed Radix
## Background

* Y. Ishikawa : "Efficient Collective Operations for Clusters in Long-and-Fast Networks"
* R. V. de Geijn : "Collective Communications on Architectures that Support Simultaneous Communications over Multiple Links"
* R. Rabenseifner : "Optimization of Collective Communication Operations in MPICH"
* NoC Simulator
       - NIRGAM (SystemC)- University of Southampton, 2007
       - OCCN (SystemC) - ST Microelectronics, 2005
       - TOPAZ (C++) - University of Cantabria, 2012
       - HNoCs (OMNeT++) - Technion, 2011
* MPI+NOC Literature to be surveyed.
* Y. W. Lim : "Efficient algorithms for block-cyclic redistribution of arrays", 1999
       Circulant Matrix based redistribution (pdf)
go to [ Electrical_&_Computer_Engineering_Studies ]
* Idea.2.A (pdf) moved to CORDIC Hardware Implementations
# DevOps/Vault

w:Hashicorp Vault, first released in April 2015, is a software which provides secrets management, identity-based access, encrypting application data and auditing of secrets (sensitive data).
To install vault in MacOS execute brew install vault

## Activities

* Read stackoverflow questions about Vault: https://stackoverflow.com/questions/tagged/hashicorp-vault?sort=votes
* Check Vault Seal status: http://localhost:8200/v1/sys/seal-status
# Develop guidelines for up-loading information to a website

Web Design → Develop guidelines for up-loading information to a website
This page is part of the Web Design project. :
From the official document:
    "This unit defines the competency required to support the effective operation of a website by establishing content upload guidelines and procedures in the context of site policies."
Basically, that means ... (translate above into plain english)
You can read more about this unit on the National Training Information Systems Official document for ICAD4198A.
This unit forms part of the following qualifications:

## How this unit will help you

After learning and applying the skills required by this unit you'll be able to demonstrate your skills in:
| ELEMENT | PERFORMANCE CRITERIA |
| 1. Develop site policies | Develop and disseminate policies on acceptable usage, security, privacy and copyright issues based on technical security and privacy requirements Develop and disseminate roles and responsibilities for updating and loading content and removing redundant information Document and disseminate information about the nature of content able to be updated and loaded Establish upload documentation and disseminate the processes and procedures for update, loading or removal of content on the site Implement automatic and/or routine updating and archiving procedures |
| 2. Establish updating and loading procedures | Allocate and make available to contributors directory space to update and load new site content Identify and make available for use authoring guides and resources based on cascading style sheet (CSS) and business style guides Develop and make available new content templates to be applied by authors for use based on cascading style sheet (CSS) parameters Allocate and monitor server permissions Identify preferred file transfer protocol client based on best fit with technical environment and make available for use Customise file transfer protocol client to meet requirements Identify and develop authoring support tools, such as help files and links Disseminate authoring support tools, such as help files and links as necessary |
| 3. Document guidelines | Develop documentation for loading information, taking into consideration security and privacy requirements Document and make available links to recommended support tools Automate details of recent updates and loading of information, such as the time, the author, location and title of new files and document on the site |
* translate the above elements and performance criteria into plain english and summarise here...

## Ideas for demonstrating this unit

The best way to demonstrate these skills is ...

## Grading

If you are demonstrating this unit as part of a formal course, you might find that the unit is graded (meaning you can not only demonstrate your competence, but can also gain a credit or distinction). Your facilitator may already have set criteria that your college uses. If not, here are some ideas for possible credit/distinction activities that you can discuss with your facilitator:
# DevOps/Nomad

Nomad is a container orchestration tool similar to Kubernetes, first released in September 2015. Nomad ships as a single binary, both for clients and servers, and requires no external services for coordination or storage.

## Basic commands

* sudo nomad agent -dev &
* nomad job init
* nomad job run example.nomad
* nomad status example
* nomad status

## Exercices

* Install Nomad following official documentation: https://www.nomadproject.io/intro/getting-started/install.html, you will need Vagrant installed.
# DevOps/YAML

YAML (YAML Ain't Markup Language) is a human-readable data serialization language.
Basic YAML file example with one record:
Basic YAML file example with two record:

## Activities

* Write a YAML file and test it with yq: yq r your_new_yaml_file.yml
* Read 10 YAML tips for people who hate YAML https://www.redhat.com/sysadmin/yaml-tips. (yamllint)
* Read https://en.wikipedia.org/wiki/Comparison_of_data-serialization_formats
* Read stackoverflow YAML related questions: https://stackoverflow.com/questions/tagged/yaml?tab=Votes
# Introduction to Superconductivity/Magnetism
## Types of Magnetic materials

Diamagnetism
There are a lot of quantum mechanics involved with diamagnetism, but in a basic sense, diamagnetic objects typically repel when exposed to magnetic fields. Diamagnetic elements include hydrogen, beryllium, poor metals, most nonmetals and semimetals, halogens, and noble gases.
Paramagnetism
The opposite of diamagnetism, paramagnetic substances attract magnetic forces when exposed to them. Paramagnets are only magnetic when in the presence of an established magnetic field and do not give off their own magnetic fields, making them different from ferromagnets. The alkali metals, alkaline earth metals, most transition metals, lanthanide metals (including neodymium) oxygen, aluminum, and tin are all paramagnetic.
Ferromagnetism
Ferromagnets are permanently magnetic. They are objects with strong magnetic attraction, regardless of whether or not they are in the presence of a magnetic field. The term comes from “ferrum”, the Latin word for iron (a ferromagnetic element). Ferromagnets include iron, nickel, and cobalt.
Antiferromagnetism
The name might be a mouthful, but the theory is relatively simple. Antiferromagnets are just that — the opposite of ferromagnets. They repel other metals without the presence of a magnetic field. However, it should be noted that this typically only occurs at very low temperatures and most antiferromagnets are simply paramagnets at room temperature. The only known antiferromagnetic element is chromium.
Ferrimagnetism
Note the vowel difference. Ferrimagnets, like ferromagnets are magnetic even without an active field. Ferrimagnets contain electrons that both attract like ferromagnets and repel like antiferromagnets. However, there are more electrons that attract than repel, leading to ferrimagnets’ own classification.
Superparamagnetism
Like paramagnets, superparamagnets are attracted to magnetic fields when exposed to them. As the prefix “super” suggests, these magnets are much more attracted than other paramagnets.
# Introduction to Superconductivity

The classic hallmarks of superconductivity: are:
* zero electrical resistance
* a phenomenon known as the Meissner effect which is the result of perfect diamagnetism
Note that a superconductor is more than just a conductor with zero resistivity in the sense that a normal conductor in an external magnetic field is attracted by the magnetic field, however a superconductor is a diamagnet which means that it is repelled by an external magnetic field.

# Conventional and Unconventional superconductivity

In conventional superconductors, the Cooper pairs originate from a small attractive electron-electron interaction mediated by phonons.
In the so-called unconventional superconductors, the pairing can originate even from purely repulsive interactions

# Experimental Electrical Resistivity of Metals

The electrical resistivity of most metals is dominated at room temperature (300K) by collisions of the conduction electrons with lattice phonons and at liquid helium temperature (4K) by collisions with impurity atoms and mechanical imperfections in the lattice.
To a good approximation the electron collision rates are independent from one another. This approximation is known as the Matthiessen's rule
${\frac {1}{\tau }}=\underbrace {\frac {1}{\tau _{L}}} _{\text{Latice phonons}}+\underbrace {\frac {1}{\tau _{i}}} _{\text{imperfections}}$
Since we have $\rho \propto 1/\tau$, the resistivity due to each component (phonons and imperfections) can be summed up to get the total resistivity
$\rho =\rho _{L}+\rho _{i}$
And often, $\rho _{L}$ is independent of number of impurities and imperfections, whereas $\rho _{i}$ is independent of temperatures.

### Debye Temperature

At temperatures above the Debye temperature the phonon concentration is proportional to the temperature, $N_{ph}\propto T$, therefore the resistivity becomes proportional to the temperature
$\rho _{L}\propto 1/\tau \propto N_{ph}\propto T$
* In a metal the resistivity at low temperatures has a constant contribution from impurity scattering, a $T^{2}$ contribution from electron-electron scattering, and a $T^{5}$ contribution from phonon scattering.
# Introduction to Swedish/Common phrases

Introduction to Swedish
Back
Introduction
· Common phrases
· Alphabet
· Nouns & pronouns
· Verb tenses
· Adjectives
· Numbers and plurals
· Spelling
· Definite forms
· Time and dates
· Possessive forms
· Agreement of forms
· Traveling
· Swedish-English vocabulary
· English-Swedish vocabulary
Next :

## Greetings

Hejsan/Hej
    Hello/Hi
God dag
    Good day
God morgon
    Good morning
God kväll
    Good evening
God natt
    Good night
Hur är det (med dig)?
    How are you?
Bra
    Good/Fine
Dåligt
    Bad
Inte så bra.
    Not so good.
Hur går det?
    How is it going?

## Conversational Phrases

Vad heter du?
    What's your name? ('heter' is a transitive verb meaning "to be called")
Jag heter [...]
    My name is [...]
Var bor du?
    Where do you live?
Jag bor i [...]
    I live in [...]
Var kommer du ifrån?
    Where are you from?
Jag kommer ifrån [...]
    I'm from [...]
Hur gammal är du?
    How old are you?
Jag är [...] år gammal.
    I am [...] years old.
Vad gör du?
    What are you doing?

## Goodbyes

Hej då/Adjö
    Good bye (the latter is formal and derived from the French word adieu)
Ha det bra!
    Have a nice day!
Vi ses!
    See you later!

## Other Useful Phrases

Ja
    Yes
Nej
    No
Tackar!/Tack/Tack så mycket/Tusen tack
    Thanks!/Thank you/Thank you very much/A thousand thanks! (conversational)
Ingen orsak.
    Don't mention it/You're welcome
Förlåt
    Sorry/Pardon me
Ursäkta mig
    Excuse me
Snälla
    Please
Pratar du svenska/engelska?
    Do you speak Swedish/English?
    Ja, lite grann.
       Yes, a little (response to previous question)
    Nej, inte alls.
       No, not at all.
Jag pratar svenska/engelska.
    I speak Swedish/English.
Jag förstår inte.
    I don't understand.
Jag vet (inte).
    I (don't) know.
En öl tack.
    One beer, please.
Vet du vad klockan är?
    Do you know what time it is?
Vet du var toaletten är?
    Do you know where the bathroom is?

## Takeaways

From the phrases above, try and find out what these words mean.
1.Tack
2.Klockan
3.grann
4. kväll
5. det

## Exercises

Translate into English:
1. Var bor Johan?
2. Johan bor I USA.
3. Vet du var Sara kommer ifrån?
4. Sara kommer ifrån Stockholm.
5. Hej då! Vi ses!
Translate into Swedish:
6. Hello, my name is John.
7. I speak a little Swedish.
8. Excuse me, do you know what time it is?
9. No, I don't know.
10. Bye! Have a nice day!
Answers to exercises
# Docker/Flask
## Try It
### Online Free

* Use Play with Docker. Create an account and/or log in.
* Start an interactive session and add a new instance.
* In the terminal window, enter the following commands:
** touch Dockerfile
** touch app.py
* Use the Editor button to edit both files and save the contents above into each respective file.
* Run the following commands:
** docker build -t flask-server .
** docker run -d -p 5000:5000 --name=flask-server flask-server
* In the top window, select the 5000 button to connect to the running server.

### On Your Own System

* Install Docker Desktop or the Docker Engine.
* Save the files above into a new Docker Flask folder:
** Dockerfile
** app.py
* At a command prompt, change to the Docker Flask folder and then run the following commands:
** docker build -t flask-server .
** docker run -d -p 5000:5000 --name=flask-server flask-server
* Open a web browser to connect to the running server:
** http://localhost:5000.

## See Also

* Server-Side Scripting
* Flask
* Docker: The best way to learn Docker for Free: Play-With-Docker (PWD)