A new algorithm for customizable, fast pseudorandom bytes that passes the tests with flying colors.
Randomness is too important to leave to chance. Donald Knuth said that, and it’s a good mantra for programmers to adhere to. Generating pseudorandom numbers is a notoriously error prone challenge, and getting it right is extremely important.
Most roofs do surprisingly well, even if they are not aimed south, or their pitch isn’t ideal. Here’s a short Python program to easily analyze any roof.
There’s a lot of misinformation, and disinformation about how well homeowner’s roofs will work with solar panels. The Python program presented here can help you decide if your roof can really save you money by going solar.
My wife is a top notch solar panels sales person. Together we’ve been involved with solar energy projects of all sizes ever since she and I were introduced to each other by her father, the best…
Here’s a concise Python program you can use to calculate the Sun’s position to 0.01 degree accuracy.
Here’s my favorite solar joke… “I stayed up all night trying to figure out where the Sun went. It finally dawned on me.”
Seriously though, knowing where the Sun is at in the sky is of great importance today as the world switches to solar and wind alternate energy sources. I’ve created software for many solar sites, such as the Carissa Plains project shown above, and sharing a core Python algorithm to calculate the Sun’s position feels like the right thing to do…
At least some of what NASA has shown us is bogus. Can we use Python to set things right?
Conspiracy theories are actually okay. However, buying into them outright is for the weak minded, and rejecting them offhand is for the closed minded. Hard facts, strong evidence, good research, and critical thinking provide the path forward to properly accepting or rejecting any interesting theories, whether of the conspiracy or of the scientific type. Having said all that, let’s take a look at one of my favorite conspiracy theories about Mars.
Back in 2004, NASA released a fascinating panoramic photograph from…
Make a date with this short educational Python program!
Yes, this is all about a dating program, but no, it’s probably not what you think. It’s still a lot of fun though! (And the results can be quite useful.)
Python is an amazing programming language, perfect for students and beginners, NASA Rocket Scientist types, and passionate lovers of logic of all ages. When learning programming concepts, Python goes hand-in-hand very well with the KISS principal (I prefer to refer to it as the “Keep It Stupidly Simple” principle), and that makes learning the core concepts fun and easy, minimizing distractions…
Think of it as an amazing programming language within a language
I discovered something very fun recently, while working on my next book, a collection of short Python programs for the Casio fx-9750GIII handheld calculator. I’ll share the resulting program here (it runs great in any version of Python) and explain how the amazing eval() function saved my bacon.
The program I was working on lets students find the roots of any function of x, or the points where the function crosses the x axis when it is graphed. Instead of having the user edit the program to define some…
Steganography is the practice of concealing messages or information within other non-secret text or data. Using the following Python code, you can hide text messages within image files, and the human eye will not be able to see any change in the file’s image. They won’t know what they don’t know.
So, how in the world is it possible to hide hundreds of lines of text in a picture without anyone detecting the change? If you check the properties of an image file, you’ll discover that it has a width and height expressed in terms of pixels — the tiniest…
Be prepared to surprise them during your next job interview!
As the story goes, a bright young programmer interviewing at Google (or was it Microsoft? Or Facebook? … take your pick) was asked to explain why manhole covers are always round, and not square or some other shape.
The standard, very logical explanation is that round covers won’t fall through the hole they cover, taking into account the lips around the edges of the lid and the hole it snuggly fits into. Supposedly, round is the only shape where this is possible.
Bean counting is boring. At least that was the assumption I lived with most of my life. But the following short Python programs are easy to set up and run (they’re free too!) and they can help you take control of your personal financial decisions. Once again, Python has helped me hack my life in good ways, and it probably can help you too.
Taking out a loan can be intimidating. A huge step towards making the process more comfortable is to have a good idea ahead of time what your monthly loan payments will be. …
Thinking outside the box just might help save us all
My wife wrote a screen play, “Lagrange Lancelot”, where the planet is saved from climate disaster by a unique geoengineering idea. It’s a very cool storyline, resulting in world peace as a by product after drastically slowing down a climate disaster. I just wish the fate of our planet, in the very real world, was also that cool.
We are in dire straights. My goal here is not to dwell on all the scary news. You can Google on “climate change” to find all the latest on that, from the…
Author, inventor, entrepreneur — passionate about alternate energy, technology, and how Python programming can help you hack your life.