Skip to content

Commit

Permalink
tutorial instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
dicook committed Mar 15, 2024
1 parent 1973afa commit e1032e2
Show file tree
Hide file tree
Showing 12 changed files with 977 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/search.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/site_libs/bootstrap/bootstrap.min.css

Large diffs are not rendered by default.

901 changes: 901 additions & 0 deletions docs/site_libs/htmlwidgets-1.6.2/htmlwidgets.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/site_libs/quarto-html/quarto-syntax-highlighting.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/site_libs/revealjs/plugin/quarto-tone/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# adapted from https://github.com/gadenbuie/xaringanExtra/blob/master/docs/slide-tone/libs/slide-tone/slide-tone.js
name: QuartoTone
script: tone.js
53 changes: 53 additions & 0 deletions docs/site_libs/revealjs/plugin/quarto-tone/tone.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
window.QuartoTone = function () {
return {
id: "quarto-tone",
init: function (deck) {
function slideToneScale(i) {
// https://www.intmath.com/trigonometric-graphs/music.php
const note = 15 - (deck.getTotalSlides() - i);
return 440 * 2 ** (note / 12);
}

/*
* Sliding tones between C3 and C5 with equal steps between tones
* but not aligned to musical scale
*/
function slideToneBounded(i, lower = 261.63, upper = 1046.5) {
const step = (upper - lower) / deck.getTotalSlides();
return lower + step * i;
}

/*
* Choose slide tone scale automatically based on number of slides.
* If there are <= 32 slides, use musical scale.
*/
function slideToneAuto(toneIdx) {
return deck.getTotalSlides() > 32
? slideToneBounded(toneIdx)
: slideToneScale(toneIdx);
}

const synth = new Tone.Synth({
oscillator: {
type: "sine",
},
envelope: {
attack: 0.001,
decay: 0.2,
sustain: 0.2,
release: 1,
},
}).toMaster();

const playTone = () => {
synth.triggerAttackRelease(
slideToneAuto(deck.getSlidePastCount()),
"8n"
);
};
deck.on("slidechanged", playTone);
deck.on("fragmentshown", playTone);
deck.on("fragmenthidden", playTone);
},
};
};
8 changes: 8 additions & 0 deletions docs/site_libs/tone/tone.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
</url>
<url>
<loc>https://iml.numbat.space/week4/tutorial.html</loc>
<lastmod>2024-03-12T22:43:57.412Z</lastmod>
<lastmod>2024-03-15T07:05:40.838Z</lastmod>
</url>
<url>
<loc>https://iml.numbat.space/week4/tutorialsol.html</loc>
<lastmod>2024-03-12T22:43:57.412Z</lastmod>
<lastmod>2024-03-15T07:05:40.838Z</lastmod>
</url>
<url>
<loc>https://iml.numbat.space/week3/tutorial.html</loc>
Expand Down
2 changes: 1 addition & 1 deletion docs/week4/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -5052,7 +5052,7 @@ <h4 class="anchored" data-anchor-id="assess-the-significance-of-pc-coefficients-
<p>In the lecture, we used bootstrap to examine the significance of the coefficients for the second principal component from the womens’ track PCA. Do this computation for PC1. The question for you to answer is: <em>Can we consider all of the coefficients to be equal?</em></p>
<p>The data can be read using:</p>
<div class="cell" data-layout-align="center">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>track <span class="ot">&lt;-</span> track <span class="ot">&lt;-</span> <span class="fu">read_csv</span>(<span class="st">&quot;https://raw.githubusercontent.com/numbats/iml/master/data/womens_track.csv&quot;</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>track <span class="ot">&lt;-</span> <span class="fu">read_csv</span>(<span class="st">&quot;https://raw.githubusercontent.com/numbats/iml/master/data/womens_track.csv&quot;</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="using-simulation-to-assess-results-when-there-is-no-structure" class="level4">
Expand Down
2 changes: 1 addition & 1 deletion docs/week4/tutorial.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In the lecture, we used bootstrap to examine the significance of the coefficient
The data can be read using:

```{r echo=TRUE}
track <- track <- read_csv("https://raw.githubusercontent.com/numbats/iml/master/data/womens_track.csv")
track <- read_csv("https://raw.githubusercontent.com/numbats/iml/master/data/womens_track.csv")
```

::: unilur-solution
Expand Down
4 changes: 2 additions & 2 deletions docs/week4/tutorialsol.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion week4/tutorial.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In the lecture, we used bootstrap to examine the significance of the coefficient
The data can be read using:

```{r echo=TRUE}
track <- track <- read_csv("https://raw.githubusercontent.com/numbats/iml/master/data/womens_track.csv")
track <- read_csv("https://raw.githubusercontent.com/numbats/iml/master/data/womens_track.csv")
```

::: unilur-solution
Expand Down

0 comments on commit e1032e2

Please sign in to comment.