Live Stream #6. (Mostly) Chapter 2 of Living Code: Forces.

Simon’s latest live stream on Thursday, January 11 was a blast! For the first time in his programming career he actually had quite a few viewers – largely thanks to Daniel Shiffman, who posted an announcement about Simon’s live session in his Twitter:

During the session, Simon recorded 6 tutorials:

  • a bonus video about vectors,
  • a video about forces in general,
  • a video about mass,
  • a video about the Friction Force,
  • a video about Air Resistance
  • and a video about Gravitational Attraction.

All as part of his “Living Code” Course. The lessons in the course are loosely based on Daniel Shiffman’s book “The Nature of Code“, but focus on JavaScript.

Simon was worried in the beginning, because he had forgotten to prepare for the stream and had no choice but do the theory (on physical forces) on the fly. It was wonderful to see how the competent viewers gave him a helping hand every now and then and generally encouraged him in the live chat. He even got a real Q&A session in the end, something he had always dreamed of:

Schermafbeelding 2018-01-11 om 20.38.49Schermafbeelding 2018-01-11 om 20.39.27Schermafbeelding 2018-01-11 om 20.39.42Schermafbeelding 2018-01-11 om 20.40.01Schermafbeelding 2018-01-11 om 20.40.20Schermafbeelding 2018-01-11 om 20.40.45Schermafbeelding 2018-01-11 om 20.41.01Schermafbeelding 2018-01-11 om 20.41.14Schermafbeelding 2018-01-11 om 20.41.24

Advertisements

Langton’s Ant in p5.js

Simon wrote this JavaScript code for Langton’s Ant (a type of Cellular Automaton) himself, inspired by Daniel Shiffman’s description/version in Processing (Java) during the Coding Train live stream on January 5.

Link to Simon’s sketch: http://alpha.editor.p5js.org/simontiger/sketches/rJeKLICmM

Simon later also made a pixel level version: http://alpha.editor.p5js.org/simontiger/sketches/rJeKLICmM

And a version with multiple ants: http://alpha.editor.p5js.org/simontiger/sketches/r1Ry_FQ4M

(Simon also loves the Numberphile video about how Langton’s Ant works and forms a mysterious “highway” after a certain number of moves).

Magic around New Year’s Eve

This magical time of the year, Simon’s craziest, most daring dreams come true! First, his guru from the New York University Daniel Shiffman sends Simon his book and the words he writes there are the most beautiful words anyone has ever told him. Then, on the last day of the awesome year 2017, Simon’s other hero, the glamorous knight of AI Siraj Raval materialises in our living room, directly from YouTube! Happy New Year full of miracles and discoveries everyone!

DSC_3314

Daniel Shiffman’s book “The Nature of Code” that Simon had already largely read online and now also reads before bed. It also comforted him recently when he was in pain, he cuddled up of the sofa with this big friendly tome on his lap.

dsc_33401897498871.jpg

Daniel Shiffman signed the book for Simon:

dsc_33441647117253.jpg

dsc_33421879896746.jpg

Siraj Raval stepped out of the YouTube screen straight into our Antwerp apartment on December 31. Simon has been following Siraj’s channel for months, learning about the types of neural networks and the math behind machine learning. It is thanks to Siraj’s explanations that Simon has been able to build his first neural nets :

DSC_3370

DSC_3364

Schermafbeelding 2018-01-05 om 02.07.56

Simon explains K Means Clustering

Simon has prepared this implementation of “K-Means Clustering” in Processing as a gift for Daniel Shiffman, who is plainning to talk about this Machine Learning model in one of his upcoming live sessions on the Coding Train channel.

Simon writes: K-Means Clustering is a type of Machine Learning Model. It’s for “Unsupervised Learning” (meaning you have data with no labels).

Link to Simon’s code on GitHub: https://github.com/simon-tiger/k-means-clustering

Link to pseudocode by Siraj Raval: https://www.youtube.com/watch?v=9991JlKnFmk&spfreload=1

 

 

Computer repeats after Simon

Following the exciting text-to-speech and speech-to-text projects yesterday, this morning Simon made a basic speech-to-text-to-speech demo, which means that the computer can now repeat (parrot) everything Simon says.

Simon relied on what he learned during Daniel Shiffman’s two latest live streams on the Coding Train channel in building these projects.

Almost talking to the computer!

This is one of those wow projects, so much fun! Simon built his Text-to-Speech and Speech-to-Text demos following Daniel Shiffman’s recent live streams on working with the p5.Speech library and added some extra style features. This basically means that you can type anything on your computer and hear it say what you’ve typed (in any voice or language!) or, in what Simon said was an easier project, yell something to your computer (I love you!) and watch it type it out for you. The next step will be combining the two and including that code into a chat bot code.

You can play with Simon’s Text-to-Speech demo on GitHub at:

Basic text to speech example: https://simon-tiger.github.io/p5_speech/01_text2speech/

Example using different voices: https://simon-tiger.github.io/p5_speech/02_voices/

Basic speech to text example: https://simon-tiger.github.io/p5_speech/03_speech2text/

Code/ repo: https://github.com/simon-tiger/p5_speech

 

 

 

 

 

Simon contributes to the p5.Speech library

Simon has made a pull request to the p5.Speech GitHub repo (a milestone!) and hopes his request gets merged. In this video he explains what he wants to improve with his contribution.

Later it turned out that someone else made a similar request (with more extras) and that request will probably be merged, so Simon was definitely thinking in the right derection. He got positive response from Daniel Shiffman and it looked like Simon’s comments have sparked a discussion on GitHub.

 

Simon contrubuted to p5.Speech library. Pull request 14 Oct 2017

Simon writing on GitHub: 

This github issue is referring to pull request #7.

As you can see in commit a2a5d38, there are some comments. Which look like 
this:

// this one 'start' cycle.  if you need to recognize speech more

// than once, use continuous mode rather than firing start()

// multiple times in a single script.

The comments are right before the start() function in the p5.SpeechRec 
object. But the commit adds arguments to this function:

p5.SpeechRec.prototype.start = function(continuous, interimResults) {

  if('webkitSpeechRecognition' in window) {

    this.rec.continuous = continuous;

    this.rec.interimResults = interimResults;

    this.rec.start();

  }

}

And before, that piece of code looked like this:

p5.SpeechRec.prototype.start = function() {

  if('webkitSpeechRecognition' in window) {

    this.rec.continuous = this.continuous;

    this.rec.interimResults = this.interimResults;

    this.rec.start();

  }

}

Are the comments "unnecessary" now? In other words, Should we remove 
them or leave them there?

Simon’s Particle Train

Simon made a particle system based on Daniel Shiffman’s latest live stream. Here is the link to Simon’s code on CodePen: https://codepen.io/simontiger/pen/OxvYYW?editors=0010

He also tweeted about it: