1,270 karma · joined Feb 20, 2013 (13y ago) · 285 submissions
comment 2w ago · link · parent
S(S(S(S(S(S(S(2+2-2+2)))))))) = 7
...which is essentially the same as Dirac's general solution (which also derives a "successor operator" akin to S that doesn't spend any numeric literals).EDIT: I realize that this was already posted in a comment by shoo several hours ago.
comment 2w ago · link · parent
I often see tool call failures because the agent invokes the tool with wrong parameter names, e.g. for file creation it provides "file_content", but the tool expects "file_text" instead. My colleague told me to put this in a pre-prompt file, but I don't understand why the models make these kinds of mistakes - the model should have the available tools with their parameter names in context, should it not?
comment 4mo ago · link · parent
It seems to me like it should be easy enough to take Ghost Font, apply normal video compression techniques, and analyze the compressed signal to recover the visual outline of the letters, which you would then analyze with OCR (or an AI I guess ...). In other words, a novel CAPTCHA technique but not necessarily "fundamentally more difficult" than existing CAPTCHA techniques, once the cat-and-mouse game gets going.
comment 5mo ago · link · parent
comment 5mo ago · link · parent
What do you mean by "roff/troff macros"?
EDIT: Ah, you're probably talking about the "section-wise" movements, defined in POSIX with language like "A line whose first character is a <period> and whose second and third characters match a two-character pair in the 'sections' edit option (see ex)" - that's the first time I've stumbled upon the 'sections' and 'paragraphs' options in the Vim manual ... Very quaint!
comment 7mo ago · link · parent
A server error has occurred
FUNCTION_INVOCATION_FAILED
sfo1::qcpj5-1777386477345-b792e22509f4comment 7mo ago · link · parent
comment 7mo ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
#!/usr/bin/env -S uv run --script
causes the OS run really run env with only two arguments, namely the shebang line as one argument and the script's filename as the second argument, i.e.: /usr/bin/env '-S uv run --script' foo.py
However, the -S flag of env causes env to split everything back into separate arguments! Very cool, very useful.comment 1y ago · link · parent
comment 1y ago · link · parent
[1] https://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified
comment 1y ago · link · parent
comment 1y ago · link · parent
:g//norm @q
Here, g// repeats the most recent search, and norm @q runs the q macro on each matched line. This is not quite the same as starting the macro with a search, since the cursor is at the start of the line and not at the start of the match, but it's often good enough.You can also restrict it to just the matches inside a range of lines: First select the lines in visual mode, then type :g//norm @q, which will cause Vim to insert a range before g, as in: :'<,'>g//norm @q, which means "between line '< and '>, find lines containing a match of the most recent search, and run @q on each such line".
comment 1y ago · link · parent
comment 1y ago · link · parent
One thing to keep in mind is that ":%norm" will place the cursor at the start of each line, before any indentation, whereas the trick of ending the macro with "+" will place the cursor at the start of each line after the indentation. But this can be worked around with ":%norm ^@q", using ^ to skip indentation before running macro q on each line.
comment 1y ago · link · parent
However, that's of course just an academic tangent - the theoretical results don't necessarily imply that one problem is easier than the other when you're just getting something to work for an afternoon project.