OpenLLM-France/wikimedia huggingface dataset:
# The Computer Revolution/Entertainment/Magazines

Advances in computer technology have had a large impact on the Entertainment industry. Movies have websites to create buzz, and provide screensavers and wallpaper, and music artists have samples released to draw attention to soon to be released albums.
Magazines have also been able to take advantage of this new forum to provide additional articles and supplements to the issues they publish.
Many magazines also have forums for readers to post comments about articles they have read and would like to see in future issues. It is a great way for magazines to receive instant feedback about what they are doing right , and where they can improve to maintain their readers interest.
Since the invention of Blogging, some magazines have also been able to take advantage of it's popularity and create blogs written by contributing staff, guests, and even contributors who are anonymously letting readers live vicariously through them by revealing personal details of their lives.
# The Computer Revolution/Entertainment/Video players

Video is the constant stream of visual information. When a video is recorded, it is broken down into separate frames. Frames are projected at a rate of about 30 frames per second to keep the video looking continuous. Video data is often compacted. “Lifestreaming” is becoming a larger part of today’s society. Creating an online record of daily activities and submitting them on the Internet is a way for people to broadcast themselves.
Video player is that software applications used in computer system of entertainment purpose. Some of the popular ones are Realplayer, Windows media player. Video players can review movies, download movies from internet, DVD or CD burner, play music and ect. Video players let users feel more entertained while using a computer.
Windows Media Player This is an all purpose media player that plays audio and video files. Media Players are software programs for playing multimedia files, audio or video on your computer developed by Microsoft. Windows has various types of free downloadable devices you can choose from. You can create your own library of playlists by purchasing music through ITunes and transferring them to a cd. I like purchasing the music because you just buy the songs you really like. These playlists allow you to burn cd’s or watch dvd’s. You can also stream music on your computer (listening) while working on files or documents. I found that out this year when I wanted to listen to music but didn’t have a small radio or cd player. This is a nice feature and I don’t normally use media players. My husband has burned cd’s for our car cd player using this. But you have to be careful because of copyright laws, do not do this to sell music.

## Quicktime

QuickTime is an Apple technology for handling video, sound, animation, graphics, text, and music. It is compatible with MAC and Windows users. QuickTime can also be described as a file format, an environment for media authoring and a suite of applications which include but are limited to the following:
QuickTime Player – is a free download from the Apple website which can be used for basic audio and video files. A number of features are disabled that would be present in the Pro version.
QuickTime Pro – is an upgrade to the QuickTime Player and can be purchased and can be used for flexible multimedia authoring. It also includes full-screen playback, editing clips through the cut, copy and paste functions, merging separate audio and video tracks and the options of cropping and rotation.
# The Computer Revolution/Entertainment/Streaming
## Lifestreaming and Lifecasting

Lifestreaming is recording your daily activities online using blog posts, tweets, Facebook status updates, and a whole host of different tools. Lifecasting is the same as lifestreaming, the only difference is, you're broadcasting video to record yourself. These two streaming techniques have taken off in popularity due to the social media craze nowadays. It's very easy to record your daily life. Websites like YouTube and Twitter have lot of people who do blogs and record things to share with others. If you plan on using your phone to stream, it is recommended to have an unlimited data plan because it uses a lot of data in the process.
* ↑ Understanding Computers 13th Edition
# SPM/Basis functions
## From WikiPedia

Basis Function
# SPM/Batch
## Batch Scripts

See this Powerpoint presentation for an overview.
See the relevant chapter in the SPM manual.
For general comments on scripting with MATLAB and SPM see the programming intro.

## Batch Script for SPM12

Any batch script should follow the template:

## Batch Script for SPM8

SPM12's advices also apply to SPM8.
The Batch Scripts for SPM5 below can also be used in SPM8.

## Batch Script for SPM5

Examples of script (for SPM5 and compatible with SPM8) are provided with the SPM Data Sets, for example:
* First Level block fMRI data analysis
* First Level event-related fMRI data analysis
* Second Level fMRI data analysis
* DCM/PPI
* Multi-Subject PET data analysis
See also:
* http://www.icn.ucl.ac.uk/courses/MATLAB-Tutorials/Sessions2008_09/sessions2008_09.htm#S13 for a generic multi-subject preprocessing script.
* http://www.mrc-cbu.cam.ac.uk/people/rik.henson/personal/analysis.html
* http://imaging.mrc-cbu.cam.ac.uk/imaging/SpmBatch5

## Batch Script for SPM2

There is an example batch script written by Rik Henson, for a single subject fMRI data set (preprocessing and statistics).
# SPM/Concatenation

A session (also referred to as a 'run') is a period of data collection in the scanner. Between sessions, data acquisition is paused, typically to give the participant a rest and enable them to communicate with the experimenter. SPM by default specifies multi-session GLMs for univariate inference. However, you may want to concatenate all sessions into one for later (esp. connectivity) analyses.

## Why concatenate?

Concatenation is not necessary for GLM-based univariate inferences. Moreover, it could lead to different estimates compared to the multi-session 'full model' because 1) if a condition is too close to the end of a session, after being convolved with an HRF it could wrongly model data from the subsequent session (acquiring additional scans before the end of each session can effectively mitigate this effect) and 2) It disables condition × session interactions by giving a single beta to each condition throughout the concatenated session.
However, SPM timeseries extraction operates on a per-session basis. It is common, therefore, to concatenate and extract timeseries from multiple sessions for connectivity analyses such as PPI or DCM.

## Procedure (fMRI)
### Preparations

The trickiest part of concatenation is ensuring your onsets, collated across sessions, are correct. If you have obtained onsets within each session, in order to append these onsets for your new concatenated GLM, you need to add to these onsets the length of sessions before the session. For example, suppose you have 3 sessions and corresponding onsets 1-3, and each session has 60, 55, 44 volume scans respectively:
Other regressors (e.g. head motion regressors) should be similarly concatenated.

### Specifying the concatenated GLM

You can then specify your single-session first-level design matrix. Instead of having multiple sessions, you should now specify only one session which includes image volumes from all sessions and appended onsets and other regressors. Run the batch to specify the model, but do not estimate for now.

### By-session adjustment and estimation

Before estimating, you still need to tell SPM which scans belong to which original session so that it can adjust for its effects. This will add to your single-session GLM block effect regressors (replacing the usual mean column in the design matrix), and correct the high-pass filter and temporal non-sphericity calculations to account for the original session lengths.
Run the following code in the main Matlab window. Again, 'scans' here denotes the number of volumes in each session in the original timeseries.
The adjusted GLM (SPM.mat) will replace the GLM you specified before (its copy will be saved as SPM_backup.mat). Now you can estimate the GLM and add contrasts (most importantly, an effect of interest F contrast for timeseries extraction) in the normal way.
Now you may use SPM Volumes of Interest utility to extract timeseries from the single session.
# SPM/Autocorrelation
## Pages from WikiPedia

Autocorrelation

## Pages from MathWorld

http://mathworld.wolfram.com/Autocorrelation.html
# SPM/Block design

Many of the first proof-of-concept fMRI experiments were block designs with two conditions. In a block design, each condition is presented continuously for a period usually longer than 20 seconds. In the earliest fMRI studies (see Kwong, 1992, and Ogawa 1992), one common paradigm was to alternate between 60 second blocks of a flickering visual stimulus, and blocks without stimulation. Analysis was done using a simple t-test between values of the MR signal collected in the "on" condition versus the "off" condition. In addition to comparing "on" versus "off" conditions, block designs have been used to look at differences between more similar conditions as well. (Kanwisher has used block paradigms where the subject is presented with blocks of pictures of faces and blocks of pictures of houses to probe high-level features of the visual system)
These block designs tend to be quite powerful for assessing BOLD signal magnitude differences between conditions. The length of the blocks of stimulation allows for the HRF to reach maximal values, while the inter-stimulus intervals are long enough for the HRF to return completely to baseline during non-stimulation. The downside of block designs is that they are not powerful at estimating the shape of the haemodynamic response (aside from its magnitude).
Block designs are also not as useful with many experimental paradigms having special requirements. In the DM paradigm for example, subjects are scanned while they are presented with single words. After scanning, they are given a list of words composed of words seen earlier mixed with new words, and instructed to mark them as "old" or "new". For the old words, the fMRI trials are analyzed according to whether or not the subject remembered them during the second part of the experiment. In this example, blocks of "remembered" and "forgotten" trials cannot be reliably constructed, because the event categorization depends on a parameter outside the control of the experimenter.
# SPM/CI
## Continuous Integration

* https://www.mathworks.com/help/matlab/matlab-unit-test-framework.html
* https://github.com/matlab-actions
* https://circleci.com/orbs/registry/orb/mathworks/matlab
* https://marketplace.visualstudio.com/items?itemName=MathWorks.matlab-azure-devops-extension
* https://blogs.mathworks.com/developer/category/continuous-integration/
* Travis CI, CircleCI, Azure Pipelines
* Jenkins, Artenolis
* MOxUnit, MOcov, MOdox
# SPM/Compile the gnumex mex files

If the provided shortpath.dll and uigetpath.dll don't work it's probably because they were compiled against a previous version of Matlab. But the source code is included so you can re-compile with your current version of Matlab, first setup mex, at the Matlab prompt type:
and Matlab will say
so choose 'y' Matlab then lists the available compilers:
Note: I have Visual Studio 2003 installed, that's why I have 2 options. If you have Borland installed you would also see it listed above.
The compiler used with MinGW and Cygwin (gcc) isn't listed, because it's not registered in Windows the same way that Matlab, Visual Studio etc. are. This is the very reason for using Gnumex to setup options for gcc. Choose [1] to use the compiler provided with Matlab.
Now change directories into c:\gnumex\src and compile the .c files:
You might get an error like this when compiling uigetpath.c:
But luckily uigetpath.dll is not crucial to the function of Gnumex. I believe it's only used when a "Browse" button is pushed, to present the user with a browseable folder tree. To avoid using it, just type paths into the text boxes in Gnumex. This error does not occur when I use the Visual Studio compiler most likely because its mexopts.bat file is setup to properly link to Microsoft libraries for the _SH functions listed.
Now that you have a working shortpath.dll (and possibly uigetpath.dll) copy it/them to the root Gnumex folder (c:\gnumex).
# SPM/Cogent

Cogent is a matlab based program for displaying stimuli in psychophysics and scanner experiments. It can show pictures, words, movies and play sounds, as well as use all of Matlab's math and randomisation functions. Timing is precise to the millisecond.
Downloads and more details here: Cogent page at the Laboratory of Neurobiology site
# Trigonometry/Functions of complex variables

The trigonometric functions can be defined for complex variables as well as real ones.
One way is to use the power series for sin(x) and cos(x), which are convergent for all real and complex numbers. An easier procedure, however, is to use the identities from the previous section:
* cos(i x) = cosh(x)
* sin(i x) = i sinh(x)
* tan(i x) = i tanh(x)
Any complex number z can be written z = x+iy for real x and y. We then have
    sin(z) = sin(x+iy) = sin(x)cos(iy) + cos(x)sin(iy) = sin(x)cosh(y) + icos(x)sinh(y)
    cos(z) = cos(x+iy) = cos(x)cos(iy) - sin(x)sin(iy) = cos(x)cosh(y) - isin(x)sinh(y)
These functions can take any real or complex value, however large. Nevertheless, they still satisfy
    sin$^2$(x) + cos$^2$(x) = 1
Also, it is easily shown that all the results such as sin(z+2π)=sin(z) and sin(-z)=-sin(z) are still true.
Clearly, sin(z) and cos(z) are real if y=0 so z is real. Otherwise, sin(z) is real if cos(x)=0 and cos(z) is real if sin(x)=0.
Since cosh(y) is never zero, and sin(x) and cos(x) are never simultaneously zero, there are no zeroes of sin(z) and cos(z) other than the ones on the real number axis.
    $\tan(z)=\tan(x+iy)={\frac {\tan(x)+\tan(iy)}{1-\tan(x)\tan(iy)}}={\frac {\tan(x)+i\tanh(y)}{1-i\tan(x)\tanh(y)}}$
# Trigonometry/Graphs of Sine and Cosine Functions

The graph of the sine function looks like this:
Careful analysis of this graph will show that the graph corresponds to the unit circle. x is essentially the degree measure (in radians), while y is the value of the sine function.
The graph of the cosine function looks like this:
As with the sine function, analysis of the cosine function will show that the graph corresponds to the unit circle. One of the most important differences between the sine and cosine functions is that sine is an odd function (i.e. $\sin(-\theta )=-\sin(\theta )$ while cosine is an even function (i.e. $\cos(-\theta )=\cos(\theta )$ .
Sine and cosine are periodic functions; that is, the above is repeated for preceding and following intervals with length $2\pi$ .

## Exercises

* When does Sine = Cosine?
* For what value of $\theta$ does $\sin(\theta )=\cos(\theta )$ ? (Choose a value between 0° and 90° or equivalently in radians between 0 and ${\frac {\pi }{2}}$).
* Convince yourself you are right by drawing the triangle and using SOH-CAH-TOA.
| previous module: "The most Difficult Triangles to Solve" | • Table of Contents | next module: "Phase and Frequency" |
# Trigonometry/Graph of Sine Squared
## Sin Squared

The graph of $(\sin(x))^{2}$, or $\sin ^{2}(x)$ as it is more usually written, is shown below:
This function
* Must be non-negative, since the square of a negative number is always positive.
* Cannot exceed 1 since $\sin(x)$ always lies between -1 and 1.
It looks like a sine or cosine wave shifted and compressed. It is. We will show this is true later when we look at double angle formulae and prove that $\sin ^{2}(x)={\frac {1-\cos(2x)}{2}}$ .
* Exercise: Spot check this
* Is the graph correct? Try some actual values to see if they have been plotted in the correct place.
* Any value where $\sin(x)=0$ will be zero in this graph too.
* Any value where $\sin(x)=\pm 1$ will be 1 in this graph.
* What about values that have $y=0.5$ on this graph? What values of $\sin(x)$ will work?
* Amplitude, Frequency and Phase
* Going from $\sin(x)$ to $\sin ^{2}(x)$
* The amplitude is halved. (the y values lie between 0 and +1, previously they were between -1 and +1).
* The frequency is doubled. (we have more complete cycles in the same x distance.
* The phase is... well we could argue that the phase is changed, but it really only makes sense to compare the phase of two waves of the same frequency, so it is hard to say what has happened to the phase.

## Cos Squared

The graph below does the same thing for $\cos ^{2}(x)$
Once again, this function:
* Must be non-negative, since the square of a negative number is always positive.
* Cannot exceed 1 since $\cos(x)$ always lies between -1 and 1.
Comparing the two graphs it looks like they would sum to one. They do. This is a graphical way to see what we have already seen earlier, that:
    $\cos ^{2}(x)+\sin ^{2}(x)=1$
* Formula for cos squared
* Using the fact that we have established that:
* $\cos ^{2}(x)+\sin ^{2}(x)=1$
* and assuming the result we will prove later that:
* $\sin ^{2}(x)={\frac {1-\cos(2x)}{2}}$
* work out an expression for:
* $\cos ^{2}(x)=$
* Be careful with the signs and brackets as you are taking the minus of a minus. Be sure to simplify the formula - your answer should be at least as simple as the formula for $\sin ^{2}(x)$.
* Does the formula you come up with look like it is consistent with the graph we have drawn for $\cos ^{2}(x)$ ?
| previous module: "Phase and Frequency" | • Table of Contents | next module: "Addition Formula for Sines" |
# Trigonometry/Graphs of Other Trigonometric Functions

A graph of $\tan(x)$. $\tan(x)$ is defined as ${\frac {\sin(x)}{\cos(x)}}$.
A graph of $\csc(x)$ . $\csc(x)$ is defined as ${\frac {1}{\sin(x)}}$ .
A graph of $\sec(x)$ . $\sec(x)$ is defined as ${\frac {1}{\cos(x)}}$ .
A graph of $\cot(x)$ . $\cot(x)$ is defined as ${\frac {1}{\tan(x)}}$ or ${\frac {\cos(x)}{\sin(x)}}$ .
Note that $\tan(x)$ , $\sec(x)$ , and $\csc(x)$ are unbounded, positive or negative. While $\tan(x)$ (and $\cot(x)$) can take any value, $\sec(x)$ and $\csc(x)$ can never lie between -1 and 1.
# Trigonometry/Heron's Formula

Heron's formula states that the area A of a triangle whose sides have lengths a, b, and c is
    $A={\sqrt {s(s-a)(s-b)(s-c)}}$
where $\displaystyle s$ is the semiperimeter of the triangle:
    $s={\frac {a+b+c}{2}}$
There is a proof here.
* Exercise
* Let us try this for the 3-4-5 triangle, which we know is a right triangle. We know its area. It's half that of the rectangle with sides 3x4. So the area $A$ is ${\frac {3\times 4}{2}}=6$ .
* Let's see if Heron's formula works too.
* $s={\frac {3+4+5}{2}}=6$
* And using Heron's formula:
* $A={\sqrt {s(s-a)(s-b)(s-c)}}={\sqrt {6(6-3)(6-4)(6-5)}}={\sqrt {6\cdot 3\cdot 2\cdot 1}}={\sqrt {36}}=6$
* It worked.
The formula is believed to be due to Hero (or Heron) of Alexandria (10 – 70 AD), a Greek mathematician.
* Worked Example
* Now over to you. We have an equilateral triangle with each side of length 1. The base of the triangle is 1, the height can be worked out by Pythagoras. It's
* ${\sqrt {1^{2}-{\frac {1}{2^{2}}}}}={\frac {\sqrt {3}}{2}}$
* so the area $A$ of our equilateral triangle is ${\frac {\sqrt {3}}{4}}$ .
* Work out what the semi perimeter S is for this triangle, and put the values for S and the lengths of the sides into Heron's formula and compute the area, A.
* $s=$
* And using Heron's formula:
* $A={\sqrt {s(s-a)(s-b)(s-c)}}=$
* Did the answer work out correctly?
| previous module: "Areas of Triangles" | • Table of Contents | next module: "Plotting (Cos t, Sin t)" |
# Trigonometry/For Enthusiasts/What Tessellations are Possible with Regular Polygons

A tesselation or tiling means a pattern or arrangement of polygons that can (by indefinite repetition) be made to cover an arbitrarily large area of the plane with no gaps.
* Investigate what tessellations are possible with regular polygons
* Did you consider polygons that had a mix of different types of polygon, e.g hexagons and squares?
* Can you be sure that you haven't missed any out? Can you prove it?
# Trigonometry/Geometric Definitions of Trig Functions
## Geometrically defining tangent

In the previous section, we algebraically defined tangent as $\displaystyle \tan \theta ={\frac {\sin \theta }{\cos \theta }}$, and this is the definition that we will use most in the future. It can, however, be helpful to understand the tangent function from a geometric perspective.
A line is drawn at a tangent to the unit circle: (i.e. $x=1$). Another line is drawn from the point on the radius of the circle where the given angle falls, through the origin(O), to a point (Q) on the drawn tangent. The ordinate (QP) of this point is called the tangent of the angle.
The slope of the line OQ = ${\frac {KC}{OC}}$ and as we mentioned before
KC = sin(θ) , OC = cos(θ)
Hence , the Slope of the line OQ = ${\frac {\sin(\theta )}{\cos(\theta )}}$
and also the slope of OQ = ${\frac {QP}{OP}}$ = ${\frac {QP}{1}}$ = ${\frac {\tan(\theta )}{1}}$ = tan(θ)
Hence , we can deduce that tan(θ) = ${\frac {KC}{OC}}$ = ${\frac {\sin(\theta )}{\cos(\theta )}}$ = QP = the ordinate of the point Q = the slope of OQ

## Domain and range of circular functions

Any size angle, positive or negative, can be the input to sine or cosine — the result will be as if the largest multiple of 2π (or 360°) were subtracted from or added to the angle. The output of the two functions is limited by the absolute value of the radius of the unit circle, $|1|$.
${\begin{matrix}&\mathrm {domain} &\mathrm {range} \\\mathrm {sine} &\mathbb {R} &[-1,1]\\\mathrm {cosine} &\mathbb {R} &[-1,1]\\\end{matrix}}$
R represents the set of all real numbers.
No such restrictions apply to the tangent, however, as can be seen in the diagram in the preceding section. The only restriction on the domain of tangent is that odd integer multiples of ${\frac {\pi }{2}}$ are undefined, as a line parallel to the tangent will never intersect it.
${\begin{matrix}&\mathrm {domain} &\mathrm {range} \\\mathrm {tangent} &\mathbb {R} \setminus \left\{\cdots ,-{\frac {\pi }{2}},{\frac {\pi }{2}},{\frac {3\pi }{2}},{\frac {5\pi }{2}},\cdots \right\}&\mathbb {R} \\\end{matrix}}$
for a deep understanding of trigonometric functions explore this Applet

## Applying the trigonometric functions to a right-angled triangle

If you redefine the variables as follows to correspond to the sides of a right triangle: • x = a (adjacent) • y = o (opposite) • a = h (hypotenuse)
Next Page: Right Angle Trigonometry Previous Page: The unit circle
Home: Trigonometry