Please don’t. If you need something like json but with comments, then use YAML or TOML. Those formats are designed to be human-readable by default, json is better suited for interchanging information between different pieces of software. And if you really need comments inside JSON, then find a parser that supports //
or /* */
syntax.
Never knew that ddg had an LLM, will check it out. Thanks!
I’m sorry which LLM is this?
It’s perplexity.ai. I like it because it doesn’t require an account and because it can search the internet. It’s like microsoft’s bing but slightly less cringe.
How’d you get that out of it?
The screenshot is fake. I used Inspect Element.
Still better than automatically converting :) to 😃
He’s recording the extracted data into a MongoDB database, yes!
Jokes aside, LLMs are actually pretty nice, since they lower the barrier to entry for programming. A guy I know has been doing all of his data processing with obscure Excel hacks his entire life. But recently he had to parse a file with like a million or so lines, which would take forever in excel, so now he’s hacking together a python script using ChatGPT and meta ai. And in the process, he’s actually picking up a bit of python knowledge himself. He now knows what lists are, how loops and if statements work, and he even understands “intermediate” features like list comprehension and regex. They said llms would replace programmers, but in reality they’re making more of us lol
This but with “microsoft office” instead of java
Gradual typing isn’t reinventing the wheel, it’s a new paradigm. Statically typed code is easier to write and harder to debug. Dynamically typed code is harder to debug, but easier to write. With gradual typing, the idea is that you can first write dynamic code (easier to write), and then – wait for it – GRADUALLY turn it into static code by adding type hints (easier to debug). It separates the typing away from the writing, meaning that the programmer doesn’t have to multitask as much. If you know what you’re doing, mypy really does let you eat your cake and keep it too.
reasoning
What reasoning? I’m not trying to make any logical deductions here, I’m just expressing annoyance at a inevitable, but nevertheless cumbersome outcome of the interaction between numpy and mypy. I like python and I think mypy is a great tool, I wouldn’t be using it otherwise.
u/vox@sopuli.xyz suggested Typst as an alternative to TeX. I gave it a try, and I’m loving it so far. It even has built-in support for the rotated text thing https://typst.app/docs/reference/model/table . I’ve only used it for notes/homework so far, but I’m looking forward to seeing how it fares for more serious typesetting tasks.
tries to install R packages by first looking in bioconductor and then trying the rejects through conda-forge, and then the rejects from that are compiled from source
Just do all of these in parallel to maximise the change of installing the correct version
it sounds almost poetic
Testing 123
$$ \sigma $$
aww…
So there are many different commands that compile LaTeX, right? pdflatex
, pdftex
, latexmk
, etc. But they all do that thing where they ask for your input as soon as they encounter an error, right? Well, if you just pipe an empty echo
command to them, it notices that stdin
has reached end-of-file, and gives up trying to ask the user for input, and just exits on first error. So instead of pdflatex mydocument.tex
, you can do echo | pdflatex mydocument.tex
and it won’t ask you for input if it sees an error, it’ll just exit. There’s probably a “proper” way to achieve the same behaviour, but I can’t be arsed to read the docs.
Speaking of stupid TeX hacks, at one point I had a script called latex_compile_and_install_packages_until_it_works.sh
. It’s essentially a loop that repeatedly tries to compile a document, searches the output of the compiler for anything that looks like a missing package error, and pipes it to sudo tlmgr install
. The “fuck it” of package management, arbitrary code execution exploit included!
(Sorry for the screenshot, I lost the original script in text form, probably for the better)
Yeah, what the hell is up with that? I always just echo | pdflatex
to make it shut up and exit on error. Maybe one day I’ll learn how to actually use that interactive compilation thing, but not today lol.
I mean good point, but if I’m just using bash as a shell and not writing a script, I’m probably first previewing the contents of a file with cat
anyway, and recalling the last command and appending a | grep <pattern>
to it is less keystrokes than re-writing the last command into grep <pattern> <file>
. Especially if you’re playing around with the pattern and trying to get it right, it’s nice to have the pattern at the end of the line.
YAML is good for files that have a very flexible structure or need to define a series of steps. Like github workflows or docker-compose files. For traditional config files with a more or less fixed structure, TOML is better I think