News for hackers. Stuff that matters.

codebrrr

Re:The Surprising Genius of Sewing Machines [video] on Friday December 29, 2023 @12:22PM (#38807552)
The computerized flat knitting machines are even more genius.

I like to call them clothes printers.

Re:In 2024, please switch to Firefox on Friday December 29, 2023 @12:19PM (#38807517)
On Windows the Twitter, Instagram, TikTok apps are PWAs. I like to use them because I can pin them to the start menu, have them start on a separate window by default and remember the window position.
Re:"I'm a world champion pea thrower" on Friday December 29, 2023 @12:05PM (#38807312)
Let's invent a new one: throw a CPU towards a motherboard. It must land in the socket in the proper orientation. Furthest distance wins.
I'm pretty sure the following optimization is invalid, since a is not a bool array, but one of positive/negative numbers (see top of article):

> You can use arithmetics to go branchless.

    if (a[i] > 0) {
       cnt++;
    }
> Rewriting using arithmetic takes advantage of the fact that the expression a[i] > 0 has an arithmetic value 1 if true and 0 if false. So the whole expression can be rewritten as:

    cnt += a[i]