Readit News logoReadit News
internet_points commented on Uncertain<T>   nshipster.com/uncertainty... · Posted by u/samtheprogram
black_knight · a day ago
This seems closely related to this classic Functional Pearl: https://web.engr.oregonstate.edu/~erwig/papers/PFP_JFP06.pdf

It’s so cool!

I always start my introductory course on Haskell with a demo of the Monty Hall problem with the probability monad and using rationals to get the exact probability of winning using the two strategies as a fraction.

internet_points commented on Using information theory to solve Mastermind   goranssongaspar.com/maste... · Posted by u/SchwKatze
SchwKatze · 2 days ago
Sorry, could you elaborate more about using grep to solve this? I can't imagine how
internet_points · 2 days ago

    $ printf '%s\n' {a..f}{a..f}{a..f}{a..f}|head 
    aaaa
    aaab
    aaac
    aaad
    aaae
    aaaf
    aaba
    aabb
    aabc
    aabd

    $ printf '%s\n' {a..f}{a..f}{a..f}{a..f}|wc -l 
    1296
So say you've guessed acab and gotten two black pins, then you know nothing is in the right position, so you can `grep -v acab` but also that two of your pins should be used somewhere `grep -E 'a.*[cab]|c.*[ab]|b.*[ca]'` (hope I got that right?)

    $ printf '%s\n' {a..f}{a..f}{a..f}{a..f}|grep -v acab | grep -E 'a.*[cab]|c.*[ab]|b.*[ca]'|wc -l
    756
That filters your options down.

However, I don't understand how/whether grepping can give you the optimal next guesses – some of these will give you less information than others. (Of course, you could run some simulations with grep, argmaxing over all the possible responses like the article says, but then you're not just doing simple grepping.)

internet_points commented on Malicious versions of Nx and some supporting plugins were published   github.com/nrwl/nx/securi... · Posted by u/longcat
homebrewer · 2 days ago
I also use bubblewrap to isolate npm/pnpm/yarn (and everything started by them) from the rest of the system. Let's say all your source code resides in ~/code; put this somewhere in the beginning of your $PATH and name it `npm`; create symlinks/hardlinks to it for other package managers:

  #!/usr/bin/bash

  bin=$(basename "$0")

  exec bwrap \
    --bind ~/.cache/nodejs ~/.cache \
    --bind ~/code ~/code \
    --dev /dev \
    --die-with-parent \
    --disable-userns \
    --new-session \
    --proc /proc \
    --ro-bind /etc/ca-certificates /etc/ca-certificates \
    --ro-bind /etc/resolv.conf /etc/resolv.conf \
    --ro-bind /etc/ssl /etc/ssl \
    --ro-bind /usr /usr \
    --setenv PATH /usr/bin \
    --share-net \
    --symlink /tmp /var/tmp \
    --symlink /usr/bin /bin \
    --symlink /usr/bin /sbin \
    --symlink /usr/lib /lib \
    --symlink /usr/lib /lib64 \
    --tmpfs /tmp \
    --unshare-all \
    --unshare-user \
    "/usr/bin/$bin" "$@"
The package manager started through this script won't have access to anything but ~/code + read-only access to system libraries:

  bash-5.3$ ls -a ~
  .  ..  .cache  code
bubblewrap is quite well tested and reliable, it's used by Steam and (IIRC) flatpak.

internet_points · 2 days ago
Thanks, handy wrapper :) Note:

    --symlink /usr/lib /lib64 \
should probably be `/usr/lib64`

and

    --share-net \
should go after the `--unshare-all --unshare-user`

Also, my system doesn't have a symlink from /tmp to /var/tmp, so I'm guessing that's not needed for me (while /bin etc. are symlinks)

internet_points commented on Unexpected productivity boost of Rust   lubeno.dev/blog/rusts-pro... · Posted by u/bkolobara
internet_points · 2 days ago
That same graph applies to Haskell. You could also exchange the x-axis with

- number of different projects you work on

- time since you last worked on the project

- number of different people working on the project

without the lines changing much.

internet_points commented on Will Smith's concert crowds are real, but AI is blurring the lines   waxy.org/2025/08/will-smi... · Posted by u/jay_kyburz
ulrikrasmussen · 4 days ago
I think AI-"upscaled" videos are as jarring to look at as a newly bought TV before frame smoothing has been disabled. Who seriously thinks this looks better, even if the original is a slightly grainy recording from the 90's?

I was recently sent a link to this recording of a David Bowie & Nine Inch Nails concert, and I got a serious uneasy feeling as if I was on a psychedelic and couldn't quite trust my perception, especially at the 2:00 mark: https://www.youtube.com/watch?v=7Yyx31HPgfs&list=RD7Yyx31HPg...

It turned out that the video was "AI-upscaled" from an original which is really blurry and sometimes has a low frame rate. These are artistic choices, and I think the original, despite being low resolution, captures the intended atmosphere much better: https://www.youtube.com/watch?v=1X6KF1IkkIc&list=RD1X6KF1Ikk...

We have pretty good cameras and lenses now. We don't need AI to "improve" the quality.

internet_points · 4 days ago
Wow, that is horrible! The 2:07 mark where AI put in some generic Rick Astley-alike for Bowie, just made me feel sick
internet_points commented on Comet AI browser can get prompt injected from any site, drain your bank account   twitter.com/zack_overflow... · Posted by u/helloplanets
hoppp · 5 days ago
Maybe treat prompts like it was SQL strings, they need to be sanitized and preferably never exposed to external dynamic user input
internet_points · 5 days ago
SQL strings can be reliably escaped by well-known mechanical procedures.

There is no generally safe way of escaping LLM input, all you can do is pray, cajole, threaten or hope.

internet_points commented on Claim: GPT-5-pro can prove new interesting mathematics   twitter.com/SebastienBube... · Posted by u/marcuschong
dinobones · 9 days ago
Are we sure this guy is not someone being mirrored by a recursive non-governmental system?

Context: https://x.com/GeoffLewisOrg/status/1945864963374887401

internet_points commented on Git-Annex   git-annex.branchable.com/... · Posted by u/keepamovin
internet_points · 5 days ago
The page doesn't say it, but git-annex was created by https://www.patreon.com/joeyh who also made the wonderful https://joeyh.name/code/moreutils/ and https://etckeeper.branchable.com/

u/internet_points

KarmaCake day1259November 15, 2024View Original