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.
$ 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.)
#!/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. --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)
- 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.
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.
There is no generally safe way of escaping LLM input, all you can do is pray, cajole, threaten or hope.
Context: https://x.com/GeoffLewisOrg/status/1945864963374887401