For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more markrages's commentsregister

Of course the comments section is going to be full of war stories about everyone's hardest bug.

This is how humans work, and this is why I am reading the comments.


Yes, of course, I greatly enjoy the stories and it’s why I opened this thread. But that’s not what my comment is about, I was specifically referencing the parts of the comments which dismiss the difficulty and length of time the author spent tracking down this particular bug. I found that funny and my comment was essentially one big joke.


shouldn't it be

var actualSize = 1 << Integer.highestOneBit(approxSize - 1);

?


Nope. I don’t know why the Java folks decided not to use the fairly standard verb “isolate” for this method, but that’s what it is[1]:

> public static int highestOneBit(int i)

> Returns an int value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specified int value. Returns zero if the specified value has no one-bits in its two's complement binary representation, that is, if it is equal to zero.

There isn’t a straight floor(log2(·)) as far as I can tell, only Integer.numberOfLeadingZeros, and turning the former into the latter is annoying enough[2] that I wouldn’t prefer it here.

[1] https://docs.oracle.com/javase/8/docs/api/java/lang/Integer....

[2] https://docs.oracle.com/javase/8/docs/api/java/lang/Integer....


Thanks. What a weird API.


> The statistical likelihood is that other civilisations will arise. There will one day be lemon-soaked paper napkins.

> ‘Till then, there will be a short delay. Please return to your seats.


> Is there any precedent to car carriers dedicated to one manufacturer?

General Motors helped design the Vert-A-Pac. https://chevyvega.fandom.com/wiki/Vert-A-Pac


Cool engineering, thank you.


> I am sure is not a fundamental but is the reality for the currently available chipsets.

It is pretty fundamental. Ant has an inverted master/slave (or whatever we're calling it nowdays) relationship. In Ant, the sensor determines the timing, and can broadcast to many receivers. In Bluetooth, the central device (phone) determines the timing, and each sensor connects to one central with a one-to-one connection.

There are ways around this limitation of BLE:

1. A few bytes of data can be stuffed in BLE advertising, so the sensor can communicate without a connection in the Ant style. To my knowledge, none of the Ant+-replacing profiles support this.

2. The sensor can basically run multiple instances of bluetooth stack at the same time to connect to multiple central devices. This basically doubles the resource usage, and good luck determining if your sensor supports this without trying it.

#2 appears to be the path forward. A few sensors support it already, and the next generation of radio SOCs will make the resource requirements less onerous.


Ant also broadcasts a unique(-ish) identifier. This was enough to end Nike+. https://en.wikipedia.org/wiki/Nike%2BiPod#Wireless_protocol_...


The Amazon preview included a page advocating for systems Hungarian in naming variables.

I am no longer interested in the book.


If we mix Polish and Hungarian notation we get Buda notation:

    flowingSequence :: (a -> [x]) -> ((a, x) -> y) -> (a -> a -> a) -> [a] -> [y]
    flowingSequence = lyla''aaa'ypax_lxa where
      lyla''aaa'ypax_lxa lxa ypax aaa la = map ypax $ concatMap (lpax_palx . palx_a) la2 
        where
          la2 = scanl1 aaa la
          palx_a a = (a, lxa a)
          lpax_palx (a, lx) = map pax_x lx
              where pax_x x = (a, x)
(The Treaty of Buda was a political maneuver that briefly created a united monarchy for Hungary and Poland in the 1300s.)


He was a Microsoft manager, so this insanity is expected.


Where is this? I don't see this advocation, and the code examples don't have it.


In the 90s I worked for a company in Kansas City designing pagers. We rented space underground for RF testing. There are no radio signals in the caves, at least back then. I'm sure that's different now, especially with manufacturing happening there. (Our cave was closer to downtown and was mostly used for warehousing.)


Are you saying there could be radio signals in caves these days?


I think they mean that there might be WiFi access points or cellular base stations now installed in some of these caves given the ways the spaces are used.


Yes! Code is for people to read, not computers. Beautiful code uses the full expressiveness that the language allows.


And people have, by definition, a much easier time reading code when it’s always consistent across codebases. Thanks for making the point.


For integer values, just subtracting bytes is enough to allow much better compression ratios. See the table at https://opensource.quarq.com/zfit/zfit.pdf


Very handy to do with 7-Zip: -mf=Delta:4 (or just f=Delta:4 in the GUI config window). This is for 4 byte little endian integers, which works pretty well with 16-bit stereo PCM even if there's some unwanted overflow between the channels, if you can't use flac in some context (raw data, etc).


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You