• 0 Posts
  • 160 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle
  • This whole debacle is a festival of stupidity:

    • It’s a personal project that taxes the sole maintainer disproportionately.
    • Millions of idiots use it blindly and end up building elaborate software on it. https://xkcd.com/2347/
    • I’ll bet you 99.99% of those idiots use it only for ip.isPrivate(), which you can write yourself in 5 minutes.
    • The CVE is a non-issue (who the fuck would call a function that takes string notation with hex numbers?)
    • Appealing and reverting or downgrading CVEs is super complicated.

    At this point the maintainer is fucked no matter what they do, so archiving the project and telling everybody to fuck off right back was really the only sane thing to do.





  • If you were 100% specific you would be effectively writing the code yourself. But you don’t want that, so you’re not 100% specific, so it makes up the difference. The result will include an unspecified percentage of code that does not fit what you wanted.

    It’s like code Yahtzee, you keep re-rolling this dice and that dice but never quite manage to get the exact combination you need.

    There’s an old saying about computers, they don’t do what you want them to do, they do what you tell them to do. They can’t do what you don’t tell them to do.






  • 60M total but divided among 40 counties makes 1.5M variations per county and the capital city (which is its own county, like Berlin) went over that.

    I looked it up and Bucharest actually has only a 1.7M population so… I think it’s understandable that nobody expected an almost 1:1 person-to-car ratio. Exactly why and how they reached that crazy ratio I have no idea. 😆

    Told you it’s a crazy rabbit hole.




  • Speaking of car plates, the Wikipedia pages for “Vehicle license plates of [insert country here]” are a rabbit hole.

    I was just reading the page for Romania the other day, speaking of uniqueness, and they had this issue apparently where the combinations overall were enough for the whole country but not enough for their capital city, so they had to hack an extra digit into the plates for the capital.


  • These days I follow a hard heuristic: Always use synthetic keys for database tables.

    And the way to follow this rule is fairly simple, but it has a few twists.

    For internal use, the best and most common key (in a relational database) is an auto-generated incremental sequence. But it it ok to use it externally? – across databases, across types of data storage, across APIs / services etc.

    It’s tempting to refer to the sequence number in API calls, after all they are going to that particular database and are only going to be used with it, right? Well not necessarily; the database and the code powering the API are different systems, who says there won’t be other apps accessing the database for example.

    The current OpSec school of thought is that sequence keys are an internal database mechanism and sequence numbers should only be used for internal consistency, never used as external references (even for the “local” API).

    Sequence keys also don’t offer any way to deal with creating duplicate data entries. If you’ve been around for a while you’ve seen this, the client sends the same “create” request twice for whatever reason (UI lets user multiple-click a button, client assumes timeout when in fact it had gone through etc.) Some programmers attempt to run heuristics on the data and ignore successive create attempts that look “too similar” but it can backfire in many ways.

    An UUID is pretty much universally supported nowadays, its designed to be unique across a vast amount of systems, doesn’t give anything away about your internal mechanisms, and if you ask the client to generate the UUID for create requests you can neatly solve the duplicate issue.

    Do keep in mind that this doesn’t solve the problem of bijection across many years and many systems and many databases. An entity may still acquire multiple UUID’s, even if they’re each individually perfectly fine.

    There can also be circumstances where you have to offer people a natural-looking key for general consumption. You can’t put UUID’s on car plates for example.


  • lemmyvore@feddit.nltoProgrammer Humor@programming.devWhat a time to be alive
    link
    fedilink
    English
    arrow-up
    37
    arrow-down
    1
    ·
    26 days ago

    That was a solved problem 20 years ago lol. We made working systems for this in our lab at Uni, it was one of our course group projects. It used combinations of sensors and microcontrollers.

    It’s not really the kind of problem that requires AI. You can do it with AI and image recognition or live traffic data but that’s more fitting for complex tasks like adjusting the entire grid live based on traffic conditions. It’s massively overkill for dead time switches.

    Even for grid optimization you shouldn’t jump into AI head first. It’s much better long term to analyze the underlying causes of grid congestion and come up with holistic solutions that address those problems, which often translate into low-tech or zero-tech solutions. I’ve seen intersections massively improved by a couple of signs, some markings and a handful of plastic poles.

    Throwing AI at problems is sort of a “spray and pray” approach that often goes about as badly as you can expect.





  • The ToS only defines the license to distribute and display. It does not define how users and consumers of that distribution may or may not use the content. So from this instance alone, there could be an argument of “the comment defines how it may be used”.

    No, there can’t. If the ToS doesn’t give you any permissions it means you have none.

    When you post something you give the site a copy of content, under the license in the ToS. From that moment onward you lose all rights to that copy and cannot re-license or do anything with it anymore, period. It’s not your piece of content anymore, it’s the site’s.

    Your original piece of content is still yours and you hold copyright. That’s the piece that you were holding on your device, in your RAM or on your disk, before you posted it. If you held onto a copy of it you have full rights to it. If you lost it after you posted it, too bad.

    The site cannot re-license their copy under different terms because it doesn’t hold copyright, it only holds a license (albeit under very wide terms).

    Other users are not included in the license. They can’t do anything with the content except what’s allowed under personal use.