• 1 Post
  • 23 Comments
Joined 2 年前
cake
Cake day: 2023年6月13日

help-circle
  • The xz attack required years of patient work to build Jia Tan’s credibility through hundreds of legitimate patches. These [LLM] tools can now generate those patches automatically, creating convincing contribution histories across multiple projects at once.

    I don’t know, but maybe the current hype could have the opposite effect: if you try to flood many projects with AI-generated patches, you’ll be marked as AI-slopper and blocked from the projects, rather than become a trusted contributor? (OK, assuming a nation-state-like powerful adversary, it can probably do the real job of checking the AI output diligently in order not to be detected as AI spamming, while still getting some advantage of it, unlike those hordes of need-famous-open-source-contribution-in-my-CV who just copypaste the first nonsense which came out of AI into a PR.)





  • I understand the idea. But many people have hugely mistaken beliefs about what the C[++] languages are and how they work. When you write ADC EAX, R13 in assembly, that’s it. But C is not a “portable assembler”! It has its own complicated logic. You might think that by writing ++i, you are writing just some INC [i] ot whatnot. You are not. To make a silly example, writing int i=INT_MAX; ++i; you are not telling the compiler to produce INT_MIN. You are just telling it complete nonsense. And it would be better if the compiler “prevented” you from doing it, forcing you to explain yourself better.







  • I wanted to publish a tiny utility I created to GitHub (you know, it might be useful to someone else…). Before that, I wanted to some cleanup, rebasing/squashing a bit, etc. In the middle of that:

    $ git checkout featurebranch
    The following untracked working tree files would be overwritten by checkout:
    .gitignore
    .idea/…
    etc...
    

    Oh, sure, no problem…

    $ rm -rf * .*
    $ git checkout featurebranch
    fatal: not a git repository (or any of the parent directories): .git
    

    D’oh! (Never mind, it probably wouldn’t have been useful to anyone else, anyway.)








  • Sure, strtok is a terrible misfeature, a relic of ancient times, but it’s plainly the heritage of C, not C++ (just like e.g. strcpy). The C++ problems are things like braced initialization list having different meaning depending on the set of available constructors, or the significantly non-zero cost of various abstractions, caused by strange backward-compatible limitations of the standard/ABI definitions, or the distinctness of vector<bool> etc.


  • Beware the DWIM!

    In one notorious incident, Warren added a DWIM feature to the command interpreter used at Xerox PARC. One day another hacker there typed delete *$ to free up some disk space. (The editor there named backup files by appending $ to the original file name, so he was trying to delete any backup files left over from old editing sessions.) It happened that there weren’t any editor backup files, so DWIM helpfully reported *$ not found, assuming you meant ‘delete *’. It then started to delete all the files on the disk!

    http://www.catb.org/jargon/html/D/DWIM.html