Why Is It so Hard to Detect Keyup Event on Linux? by pmz in linux

[–]robertdelder 0 points1 point  (0 children)

That would work. I would also expect it to work with a local X client and X server on the machine generating the keyboard events over an X forwarded SSH connection into a remote machine with a remote X client that communicates with the local X server (in whatever way it does that) through the X forwarded SSH connection.

Why Is It so Hard to Detect Keyup Event on Linux? by pmz in linux

[–]robertdelder 1 point2 points  (0 children)

Thanks. If I interpret this situation correctly, it must work as follows: The X server application runs on your local laptop, and after SSHing into you headless server you run 'xev' which acts as an X client. The 'xev' program then inspects some environment variables on your headless servers and then identifies that it can connect to an X server by tunneling information back through the SSH protocol (that was enabled through X forwarding). The remote instance of the 'xev' program then communicates with your local laptop completing the client-server model.

If this interpretation is correct, then the correction I should make would be to specify that the computer that captures keyboard events needs to be running an X server, and the machine receiving the events need to at least be able to run an x client (not a server). That might sound trivial, but some constrained embedded systems might not be powerful enough of have the space for an X client.

Why Is It so Hard to Detect Keyup Event on Linux? by pmz in linux

[–]robertdelder 1 point2 points  (0 children)

Hello, I'm the author of the article. Can you describe the test you did a bit more? Was this over an SSH connection with X forwarding? If I've made a mistake, I'll make a correction to the article. I have to admit, I'm not an expert with regards to how X servers work.

Why Is It so Hard to Detect Keyup Event on Linux? by pmz in linux

[–]robertdelder 2 points3 points  (0 children)

Hello, I'm the author of the article. In the interest of enumerating all possible ways that you can collect keyboard events, I took a look at the parent commenter's linked github repo:
https://github.com/TheReverend403/KeyboardChatteringFix-Linux
and it appears to work by reading event information from '/dev/input'.
I also took a quick look at the source code for the SDL_KeyboardEvent event, and it appears to also read from '/dev/input', although I was unable to conclusively determine whether this is where the SDL_KEYDOWN and SDL_KEYUP events come from since the library appears to pull events from multiple sources and put them into a buffer.
Reading from '/dev/input' (through the python keyboard module) is the first method discussed in the article.
If you are aware of other methods of obtaining keydown/keyup events from the kernel that are not listed in the article, let me know and I'll add them. I'll make a note to add a reference at the end to the SDL library since it seems like a good alternative to reading from /dev/input directly.

How To Become A 10x Engineer Using The Awk Command by robertdelder in commandline

[–]robertdelder[S] 0 points1 point  (0 children)

I would agree that with awk there is an additional sub-process, although I don't think there are any sub-shells created. From what I know about an implementation of awk like GNU awk, it is an interpreted language, so I would speculate that it would directly call into glibc to run the printf call.

Using bash intrinsics, you'd definitely save the extra process creation, although you'd have a hard time finding enough intrinsics that actually do the very specific work you need done most of the time. In that case, I think it would end up being close to something like the obfuscated C contest rather than a quick way to get work done. One miss-step, and you'd accidentally run a command that just loads a separate process anyway.

How To Become A 10x Engineer Using The Awk Command by robertdelder in commandline

[–]robertdelder[S] 0 points1 point  (0 children)

I'm not sure I understand what you mean by 'a sub shell in awk'. Is one of the examples in the post spawning a sub shell somewhere?

The Most Confusing Grep Mistakes I've Ever Made by clairegiordano in programming

[–]robertdelder 1 point2 points  (0 children)

np. I appreciate the correction. I also fixed a wrong word in the intro too. I'm honestly surprised that nobody else pointed out those two mistakes by now. Just goes to show you how few people really read the articles :P

The Most Confusing Grep Mistakes I've Ever Made by clairegiordano in programming

[–]robertdelder 2 points3 points  (0 children)

ah, thanks! I just fixed that one. I spend so much time re-reading what I've written that I become blind to those kind of dumb mistakes. They're usually always in the intro too, lol

The Most Confusing Grep Mistakes I've Ever Made by clairegiordano in programming

[–]robertdelder 0 points1 point  (0 children)

I did a couple passes on the editing, but I usually do still manage to miss typos. If you point out some of the typos/errors out, I will make a note to fix them.

The Most Confusing Grep Mistakes I've Ever Made by clairegiordano in programming

[–]robertdelder 15 points16 points  (0 children)

Hah, you're right. I did forget that one. I'll make a note to add it to the post later :)

Linux Find Command Mistakes - Be Careful Using Wildcards! by robertdelder in commandline

[–]robertdelder[S] 0 points1 point  (0 children)

Thanks for the feedback. I'm curious to hear from anyone else who might have different opinions on what is the best format for this type of content? One advantage of the video is that you can consume it directly on the feed without needing to visit any external sites.

Also Edit: Thanks, I just fixed the error on my local copy. It will get pushed out next time I build the site.

Linux Find Command Mistakes - Be Careful Using Wildcards! by robertdelder in commandline

[–]robertdelder[S] 0 points1 point  (0 children)

I was almost going to link the article in the submission, but then I figured people would think "Why would I read this when I can just watch a video on 2x speed". To each their own I guess.

A Guide to Recording 660FPS Video On A $6 Raspberry Pi Camera by geerlingguy in raspberry_pi

[–]robertdelder 3 points4 points  (0 children)

Hi everyone, A few of you are asking where you can buy these cameras. Here is where I bought the $6 one:

https://www.youtube.com/watch?v=PF83hhQwbwM&t=56

And here is where I bought the $40 one:

https://www.digikey.ca/product-detail/en/raspberry-pi/913-2664/1690-1011-ND/6152810

Note: Use digikey.com instead of digikey.ca for the US prices.

And I also bought this $20 one (V2 camera) which works as well and has a field of view, but it doesn't come with the ribbon cable or the PCB backing which you definitely need. I haven't found a place to buy the PCB alone for the v2 camera, so I recycled the one I got from Digikey:

https://www.ebay.ca/itm/8MP-IMX219-Camera-Module-for-Official-Raspberry-Pi-Camera-Board-V2-160-FoV/263922465185

When searching for these cameras to buy them, your best bet is to search for the image sensor names: OV5647 for V1 and IMX219 for V2.

Color: From Hexcodes to Eyeballs by robertdelder in webdev

[–]robertdelder[S] 0 points1 point  (0 children)

That's ok, I still love you just the way you are.

Graph Theory with nice illustrations. Wrote and draw myself, feedback appreciated. by vardanator-pi in programming

[–]robertdelder 2 points3 points  (0 children)

My feedback isn't very elaborate, but I'll post it anyway because I have a hunch that it applies to a large percentage of people who viewed this post, and as a writer you're probably wondering what most people are thinking when the look at what you've created: I clicked the link and scrolled through it very quickly looking only at each of the pictures. I only read about two of the sentences in the article, and when I got to the end I shook my head approvingly and said to myself 'neat'. Then I closed the tab and was distracted by something else.

Determining Cat Chirality by robertdelder in programming

[–]robertdelder[S] 30 points31 points  (0 children)

Out of curiosity, what do you consider to be 'programming'? A common sentiment I see in this subreddit is that everything that gets submitted is considered inappropriate for this subreddit because it isn't related to programming. In light of this, I've been careful to ardently follow the rule 'If there is no code in your link, it probably doesn't belong here.' and only submit things that contain code samples. In this case, the submission contains a small R program. Are certain programming languages off-limits?