Making Pictures Worth 1000 Words in Python

In a previous post, I showed how you could upload images into a Discord server from Python; leveraging the popular chat platform to simplify things like remote monitoring and push notifications on mobile devices. As an example, I showed an automatically generated image containing the statistics for my Battlefield 1 platoon which gets pushed to member’s devices on a weekly basis.

Automatically generated stats posted to Discord

The generation of that image was outside the scope of the original post, but I think it’s a technique worth discussing on its own. After all, they say that a picture is worth 1000 words. So that means a picture that actually contains words must be worth way more. Like, at least 2000, easy.

Being able to create images from your textual data can lend a bit of flair to your projects without the need to create an entire graphical user interface. By putting a text overlay on a pre-rendered image, you can pull off some very slick visuals with a minimum amount of system resources. So long as you have a way of displaying an image file, you’re good to go.

In this post I’ll quickly demonstrate how to load an image, overlay it with text, and then save the resulting image to a new file. This technique is ideal in situations where a display doesn’t need to be updated in real-time; visuals can be generated at regular intervals and simply displayed as static images. Possible uses include weather displays, “magic” mirrors, public signage, etc. Continue reading “Making Pictures Worth 1000 Words in Python”

Friday Hack Chat: All About The Hackaday Prize

For this week’s Hack Chat, we’re talking all about the Hackaday Prize. Our guests for this week’s Hack Chat are Alberto Molina and Elecia White.

Elecia White was a Hackaday Prize judge in 2015 and 2016, and she’ll be discussing what makes a standout entry from a judging perspective. Elecia is an embedded software engineer at Logical Elegance, Inc., author of Making Embedded Systems, and host of the podcast.

Alberto Molina won the Grand Prize of the 2016 Hackaday Prize with Dtto, an Open Source, self-reconfiguring rescue robot that Alberto is continuing to develop.  Alberto is an Electronic engineer who wants to design the next generation of robots and he will share his insights on putting together a fantastic entry for your project.

The Hackaday Prize is the greatest hardware competition ever. It’s the Academy Awards of Open Hardware (and will remain so until we get a cease and desist). The Hackaday Prize is a competition where thousands of hardware hackers, makers, and artists compete to build a better future.

The Hackaday Prize is in its fifth year in 2018, and the theme this year is Build Hope. We’re challenging everyone to put your ideas and creativity to use and Build Something That Matters. Do this, and you’ll be in the running for the Grand Prize of $50,000. In total we’re giving away $200,000 in total cash prizes to build hardware, something no other hardware competition can match.

Also on board for this Hack Chat, like all Hack Chats, will be Stephen Tranovich, Technical Community Leader at He’s working hard on the logistics for the Prize this year, and he’ll field any and all questions about entering the 2018 Hackaday Prize.

In this Hack Chat, we’ll be discussing how the Prize is judged, the new challenges for the 2018 Hackaday Prize, the achievements the winners of the Hackaday Prize have already seen, and of course, your questions. We know there’s a lot of interest in the Hackaday Prize, and we want you to ask what’s on your mind. If you have a question, just add it to the Hack Chat event page as a comment, and we’ll answer it.


Our Hack Chats are live community events on the Hack Chat group messaging. This week it’s going down at the usual time, on noon, Pacific, Friday, March 23rd  Want to know what time this is happening in your neck of the woods? Have a countdown timer!

Click that speech bubble to the right, and you’ll be taken directly to the Hack Chat group on

You don’t have to wait until Friday; join whenever you want and you can see what the community is talking about.

Buying Machine Tools: Foreign or Domestic, New or Used?

The last time we discussed machine tools, we talked about how to choose the size of the new metalworking lathe that your wallet is itching to pour itself into. The next big decision to make is “new or used?” If you’re in North America, this question has a lot of overlap with the classic question “Import or American?”. The answer boils down to what your needs are, and what you want to get out of this machine.

If you are new to machining, and want to learn the skills, I recommend starting with an Asian import machine. If you’re careful which one you select, you’ll end up with a very reasonably priced lathe that can do precise work right out of the crate. If your interest is in learning how these tools work, and in doing a restoration project, an old American machine is a great choice. Let’s look at these two routes in more detail.

Continue reading “Buying Machine Tools: Foreign or Domestic, New or Used?”

Hackaday’s Irish Excursion is on 7 April

Try something a bit out of the ordinary with us on 7 April. Spend a Saturday with Hackaday in Dublin without really knowing what to expect. This is the Unconference format, and we’ve fallen in love with the spontaneity and consistently fascinating talks that come out of it.

We’ve booked a fantastic hall in the Temple Bar district of Dublin, lined up snacks throughout the day and dinner for all who attend, plus there’s an after bar and we’ll buy the first round. All of this is yours if you grab one of the rapidly disappearing free tickets.

What we ask of you is to come prepared to give a 7 minute talk on something you’re really excited about right now. This is low-pressure; the point of an Unconference is to learn about what people are working on right now (not to see a 40 minute talk that was polished over several months). There will not be enough time for absolutely everyone to speak but we’ll get through as many as we can and make sure there’s an interesting mash-up of topics throughout the day.

To break the ice, we have a few “ringers” who we’ve asked to lead off each talk session. Beth ‘pidge’ Flanagan is an embedded and Linux expert who is well-known for her work on OpenEmbedded and Yocto and will talk about “how the sausage is made” specifically surrounding some advance metering infrastructure. Rachel “Konichiwakitty” will be speaking. Rachel was at our London Unconference back in September and we’re excited to hear about the stem cell research she’s been doing as part of her Ph.D. work. James Twomey will be on hand to go into some of the craft of stage magic, and also talk about what we can learn from the battery-free magic of crystal set radios like the “foxhole” radios built during WWII.

DesignSpark LogoThere are already enough people to pack the place and we only have about 20 tickets left, so hurry up and grab yours.

This event is made possible, free of charge to the attendees, with generous support from DesignSpark, the innovation arm of RS Components. DesignSpark is the exclusive sponsor of the Hackaday Dublin Unconference.

Sophie Germain: The Mathematics of Elasticity

When a 13-year old Marie-Sophie Germain was stuck in the house because of the chaotic revolution on the streets of Paris in 1789, she found a refuge for her active mind: her father’s mathematics books. These inspired her to embark on pioneering a new branch of mathematics that focussed on modeling the real world: applied mathematics.

Post-revolutionary France was not an easy place for a woman to study mathematics, though. She taught herself higher maths from her father’s books, eventually persuading her parents to support her unusual career choice and getting her a tutor. After she had learned all she could, she looked at studying at the new École Polytechnique. Founded after the revolution as a military and engineering school to focus on practical science, this school did not admit women.

Anyone could ask for copies of the lecture notes, however, and students submitted their observations in writing. Germain got the notes and submitted her coursework under the pseudonym Monsieur Antoine-August Le Blanc. One of the lecturers that she impressed was Joseph Louis Lagrange, the mathematician famous for defining the mathematics of orbital motion that explained why the moon kept the same face to the earth. Lagrange arranged to meet this promising student and was surprised when Germain turned out to be a woman.

Gauss and Germain

‘Le Blanc’ also corresponded with German mathematician Carl Friedrich Gauss on number theory. When Napoleon’s armies occupied the town the famous mathematician lived in, Germain enlisted a family friend in the army to check that Gauss had not been harmed. Gauss didn’t realize who had helped him out, until he discovered that ‘Le Blanc’ was Sophie Germain, he wrote to her thanking her for her concern and praising her mathematical prowess given the hurdles set before her.

“How sweet is the acquisition of a friendship so flattering and precious to my heart. The lively interest you took during this terrible war deserves the most sincere recognition….But when a person of this sex, who, for our mores and prejudices, must recognize infinitely more obstacles and difficulties than men to become acquainted with these thorny searches, knows how to get rid of these obstacles and to penetrate what they have, most hidden,  must undoubtedly, she has the most noble courage, talents quite extraordinary, genius superior.”

As well as working on the thorny and theoretical problems of number theory, Germain worked on applying mathematics to real world problems. One of these was a challenge set by the Paris Academy of Science to mathematically describe the elasticity of metal plates. An experimenter called Ernest Chladni had demonstrated that a metal plate would resonate in odd ways when vibrated at certain frequencies. If you put sand on the plate, it would collect in different patterns created by the resonance of the plate, called Chladni figures. To win the prize, the solution had to predict these figures.

The Mathematics of Stress and Strain

Mathematically predicting the behavior of metal plates could make it easier to design metal objects and predict how they would behave under stress. The prize was set in 1808 but was so difficult that Germain was the only one who decided to try to solve it, as it required coming up with a whole new way to analyze and describe how materials bend and change under stress.

The first two solutions that she submitted were rejected due to mathematical errors, but the third version won her the prize in 1816. However, due to the Academy policy of not allowing women to join (and to only attend events if they were wives of members), Germain was not able to attend the ceremony where the prize was granted. She was also not allowed to attend meetings of the Academy. After the Academy failed to publish her prize-winning work, Germain had to pay to publish the work herself in 1821.

Later, her friend Joseph Fourier allowed her to attend meetings and presentations, but the mathematical establishment never really accepted her, or her work. In a letter to a colleague in 1826 she complained about the way they rebuffed her:

“These facts are my domain and it is to me alone that they remain hidden. That’s the privilege of the ladies: they get compliments and no real benefits.”

In the same letter, Germain complained of suffering fatigue and she was diagnosed with breast cancer shortly afterwards. She died in 1831. Her final years were spent working on a solution to Fermat’s Last Theorem, and just before her death she published a partial solution that was the basis for much research into the theorem, which was finally solved only with computer help in the late 1990s.

Although Sophie Germain never earned a degree in her lifetime, she was given an honorary degree in 1837 from the University of Göttingen at the suggestion of Gauss, who noted that

“she proved to the world that even a woman can accomplish something worthwhile in the most rigorous and abstract of the sciences and for that reason would well have deserved an honorary degree.”

The Academy that snubbed her also now offers an annual prize for mathematics in her name. Perhaps more importantly, her work formed the basis of the study of elasticity and stress in metals that allowed engineers to build larger objects and buildings. Creations such as the Eiffel tower in 1887 were directly influenced by her work, and it laid some of the groundwork for Einstein’s theory of General Relativity.

Modern scholars argue that Germain could have been more than she was: her work, they argue, was hamstrung by a limited understanding of some of the fundamental concepts that Gauss and others had described. Although her work was fundamental and important, if she had been given free access to the education that she wanted and deserved, it’s easy to imagine that she would have gone farther.

CUDA is Like Owning a Supercomputer

The word supercomputer gets thrown around quite a bit. The original Cray-1, for example, operated at about 150 MIPS and had about eight megabytes of memory. A modern Intel i7 CPU can hit almost 250,000 MIPS and is unlikely to have less than eight gigabytes of memory, and probably has quite a bit more. Sure, MIPS isn’t a great performance number, but clearly, a top-end PC is way more powerful than the old Cray. The problem is, it’s never enough.

Today’s computers have to processes huge numbers of pixels, video data, audio data, neural networks, and long key encryption. Because of this, video cards have become what in the old days would have been called vector processors. That is, they are optimized to do operations on multiple data items in parallel. There are a few standards for using the video card processing for computation and today I’m going to show you how simple it is to use CUDA — the NVIDIA proprietary library for this task. You can also use OpenCL which works with many different kinds of hardware, but I’ll show you that it is a bit more verbose.
Continue reading “CUDA is Like Owning a Supercomputer”

Hackaday Links: March 18, 2018

Oh, boy. You know what’s happening next weekend? The Midwest RepRap Festival. The greatest 3D printing festival on the planet is going down next Friday afternoon until Sunday afternoon in beautiful Goshen, Indiana. Why should you go? Check this one out. To recap from last year, E3D released a new extruder, open source filaments will be a thing, true color filament printing in CMYKW is awesome, and we got the world’s first look at the infinite build volume printer. This year, The Part Daddy, a 20-foot-tall delta bot will be there once again. It’s awesome and you should come.

We launched the 2018 Hackaday Prize this week. Why should you care? Because we’re giving away $200,000 in prizes. There are five challenges: the Open Hardware Design Challenge, Robotics Module, Power Harvesting, Human-Computer Interface, and Musical Instrument Challenge. That last one is something I’m especially interested in for one very specific reason. This is a guitorgan.

Building a computer soon? Buy your SSD now. Someone fell asleep on the e-stop at a Samsung fab, and now 3.5% of global NAND production for March has been lost.

Need to put an Arduino in the cloud? Here’s a shield for that. It’s a shield for SIMCom’s SIM7000-series module, providing LTE for a microcontroller. Why would you ever need this? Because 2G is dead, for various values of ‘dead’. 3G is eventually going to go the same way.

A bridge collapsed in Florida this week. A pedestrian walkway at Florida International University collapsed this week, killing several. The engineering efforts are still underway to determine the cause of the accident, but some guy from Canukistan posted a pair of informative videos discussing I-beams and pre-tensioned concrete. It’s going to be months until the fault (and responsibility) will be determined, but until then we have the best footage yet of this collapse. It’s dash cam footage from a truck that rolled up to the red light just before the collapse. This is one that’s going to go down in engineering history along with the Hyatt Regency collapse.

Need to test your app? Here’s a delta robot designed for phones. You would be shocked at how popular this robot is.