Injecting commands and debugging a running Python program, with Project Euler example

How often has it happened to you… you build a simple script to calculate something, run some bulk process, and coming back after an hour or so it just hangs with no output. Is it doing something or stuck? You could debug it, using WinPdb or Visual Studio Code debugger or GDB to run it step by step, but that would lose the time that it has been processing. Instead, you can use Pyrasite, a program for looking in to a running Python script!

Continue reading “Injecting commands and debugging a running Python program, with Project Euler example”

Linux 5.9

Recently, Linux 5.9 was released! While folks are unlikely to see this in any distribution very soon, it brings some improvements that will be a clear reason that we will hear about it very soon (ok, enough ham radio jokes 🙂 )

Although it’s not something particularly recommended for your main system, but you could install it now – in fact with kernels of Linux you can generally switch it out and if it doesn’t work, just select the old one at the boot screen.

Better things to do this Oct 31st

This has been a challenging year for many of us, and while it may be tempting to go visit neighborhood houses for parties or candy, the extra sugar and staying out in the cold could possibly be a setback from healthy progress in recent weeks. Some say sugar worsens immune function. Instead you might consider activities including:

  1. Reading, study
  2. Watch some interesting Makerfaire videos, as most areas didn’t get a Makerfair this year 🙁
  3. Build something on the computer and present at a hackathon – there’s a Tmobile hackathon, a Here Maps hackathon, Post COVID Hackathon, hack-or-treat going on.

Machine learning SVM – the usefulness of kernels

If you’ve read through how Support Vector Machines work, you probably know the linear simple SVM might not work in all cases… but how does it fail? Let’s take a look at an example I tried like to my simple example… but change it to be a larger space than just 4, and separated with a region in the middle, and the region around it (positive, negative labelled areas to learn):

Continue reading “Machine learning SVM – the usefulness of kernels”

Human pose estimation with Python and Gluoncv

Human pose estimation is something useful for robotics/programming as you can see what position a person is in a picture. For last weekend’s Hackrithmitic I did an experiment for fun using computer vision pose estimation. To start with I found several possibilities with available libraries:

  • Tensorflow js has been used to say, don’t touch your face, but it takes a massive amount of cpu.
  • Openpose is a popular one, only licensed for noncommercial research use, and there is a Opencv example for it that doesn’t quite show how to use it.
  • AlphaPose is supposedly faster and has a more clear license and possibility for commercial use – if you want that as a possibility. I checked out the install instructions and worked but for “python3” instead of “python”. It also misses obvious step of installing cuda for your Nvidia system before running.
  • GluonCV is another, which seems more user friendly. This one I was able to get running in a few minutes with their example:
Continue reading “Human pose estimation with Python and Gluoncv”

Slide rule enters the 21st century

Some time ago I came across this online tool in a newsletter article – this is a very cool slide-rule-emulator that will not just let you move two slides, but actually slide it for you as you run an equivalent digital calculator calculation to the right!

If you haven’t ever used a slide rule before, it works on properties of logarithms, and the principle that log(a)+log(b) = log(a*b). Now it wouldn’t be very interesting to just have two normal rulers together, as sliding and adding would just let you do problems like 5+5 = 10 or 50+50 = 100 if you scale the numbers. With logarithmic scale, the spacings are off and it allows you to do multiplication in adding the numbers.

Continue reading “Slide rule enters the 21st century”