From 53c0dfbf8afa54773bf65175c5bf5437518902e4 Mon Sep 17 00:00:00 2001 From: tth Date: Fri, 1 Apr 2022 14:23:45 +0200 Subject: [PATCH] more bla... --- chap/Fortran.tex | 21 +++++++++++++++++++-- chap/IRC.tex | 2 ++ chap/MIDI.tex | 4 +++- chap/Maths.tex | 13 +++++++++++++ chap/reseau.tex | 2 +- chap/scripting.tex | 34 ++++++++++++++++++++++++++++++++++ chap/son.tex | 13 ++++++++++--- chap/ssh.tex | 2 +- code/awk/dataset | 3 +++ main.tex | 2 ++ 10 files changed, 88 insertions(+), 8 deletions(-) create mode 100644 chap/scripting.tex create mode 100644 code/awk/dataset diff --git a/chap/Fortran.tex b/chap/Fortran.tex index 1dfa131..80da08b 100644 --- a/chap/Fortran.tex +++ b/chap/Fortran.tex @@ -91,7 +91,7 @@ des fichiers en Fortran est assez déroutante% \footnote{Par contre, pour un dino des \textsl{big irons}\dots}. Il semble qu'il y ait deux concepts orthogonaux. -Open, Read, Write, Inquire, toussa\dots +\textit{Open, Read, Write, Inquire, toussa\dots} % -------------------------------------------------------- @@ -102,10 +102,27 @@ au-delà de 104 lignes. Oui, j'avoue, j'ai bien changé depuis l'époque où je confectionnait des procédures \textsl{monobloc} de 1337 lignes, avec une bonne centaine de \texttt{GOTO} dedans. +% -------------------------------------------------------- +\subsection{Random et Aléa} + +La dernière ligne va vous étonner. + +\begin{verbatim} + integer, dimension(3) :: tarray + integer :: t3 + real :: dummy + call itime(tarray) + t3 = 3600*tarray(1) + 60*tarray(2) + tarray(3) + write(0, '(A,3I3,A,I6)') "sranding: ", tarray, " --> ", t3 + call srand(t3) + ! after initializing the random generator engine, + ! you MUST use it for initializing the initializer + dummy = rand() +\end{verbatim} % -------------------------------------------------------- -\subsection{Images ?} +\subsection{Images} Plplot semble être un bon choix pour commencer. diff --git a/chap/IRC.tex b/chap/IRC.tex index 4ac1752..a6d0369 100644 --- a/chap/IRC.tex +++ b/chap/IRC.tex @@ -35,6 +35,8 @@ pinpin0: çhârsèt ? /SET autoclose_windows OFF \end{verbatim} +\textbf{Question :} comment enregistrer un chan' ? + % ============================================================== \section{hexchat} \index{hexchat} diff --git a/chap/MIDI.tex b/chap/MIDI.tex index 93b9ba1..792510f 100644 --- a/chap/MIDI.tex +++ b/chap/MIDI.tex @@ -216,7 +216,7 @@ d'un fichier \texttt{.mid} ? \lstinputlisting[language=perl]{code/midifile.pl} -Voilà. +Voilà enfin du code qui n'est pas fini\dots % --------------------------------------------------------- @@ -233,5 +233,7 @@ OSC\index{OSC} (page \pageref{chap:OSC}) semble une possibilité pour aller au-delà. Mais, \textsl{amho}, rien ne pourra vraiment remplacer le midi tel que nous le connaissons depuis les années 80. +You can read more about USB MIDI here: + https://www.midi.org/midi-articles/basic-of-usb % --------------------------------------------------------- diff --git a/chap/Maths.tex b/chap/Maths.tex index 4f13304..c564892 100644 --- a/chap/Maths.tex +++ b/chap/Maths.tex @@ -15,6 +15,19 @@ Je songe ensuite aborder certains aspects de la théorie du signal, dans le but pratique de brotcher du son. +\section{En vrac} + +\begin{verbatim} + double stddev(const auto *x, int N) + { + double sum = 0, sum_sq = 0; + for (int i = 0; i < N; i++) { + sum += x[i]; + sum_sq += x[i]*x[i]; + } + return sqrt((sum_sq - sum*sum/N)/(N-1)); + } +\end{verbatim} diff --git a/chap/reseau.tex b/chap/reseau.tex index 140fdb1..dc49c17 100644 --- a/chap/reseau.tex +++ b/chap/reseau.tex @@ -200,7 +200,7 @@ Comment scanner un /24 pour y découvrir les machines ? \section{netcat} \index{netcat} -\textbf{Attention :} Il existe au moins deux variantes de netcat +\textbf{Attention :} Il existe au moins $N$ variantes de netcat en circulation, bien entendu avec des options et des comportements différents. diff --git a/chap/scripting.tex b/chap/scripting.tex new file mode 100644 index 0000000..e3b97ab --- /dev/null +++ b/chap/scripting.tex @@ -0,0 +1,34 @@ +\chapter{scripting} + +\section{Awk} \index{Awk} + + +Quelques \textsl{oneliners} de bon aloi pour vous donner +une idée du langage\dots + +\begin{verbatim} + cat { print $0 } or just 1 + grep pattern /pattern/ + head -n 5 NR <= 5 + cut -f1 { print $1 } + tr a-z A-Z { print toupper($0) } + sed 's/hi/ho/g' gsub(/hi/,"ho") + wc -l END { print NR } +\end{verbatim} + +% =============================================================== +\subsection{Un exemple simple} + +À partir d'un jeu de données structurées, nous allons générer un +fichier \texttt{.inc} contenant un objet pour Povray\index{povray}. +Un cas d'école : un élément par ligne, les valeurs séparées par +des espaces. + + +\lstinputlisting[]{code/awk/dataset} + +Ces données sont les coordonnées \textsc{xyz} et le rayon d'une +petite collection de bubulles. Pratiquement, une représentation +sommaire d'une sphère de povray. + +% =============================================================== diff --git a/chap/son.tex b/chap/son.tex index ec19eb0..c1081fd 100644 --- a/chap/son.tex +++ b/chap/son.tex @@ -91,8 +91,8 @@ sur la page \pageref{chap:MIDI}. TODO\index{XXX} %------------------------------------------------------------------ - - +% +% bienvenu dans le monde de LP \section{pulseaudio} \index{pulseaudio} \label{pulseaudio} @@ -102,7 +102,7 @@ même falloir y passer : ce machin prétenduement \textsl{michu compliant}\index{Michu} a parfois, voire même souvent, tendance à se mettre en travers du chemin des honnètes gens% -\footnote{Du moins vers l'année 2014}. +\footnote{Du moins vers les années 2014/2019}. %------------------------------------------------------------------ \section{Jack} @@ -159,6 +159,13 @@ voir qu'elle est à deux niveaux. https://www.xiph.org/ao/doc/drivers.html +\subsection{Choisir la sortie} + +Pour choisr comment et vers quelle prise physique libao va envoyer +le son, il y a deux choix à faire. La partie logicielle d'une part +(aixs, oss, alsa, jack, sndio\dots) +et la partie matérielle (jack standard, casque audio USB\dots). + %------------------------------------------------------------------ \section{Portaudio} \label{Portaudio} \index{Portaudio} diff --git a/chap/ssh.tex b/chap/ssh.tex index 9718eb8..b3496ca 100644 --- a/chap/ssh.tex +++ b/chap/ssh.tex @@ -32,7 +32,7 @@ the implementation makes use of the FUSE (Filesystem in Userspace) kernel module. The practical effect of this is that the end user can seamlessly interact with remote files being securely served over SSH just as if they were local files on his/her computer. On the remote -computer the SFTP subsystem of SSH is used.} +computer the SFTP\index{sftp} subsystem of SSH is used.} Hélas, ça ne marche pas trop bien depuis un OpenBSD\index{OpenBSD}\footnote{OpenBSD 5.5 sur sparc64} : diff --git a/code/awk/dataset b/code/awk/dataset new file mode 100644 index 0000000..66f0442 --- /dev/null +++ b/code/awk/dataset @@ -0,0 +1,3 @@ +17 9 4 1.5 +11 0.8 2.3 0.989 +0 0 0 1 diff --git a/main.tex b/main.tex index b743120..7bcbf00 100644 --- a/main.tex +++ b/main.tex @@ -119,6 +119,8 @@ en ligne sur le site du Tetalab. Your mileage may vary\dots % \input{chap/SCSI} \input{chap/X11} \input{chap/Fortran} +\input{chap/scripting} + % \input{chap/GMP} \input{chap/Python} \input{chap/dino}