“If Abortion Was Legal, I Would Have Aborted You” — Mom

Photo by Maria Oswalt on Unsplash

As a child growing up in the 1970s, my mother told me frequently that she would have aborted me if abortion was legal in 1969. Four years before Roe vs. Wade made abortion legal throughout the United States.

My parents got friendly during Thanksgiving weekend in 1968. After the New Year, they knew that they had — in today’s vernacular — an “oopsie” baby. An unplanned pregnancy by an older couple (my father was 34, my mother was 29) with an older child (my brother was 13).

The doctor told my mother that she was expecting twins.

A day after my maternal grandfather’s birthday in early August, she delivered a ten-pound bowling ball in one hour. I was so big and came out so fast that she needed 250 stitches. The latter she would hold against me for years to come.

My father stopped drinking and got a vasectomy. My mother started drinking and became an alcoholic.

Read my essay and follow me on Medium. Your support is greatly appreciated.

When Is A Bug Not A Bug in Python?

Photo by Alan Emery on Unsplash

While writing a chess program in Python as a learning exercise, I had two separate functions for converting a position from an algebraic notation string, 'a1', to a tuple, (97, 1), and vice versa. I later merged the two functions into a static method for the Board class. The code works. I should have left it at that and move on.

I found any interesting situation when refactoring the code to work with @functools.singledispatch and @staticmethod in a class. The code worked but I was using the wrong single dispatch decorator. When is a bug not a bug?

Read my essay and follow me on Medium. Your support is greatly appreciated.

The Incompatible Type Assignment Error in Mypy

Photo by Antoine Dautry on Unsplash

I’m writing a chess program in Python as a learning exercising. Not surprisingly, mypy, the static type checker, complained about my code with yet another incomprehensible error message. Here’s a quick-and-dirty fix for the incompatible type assignment error.

Read my essay and follow me on Medium. Your support is greatly appreciated.

Fixing A String Issue with Enum.name in MyPy

Photo by Mel Poole on Unsplash

While cleaning up code in my chess program that I’m writing in Python as a learning exercise, I came across yet another problem with the mypy static type checker. This time with the Enum.name attribute.

color = Color(self._color).name.capitalize()

The statement worked but mypy reported an error message.

error: Item “None” of “Optional[str]” has no attribute “capitalize”

I came up with a solution for that problem.

Read my essay and follow me on Medium. Your support is greatly appreciated.

Fixing “None” Not Callable Error in Mypy

Photo by David Travis on Unsplash

The mypy static type checker always complain about using a dictionary to call functions. Especially this code segment from my chess program that I’m writing in Python as a learning exercise.

status = {Bishop: self.validate_move_bishop,
King: self.validate_move_king,
Knight: self.validate_move_knight,
Pawn: self.validate_move_pawn,
Queen: self.validate_move_queen,
Rook: self.validate_move_rook,
}.get(type(self._board[start]))(start, end)

This message, error: “None” not callable, always leave me cross-eyed at times. I came up with a solution for that problem.

Read my essay and follow me on Medium. Your support is greatly appreciated.

Fixing The Incompatible Dunder Method Error in Mypy

Photo by Stephanie Mulrooney on Unsplash

While cleaning up my code in a chess program that I’m writing in Python as a learning exercise, I created an Enum class to represent the starting ranks for certain pieces on the board. Since I wanted the Enum to also behave like a list, I added that to the class definition. The mypy static type checker reported an incompatible __hash__ dunder method error between list and Enum. I came up with a solution for that problem.

Read my essay and follow me on Medium. Your support is greatly appreciated.

Un-Cringing An is_even() Function in Python

Johnny B. Getgoode tweeted this screenshot of if-else statements.

Johnny B. Getgoode tweeted a screenshot from his developer Discourse server on February 13, 2022. Experienced programmers cringed at the repeating lines of if else to determine if a number is even or odd. That prompted a lively discussion on how to “un-cringe” this function.

Here are four ways to refactor the function for readability and speed in Python: match and case, recursive inner function, modulo operator, and bitwise operator.

Read the rest of the essay on Medium. If you’re interested in supporting my writing on Medium, please follow me and become a paid member (I’ll get a referral bonus).

George Floyd’s Death Blurred Out

YouTube sent me a late night email on Wednesday, August 4, 2021, informing me that a video on my channel was no longer compliant with the Community Guidelines and age restricted (a viewer must be 18 years or older and logged in to view the video).

That was odd.

I maintain a family- and advertiser-friendly, and, under the Federal Trade Commission’s COPPA, not “made for kids” channel. All my videos are suitable for a general audience (13 years or older).

Which video got age restricted?

My montage video that alternated clips from George Floyd’s death and the first SpaceX crewed flight while Gil Scott-Heron narrated his 1970 poem, “Whitey On The Moon,” about poverty on the earth and white men on the moon.

Read the rest of the essay on Medium. If you’re interested in supporting my writing on Medium, become a paid member and I’ll get a referral bonus.

Does Storyblocks License Supersedes Creative Commons License?

Photo by Markus Winkler on Unsplash

On my YouTube channel, there are two types of videos that get copyright claims I can do nothing about.

  • Copyrighted music at public events
  • Videos I make on purpose with copyrighted music

A copyright claim allows a collection agency — a third-party working on behalf of a copyright owner — to collect ad revenues from videos with copyrighted music.

A third type of video that sometimes get copyright claims are the videos that I make with Creative Commons music. I always appeal to release the copyright claim on these videos.

Creative Commons is an irrevocable license. If a musician signs a label deal, their new licensing doesn’t affect my usage of the music under the Creative Commons license.

The relevant part of the license is this: “The licensor cannot revoke these freedoms as long as you follow the license terms.”

When I cite that line in a appeal, the collection agency releases the copyright claim within hours or a few days.

A recent copyright claim on the behalf of Storyblocks took a bit more effort to resolve because they tried to assert their licensing over the Creative Commons licensing. That was unacceptable.

Read the rest of the essay on Medium. If you’re interested in supporting my writing on Medium, become a paid member and I’ll get a referral bonus.

A Pandemic of Nightly Fireworks

Photo by Nicolas Tissot on Unsplash

The battle for my Silicon Valley neighborhood began at 9:00 PM every night. A steady round of pop-pop-pop, several loud booms, and missiles exploding in brilliant displays of light. An occasional ka-BOOM rattled the windows, setting off car alarms and dogs in equal measure.

Was it the police firing rubber bullets and gas canisters at Black Lives Matter protesters hurling Molotov cocktails in the streets?

Oh, hell no.

The nightly fireworks show of firecrackers, cherry bombs, and bottle rockets started on Memorial Day and kept going until Fourth last year. Each show lasted 15 minutes in case someone did call the police and a patrol car showed up 20 minutes later. The shadowy people who lit the fireworks slipped back into the night. The pungent smoke in the air and the spent fireworks in the gutters were the only evidence that any illegal activity took place.

Not in my neighborhood, but in everyone’s neighborhood.

Scrolling through the #fireworks tweets on Twitter in the days leading up to July 4, 2020, nightly firework shows were a regular complaint for many neighborhoods throughout the United States. Three different groups may have been responsible for the pandemic of nightly fireworks.

Read the rest of the essay at Medium. If you’re interested in supporting my writing on Medium, become a paid member and I’ll get a referral bonus.