Posts

Switching The Nuphy Air Switches

Image
From Clicky To Quiet: Blue, Brown, Wisteria, Red My Nuphy Air75 mechanical keyboard seems to drop keys occasionally. I ordered it with blue switches, the clickiest available, and also the ones that require the most operating force. This could explain (some of) the dropped keys. Apple keyboards, with scissor switches, have short travel distances and don’t require much force. With muscle memory ingrained, my fingers just glide over the keys with speed and accuracy. But mechanical keyboards provide better, even addictive, tactile feedback. They also offer auditory feedback which, on a subconscious level, helps with focus. Operating forces from the   Nuphy website : Blue operating force: 65±15gf end force: 70±5gf Brown operating force: 55±15gf end force: 60±5gf Wisteria operating force: 55±15gf end force: 50±5gf Red operating force: 50±15gf end force: 60±5gf All switches have the same total travel distance of 3.2+0.2mm Wisteria sits alongside Brown, between Blue and Red. Wisteria’s end...

Prolog Is Past

Image
With apologies to Shakespeare, the correct quote is "What's past is prologue," which eloquently states that events and actions of today shape and foreshadow the world of tomorrow. Prolog is an AI language of the past, and I had a little fun with it in the 1980s. I have long forgotten the language syntax, but do remember the program I wrote to answer a juvenile question: "If God's power is infinite, can he create a boulder he cannot move?" On the screen appeared the answer I expected: "Undefined." I shrugged, and was just a little disappointed the computer didn't crash or blow up, not realizing then, that "undefined" was a very good, if not the best possible answer. Enter the prompt today in the Duck.ai / ChatGPT-4o, I was amused by its answer: A second attempt produced a few paragraphs describing the nature of omnipotence and the logical paradoxes it can bring. The essay could have been written by a high school senior. In contrast, th...

A Raspberry Pi and Logitech Jam

Image
My old Logitech K750 keyboard has been with me for more than 12 years and is poised for a second life with a Raspberry Pi. What powered the keyboard all this time were the solar panels above the row of function keys. The collected energy, whether from daylight or lamplight, was stored in a Maxell ML2023 rechargeable button battery seen below: ML2023 Rechargeable Battery So far, I’ve only had to replace the battery twice, but Logitech (intentionally) did not make it easy, as I needed a spudger tool to gently pry the battery tray open. Do not use the similarly sized CR2023 battery, as it is not rechargeable and would pose a fire hazard. Being solar powered, it follows that the keyboard would be wireless. Connection to a computer is over a 2.4GHz USB dongle, which Logitech calls a Unifying Receiver. Living up to the name, this receiver also let me connect an old Logitech M335 mouse. While there were many Logitech models listed in the Raspberry Pi’s keyboard settings, there wasn’t one fo...

A World Without "Technology"

Image
Back in 2005, I wrote " Yam Technology? ", a light hearted article pondering my company name.  Today, the "technology" part of the name has proliferated, and I am sometimes mistaken for someone or something else.

😦 The Real CrowdStrike Flaw Was In Deployment

By now, most of you are familiar with the story of CrowdStrike and the resulting worldwide outages. The initial, and angry, responses were along the lines of "Where are the devs? Where was QA?" As it turned out, the actual patch, or software code, was fine. The problem was in the config file  that governs the behavior of the patch.  Being flawed, it triggered the Microsoft Windows' blue screen of death. In a variation of "Who Watches The Watchers," the config file was indeed tested, but CrowdStrike's testing system was unknowingly broken.  The config file passed when it shouldn't have. Nothing is perfect all the time, but what would have mitigated the fallout would have been a gradual or staggered rollout of the config file instead of the apparent "big-bang" release to all machines at once. The staggered rollout is an old and reliable technique. I can think of 2 reasons why it might have been forgotten or abandoned: inexperience or over-confide...

Raspberry Pi Swap Space

Image
Who took my slice of pi ?   Sometimes I ask myself that while looking in the fridge. This time, I am looking at the  top  command and see nearly a quarter of the reserved swap space in use.  The question is purely academic, and spurred by curiosity, I wrote a bash script to learn the answer. The script, swapid,  searches through the process list, identifies the process name and amount of swap used, and then sorts the output by swap size.  With Linux, processes can be viewed and interrogated like a file system. Run $ ls /proc and you'll see it sprinkled with subdirectories named with numbers. These numbers correspond to process ids. Inside each of these subdirectories is a file named status , and running  $  cat status reveals a bunch of process information. At this point, it's simply a matter of using  awk and   grep   to pick out the attributes of interest; in this case, "Name" and "VmSwap." Output is written to the /tmp di...

Raspberry Pi 5 Resource Limits

Image
I was fortunate enough to get a Raspberry Pi 5. I had no particular purpose for it other than to explore it and have fun. On UNIX and Linux based systems, part of that exploration involves checking the default resource limits . The screen shot above is a vimdiff of the rlimits for the Raspberry Pi 400 (left) and the Raspberry Pi 5 (right). Both are running their respective 64-bit versions of Raspberry Pi OS. Four of the 15 resources turned up with diffs, and it's no surprise that the pi5 would have the higher limits. These include the number of processes , the locked-in-memory address space , the number of pending signals , and the realtime priority .  They all serve the common purpose of improving realtime performance.  The last item, realtime priority , is the most telling.  On the pi400, the current and max values are 0.  On the pi5, they are 2.  These settings most likely support hardware destined for the Pi5's new PCIe connector. For a detailed review o...

MR2 Check Engine

Image
Shown here is the 1991 Toyota MR2. Thanks to the mechanical skills of a family enthusiast, it purrs, growls, and turbo whistles like a dream.   My hardware ability doesn't go much further than oil changes. Rather, my expertise is in software, and I wrote an app for Android and iOS to diagnose the flashes of the check engine light. This second generation MR2 predates the OBD2 connector, a standard used to diagnose engine, transmission, and emissions problems quickly and easily. Instead, we have a flashing check engine light which needs some deciphering, followed by a lookup in the service manual. Basically, you count flashes to arrive at fault code number. A short pause (~1.5 seconds) indicates the start of the next digit. A medium pause (~2.5 seconds) indicates start of the next fault code. And a long pause (~4.5 seconds) means the sequence has ended and will repeat. The video below corresponds to the codes 41 and 51. Using the the MR2 Check app and selecting the 3S-GTE engine...

Rust's Other Super Power

Image
If you can't prototype, you can't release prematurely. Memory safety. That's the super power that launched Rust into the minds of modern developers.  Wired describes the popularity of Rust as a "viral secure language," lauding its resistance to buggy memory conditions known as "out-of-bounds access," and "reuse of memory after free."  And yet... I find myself lukewarm to the language. While memory insecurity is a problem, it is not an existential one. Indeed, the problem has largely been addressed in C++ with Resource Acquisition Is Initialization ( RAII ) which uses the symmetry of constructors and destructors for resource allocation and de-allocation.  As for accidentally reusing freed pointers, setting them to NULL after a free neutralizes any downstream threats, but this defensive practice has been largely ignored or forgotten.  The real quandry is finding developers with the interest, patience, and care to actively manage memory, and Rus...

The Collatz Conjecture Python Plot

Image
  No, it is not an evil plot. This chart is just another example of how easy it is to do fun things in the Python language. Revisiting the  Collatz Conjecture , I've updated the python code to plot a chart of the hailstones.  If you haven't already done so, you will need to install the Matplotlib in your python environment.  First install pip, then install matplotlib.  The -U option means upgrade dependent packages to the latest version: python -m pip install -U pip python -m pip install -U matplotlib For more information, go to the  matplotlib website . Below is the updated code: #!/usr/bin/python3 from  matplotlib  import  pyplot  as  plt def   even (n):      return  n/ 2 def   odd (n):      return   3 *n+ 1 n =  int ( input ( "Enter a number: " )) peak = n count =  0 hailstones = [] hailstones.append(n) while  n >  1 :     count +=  1   ...

My Retina Display Is Ghosting Me

Image
  We've been together since 2014. A few of years ago, my 27-inch retina display began ghosting me.  Open applications, desktop icons, and the dock left a residual image, and while the screen saver eventually cleared them, the ghostings happen much more quickly now.  Is it time to end the relationship and upgrade to the new  Apple Studio display ? Fortunately for my wallet, not yet.  I was able to fix this in the display settings. First, I recalibrated the display to avoid the native white point, setting the color temperature to a cool blue -- anywhere from 7000K to 9500K.  Second, not wanting to see Smurf all day, I went to the Night Shift settings and filtered out the excess blue by adjusting the slider to a warmer temperature... that is, until the colors looked natural again.  Last, I created a custom Night Shift schedule to have it on 24 hours a day.  Evidently, being at, or near, the native white point leads to "burn-in." This solution could l...

A Market Guardrail named Limit Up Limit Down

Image
  Stocks trade faster and more frequently than ever before, and make volatile price action inevitable.  There are, however, guardrails in place to protect the trader, and one of them is known as Limit Up Limit Down, or LULD. Back in 2012, the SEC approved a National Market System (NMS) plan to limit price variability to a specific range. The range, or price band, is governed by statistical measures, a stock's tier and reference price, and the time of the trade; prices are markedly volatile near market open and market close. To see the specific rules, visit the Limit Up Limit Down website . While at the NYSE, I had the privilege of working on this project. It wasn't easy. The scope spread across multiple systems and multiple teams. The specifications -- like all projects -- were ambiguous at first, and needed several iterations.  Questions arose, such as what happens to the reference price if a trade was cancelled, corrected, or flagged as an error?  We were careful d...

The Nuphy Air75: It Clicks

Image
  Mechanical keyboards offer aural and tactile feedback that, for some, make them a joy to use.  For others, they are just another choice in the world of scissor switches and membranes. I fall into the former category, having pretty much grown up with the well regarded IBM PC Mechanical Keyboard .  I ordered my Nuphy Air75 with clicky blue switches which are the loudest and most mechanical in sound and feel. Avoid, if you have a roommate or an officemate. Get, if you miss the IBM PC keyboard. For the uninitiated, switches on mechanical keyboards typically come in three varieties: red, brown, and blue. Red switches feel the most linear and are the quietest. Brown switches sit between red and blue, and are described as tactile, with an engagement point that needs just a tiny bit more force to overcome.  Blue switches were the easy choice for me, but ideally, it would be best if you could test these switches in person. The Nuphy Air  comes in three sizes: 96, 75, 6...

Not A Martian, Elon Is All Too Earthling

Image
A fun narrative has Elon Musk really being from Mars and badly wants to go home. In my imagination, I add that Elon, having watched the movie E.T. , realizes that if he directly sought the help of space capable governments, he would likely be captured, imprisoned, and eventually dissected. Clever Martian that he might be, Elon would parallel the real life story of One Red Paperclip , where one man started with a single red paperclip and through 14 trades, ended up with a two story farmhouse. And so goes Elon, first with Paypal and selling it to eBay for more than a hundred million dollars, then using that fortune to start SpaceX (2002) and Tesla (2003), and later Starlink (2015), all in the hopes of amassing enough money and technology to get him home. Also in my fevered imagination, Elon is BFF with Bernie Sanders and AOC, because addressing the looming menace that is climate change is really that important. That they approach the climate threat from opposite ends -- private business ...

Sometimes The Math Doesn’t Add Up. And Sometimes, It Does

Image
It just don't add up! Cartoon math isn't meant to add up. Here we see a dog number crunching, trying to determine why a cat is running away from two mice, and running towards him, a dog, to be "massacred."  Furthermore, the mice are disgusted by cheese, and run toward the cat to be eaten by him. The dog, reading the results on his Acme adding machine, exclaims "It just don't add up!" and then runs toward a dog catcher, hoping to be caught.  In contrast, real world math is meant to add up, but doesn't always, and when it does, it's kinda', sorta', maybe. Federal Reserve Chair Jerome Powell said as much  (see time index 46:45) while at the Cato Institute to discuss inflation and monetary policy:  " Economics is not physics. There isn’t any specific temperature in which the economy boils over... and when that happens it takes many years of analysis, discussion, and debate to reach general agreement on why that's happened. " B...

Python Newbies Reject A Good Idea

Image
The YouTube Short at the bottom of this post illustrates a table-driven alternative to if-else statements in Python. I liked this tip because it was reminiscent of pointers to functions in C, which I wrote about  here . The technique allowed me to isolate code to format output to screen, printer, file, or a network socket.  Back then, it took a bit of work to convince my colleagues the value of this approach, so I was not surprised to see this Python tip dismissed in the comments section: Please don't do this in production. It's much less clear than an if/else. clarity > conciseness. Great advice, make it as hard as possible so when your company kicks you [sic] they will have no clue what this does. Different language, different time, same misunderstanding. The video described the tip in general terms, so I reimplemented it to solve a specific, more relatable, problem: #!/bin/python3 SCREEN = 1 PRINTER = 2 DISK = 3 def to_screen ():     print ( "format for scre...