Robert Elder

blog.robertelder.org · Personal blog · on HN since 2015

Robert Elder writes technical posts on Linux, C, hardware, and algorithms, often with interactive visualizations.

What HN saysHN commenters recommend it as a Linux systems blog, praising his series on making a CPU, and link his posts on comm and signed ints.
61HN people shared it
24linked it in comments
126stories submitted
6.9Kstory points
5 months agolast shared
2015people per year2026

Most-shared posts

  1. 1
  2. 2
  3. 3
    Should I Use Signed or Unsigned Ints?
    6 people · 120 points · first shared 2015 · 68 comments on HN
  4. 4
  5. 5
    How to make a CPU – a simple picture-based explanation
    4 people · 609 points · first shared 2021 · 169 comments on HN
  6. 6
    Why Is It So Hard to Detect Keyup Event on Linux?
    4 people · 321 points · first shared 2019 · 131 comments on HN
  7. 7
  8. 8
    Should I Use Signed or Unsigned Ints? (Part 2)
    4 people · 61 points · first shared 2015 · 44 comments on HN
  9. 9
    'Music' from /dev/urandom
    3 people · 180 points · first shared 2016 · 56 comments on HN
  10. 10
    The Jim Roskind C/C++ Grammar
    3 people · 171 points · first shared 2018 · 19 comments on HN
  11. 11
  12. 12
    Strange C Syntax
    3 people · 116 points · first shared 2015 · 55 comments on HN
  13. 13
    An Overview of Computer Science Concepts for Engineers
    3 people · 42 points · first shared 2017 · 2 comments on HN
  14. 14
    Homepage
    3 people · first shared 2019
  15. 15

What HN people wrote when they linked it

nick__m · 2024-08-13
The comm command is my favorite lesser know coreutils command https://blog.robertelder.org/intro-to-comm-command/
gppk · 2024-04-27
Explored on this amazing blog series - https://blog.robertelder.org/how-to-make-a-cpu/
suprjami · 2022-10-28
Some more * Chris Wellons - C and all sorts of stuff - https://nullprogram.com/ * Raymond Chen - low-level Windows-centric, really good - https://devblogs.microsoft.com/oldnewthing/ * Robert Elder - Linux systems - https://blog.robertelder.org/ * Andrew Hutchings - old computer restoration - https://linuxjedi.co.uk/
cannam · 2022-08-23
I agree with the content of this article, but all the same my advice is usually the opposite - for reasons that its author sets out rather well in the table in his follow-up article (https://blog.robertelder.org/signed-or-unsigned-part-2/) I wrote a little piece about this myself once (http://soundsoftware.ac.uk/c-pitfall-unsigned.html) I suppose I would loosely characterise my view as - if your profession is "C programmer" and you really know what you're doing, you probably want to use unsigneds most of the time - if your profession is something else, e.g. signal processing researcher who has to translate an algorithm to C or C++, you are probably better off not using unsigneds at all.
lemariva · 2021-12-29
You mean using this hack: https://blog.robertelder.org/recording-660-fps-on-raspberry-pi-camera/ I didn't check that yet, but using the provided software and the flag (--framerate), I got the following timestamps: # timecode format v2 0.000 8.329 16.657 24.987 33.316 41.644 49.972 58.302 Meaning that the camera is working at max. 120fps@640x480
robertelder · 2020-07-28
I tried to follow a middle-of-the-road works mostly everywhere made up flavour. Here is a grammar for it: https://blog.robertelder.org/regular-expression-parser-grammar/ I may add to it in the future if there is enough interest. At the moment it doesn't support a few common things like word breaks and backreferences, but I don't think it'd be too hard to add.
ausjke · 2018-07-06
http://blog.robertelder.org/signed-or-unsigned-part-2/ in this following article the author presented a page to choose unsigned or signed in practice
peapicker · 2017-02-02
Gehinnn · 2022-11-03
I just worked on a new diff algorithm for VS Code, in particular for the new merge editor (you can turn it on with "diffEditor.diffAlgorithm": "experimental"). Diffing is hard and there are many subtleties (e.g. https://github.com/microsoft/vscode/issues/164370). The space efficient Myers diff algorithm has some problems when using it for merging, as tiny changes at the beginning of a file can cause a different path selection later on. Also, Myers doesn't minimize the number of hunks (only their total length), which sometimes leads to unnatural outcomes. If anybody has good ideas for more advanced diffing algorithms, I'm all ears! (maybe even tree based ones, like difftastic) It's already very difficult to objectively evaluate the quality of a diff or to see if improving the diff for a special case doesn't make the average case worse. As for the visualization of Myers, I can recommend to have a look at https://blog.robertelder.org/diff-algorithm/.
TheOtherHobbes · 2016-08-16
No, it's not about stuff you know. This was posted recently, but it was so good it's worth repeating: http://blog.robertelder.org/50-interviews-with-facebook-twitter-amazon… The interesting point is the distinction between skill and talent. Skill is close to competence. You can solve well-defined problems using standard tools and practices. Talent is close to proficiency. You can not only improvise good solutions for novel problems, but you can also prioritise problems intelligently to achieve strategic goals, because you have a clear view of how the codebase fits into your business or project. Without talent you can waste a lot of time by picking the wrong tools, or using tools in the wrong ways. Even though your code may be perfectly correct, the solution built with the code can still be completely wrong or useless. In fact talent is somewhat orthogonal to skill. You can have an untrained version of that overview talent, but it's not so useful if it isn't grounded in skill. When you have both, you have real proficiency - good code doing the right things to solve the right problems.
svilen_dobrev · 2025-01-10
hehe. similar to How to Get Fired Using Switch Statements & Statement Expressions: https://blog.robertelder.org/switch-statements-statement-expressions/
azalemeth · 2024-08-13
Some of these examples are genuinely hilarious -- I honestly laughed aloud at the example file given for csplit (https://blog.robertelder.org/intro-to-csplit-command/), one command I don't routinely use but now shall certainly do so more...
stabbles · 2024-08-13
It's funny that it uses `xxd` in the example here [1] echo "Hello World!" | xxd which is not part of coreutils ... but vim [2] confusingly. But also hexdump is not part of coreutils. They have `od`, which nobody uses because it looks like this: echo "Hello World!" | od -A x -t x1z -v [1] https://blog.robertelder.org/intro-to-mkfifo-command/ [2] https://github.com/vim/vim/blob/d33afe12c6639d70fca82230df6b9fdee73654…
fuzztester · 2024-08-13
ha ha, i laughed at that one too, the "procrastinate on work until the last day" example. csplit stand for context split, iirc. there is also the split command. it splits on the basis of number of lines, which can be specified in various ways. didn't know about the '--filter' flag earlier. it allows you to filter each output file through some other command. useful. https://blog.robertelder.org/intro-to-split-command/ https://man7.org/linux/man-pages/man1/split.1.html
PuffinBlue · 2024-03-20
This seems like the perfect opportunity to introduce those unfamiliar to Robert Elder. He makes cool YouTube[0] and blog content[1] and has a series on regular expressions[2] and does some quite deep dives into the differing behaviour of the different tools that implement the various versions. His latest on the topic is cool too: https://www.youtube.com/watch?v=ys7yUyyQA-Y He's has quite a lot of content that HN folks might be interested in I think, like the reality and woes of consulting[3] [0] https://www.youtube.com/@RobertElderSoftware [1] https://blog.robertelder.org/ [2] https://blog.robertelder.org/regular-expressions/ [3] https://www.youtube.com/watch?v=cK87ktENPrI
capableweb · 2023-01-09
It is possible! This article been on the HN frontpage at least twice: "A Guide to Recording 660FPS Video On A $6 Raspberry Pi Camera" - https://blog.robertelder.org/recording-660-fps-on-raspberry-pi-camera/ - Aug 6, 2019 | 103 comments | https://news.ycombinator.com/item?id=20627574 - Dec 27, 2021 | 64 comments | https://news.ycombinator.com/item?id=29703293 Obviously, the resolution is really low (640x64) but for the price, the quality seems quite nice.
mfashby · 2021-12-29
golang unfortunately also produces negative results from the mod operator It was quite confusing trying to port this diff algorithm https://blog.robertelder.org/diff-algorithm/
kejaed · 2020-05-01
The original pi camera can be made to run at 660 fps with reduced line count, pretty neat hack! https://blog.robertelder.org/recording-660-fps-on-raspberry-pi-camera/
klingonopera · 2020-02-29
One of the biggest mistakes in IT ever, in my opinion. I'd even go so far to say that defaulting to signed instead of unsigned was also one of the biggest blunders ever. I would've never defaulted to a type that inherently poses the risk of UB if I have another type that doesn't. Though it's also possible that precisely that was the reasoning for it. Some more thoughts on unsigned vs. signed: https://blog.robertelder.org/signed-or-unsigned/
xentronium · 2016-02-21
stinos · 2015-09-02
The argument 'google says so' is addressed by the author in part [1]: Overall their argument for avoiding unsigned integers and sample code seems surprisingly weak for a company of the caliber of Google. The most important reason to use unsigned instead of signed is not self-documentation, it is to avoid undefined behaviour. [1] http://blog.robertelder.org/signed-or-unsigned/
deathanatos · 2015-09-02
> Use `signed char` for strings If you're dealing with POSIX / the C stdlib, mirror it and use char* . (The string version of "Respect the integer types used by each API."; if you're coding for Windows you'll likely need to use LPWSTR or whatever they call it now.) But: if you're storing UTF-8 string data, you _want_ unsigned char (and maybe uint8_t[2]): if start trying to inspect the code units, esp. to decode them to code points, you're going to need to do comparisons and bit manipulations on them, and its too easy to write `code_unit < 0x80` or something similarly silly (e.g., while masking bits to see if it's a continuation byte). It's like the article early today called "Should I use Signed or Unsigned"[1] states: "Prefer unsigned when using bitwise operators". > Limit recursion Recursion is fine; you simply need to be aware of your worst case stack depth. You're looking, really, for the complexity of your stack usage, or the big-oh of your stack size. If you're doing something like recursing down an in-memory balanced binary tree, it's O(log(n)) in the worst case: ~64 stack frames on a 64-bit CPU. Can you fit that many on the stack? Certainly that's heavier than a normal function call, but it's still a finite, computable size. If you can't compute that / prove an upper bound, then I agree. > Aside: any language that uses keywords like public and private to determine visibility instead of placement/scoping is bad If not with keywords, how should visibility be…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close