Skip to content

Commit

Permalink
Update blog
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed Dec 7, 2018
1 parent a6cfa60 commit f5e74ce
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
26 changes: 21 additions & 5 deletions blog/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
<meta name="viewport" content="width=device-width">
<style>
html {
max-width: 800px;
max-width: 640px;
margin: 0 auto;
}
body {
margin: 0 12px;
}
header {
position: fixed;
height: 1px;
background-color: #8ac3f1;
top: 0;
left: 0;
right: 0;
width: 800px;
margin: 0 auto;
}
article {
margin-top: 42px;
}
code {
background: #F0F0F0;
display: block;
Expand All @@ -16,9 +32,9 @@
</style>
<!--<a id="anchor" href="sample2.html">Another article</a>-->
<body>
<header>Francois Beaufort wrote</header>
<header></header>
<article>
<h1 id="title">Machine Learning Explained in Three Easy Steps</h1>
<h1 id="title">&lt;canvas> and &lt;video></h1>
<canvas id="canvas"></canvas>
<section id="article"></section>
</article>
Expand Down Expand Up @@ -55,6 +71,7 @@ <h1 id="title">Machine Learning Explained in Three Easy Steps</h1>
canvas.hidden = false;
}, 200);
const response = await fetch(url);
/*
const textDecoder = new TextDecoder();
for await (const chunk of streamAsyncIterator(response.body)) {
await setTimeoutAsync(500);
Expand All @@ -66,7 +83,7 @@ <h1 id="title">Machine Learning Explained in Three Easy Steps</h1>
}
article.innerHTML += textDecoder.decode(chunk, { stream : true });
}
/*
*/
const text = await response.text();
clearInterval(id);
article.animate([
Expand All @@ -79,7 +96,6 @@ <h1 id="title">Machine Learning Explained in Three Easy Steps</h1>
article.innerHTML = text;
canvas.hidden = true;
highlightCode();
*/
}

async function* streamAsyncIterator(stream) {
Expand Down
12 changes: 12 additions & 0 deletions blog/sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
You’ve probably heard the term “machine learning” and how it’s <a href="https://www.nytimes.com/2016/12/14/magazine/the-great-ai-awakening.html">changing everything</a>
. In this article, I’m going to explain the fundamental concept behind machine learning.
</p>

<p>There will be no math or programming. There will be no scary diagrams. You won’t need a background in computer science or engineering. All you need is the ability to read and think, which you obviously already have if you’ve made it this far. Well done on that reading and thinking! Onward…</p>
<h3 id="foxes-and-dogs">Foxes and Dogs</h3>
<p>There’s a nice sequence of words which is famous for containing every letter in the english language in one short sentence. Have you seen it?</p>
Expand All @@ -26,6 +27,17 @@ <h3 id="foxes-and-dogs">Foxes and Dogs</h3>
<li>Purpose or qualifier</li>
</ol>
<p>Since quick is a quality/opinion and brown is a color, “quick brown” is the proper order, not “brown quick”. To give an extreme example, this is fine: “one really big old antique American car” but perturb that sequence of adjectives in any way you like and the results sound very wrong.</p>
<pre>
<code class="javascript">

// Stream canvas to a video.
video.srcObject = canvas.captureStream();
// Play automatically.
video.muted = true;
video.play();

</code>
</pre>
<p>
The amazing thing about this sequence is that nearly every native english speaker knows it, but <strong>very few people know they know it</strong>
. In my audience of 200 professional CS and IT people, not a single person could tell me this sequence.
Expand Down

0 comments on commit f5e74ce

Please sign in to comment.