OpenLLM-France/wikimedia huggingface dataset:
# Non-Programmer's Tutorial for Python 2.6/Using Modules

Here's this chapter's typing exercise (name it cal.py). import actually looks for a file named calendar.py and reads it in. If the file is named calendar.py and it sees an "import calendar" it tries to read in itself which works poorly at best.)):
And here is part of the output I got:
(I skipped some of the output, but I think you get the idea.) So what does the program do? The first line import calendar uses a new command import. The command import loads a module (in this case the calendar module). To see the commands available in the standard modules either look in the library reference for python (if you downloaded it) or go to http://docs.python.org/library/. If you look at the documentation for the calendar module, it lists a function called prcal that prints a calendar for a year. The line calendar.prcal(year) uses this function. In summary to use a module import it and then use module_name.function for functions in the module. Another way to write the program is:
This version imports a specific function from a module. Here is another program that uses the Python Library (name it something like clock.py) (press Ctrl and the 'c' key at the same time to terminate the program):
With some output being:
The output is infinite of course so I canceled it (or the output at least continues until Ctrl+C is pressed). The program just does a infinite loop (True is always true, so while True: goes forever) and each time checks to see if the time has changed and prints it if it has. Notice how multiple names after the import statement are used in the line from time import time, ctime.
The Python Library contains many useful functions. These functions give your programs more abilities and many of them can simplify programming in Python.

### Exercises

Rewrite the High_low.py program from section Decisions to use a random integer between 0 and 99 instead of the hard-coded 78. Use the Python documentation to find an appropriate module and function to do this.
Rewrite the High_low.py program from section Decisions to use an random integer between 0 and 99 instead of the hard-coded 78. Use the Python documentation to find an appropriate module and function to do this.
| Previous: Dictionaries | Front Page | Next: More on Lists |
# Rebol Programming/crimson

CRIMSON is a tuple of value: 220.20.60
# Rebol Programming/crlf

CRLF is a string of value: "^M^/"
# Rebol Programming/ctx-prefs

CTX-PREFS is an object of value:
# Rebol Programming/crypt-strength?
## DESCRIPTION

Returns 'full, 'export or none
CRYPT-STRENGTH? is a native value.
# Rebol Programming/ctx-access

CTX-ACCESS is an object of value:
# Rebol Programming/ctx-viewtop

CTX-VIEWTOP is an object of value:
# Rebol Programming/ctx-edit

CTX-EDIT is an object of value:
# Rebol Programming/ctx-emailer

CTX-EMAILER is an object of value:
# Rebol Programming/cr

CR (Carriage Return) is a char of value: #"^M"
# Rebol Programming/ctx-text

CTX-TEXT is an object of value:
# Reaktor/Modules/MIDI Out
## MIDI Out Modules

* Note Pitch
* Pitchbend
* Controller
* Ch. Aftertouch
* Poly AfterTouch
* Sel. Poly AT
* Program Change
* Start/Stop
* 1/96 Clock
* Song Position
# Reaktor/Modules/Math
## Math Modules

* Constant
* Add
* Subtract
* Invert, -x
* Multiply
* Mult/Add, a*b+c
* Reciprocal, 1/x
* Divide, x/y
* Modulo, x%y
* x||Rectify, |x|
* Rectify/Sign
* Compare
* Compare/Equal
* Quantize
* Expon. (A)
* Expon. (F)
* Log. (A)
* Log. (F)
* Power, x^y
* Square Root
* 1 / Square Root
* Sine
* Sine/Cosine
* ArcSin
* ArcCos
* ArcTan

## Tutorials

* Basic applied algebra for Reaktor users
# Reaktor/Modules/Modulo, x%y

Modulo is a mathmatic operation. -taken from the NI Reaktor user forum: http://www.nativeinstruments.de/index.php?forum_us -
The Div output is the integer part of the division, the Mod output is the remainder from the division. The mod output will always be in the range 0...[b-1] The div output will always be Int(a/b) (where "int" mean "drop any fraction - DON"T ROUND)
16 div 3 = 5 16 mod 3 = 1
8 div 5 = 1 8 mod 5 = 3
9 div 5 = 1 9 mod 5 = 4
10 div 5 = 2 10 mod 5 = 0
5 div 8 = 0 5 mod 8 = 5
# Reaktor/Modules/Out Port

The maximum number of Out Ports in one design page is 40.
From Leviathan User's Guide and Event Logic tutorial v2.0, page 30
# Reaktor/Modules/Multi Picture
## Comments

* MultiPicture module works in incremental mode. MX and MY ports do not fire anything on ensemble start up, or on switch pressing, as that usually conflicts with a Snap Value. They only fire as you move the mouse.
# Reaktor/Modules/LFO, Envelope
## LFO, Envelope Modules

* LFO
* Slow Random
* H
* HR
* D
* DR
* DSR
* DBDR
* DBDSR
* AD
* AR
* ADR
* ADSR
* ADBDR
* ADBDSR
* AHDSR
* AHDBDR
* 4-Ramp
* 5-Ramp
* 6-Ramp

## LFO, Envelope in general

* Low frequency oscillation
* ADSR envelope at Wikipedia
# Reaktor/Modules/Logic AND

When input signal in A and B is <=0 (less or equal to 0) then the signal is false, but when bigger then 0 then true.. The output of this module is only true when both A and B are true. Not inverts the output.
# Reaktor/Modules/MIDI In
## MIDI Modules

* Note Pitch
* Pitchbend
* Gate
* Single Trig. Gate
* Sel. Note Gate
* On Velocity
* Off Velocity
* Controller
* Ch. Aftertouch
* Poly AfterTouch
* Sel. Poly AT
* Program Change
* Start/Stop
* 1/96 Clock
* Sync Clock
* Song Position

## MIDI in general

* MIDI on Wikipedia
# Reaktor/Modules/Note Pitch

Note Pitch is an event source which outputs the pitch (key) of received MIDI Note On messages. The Min and Max properties determine the output range. When using the default range of 0 to 127, each step corresponds to a semitone, and middle C is represented by 60.
# Reaktor/Modules/Oscillator
## Oscillator Modules

* Sawtooth
* Saw FM
* Saw Sync
* Saw Pulse
* Bi-Saw
* Triangle
* Tri FM
* Tri Sync
* Tri/Par Symm
* Parabol
* Par FM
* Par Sync
* Par PWM
* Sine
* Sine FM
* Sine Sync
* Multi-Sine
* Pulse
* Pulse FM
* Pulse Sync
* Pulse 1-ramp
* Pulse 2-ramp
* Bi-Pulse
* Impulse
* Impulse FM
* Impulse Sync
* Multistep
* Multistep 4-Step
* Multistep 4-Ramp
* Multistep 5-Step
* Multistep 5-Ramp
* Multistep 6-Step
* Multistep 6-Ramp
* Multistep 8-Step
* Multistep 8-Ramp
* Ramp
* Clock Oscillator
* Noise
* Random
* Geiger
# Radiation Oncology/Skull Base

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
Skull Base Tumors
* Chordoma
* Chondrosarcoma
# Radiation Oncology/Spine

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
* Spine and Bone Metastases
* Spinal Cord Compression
* Ependymoma
* Chordoma
# Radiation Oncology/Small round blue cell tumors

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
Small round blue cell tumors of childhood
* Neuroblastoma
* Wilm's Tumor
* Rhabdomyosarcoma
* Ewing's sarcoma/PNET
* Small cell lymphoma
* Desmoplastic small round cell tumor
# Radiation Oncology/Space Radiation

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials

## Space Radiation

* Sources of Radiation
** Solar
** Galactic Cosmic Rays
* Types of Cosmic Radiation
** Photon
** Particles
* Measurements of Cosmic Radiation
** Units
** Dosimetry
* Impact of Cosmic Radiation on Astronaut tissues
** to be expanded ...

## Space Medicine

* P D Hodkinson et al. Br J Anaesth. 2017. An overview of space medicine (PMID: 29161391)
* Jan Stepanek et al. N Engl J Med. 2019. Space Medicine in the Era of Civilian Spaceflight (PMID: 30865799)
* T E Vasquez et al. West J Med. 1987 Sep. Space medicine--a review of current concepts (PMID: 3314154)

## Mars Exploration Program

* John D Boice et al. The Million Person Study relevance to space exploration and Mars. Int J Radiat Biol. 2022;98(4):551-559. (PMID: 30831048)
* J B Garvin et al. NASA's new Mars Exploration Program: the trajectory of knowledge. Astrobiology. 2001 Winter;1(4):439-46. (PMID: 12448977)
* Zarana S Patel et al. Red risks for a journey to the red planet: The highest priority human health risks for a mission to Mars. NPJ Microgravity. 2020 Nov 5;6(1):33. (PMID: 33298950)
# Radiation Oncology/Spinal radiosurgery

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
Spinal radiosurgery is the one or a few fractions and high doses per fraction for primary or metastatic tumors involving a vertebral body with close proximity to the spinal cord. It is often used in a site of prior irradiation, so IMRT can be used to limit the dose to the cord.

## Doses

* 25 Gy in 5 fx
# Reaktor/Tutorials/Reaktor as effects processor/The difference between effects and sound sources
## The difference between effects and sound sources

Effects have audio inputs and outputs. Sound sources (synths, samplers, loopers, drum machines, etc.) only have audio outs. Effects are usually labeled as such in R library folders, the user library, and other online sources.
I've created an FX Favorites folder and made that a favorite in the Browser, so whenever I open a new effect and like it, I've got a place to save a copy of it, including any new snaps I've created for it, and any other changes I've made to the file. I usually use its original name, so I can track that down if necessary, perhaps with some additional info to distinguish it from the unchanged version.
next page
# Reaktor/Tutorials/Reaktor as effects processor/Tips: adding level controls
## Tips: Adding level controls

To make an effects routing more useable when processing external audio, you can add an audio-in level control. With a MIDI controller assigned to the panel control, you'll be able to externally adjust the send-level of your signal to the R effects chain. The controller becomes the virtual equivalent of a stereo or mono volume pedal patched in front of your effects hardware. One easy way to do this is to insert the 2x2 stereo mixer from the R4 instrument library into your ensemble, right after the Audio In module or anywhere else you want it, then either delete all unwanted mixer panel-control modules in the Mixer structure, or use the Properties window to disable and make invisible everything in the panel except two input channels and the master level control. You'll find an already trimmed-down copy in the downloads that accompany this tutorial.
To keep the effects output level from distorting the Audio Out module or the inputs of the next processor in the chain, you can add a limiter. A simple, CPU-efficient, stereo peak limiter is available as an instrument in the R4 library, and it can be inserted anywhere within or after a chain of other instruments, as often as needed.
next page
# Reaktor/Tutorials/Reaktor as effects processor/Turning Macros to instruments
## Turning Macros to instruments

You can save a macro as an instrument by pasting it or its contents into an empty instrument, as shown below. It will then have its own snapshots and its own panel in panel view.
Your new instrument will appear in a new panel within the ensemble panel window, as shown above. Looks like the panel layout needs some work... Unlock the panel, fix it, lock it again, then save the instrument to a new location. You can repeat the process for any other macros in the same ensemble, or just close it without saving to leave the original unchanged.
You can also convert instruments to macros, by copying and pasting the contents of an instrument into an empty macro, which can be inserted into any instrument. The converted instrument's controls will then show up on any instrument panel that contains that macro, within an outline if desired, as in R4's Banaan Electrique, shown in the previous example, or in GeekFX from the R3 Premium Library, shown here. The converted instrument won't have its own snapshots or snapshot window, but its settings will be stored and recalled by the snapshots of the instrument that contains it.
I almost always prefer to build multi-effect structures from combined instruments instead of assembled macros, as shown below, so that each device in the structure has its own snapshots, controllable with ensemble-level “master” snapshots, and can open a saved snapshot bank from the same device used and tweeked in some other ensemble. This also allows me to take maximum advantage of snapshot morphing and linking, all of which I'll describe in the Snapshot-panel portion of this tutorial. If necessary, I deal with the screen sizes of large, multiple panels by collapsing the instruments as soon as I have a set of snaps I like for each one.
next page
# Reaktor/Tutorials/Reaktor as effects processor/Where to find Reaktor effects
## Where to find Reaktor effects

Almost every R ensemble includes effects, either as part of the processing for a sound-making source, or by themselves. Besides the R3 and R4 libraries and the incredible User's library, there are several websites, either from individuals or groups, that offer free or inexpensive downloadable effects ensembles and instruments.
* http://joeorgren.com/tech.htm
* http://www.lost-online.com/
* http://www.semaforte.com/reaktor/files.htm
* http://www2.charlielamm.com/reaktor/download/index.
* http://www.midiworld.org/AuReality/products/reaktor/reaktor.
* http://www.swiftkick.com/
* http://www.martin-brinkmann.de/ensembles.html
* http://www.kvraudio.com/get/54.html
next page
# Reaktor/Tutorials/Rounding a number

Suppose you have a floating point number, for example the output of a mouse area, and you want to round this number to the lower integer bound. One way to do this is to Modulo/Divide the number by 1.
It is often useful to add a StepFilter on the output if you only want to trigger on changing values.
In Core, you can round a number by building a macro with a float input and an integer output. If you want to round to the upper number, you can add 1 first. If you want to round to the upper number for fractional values bigger than 0.5, add 0.5 first.
# Reaktor/Tutorials/Requests

* Please add ideas for tutorials, which you really need, things you want to be explained...
* A tutorial on using sequencers would be fine. The user's manual only tells you what the sequencer modules can (or should) do, but *not* how to connect them to your instruments (fi., how do I use the Modulation4 sequencer of the Classic Modular Collection, or the SQ16...?)
* A tutorial about the use of Event tables, because NI isn´t offering very much info in the manual.
* A tutorial on translating DSP theory, C++ Code, and/or electronic schematics into Core Technology.
* A tutorial designing a step sequencer in Reaktor 5.] ==
* A tutoria on how to build your own delay, echo, reverb and so on would be fantastic! like a step by step guide
* Oh Jesus, how do I even get it to record what I'm playing?
* Sample-based manipulation, guide to both the basics and the advanced granular techniques, and FFT processing in Reaktor...
* CPU usage - reduction tips and techniques.
* A tutorial on the different Delay modules and their applications and perhaps including an example of a Delay module built around Core
* A newbie/dummy-guide for Reaktor 5 would be very helpful. The tutorial in the documentation is usefull, but all I can build now is the tutorial-synth, and I don't understand much more than that...
* A tutorial on polyphony. This is very complex and counterintuitive, especially for those of us who learned "MAX"
* A tutorial on live-manipulation of vocals, like pitchchanging, changing formants, creating harmonies and all that ...!
# Reaktor/Tutorials/Reaktor as effects processor/The paste-from-me instrument
## The paste-from-me instrument

Thanks to some great suggestions from Herwig Krass in the Reaktor Creator's forum, I patched together a serviceable device for drawing mathematically derived shapes in a table—here it is:
next page
# Reaktor/Tutorials/Reaktor as effects processor/Snap management and controls
## Snap management and controls

The Snapshot window is definitely my favorite new feature in Reaktor 4. In addition to its welcome snap-organizing and -display features, it's also extremely powerful and flexible as a parameter modulator, via its Morphing and Randomizing features. Let's start with a few basics. When the Snapshot window is open (hit F6, or click on the camera icon in any panel header: ), you can change its focus to any existing instrument within the current ensemble by simply clicking anywhere on the desired instrument panel, or by using the drop-down menu in the window's upper-left corner to select the instrument you want. If you don't want the window's focus to change whenever you click outside it, click on the Link icon to un-hi-lite it when the focus is as you want it, and it will stay put.
next page
# Reaktor/Tutorials/Terminology

* Module: small building blocks like oscillators, filters and envelopes.
* Macro: between a module and an instrument in complexity, these are groupings of modules.
* Instrument: a module that has a structure, handles MIDI, as well as its own snapshots and control panel. Instruments end in ".ism"
* Ensemble: an instrument that contains other instruments. Ensembles end in ".ens"
* Sequencer: either a module or an entire ensemble that allows one to program sound events on a timeline. The classic 16 step sequencer is common.
* Drum Machine: A sequencer that triggers percussion sounds. There are also drum samplers which do not have sequencers attached, which the user can either trigger manually or through an external sequencer.
* Sampler: either a module, instrument or ensemble that allows one to play recorded sound. There are many types of samplers which offer various editing, processing, or effects in addition to basic playback.
* Synth: an instrument or ensemble which generates sound based on building blocks of simple sound waves. These sounds can be very complex. Some of the popular synthesis methods are subtractive, fm, and wavetable.
* Sine Wave: a sound waveform which oscillates between y=n and y=-n.
# Reaktor/Tutorials/Tip of the day
## What did you learn today? Add your tip here

* You learn something about Reaktor every day you work with it. What you learned today may be very easy for you, but it may be very difficult for other users or Reaktor beginners. Share what you learned today here, just add a sentence, or two. We will pick up these tips and build a larger tutorial based on it.
* Use of IC Send module with any sequencer
* On the PC use Ctrl to automatically create an additional input point for a Macro when you drag a wire towards it, on a Mac it's the Command key. This also works with some Math modules and any other module that has '...' on the bottom left.
* To modify instrument volume with an LFO, the LFO has to produce AUDIO output so as to avoid annoying sound artefacts (pitch modulation, in contrast, can safely be done by an event LFO signal). Also, it's a good idea to smoothen the LFO signal using an integrator that adjusts it to Reaktor's control rate´(I once found a "Ramps CtrlRate" macro in one of the User Library's instruments to do the job).
* ADD YOUR TIP HERE
# Introduction

The theory of Diophantine equations is an ancient subject that typically involves solving (a system of) polynomial equation in integers. Perhaps the most famous diophantine equation is Fermat's, who stated in the 17th century that the equation $x^{n}+y^{n}=z^{n}$ has no solution in integers if $n$ is greater than or equal to 3 (this is called Fermat's last theorem). Fermat never published his solution to this problem (that he actually had a valid solution is highly debated)and it took mathematicians the next 350 years to finally solve this problem.
# Nuclear Physics/Nuclear Binding Energies

Binding energy is the amount of energy required to separate something down into its base components. In nuclear terms, the energy is derived from the Strong Nuclear Force.
The binding energy must come from somewhere, and in the case, because mass and energy are so strongly linked by Einstein's Equation E = mc$^2$ the Binding Energy is proportional to the Difference in Mass of the Atom, compared to the sum of its parts. This is also called the mass defect. The larger the mass defect, the more stable the isotope is.
Example of Binding Energy:

### The Binding Energy of a Deuterion $^2$H

A deuterion is the nucleus of a deuterium atom, and consists of one proton and one neutron. The masses of the constituents are:
    m$_{proton}$ = 1.007276 u (where u represents the Atomic mass unit ≈ 1.66053886 x 10$^{-27}$ kg)
    m$_{neutron}$= 1.008665 u
    m$_{proton}$ + m$_{neutron}$ = 1.007276 + 1.008665 = 2.015941 u
The mass of the deuterion is:
    Atomic Mass $^2$H = 2.013553 u
The mass difference = 2.015941 - 2.013553 = .002388 u. = 3.9654 x 10$^{-30}$ kilograms.
* $=mc^{2}\,$
* $=3.9654\times 10^{-30}kg\times (2.99792458\times 10^{8}ms^{-1})^{2}$
* $=3.5639\times 10^{-13}J$
* $=2.224MeV\,$

### Binding Energies of Isotopes

Iron is one of the most stable nuclei around. A picture should really be added here.
but if h= 1.007277, then 2h= 2.014554 and the difference between p and n is .001388. when you add this difference you get 2.0028434=2h.
try this h=1,007825,n=1.008665 then 2h =2.01565 and 1.008665-1.007825=.00084 then add that difference to change p to n, so 2.01565+.00084=2.01649 now sub. the so call binding energy, 2.01649-.002388= 2.014102 and this is mass of 2d that I find in text books!!! also .002388u mult. by 931.5 = 2.224422 in MeV units! if you follow the above 2.014102 times 2 is 4.028204. and 3 times 4.028204 is 12.084612, this is carbon. 12carbon(12.084612) + 1.007825 = 13nitrogen(13.092437) + .00084 = 13.093277(before the loss of a +beta and neutrino!). 13.093277 - .002388 = 13carbon(13.090889), add 1.007825 to get 14nitrogon(14.098714). again add 1.007825 to get 15oxygen(15.106539). again add .00084 to get 15.107379(again this is before loss of a +beta and neutrino!). again subtrack .002388 to get 15nitrogen(15.104991). now add 1.007825 to get 16oxygen(16.112816).
in David Wayne Ferrin's note: the proton is 1.007277, and Hydrogen is 1.007277+(+beta=.000548)= 1.007825. Also .002388= (2(+beta)+2(-beta)+2(.000098)) or .002388=(.001194+.001194)=((.000548)+(.000548)+(.000098))x2, that is in a world with perfect field breaking symmetry, in fusion this happens 1.007825 + (1.007825 + .000840) = 2.01649.
Now take 2.016490-1.006985(too light)=1.009505(too heavy). To 1.006985(tl) add .000292= 1.007277 add .000548= 1.007825 add (.000292+.000548)=.000840= 1.008665 add .000840= 1.009505(th). And if 1.006985/3= .3356616667 add .000840= .3365016667*3= 1.009505. .3356616667*931.5= 312.6688425, .3365016667*931.5= 313.451325, and 312.6688425 + (2*313.4513025)=939.5714476/931.5= 1.008665.
# Number Theory/32-bit Linear congruential generator/2,147,483,561

The following table shows the sequence of pseudorandom numbers using the 32-bit linear congruential generator starting with seed value 2,147,483,561. This number is congruent to −2 modulo 2,147,483,563.
In this table, m = 2,147,483,563, and s = 2,147,483,561.
| n | ${40,014}^{n}\times {s}{\pmod {m}}$ | RAND |
| 1 | 2,147,403,535 | 0.999962734 |
| 2 | 1,092,726,734 | 0.508840558 |
| 3 | 1,602,191,596 | 0.746078631 |
| 4 | 1,267,716,105 | 0.590326337 |
| 5 | 682,983,847 | 0.318039150 |
| 6 | 39,831,120 | 0.018547811 |
| 7 | 369,631,934 | 0.172123289 |
| 8 | 732,908,695 | 0.341287220 |
| 9 | 572,985,402 | 0.266817130 |
| 10 | 903,357,040 | 0.420658419 |