
Ask HN: What is the most amusing bug you've encountered? - Wowfunhappy
A recent HN thread about Hackintosh gave me the opportunity to recount a favorite anecdote: Many years ago, I was browsing a Hackintosh forum, and I came across a thread titled something like:<p>&gt; Help! Audio only works while I&#x27;m moving my mouse!<p>This is my all-time favorite technology problem. What&#x27;s yours?
======
otras
I was working on a frontend issue related to CSS and shadows. There was a card
element with a photograph on the left and a white container on the right with
some information, and it looked like the shadow below the card was a different
color below the photograph than below the rest of the card.

    
    
         __________
        |photo|info|
        |_____|____|
        [  shadow  ]
    

After debugging the CSS and inspecting every element, I couldn't figure it
out. I ended up taking a screenshot, zooming in to the pixels in GIMP, and
using the color picker to see just how different they were, but it turned out
the shadow was the same color! It was the same principle behind the checker
shadow optical illusion
([https://en.wikipedia.org/wiki/Optical_illusion#/media/File:C...](https://en.wikipedia.org/wiki/Optical_illusion#/media/File:Checker_shadow_illusion.svg)),
where the darker side (the photograph) made the shadow look lighter than the
shadow below the lighter side.

Definitely made for an interesting writeup as I closed the issue.

------
Jugurtha
I wrote an algebraic equation systems solver to compute KPIs from user text
equations.

The user would upload a spreadsheet file that contains hundreds of equations
for different "KPIs", and the solver would go through them, look for the
variables in database tables and columns, and then solve the system.

Example:

    
    
      kpi1 = sales.clients + marketing.last_year_accounts – kpi2*legal.billable_hours
    

sales, marketing, legal being database tables, and clients,
last_year_accounts, billable_hours being column names. kpi2 is another KPI
defined somewhere solved iteratively.

I squinted my eyes hard looking at one equation that used to be solved that
raised an exception. As a matter of fact, I don't know if you have spotted it
in the equation above.

The problem is the dash[0] instead of the - (minus). It would be "minus", then
somehow Excel would transform it to an _en dash_ if I recall correctly. Since
I used abstract syntax trees and parsed the equations, it threw the solver
off.

I remember at some point, I just noticed a difference in length compared to
the - sign.

[0]: [https://en.wikipedia.org/wiki/Dash](https://en.wikipedia.org/wiki/Dash)

------
kleer001
Universally I'm a huge fan of the off-by-one errors. Because the index started
at 0 instead of 1, or 1 instead of 0, or the range ends one before the given
number, or the difference between subtracting two numbers and then using that
as a range. Or when you're using < or > when you should be using <= or >=
Whoo, there's so many ways to be off by one. Good times.

~~~
sloaken
I believe the 'off by one' are called fence post errors. Building a fence, 50
feet, put a post every 10. How many fence posts do you need? Well 50 / 10 = 5
obviously :-)

~~~
sloaken
Turns out good old wiki has an article on it:
[https://en.wikipedia.org/wiki/Off-by-
one_error](https://en.wikipedia.org/wiki/Off-by-one_error)

