Both Matt Parker and the Youtube Veritasium channel have reviewed the surprising best practice for the 100 prisoners puzzle. The puzzle is a way to find a solution that will let the prisoners win with the most probability. If you have not seen this already please see the video here before some spoilers below.Continue reading “Testing solutions to the 100-prisoners puzzle.”
Optimal placements and unsolved math problems are among the interesting problems discussed in the book, Tomorrow’s Math, Second Edition by C. Stanley Ogilvy. On chapter two, pg.23-24 he asks how a land’s defenses may be best defended by n defense stations on a disk shaped land area? They state it had known answers for n<6, and “a general solution seems remote at present”.Continue reading “Optimal placements and unsolved math problems”
One thing many don’t consider when setting up a GTK+ window application is that the same code that runs on a Linux phone or Linux computer, can also run on MS Windows with the same libraries! Next time you are on a Windows system and trying to set up a command or tool normally working on Linux, try this:Continue reading “Linux tools on Windows with MSYS2 (And a Repeater app for Windows!)”
There may be times you have a simple choice or listing in a GTK list box – for this example, in choosing a serial connection or other device. Glade is a good way to build an application window easily with an interface to build in to your app on Linux desktop, Ubuntu or Librem phone or other Linux based phones. I was able to use this to create a Winlink user interface for the previous tutorial to call up the Pat interface.Continue reading “GTK Choice box with Glade and Python”
In the chapter The Long Tail of the Law, in Alex Bellos’ book The Grapes of Math, he shows some different statistical patterns that share the same properties:Continue reading “Zipf’s law, Kleiber’s law, and finding interesting patterns in browsing history”
If like many you have been starting gardens and planting rather than traveling and visiting in recent months, there is one important thing to consider lately – severe weather reports including frost on your crops. I noted there was a little red (!) alert icon on an Android weather widget, but there seems to be no such alert for desktop computer or Linux computer or phone. It is a fairly simple to make this alert though with a simple script:Continue reading “Severe weather alerts with a simple Python script”
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”
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 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:
Remember when there were mini mp3 players with one button and a shuffle feature? If like many geeks you have a bunch of interesting ebooks from Humble Bundle, Oreilly or Github or wherever you get technical books, you probably have folders and folders of lots of interesting books. What if you want to “shuffle” or randomly pick one off your virtual bookshelf and read a bit while staying home? Today I’ll show how to virtually “grab a book off the shelf” of your collection with a simple Python script:Continue reading “The eBook Shuffle”