Simon hadn’t been writing in Python for months but seems to be quite fluent still, here using the Python space in Processing for the first time:
Simon was preoccupied with vector functions for most of the day on Saturday, compiling what, at first site, looked like a monstrously excessive code in Processing (he recycled some of it from the Processing forum, wrote some it himself and translated the rest from Codea). Originally, he was gong to use the code to expand the 3D vector animation he made into a roller-coaster project he saw on Codea and wanted to create in Processing, but got stuck with the colors. What happened next was fascinating. In the evening I all of a sudden saw Simon write in a new online editor Repl.it – he was translating the vector code into… Python! He hadn’t used Python for quite a while. I don’t know what triggered it, maybe Daniel Shiffman noting last night during the live stream session that “normal people use Python for machine learning”. Simon also said he had sone some reading about Python at Python for Beginners and Tree House!
He isn’t done with his project in Python yet, but here is the link to it online: https://repl.it/JAeQ/13
Here Simon explains what he is writing in Python:
Simon did the 2D, 3D and 4D classes but eventually got stuck with the matrix class in Python. He then opened his old Xamarin IDE and wrote the 2D, the 3D and the 4D classes in C#. In the video below he briefly shows his C# sketch and talks about Cross Product in general:
And this is a video he recorded about vector functions (in Processing, Java) the day before:
Simon talking about the most dangerous place in the world:
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.
The missing comas back in place:
Over the past week Simon has made some more progress in his Python courses. By now he has completed 5 courses. The level of the last few lessons is quite high and sometimes we only manage to debug one exercise per day.
Today we had a much busier day as we had to bike for two hours to get Simon to his Scratch programming class. That said, Code Academy still largely ruled the day. Simon has completed four and a half courses by now and the tasks are getting tougher. Sometimes he finishes a tasks without errors, but mostly not and then he asks me to help debug his code. We sit down together and go through it again and brainstorm and try different variants. Yet it hit me that most of the time it’s not I who finds the final solution but Simon.
And he even squeezed some Raspberry Pi Photon Red Board programming in, too:
Tuesday morning I briefly showed Code Academy’s website to Simon: “Look, you can learn to code in Python right here. And here’s a list of other coding languages”, – I surfed back to the homepage. Then I went back to the kitchen to make tea. We have an open kitchen so I can watch Simon from where I’m making tea. The next second I saw him flip back to the Python course and start. He only took pauses when I insisted he eat something and come along to the immigration office to pick up our Belgian ID’s. No other pleas to take a break and relax worked. The rest of the time he went on studying, for seven or eight hours. He successfully finished a whopping 60 exercises that day, most of them without any help on my behalf.
A badge earned for every completed course:
To write a Python project in Arduino Simon had to calculate how many milliseconds there are in one day, one month and one year. Here he explains how he did that (in Dutch):
This is the result. As it turned later it does contain errors, but still impressive for someone who is only getting acquainted with both languages. The code, that Simon says should be uploaded on New Year’s day at midnight, should be able to send you weather and humidity updates every hour, every day or every month, depending on your personal settings.