Coding, Computer Science, Milestones, Murderous Maths, Python, RaspberryPi, Simon teaching, Simon's Own Code, Simon's sketch book

More Sorting Algorithms!

An update to Simon’s new project: a series of video tutorials on sorting algorithms! See the full playlist here.

Part 7: Heapsort

Finally, parts 6 and 7 of Simon’s exciting series of video tutorials about sorting algorithms are done! In the videos, Simon codes on his RaspberryPi, but here is the link to the Python code (parts 6 – 7) available on his GitHub page:
https://gist.github.com/simon-tiger/be3864b36f6d89fecd06f150063a6321

Part 6: Shellsort

The code of the sorting algorithms discussed in the previous videos (parts 1 – 5) is available here: https://gist.github.com/simon-tiger/5be70247a066f69c2578be5bb8e41e59

Simon wrote the Shellsort code himself. He tried to run his own code for Heapsort as well, but didn’t get the list fully sorted, so in the end he implemented the heapsort code that he learned from Brilliant.

“Then, with VERY much relief, I MASSIVELY condensed the code (to just 3 lines!), using Zax Rosenberg’s blog“, Simon adds.

Coding, Coding Everywhere, Computer Science, Milestones, Murderous Maths, Python, RaspberryPi, Simon's Own Code, Simon's sketch book

Simon creates a playlist with Sorting Algorithms tutorials in Python

Simon’s chart of sorting algorithms ranked by efficiency

Simon has started a huge new project: a series of video tutorials about sorting algorithms. In the videos, he codes on his RaspberryPi, but here is the link to the Python code available on his GitHub page (that he continuously updates): https://gist.github.com/simon-tiger/5be70247a066f69c2578be5bb8e41e59

Today, Simon has recorded the fifth part of the series, in which he explains and applies the Quicksort algorithm. [The coding part goes very smoothly and much quicker (hehe) than in the previous sorting videos we have made so far. Simon also came up with his own code, he didn’t look the code up].

the quicksort video

And here come the previous parts of Simon’s sorting algorithms series, also available via this link to a playlist on his YouTube channel (there will be more videos coming):

the bubble sort video
the selection sort video
the insertion sort video (took Simon two days to make)
the merge sort video (was the most painful one)

Simon is also fascinated by more exotic sorting algorithms, such as a sorting network:

Simon used the following resources: Daniel Shiffman’s tutorial on Quicksort, Timo Bingmann’s sort algorithms visualization, Must Know Sorting Algorithms in Python, a medium blog on sorting algorithms, Brilliant.org’s computer science courses, Wikipedia.


Coding, Java, RaspberryPi

Processing on RaspberryPi

Simon installed Processing on his RaspberryPi recently (using the terminal, which looked terribly sophisticated and scary as on Linux you’re forced to do everything through the terminal) and started preparing examples that he hoped to show during his own livestreams, but the RaspberryPi seems to have crashed, unable to bear the weight of so many examples…

dsc_19091456268463.jpgdsc_1908267889140.jpg

Coding, RaspberryPi

Wolfram in RaspberryPi 

Simon tried out a new language Wolfram on his RaspberryPi. Wolfram is a programming language that can be used to program 3D print sketches. “With different functions and constants you can do it exactly the way you want”, Simon says. In the video below he used Wolfram in a simple terminal.

Simon later also used Wolfram in Mathematica, a text editor pre-installed on RaspberryPi.

wp-image-1173566453jpg.jpeg

Wolfram can be used to program objects for 3D printing.

Coding, Electricity, Electronics, Milestones, Python, RaspberryPi

What is Simon’s level in coding and problem solving?

Simon carried out a project on his new RaspberryPi today that allows to see his programming and problem solving level quite well. Luckily I was there on time with my iPhone camera to film and take pictures.

It involved a simple Blink-an-LED code for Python, but note that Simon wrote it completely from memory. Also interesting that since he was missing the M/F jumper wires required for the project he decided to use his broken M/M wires instead, which I thought was quite inventive.

He used Terminal to create a program called led.py, saved and closed the file and opened the File Manager. He looked for the led.py file, but it wasn’t there.  So he hit Shift-Ctrl-F to search for it and found it. He opened the file by right-clicking on it and selected Python 2 (IDLE). He made sure the correct screen appeared and that the Python code was complete. He then ran the code by typing “sudo python led.py” . Unfortunately a syntax error message popped up.

After a moment of hesitation (when I though he maybe would give up) he said he knew what the error was: he missed a couple of comas. After inserting the comas in the Leafpad file he ran the code again. And it worked!! We were both so happy as if we witnessed sheer magic.

 

Later Simon also showed me how to make the LED light burn continuously or turn it off again.

 

img_2496

img_2497

img_2498

img_2500

img_2502

img_2505

The missing comas back in place:

img_2506

img_2508

Coding, Electronics, Experiments, html, JavaScript, RaspberryPi

RaspberryPi work station

When Simon got a new RaspberryPi 3 from Sinterklaas on Sunday joy quickly turned into drama as he discovered the old (and only) keyboard we had at home was outdated and had no usb connection. His original plan was to use the television screen as the RaspberryPi screen and that would have let towards constant struggle with those other members of the family who actually wanted to watch tv. What made things worse was that it was Sunday and all Belgian computer stores (and all other Belgian stores) were closed. Simon was devastated as he’d really set his mind on this project. We jumped in the car and drove to The Netherlands where people never stop working and neither does MediaMarkt. Within an hour we got a wireless keyboard and a nice Samsung screen, both at a good price, and went for a drink on the Grote Markt square of the old Dutch town Bergen op Zoom. And now we’ve got one more “desktop”.

Simon has been using this single board computer to train html and JavaScript. His favourite is setting the background colour in hexadecimals.

 

 

 

Coding, Crafty, Electronics, Milestones, PiTop, RaspberryPi

We fixed the PiTop! Can’t believe it worked!

It was Simon’s idea to reimage the corrupted SD-card, he tried doing it himself the morning after the crash. He downloaded Noobs and Raspbian from RaspberryPi’s website but couldn’t go any further. The desktop said the files were “damaged”. As it turned out later, they were zipped and the desktop simply had no space on the hard drive to unzip them. But that was a good thing Simon stopped there as he didn’t know he should format the SD-card first, before uploading the new OS.

Later the same day we received an email from PiTop support with the steps to reanimate our newborn. The procedure was quite like what Simon had suggested, except that were advised to start with extracting the old OS and formatting the SD-card. We also received useful links to download imaging software:

The new OS came directly from PiTop’s site.

After reimaging the SD-card Simon reinstalled the tiny thing back into the RaspberryPi inside the PiTop without removing the RaspberryPi – he has thin fingers! It was a very exciting moment, we didn’t know if it would work. But it did!!

 

Simon went straight on to programming again.

These were the steps we followed:

Extract the old OS from the SD card onto to your desktop.

Reformat your SD card by using SDFormatter which will ensure the the SD card is in the correct format.

For the most up-to-date version of the pi-topOS, download it here: https://pi-top.com/product/pi-top-os

Follow this link for instructions on installing the OS onto your SD card: https://www.raspberrypi.org/documentation/installation/installing-images/

Follow the instructions for, “Writing an image to the SD Card,” based on your operating system. (We had to install new imaging software at this pont). Once you’ve completed this you should be able to plug your microSD card back into your Raspberry Pi and go!

 

Coding, Crafty, Electronics, Experiments, html, JavaScript, Milestones, PiTop, RaspberryPi

PiTop, day 2 (Tuesday)

Didn’t really feel like going to his first Fench class this morning. All he wanted to do before and after French class was program:

We were utterly shattered when at the end of day two the PiTop stopped working. First it froze and we had to force reboot it by pressing the on/off button. This may have caused corruption of the MicroSD. The PiTop’s power does go on but the screen remains grey. Simon was crying bitterly at first but started looking for rebooting solutions on YouTube later in the evening. He is planning to reimage the SD-card tomorrow. Even if that doesn’t help there is a lot of learning involved in the process I believe. I have also written a letter to the PiTop support team.