#!/usr/bin/python3
import subprocess
import time
import random
with open("/tmp/x") as f:
t = f.read()
for c in t:
subprocess.call([ "xdotool", "type", c ])
time.sleep(abs(random.gauss(0,0.07)))
And pasted a random Hacker News comment:
Authenticity Score
81
Highly Authentic
Words per minute:
162
Keystroke variance:
52ms
Paste attempts:
0
Window/tab switches:
4
Pauses (≥10s):
0
DOM manipulations:
0
I think your approach is pretty much fundamentally flawed.
Put it this way, let's say someone recorded typing in the paragraph that you presented but saved the keystrokes, pauses, etc. Now they replay it back, with all the pauses and keystrokes, maybe with the `xdotool` as above, how could you possibly know the difference?
Your method is playing a statistical game of key presses, pauses, etc. Anyone who understands your method will probably not only be able to create a distribution that matches what you expect but could, in theory, create something that looks completely inhuman but will sneak past your statistical tests.
Most text composition involves backspaces and cursor movement. This script simulated neither afaik, though I’m sure it could have without much more difficultly.
Probably you will need to track many signals like those and use a model that takes them all into account.
Every OS has a similar facility for emulating keystrokes, and then there's the hardware solutions, e.g. raspberry pi that masquerades as a keyboard. It's practically impossible to prevent someone from cheating if they are motivated enough.
The benefit of single-header, specifically, is that it's super easy to integrate with any project. You don't need to mess with your build system, or the library's build system, just include the file and you're good to go.
No allocation is useful for embedded / resource constrained targets.
Both the single header and the zero-allocation callouts can be desirable qualities for something used in an embedded (as in classical MCU-shaped) context.
edit: Seeing that it's also C99 makes me think that embedded applications might be what this was geared toward.
It fills the lightweight niche. You can build it on Windows without needing to drag in all of msys. I can see this as really useful for toy projects and demos.
I'm not sure why walking is an advantage over a hot air balloon. /s
Try to understand that "advantage" can mean different things to different people. Your perspective and usecases might be totally opposite from someone else, and that doesn't mean either of you are wrong.
> Other than it being completely wrong and requiring a regex to be compiled for an amount of work that's certainly less than the compilation itself.
It's not. And the sequence you describe is not even parsed because colons are not part of the IPv6 extension of the SAN. PLease educate yourself before spilling such drivel.
#!/usr/bin/python3 import subprocess import time import random with open("/tmp/x") as f: t = f.read() for c in t: subprocess.call([ "xdotool", "type", c ]) time.sleep(abs(random.gauss(0,0.07)))
And pasted a random Hacker News comment:
Authenticity Score 81 Highly Authentic
Words per minute: 162 Keystroke variance: 52ms Paste attempts: 0 Window/tab switches: 4 Pauses (≥10s): 0 DOM manipulations: 0
You failed.
reply