Posts

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 of the pi5, see J

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 Android App (iOS version is in progress) 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 3

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      if  n %  2  ==  0 :         n = even(n)         hailstones.append(n)      else :         n = odd(n)         hailstones.appen

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 limit the color gamut, and

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 during rollo

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, 60.  The numbers correspo