Easy fix for most mouse-button problems

A new computer mouse will usually function just fine, but over time, it will usually start having some problems with the buttons. One common problem is for it to keep releasing prematurely as if you let go of the button even though you didn’t, you may have simply decreased the pressure on it. Another problem is for clicks to not register at all. Assuming there is no physical damage (e.g., dropping the mouse on a hard surface), both of these problems are usually caused by the same thing, a layer of patina growing on the metal contacts inside the switch under the button. This is normal; oxides regularly accumulate on metals which make them less conductive. This is usually fixed by simply cleaning the metal. Unfortunately, the micro-switches used in computer-mice are too small and to inaccessible to open and clean. Fortunately there’s a pretty easy solution with just a bit of vinegar:

  1. Disconnected the mouse and/or remove the batteries
  2. Open the mouse (there are typically only a couple of screws)
  3. Locate the micro-switches; they’ll usually look like the Omron switches below
  4. Dip a cotton-swab (Q-tip) into white-vinegar
  5. Dab the switch several times to wet it
  6. Press the switch a bunch of times to allow the vinegar to soak in and coat the metal
  7. (You can leave a blob of vinegar on the switch for a couple of minutes)
  8. Use a paper towel to soak up excess vinegar and dry button
  9. Repeat with some water (distilled if possible) to remove the vinegar
  10. You can dry it more thoroughly by blowing hard on it to eject any remaining liquid
  11. Close it

The patina should be removed and the metal contacts should be properly conductive and last a few more years before giving problems again.

Important: Make sure to not leave the vinegar or water on for too long. Otherwise, they will corrode the metal and make the copper grow a green patina which, while pretty, makes things worse, requiring you to open the switch and try to clean it directly which has a good chance of totally ruining the switch and requiring you to completely replace the whole switch (which depending on the mouse—like some very expensive gaming mice—might be worth the effort of putting in a fresh new switch).

Omron micro-switch
Typical mouse-button Omron micro-switch

Fix Linux MotD Weather

This past summer, I updated the MotD of my Orange Pi to include the current weather whenever I log in. It worked great… until recently. For the past week or so, I noticed it wasn’t showing the weather when I logged in.

It turned out to be a simple error and easy fix. The command works by downloading the current weather from the Internet, then using SED to scrape the current temperature and status from the resulting page using a regex.

The problem is that it does not account for negative temperatures, which is what the temperatures are now in the winter (at least in Celsius), so when the temperature is below zero, it does not find the information because the pattern does not match. The fix is simply adding an optional negative sign (-\?) to the regex (optional in the regex sense; it’s required to make this work correctly):

root:/> more /etc/update-motd.d/32-weather
#!/bin/bash
curl -s "http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=NAM|CA|ON|LONDON|" |\
sed -n '/Currently:/ s/.*: \(.*\): \(-\?[0-9]*\)\([CF]\).*/\2°\3, \1/p'

“The Navigator” in The White Chamber

The game The White Chamber is pretty amusing, but the anime style doesn’t really mesh with its horror-survival theme. That said, it’s still a pretty solid (and free) game with a decent story. It’s not too long and you can play through it to get the eight different endings in just an hour or two. One thing to look out for is the alphanumeric codes. Half of the endings display a three-letter code at the top of the screen which when taken together spell out a message, which oddly enough, there do not seem to be any references of on the Internet; apparently nobody has noticed it. 😕

EndingCode
Space
Electrocution
Venemous [sic]
Decaying
RedemptionROT
DamnedAGI
TormentedVAN
ComedyEHT

If you read the codes from right to left, it reads “THE NAVIGATOR”. Ostensibly, this refers to the protagonist Sarah (or maybe the Artefact 🤔).

Wolf4knowledge has a video with all of the endings:


ROT AGI VAN EHT
“THE NAVIGATOR”

Wasting Tax-Dollars on Intersection Buttons

At most intersections, you can usually find a pair of buttons for pedestrians to push to tell the traffic-control system that they are there and want to cross. There are usually separate buttons for each direction (one for crossing north-south and another for crossing east-west). This results in up to eight buttons at each intersection. However, this is wasteful over-engineering. In fact, with proper software design, only a single button is ever necessary at each corner of a standard 4-way intersection. Can you figure out the logic to prove this?

Show solution… ▼

Intersection button design options
Intersections can have either one or two crossing buttons at each corner

The return trip feels shorter because of freedom, not familiarity


That explanation that psychologists came up with back in the 1950’s is incredibly specious because it’s not the same on the return trip because everything is backwards. The roads are different (and might require a different route due to one-way streets), and all of the sights are different because you are seeing everything from the other side. It is a completely different experience. Also, unless this is the first time you’ve been to that location, then the novel-there-familiar-back explanation makes no sense.

A better explanation is that the trip there is likely under a deadline while the return trip is more free. The pressure of trying to stick to a schedule puts added stress on the brain and makes time feel lengthened like most stressful or unpleasant situations have a tendency to do. The freedom of making it back at your own pace (melting ice-cream notwithstanding), relieves you of that burden and so the trip feels shorter.

Cool, and easy runnings

When I was in 5th or 6th grade, I learned how to correctly run. We were in gym class and had to do laps around the entire playground, and I noticed that we were all being easily lapped by Ninar Kabuti (Neenar Kabutee?). It may be a cliché, but it should probably not come as a surprise that an African kid (he was quite stereotypical; dark-skinned, tall, skinny, etc.) would be more athletic than the rest of us. I watched him running from the other side of the playground (before he made it around and lapped us again), and noticed that he ran differently from the rest of us. Instead of rapidly pounding the ground with his feet like were were, he was practically bouncing like on springs. He was bounding across the playground like a gazelle with long strides. Ever since then, whenever I have to run, I take long, bouncing strides because it covers a longer distance with less energy, and it works for long-distance running, but also helps with short sprints.

Goo Gone Secret Recipe Fail

Years ago, my mother bought a baking sheet that was “non-stick”, except that the label on it stuck all too well to it. She peeled the sticker off, but it left behind a bunch of adhesive which couldn’t scrape it off since that would have ruined the non-stick coating. She asked someone at Home Depot for advice and they sold her a bottle of Goo Gone. She brought it home and told me to read the instructions and use it to get the adhesive off of the baking sheet.

I looked at the bottle and noted that the label boasted its “Citrus Power”. I also noted that the liquid in it was orange. I put the bottle down and opened the fridge. I pulled out an orange and peeled it. I squeezed the rind a little to make it exude a little orange-oil and rubbed it on the baking sheet and the adhesive came right off.

My mother laughed heartily. Then she returned the Goo Gone.

Thank you Goo Gone for letting us know that we don’t need your product.

Goo Gone bottle with "citrus power" logo on label
Goo Gone gave away its secret right on the label

More Rubik’s cube challenges

If you have already learned how to solve a Rubik’s cube, then you may start getting bored with it. That’s when you can start coming up with new ways to make it a challenge. Here are a few suggestions:

  • Solve it with only your dominant hand
  • Solve it with only your non-dominant hand
  • Solve it blind-folded
  • Solve it from a different face than you are used to (e.g., instead of starting with white, start with a different color)
  • Solve it to a different state (e.g., solve it to the checkerboard pattern)
  • Try to fully scramble the cube (i.e., such that no face has two adjacent squares with the same color)

Fully scrambling a cube is surprisingly difficult. I managed to do it after a minute or two when I first thought of it, but then doing it again took a long time. It is however possible and I’ve recorded my last three scrambles (I didn’t note down the first one). It is possible with a 2x2x2 as well as a 3x3x3. I don’t know if it possible with higher-order cubes. As a tangentially-related challenge, see if you can mathematically prove or disprove the possibility of fully-scrambling higher-order cubes.

Geometric net of a fully-scrambled Rubik’s cube

Geometric net of a fully-scrambled Rubik’s cube

Geometric net of a fully-scrambled Rubik’s cube

Geometric net of a fully-scrambled Rubik’s cube

Bad password-masking (in movies)

For some reason, movies have a tendency to show password that someone types into a computer in such a way that each character is shown briefly before being replaced by a circle, ×, or asterisk. This is terrible from a security standpoint as can be seen in the movie Iron Man 3 since you can probably see what the password is. I can’t fathom what reason they could have for doing this other than as an easter-egg for viewers. Hopefully real developers never do this; if you are ever in a position to create an interface that involves entering sensitive information which needs to be masked, don’t show what was entered at all.

Scene from “Iron Man 3” with terrible password-masking
This is not secure (view full-size for animation)