In this small lecture Simon talks about Set, Stack, Queue and Array in Computer Science.
Simon says he made a mistake in the Addendum: you can add and remove elements to/from an array in PHP.
This weekend Simon came back to his old fascination, Fractal Trees. This time he didn’t just follow along Daniel Shiffman’s coding challenges, but created customized versions of Daniel’s trees, adding color and physics in some cases or writing the code in object oriented manner:
Simon’s favorite piece for the moment – Schubert’s Unfinished Symphony:
Simon also worked on a Markov Chains projects this weekend, trying to introduce a slider into his text generating code.
“A Markov Chain can be described as a sequence of random “states” where each new state is conditional only on the previous state. (…) An n-gram is a contiguous sequence of N elements. (…) Using an N-gram model, we can use a markov chain to generate text where each new word or character is dependent on the previous word (or character) or sequence of words (or characters)”, Daniel Shiffman writes.
In other words, Markov Chains can be used to generate text automatically based on a source text. For some reason, Simon’s slider only worked in the minimum stand (“least sense”, generating words from 2-letter combinations). When turned to maximum, it only returned the same one and a half words all the time. Simon gave up at that point:
The rest of the code comes from Daniel Shiffman’s Markov Chains Coding Challenge. This coding challenge is part of the Programming A to Z course, one of the courses that Daniel Shiffman has taught at the Interactive Telecommunications Program at NYU’s Tisch School of the Arts.
This is the chapter on Markov Chains: http://shiffman.net/a2z/markov/
Today Simon was watching Daniel Shiffman’s tutorials to learn about drag force and how to apply it when building a spring simulation in p5.js. Simon wrote the formula for drag force in Microfost Word and looked up all the variables:
While building a spring in p5.js, Simon talks about the 3 laws of Isaac Newton:
The project is based upon Daniel Shiffman’s book The Nature of Code, specifically Chapter 3 (Oscillation). Simon spent the rest of the evening studying “simple harmonic motion”, periods and amplitudes. Here is an excerpt from Daniel Shiffman’s book:
Simon has nearly completed the basic equations and inequalities course on Khan Academy.
Every time his math teacher comes they solve a couple of inequalities from the course and what happens next is that Simon goes over to his desktop to check his answers in the “Inequalities machine” he programmed! He often has to change the program to fit a new inequality format, so it takes some time. Luckily the math teacher understands how awesome this is. I also think it’s the first time Simon has really programmed something for practical use!
This is how Simon solves the inequalities, by typing them:
Testing the answer in the “Inequalities Machine”:
The original “Inequalities Machine” Simon programmed back in February:
Simon talking about the most dangerous place in the world:
Simon practicing Markdown with GitHub: