Category Archives: Technology

Automate The Boring Stuff with Python Coding

Spread the love

If everyone in the world understood and had a working command of regular expressions, everything would run smoothly. Especially if all of our interfaces to text allowed for their use. This has been pointed out. And, Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners has a whole chapter on this.

What is a regular expression? We can talk about that in detail some other time. Briefly, it is a string of symbols that is designed to match a specified set of symbols, or a range of a set of symbols, in a larger body or stream of text. For example, if you pass a stream of information (say, all your emails) through a filter with the regular expression:

‘\d\d\d-\d\d\d-\d\d\d\d’

then any part of that stream of information that looks like a phone number (not using parens), such as 636-555-3226, will be isolated.

Automate the Boring Stuff with Python is a book that teaches beginning Python computer Augean programming focusing on examples from day to day life, including but well beyond REs.

The new edition includes pattern matching with regular expressions, input validation, reading and writing files, organizing files, web scraping, manipulating Excel spreadsheets and Google Sheets, PDF and Word documents, CSV and JSON files, email, images, and automating your keyboard and mouse.

The great benefit of a book like this is that you learn Python (the first part of the book gives you all you need to know to program in Python) in the context of things you actually want to do with Python. If you are interested in learning Python, or coding in general, this can be your first book.

The book is well done, as all in this series are, and fun. There are strong on line resources including all the code, and that information is regularly updated. Generally, “No Starch” press books are great, and this is one of those!

I would like to have seen at least sidebars on manipulating things using Libreoffice software, but note that the book focuses on documents, and OpenSource software does work with normal Excel and Word documents, so it is there.

The second edition adds a new chapter on input validation. The Gmail and Google Sheets sections, and the information on CSV files is also new. I plan on using the software tips and tricks to develop my own highly specialized and targeted search software. I’m often looking for files that have specific extensions, and certain kinds of content, in certain locations. Just the ability to hard-wire where to search for files will save me a lot of time and trouble.

Author Al Sweigart is a professional software developer who teaches programming to kids and adults, and who is author of Invent Your Own Computer Games with Python, Cracking Codes with Python, and Coding with Minecraft, all of which are quite nice. We need a new edition of Coding with Minecraft, by the way, that looks at a wider range of coding options and keeps up with the major advances in that software environment! So, get to work, Al!


Spread the love

NOAA Gets Cool New Computers

Spread the love

NOAA will be adding two new Cray computers (one operational and one backup) to replace existing hardware used in weather forecasting. According to a press release, “the computers — each with a 12 petaflop capacity — will be operational and ready to implement model upgrades by early 2022 after a period of code migration and testing. They will replace the existing Cray and Dell systems, “Luna” and “Mars” in Reston, Virginia, and “Surge” and “Venus” in Orlando, Florida.”

When combined with other hardware that will remain in use, the total capacity will rise to 40 petaflops. (A petaflop is a measure of computing speed equal to one thousand million million (1015) floating-point operations per second.) Given upgrades in storage and connectivity, and this increasing computing power, there will be a noticeable increase in resolution and other features of NOAA’s modeling of earth systems.

There is a rumor that the Trump Whitehouse plans to sell off the hardware to some friends who live out near the airport in Queens, and replace it with lower grade equipment that Trump claims works just as well (see illustration).

Though the press release does not give details, a spokesperson for NOAA just informed me that these computers will run the Linux operating system. I had assumed so, but wanted to check. Linux is the standard operating system for super computers, because it is a super operating system. Nobody wants to see the Blue Screen of Death in the middle of their tornado warning.

Specifically, the computers will run the Cray Shasta Linux Environment. This is a high performance suit designed to run large and complex applications on more than a half a million cores, with docker container support, and the robust Cray system management support including staged upgrading capabilities and the low overhead Cray system snapshot analyze.


Spread the love

Things To Do After Installing Xubuntu or XFCE

Spread the love

One: set up Dropbox and, as it syncs your files from the cloud, go outside and mow your lawn or rake your leaves.

Two: Start using your computer.

Three: Cancel the order for the new laptop because your old laptop is faster now.

You may have been expecting one of those posts that tell you the “ten things to do after installing [Linux Distribution]” but this ain’t it. In fact, for the most part, those posts have become fairly useless. Consider these “things to do”: Continue reading Things To Do After Installing Xubuntu or XFCE


Spread the love

Do Not Miss Rachel Maddow’s New Book: Blowout

Spread the love

Rachel Maddow is the Charles Darwin of Cable News.

Darwin’s most important unsung contribution to science (even more important than his monograph on earthworms) was to figure out how to most effectively put together multiple sources into a single argument — combining description, explanation, and theory — of a complex phenomenon in nature. His first major work, on coral reefs, brought together historical and anecdotal information, prior observation and theory from earlier researchers, his own direct observations of many kinds of reefs, quasi experimental work in the field, and a good measure of deductive thinking. It took a while for this standard to emerge, but eventually it did, and this approach was to become the normal way to write a PhD thesis or major monograph in science.

Take any major modern news theme. Deutsche Bank. Trump-Nato-Putin. Election tampering. Go to the standard news sources and you’ll find Chuck Todd following the path of “both sides have a point.” Fox News will be mixing conspiracy theory and right wing talking points. The most respected mainstream news anchors, Lester Holt, Christiane Amanpour, or Brian Williams perhaps, will be giving a fair airing of the facts but moving quickly from story to story. Dig deeper, and find Chris Hayes with sharp analysis, Joy Reid contextualizing stories with social justice, and Lawrence O’Donnell applying his well earned in the trenches biker wisdom.

But if you really want to Darwin the news, and sink your natural teeth and claws into a story, go to Maddow. Continue reading Do Not Miss Rachel Maddow’s New Book: Blowout


Spread the love

The Mysterious Russian Nuclear Disaster

Spread the love

Are you following this story from Russia? The Russians lied about it numerous time, and I don’t think we can expect them to ever tell the truth. But it appears to have been a test of a highly improbably weapon (a nuclear powered missile) that resulted in either an explosion that shoved a lot of radioactive material into the atmosphere, or an actual but accidental nuclear explosion.

A village was ordered to be evacuated. Then they cancelled the evacuation.

There is evidence that the bodies of the slain scientists, and/or others injured at the site, who were blasted in the explosion, were so radioactive that the doctors that attended to them also need to be treated. It also may be the case that the nuclear device is in the sea and needs to be recovered.

This is a real mess.


Spread the love

ALERT!! cPanel is ruining the Internet!

Spread the love

cPanel is a widely used front end used on servers for people to operate things like their blog, email system, other web related functions, etc. It is a way to avoid using the command line. So, for instance, you might buy into a hosing package, and that may allow you to set up a WordPress site. Your host give you the info to log into your own cPanel. There, you press the “one click install” button and whoosh, you have a web site. Continue reading ALERT!! cPanel is ruining the Internet!


Spread the love

How my father invaded Europe on D-Day

Spread the love

My father told me exactly three things about his time in the war (aka World War II).

One. He had made a date with a nice English lady, they were to meet under Big Ben at noon on some day, but the Victory in Europe happened and he was hastily sent back the US where he was put on a train to San Francisco to help invade Japan, but then they dropped the bomb. As a result, there is to this day a nice lady in England waiting under Big Ben, and the Japanese Army waiting in Japan, and my dad ditched both of them.

Two. On one, two, or three occasions (I don’t remember) he was at a location in London (like a store or something) and then left, or was just about to arrive at some location London (a store or something) when a German missile blew the place up. Close call.

Three. His contribution to D-Day. He was in the Army Air Corps, though he may have spent more time on a horse (which he presumably knew how to ride before enlisting) than in a plane. He volunteered for the glider corps, willing to be a pilot or navigator, or anything. He cheated on the eye test (he was nearsighted even at that age). He had memorized the eye chart, so when asked to read the letters, he read them all off perfectly.

Unfortunately, he had memorized an older eye chart, and the new eye chart had a different order of letters except the big E on top. The guy giving the test, another Staff Sargent, was his friend, so he did not get in trouble for cheating, but he was not allowed into the glider corps.

Meanwhile, he was assigned to one of those numerous typically secret air bases where they were preparing for the big invasion. His job was to supervise the arrival of airplanes, which were unassembled, and to oversee the storage and transfer of the plane parts to buildings where technicians would assemble them and get them ready to invade Europe. Lots of planes were simply flown to England from the US, but these were built in the us, but sent as non-completed planes to England via large transport planes such as the C-47 Skytrain.

But here’s the thing. The process of delivering these airplanes was rough and rugged. The various partly assembled parts of the planes often came damaged. I believe he said that they were often literally dropped off, pushed out of a transport plane as it landed and taxied, only to take off seconds later. This meant that if five or six planes were delivered over a short period of time, the technicians would have to borrow one part from this plane, and another part from that plane, in order to make perhaps four whole planes, with some spare bits left over.

My father changed the way they managed this, sending a suggestion up the line back to the US, where the planes originated. “Just pack the plane parts in the transport the best way they fit, don’t worry about sending a whole but disassembled plane all together.” So they did that. A transport plane would come in with mostly tails, another with mostly engines, another with mostly whatever. My father set up a method of inventorying and keeping track of the parts, and of supplying to the technicians working, undamaged, sections as they needed to assemble working aircraft. The process of building planes at this airstrip sped up, and when it came time to teach Hitler what for, more planes were ready than otherwise possible.

In other words, my father, Staff Sargent Joseph F. Laden, invaded Normandy with his mind.

He got a medal each from the US Government and from the UK Government for this.

You may already know that a large percentage of the glider-borne soldiers who took part in the Normandy invasion were killed or wounded during the “landing” of the aircraft, or soon after being under heavy fire. The glider pilots suffered much higher casualty rates than the others. So, I’m thinking that my father contributed a more important thing to the war effort with his reorganization of the aircraft building process than he would have as a glider pilot or crew member, and he got to live.

But he never did get to meet that girl under Big Ben.


Spread the love

Make Your Own Pixel Art

Spread the love

First, what is “pixel art?”

Is that just art that is rendered in raster? Not exactly. Pixel art is the sort of art you draw for digital cartoons or similar things. The skills and tools of making pixel art would apply to designing icons or logos used in electronic products as well.

To demonstrate what pixel art is, I’m including a few examples from the newly published Make Your Own Pixel Art: Create Graphics for Games, Animations, and More! by Jennifer Dawe and Matthew Humphries.

This book will give you an introduction to the tricks of the trade of making technologically simply but artistically potent drawings, including ways to animate them.

The non-OpenSource (boo) software that is used throughout the book is not expensive and is easy to use, and yes, OpenSource alternatives are suggested and briefly discussed. The book relies on Aseprite and Pro Motion, with GraphcsGale (Windows only, boo) being a free alternative.

Techniques covered include shading, texture, proper use of color, motion and animation, and making things look sentient. Apparently, you can make money doing this sort of thing! This book is probably a good investment, at the very least to see if you have the talent and interest.

Author Jennifer Dawe is an animator and character designer who has been a professional pixel artist for the past 15 years. Author Matthew Humphries is Senior Editor at PCMag.com and a professional game designer.


Spread the love

Update on Mechanical Keyboards

Spread the love

All keyboards are “mechanical” in some sense, or at least most of them, in that something moves. But what we call a “mechanical keyboard” is one that has individual switches under each key cap, instead of some sort of silly squishy membrane. This gives the keys a different tactile sense, and often, a sound.

This post — Mechanical Keyboards What Are They And Which One Do You Want — is a little, but not too much, out of date. The basic information is correct. There are one or two more kinds of keys than described, and there are emerging manufacturers that may or may not be making good switches, and there are many more offerings of el-cheapo keyboards. And, still, the DasKeyboard is still one of the better (and more expensive) options.

My Avant Stellar keyboard finally broke in enough places (I’m tough on keyboards) to require major repair or replacement. I looked briefly at really old Northgates (20-30 years old?) on ebay, bid on a few, but was outbid and decided not to spend an exorbitant amount of money on a decades old untested machine. I also realized that I have two computers sitting next to each other, and when I change between them, it feels wrong, because they have two entirely different kinds of keyboards. But, I realized, if I get a new DasKeyboard for my Linux machine, since I have a Mac DasKeyboard on the Mac, then I would quickly become accustomed to switching back and forth and all would be well. So, I got the Das Keyboard Model S Professional Cherry MX Blue for the Linux to match the Das Keyboard Model S Pro for Mac, and now everything is good.

Except possibly one thing. You may recal that I had earlier complained about the font used on the key caps on the DasKeyboards. At the time, I used stick on labels to upgrade the DasKeyboard to how I like it. For some reason, as I sit here typing on the new DasKeyboard with the small typeface that I don’t like much, I’m not bothered by it, so I may not make that change. We’ll see.

So now all is well in keyboard land, and my pile of no longer in use keyboards available for spare parts grows.


Spread the love

No, it is NOT rational to keep flying the Boeing 737 Max

Spread the love

Boeing 737 Max:

-First commercial flight May 2017

-First fatal crash October 2018

-Second fatal crash March 2019

Both fatal crashes were attended by a nose-down response by auto-pilot right after takeoff.

The same nose-down response by auto-pilot was reported many times (dozens?) by pilots for months.

Boeing has a software fix that changes the way autopilot handles incorrect nose-down responses with autopilot. The software fix (delayed by the Trump-McConnell shutdown) is still not ready yet.

This is the highest rate of crashes or fatalities of any single model of commercial airline. Maybe. I haven’t checked, but it’s gotta be or close, anyway.

Response by Hyper-skeptical skeptics: “Air travel is safe, so this is not actually a problem, don’t ground the flights.”

Response by the idiots who run the Trump administration: “Everything is fine, don’t worry about it.”

Response by every other country in the world, practically, “Out of an abundance of caution, ground the planes until this is figured out”

Response by the air flight industry and regulators when the b787 dreamliners had unexpected unexplained problems: Ground all the planes and fix the problem.

Response when SW planes discovered to have inadequate inspections: Ground the plains and fix the problem

Response when BQ400s have landing gear problem a couple of times (2007): Ground the plane until it is addressed.

In other words, the NORMAL response to this sort of situation is to ground the model. This is THE REASON AIR TRAVEL IS SAFE. Air travel is not inherently and automatically safe. It is safe because when a model aircraft if considered POTENTIALLY FAULTY in some serious way it is grounded until that problem is addressed.

Finally, after everybody else grounded the plane, the Trump administration FOLLOWS.

I’m sure the hyper-skeptics are still saying it is irrational to ground the 737Max planes.


Spread the love

How to extract pages from a PDF file

Spread the love

If you have a PDF file and need to extract a subset of pages, creating a new PDF file with those pages in it, you can do that.

I like PDF Lab‘s PDFtk aka PDF toolkit. This is not OpenSource and there is both a non free pro and free version of it. I’ve tried the free version (example below) and was impressed. Next time I need to do a lot of PDF work I’ll probably fork out the 399 for the pro version. (That’s 399 pennies, quite cheap. It is developed by Sid Steward, the author of PDF Hacks: 100 Industrial-Strength Tips & Tools.

So, for example, I can get pages 11-20 of a larger file called big.pdf extracted into a smaller file called extracted.pdf like this:

pdftk A=bigpdf cat A11-20 output extracted.pdf

That line of code makes almost no sense to me, but it works.

I learned about this tip at a Linux Journal Tech Tip page on extracting pages from a PDF, where you will find several other approaches.


Spread the love

End Robocalls

Spread the love

I don’t know about you, but I’m getting an increasing number of robocalls. Most of the calls I get are robocalls. I have stopped answering my phone unless it is from my wife, daughter, or other relative or person who’s phone is IDed.

I was speaking with someone last week who works in a business where phone calls are critically important, and the office has several phone lines. Each phone line gets a continuous stream of robocalls. There are times, frequently, when this business that relies on phone contact with clients turns off its entire phone system for an hour or two. That seems to temporarily reduce the number of robocalls, allowing for a brief period when customers can get through.

This madness must end!

I have a proposal to end robocall.

The US Congress passes a law that eliminates robocalls entirely. You simply can’t ever do them.

The robocall lobby will object, and fight, and make it impossible for such a bill to be passed. So, I have an additional set of provisions to help to get a bill like his through.

1) The ban on robocalls can not be lifted in any way for five years. That should give time for all the equipment to get old and all the people in the business to drift off.

2) If an exception is allowed, say for emergency calling systems, it can only be allowed on a state by state basis and only for a maximum of six months, but extendable. This way, any lifting of the ban will require re-evaluation and thus, it is possible that it will be less abused than similar laws have in the past.

In addition to banning all robocalling, it will be necessary, likely, to ban phone communication to or from countries that send out illegal robocalling.


Spread the love