WTF Bites
-
@PleegWat least common PINs according to the chart legend.
I just found that on FB but it seems plausible.
-
@boomzilla What's with the black dots
I wonder as well. To me, that's almost more interesting than the hot spots.
-
@Zerosquare said in WTF Bites:
@boomzilla What's with the black dots
I wonder as well. To me, that's almost more interesting than the hot spots.
5 dollars on they’re a bug in the data analysis script.
-
@Zerosquare said in WTF Bites:
@boomzilla What's with the black dots
I wonder as well. To me, that's almost more interesting than the hot spots.
5 dollars on they’re a bug in the data analysis script.
I'll take $5 on "the scale is so compressed that there's only a few hundred uses difference between black and yellow"
-
@boomzilla said in WTF Bites:
I just found that on FB but it seems plausible.
Longer writeup by the original author
I was hoping for a link to the raw dataset...
-
-
@topspin mused in the Lounge:
I would prefer to never upgrade anything
Oh my gawd, what the fuck happened here?!
(Seems like clangd somehow used all the rulesets , even the most retarded ones, and I've explicitly configured it to use only a certain set.)
-
@topspin All the warnings regarding
__llvm_libc
namespace are particularly stupid, because—unless you are actually editing libc code, which it does not look like—that definitely shouldn't be touched here.
-
@Bulb yes, it's definitely encouraging me to do things very wrong here. That namespace doesn't even exist and of course putting stuff there instead would break everything.
This particular ruleset probably shouldn't even be shipped to the general public outside of libc. (And all google/chrome/fuchsia/... rulesets should probably be nuked from orbit.)
-
And all google/chrome/fuchsia/... rulesets should probably be nuked from orbit.
Yeah, Google is well known for their C++ coding guidelines being either ass-backwards or back-asswards.
-
E_RESOLVED: All angular quantities are now referred to radians.
Isn’t π a magic number too?
-
@kazitor No, it's a named constant.
-
@kazitor No, it's a named constant.
double degToRad(double v) { return v * M_PI / M_ONE_HUNDRED_AND_EIGHTY; }
-
@topspin Yes, that's the kind of retardry those rules generate. Along with M_SECONDS_PER_MINUTE, M_HOURS_PER_DAY, and M_SECONDS_PER_DAY.
-
@kazitor No, it's a named constant.
double degToRad(double v) { return v * M_PI / M_ONE_HUNDRED_AND_EIGHTY; }
The real question, can you declare a constant such that its value is M_PI / M_ONE_HUNDRED_AND_EIGHTY meaning that you simply end up with:
double degToRad(double v) { return v * M_DEGREES_PER_RADIAN; }
-
@boomzilla What's with the black dots
I figure it's the least commonly used PINs. Which is why I changed my PIN to 0575. Now I should be safer.
-
@Arantor At which point, why have a function at all?
-
@Arantor I can, but why would I? The "you should name this magic number" complaint is bullshit, because it already has a name: the function name itself. And I prefer user code to call
degToRad(value)
instead ofvalue * M_DEGREES_PER_RADIAN
, orradToDeg(value)
instead ofvalue / M_DEGREES_PER_RADIAN
(note the/
).
-
@topspin I wasn’t sure if I should use or at that point…
Having a nice function for clarity is good. Having bullshit lint rules isn’t.
-
@topspin I wasn’t sure if I should use or at that point…
Oh, I didn't misunderstand you, don't worry. Just voicing my frustration.
-
@topspin just use PHP and you won’t have this drama.
-
@topspin
auto angle = 180.0_degf
.
-
@cvi I'm sure that works wonderfully on user input.
-
@topspin give them a drop-down with all the values precomputed. Done.
-
@topspin Users are somebody else's problem. Everything works much better without them.
-
@Arantor I can, but why would I? The "you should name this magic number" complaint is bullshit, because it already has a name: the function name itself. And I prefer user code to call
degToRad(value)
instead ofvalue * M_DEGREES_PER_RADIAN
, orradToDeg(value)
instead ofvalue / M_DEGREES_PER_RADIAN
(note the/
).Filed under: 1440 and 86400 are not magic numbers.
-
@PleegWat funny enough, I recognized the latter immediately and the former only by context.
-
@topspin We've used 288 too. And we didn't take too much effort to put clear context on them, but they were used in specific locations and you pretty quickly learned what those two (and 288, which we also used) mean. From that domain, I think only 24 and 60 don't need context to not be magic.
Some more examples of oddly specific numbers: 256 and 65536. Which should generally be written as
(1 << n)
or in hex in source code.
-
I think only 24 and 60 don't need context to not be magic.
Yeah, but the context was right there. The linter was just to blind to see.
Some more examples of oddly specific numbers: 256 and 65536. Which should generally be written as
(1 << n)
or in hex in source code.Hex might be more appropriate, sure, but if you don't know what these numbers are you should get another job.
-
But even then are they not implicitly magic numbers?
-
@topspin Those two, yes. 16777216 or 4294967296, I might think "It's probably that" but will take me quite some time to ensure it's not intentionally one or two off.
Also, I'm going back on the hex comment.
0x100000000
is too many zeroes to count for my taste.
-
if you don't know what these numbers are you should get another job.
Yeah, but you should get another job, anyway. You read TDWTF, so you know why.
-
Also, I'm going back on the hex comment.
0x100000000
is too many zeroes to count for my taste.There are some languages that allow you to write that as
0x1_0000_0000
for clarity.
-
@HardwareGeek said in WTF Bites:
Also, I'm going back on the hex comment.
0x100000000
is too many zeroes to count for my taste.There are some languages that allow you to write that as
0x1_0000_0000
for clarity.Including PHP.
-
@Arantor I can, but why would I? The "you should name this magic number" complaint is bullshit, because it already has a name: the function name itself. And I prefer user code to call
degToRad(value)
instead ofvalue * M_DEGREES_PER_RADIAN
, orradToDeg(value)
instead ofvalue / M_DEGREES_PER_RADIAN
(note the/
).Filed under: 1440 and 86400 are not magic numbers.
Neither is 2.
int middle = width() / k_half;
-
@dcon
(left() + right()) / num_sides()
-
@HardwareGeek said in WTF Bites:
Also, I'm going back on the hex comment.
0x100000000
is too many zeroes to count for my taste.There are some languages that allow you to write that as
0x1_0000_0000
for clarity.Including PHP.
I did not know that. I shall now endeavor to, as quickly as possible, forget that I ever learned this (or anything else) about PHP.
-
@HardwareGeek it's becoming a less shit language each year.
-
@Arantor If the old product hadn't gone into maintenance mode, we'd be desupporting RHEL6 and the PHP 5.x it ships some time next year.
-
@HardwareGeek it's becoming a less shit language each year.
(Begin snark) At this rate, it might even become usable this millennium! (End snark)
But really, yeah. I'd rather write modern PHP than straight JavaScript.
In other news, another developer and I spent 30 minutes trying to figure out why checking if a C with classes pointer was null was throwing SIGSEV errors. Turns out we both missed that the monkeys who wrote the code initially didn't use braces for one line blocks, so adding logging to try to diagnose a different null pointer bug caused this one to both crash and not print the logs.
-
status: installed Ubuntu 22.04. Did the updates on all the packages. Set up the proxy.
Firefox doesn't start.
Something with the display context?
It's so bad it doesn't even trigger the "oops" reporter thing.
Great jorb.
-
@Tsaukpaetra said in WTF Bites:
status: installed Ubuntu 22.04. Did the updates on all the packages. Set up the proxy.
Firefox doesn't start.
Something with the display context?
It's so bad it doesn't even trigger the "oops" reporter thing.
Great jorb.
https://packages.ubuntu.com/search?keywords=firefox said:
jammy (22.04LTS) (web): Transitional package - firefox -> firefox snap
1:1snap1-0ubuntu2: amd64 arm64 armhfwhich is the same shit they did to Chromium a release earlier
And … well, back when I installed snap, I had two problems with it:
- the package did not correctly add its special
/snap/bin
path to PATH correctly, and - snaps installed as root, rather than via sudo from the normal user's X session, didn't get properly plugged to the desktop sockets.
I hope they fixed it since, but it's quite possible that you have some such problem.
After fixing up snap, I started using it for Firefox (intentionally; I am on Debian testing here and Debian still does have normal firefox and chromium packages) and it works fine since, but initial install might be still going bad.
Update: I realized Ubuntu is normally configured from an X session (unlike Debian where I do all the initial configuration from console), you must at least log out and log in again after installing
snapd
, because it relies on environment.
- the package did not correctly add its special
-
@Bulb Desktop Linux is going great
About the only thing those clowns should do is to be slightly better than M$$$, which is a bar that is currently digging into ground and expected to reach China by 2030, but for some strange reason they can't - inescapably can't - stop tripping over their own gargantuan braindicks.
-
@Applied-Mediocrity Canonical attempts at innovation have a curious property of actually driving Linux innovation, but shooting Canonical in the foot in the process, because the final solution usually ends up being different from what Canonical started with.
- Working with sysv-init was painful, and everybody knew, so Canonical started writing upstart, only for the rest of the Linux world to settle on systemd.
- X11 is hard to make efficient in the face of direct rendering, so Canonical started writing mir only for the rest of the Linux world to settle on wayland.
- The Unity shell they made for Gnome, I think nobody else showed any interest. I don't understand the love of Gnome anyway, KDE and even XFCE or LXDE work better in my experience.
and regarding snap, that one actually somewhat caught on, and even makes sense, but they made a couple of odd choices, leaving some rough edges:
- The use of weird layout, with a special- directory
/snap
, but also more stuff in/var/lib/snapd
, makes it … unnecessarily hard to integrate in the system, especially since they still didn't add the directories, even empty, in the base files. - Quite a while ago, they added a feature that stops the automatic upgrade from happening when the program is running, which is doubly weird, because updating packages of running programs normally works even for traditional packages and this is well isolated containers. Instead it pops up a notification that you should upgrade the app, but then there is nothing to notice you closed it, so you can't just restart Chromium or Firefox when the thing pops up, you have to trigger the update yourself or wait an hour or something for the periodic check to do it. Who the hell ever closes their browser these days‽ And browsers are the primary use-case for snap, and the point was keeping them up-to-date!
I would note that snap also has a competition, flatpak, but while that is more featureful and I'd say a bit better technically, it is unfortunately much worse in regards to usability.
-
On another note, did I already mention the absosmurfly retarded ways that pulumi defines backend (where it keeps the state, it's notes about the environment)? They have their own backend service and there you only provide credentials, but if you want to use your own storage, the ‘url’ for e.g. Azure storage looks like
azblob://
<container-path>?storage_account=
<account_name>… instead of, you know, the normal URL (
azblob+
)https://
<account_name>.blob.core.windows.net/
<container-path>, or at least giving the arguments in the logical order likeazblob://*<account_name>*
/`<container-path>. If you don't provide the query parameter, it is taken from an environment variable, but that combination basically never makes sense at all.I suppose it comes from the fact that S3 buckets are global identifiers, so ‘url’ in the form
s3://
<bucket-name> is suffici… no, it actually ain't, because you need to do something likes3://
<bucket-name>?region=
<region>&awssdk=v2&profile=
<profile-name>, because if you don't provide the correct region, the bucket will be accessed via circuitous route throughus-east-1
, costing extra money. But in that case the brain-damage comes from AWS itself. It is whoever didn't realize the structure of the other backends is different and applying the AWS logic to it dumb.
-
@HardwareGeek it's becoming a less shit language each year.
Theseus called. Something about a ship.
-
@HardwareGeek it's becoming a less shit language each year.
Theseus called. Something about a ship.
And yet code I write years ago works perfectly fine on it because I’m not a raging eejit about following sanity.
-
-
@HardwareGeek it’s definitely underused.
-
@Bulb Oh really? Wow. How interesting! It seems your carefully considered explanation how a bunch of bubblewrap chomping goblin beardnecks couldn't decide which equally defective approach is preferable, so they went with all of them, now that I'm informed of all the autistic reasoning that went into it, will solve the problem. It's probably just one more arcane command somewhere and it'll be all right fucking dandy. Fuck!