Remote Development on Raspberry and Arduino with VS Code

Efficient Programming with Visual Studio Code Remote-SSH extension and Arduino CLI

In this short note I will summarize how I can happily use Visual Studio Code on my local Windows desktop or laptop to do remote development on a Raspberry Pi or another Linux machine, and even push Arduino sketches from the Raspberry to an Arduino without touching the Arduino IDE. I have been a fan of the Raspberry Pi single board computer for a number of years now, and have used quite a number of them in my desktop single board computer cluster and my developing Raspberry/Arduino robot car. Still, I found developing code on it to be uncomfortable and sometimes cumbersome, as some IDEs don't support ARM processors whereas others like Thonny are rather basic. Remote development solves this by allowing you to code on your desktop / laptop and run it externally on a host (like the RPi). With the nascent Arduino CLI you can even largely replace the Arduino IDE for developing Arduino sketches on RPi and pushing them to a connected Arduino.

[Read More]

Converting LaTeX to Markdown

Using Regular Expressions

I'm usually writing my notes on physics and mathematics, e.g. the ongoing series of posts on Riemannian geometry, in \(\LaTeX\) documents, as probably most people do. For the purpose of this blog I regularly need to convert parts of these documents into markdown that Hugo can understand. Since I haven't found any better solution yet I decided to develop a set of regular expressions in Python that do the job pretty well. I normally run the code in a Jupyter notebook that allows me to check the quality of conversion immediately and do some minor tweaking if required.

[Read More]

AI weekly (51/2019)

My selection of news on AI/ML and Data Science

+++ Facebook has a neural network that can do advanced math +++ Google’s AI can identify wildlife from trap-camera footage with up to 98.6% accuracy +++ Intel acquires AI chip startup Habana Labs for $2 billion +++ eBay open-sources AI platform Krylov +++ AI experts urge machine learning researchers to tackle climate change +++ Top 10 Python libraries of 2019 +++

[Read More]

Python virtual environments

Getting to know pipenv, pyenv, conda and friends

Anyone who works on Python projects and uses various packages will sooner or later have to deal with different versions of packages across different branches and projects. Because each project has its own set of dependencies, it’s a good practice to avoid mixing them. If all the dependencies are installed together in a single Python environment, then it will be difficult to discern where each one came from. In the worst cases, two different projects may depend on two different versions of a package, but with Python you can only have one version of a package installed at one time. What a mess! Virtual environments address this issue. A virtual environment, put simply, is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects.

[Read More]
python  code 

Image Manipulation with Python Pillow

Normally I use GIMP when I need to resize, crop or retouch images in various ways. However, for my last post on the Berlin Festival of Light I would have had to manually resize and crop a whole bunch of images at a time. That's why I took a look how Python could help with this task, and found PIL, the Python Imaging Library, in newer versions known as Pillow.

[Read More]