Better HN
topnewbestaskshowjobs
Log inSign up

adamcc

74 karma · joined May 12, 2021 (5y ago) · 9 submissions

Submissions

1.

Not knowing Guile or Guix (but knowing how to fail)(admccartney.mur.at ↗)

2 points · by adamcc · 2y ago · discuss

comment 3y ago · link · parent

Yeah, so you are probably right. The custom definition is something that grew out of my response to the following two posts:

A general review of the stdlib https://nullprogram.com/blog/2023/02/11/

A review of scanf https://sekrit.de/webdocs/c/beginners-guide-away-from-scanf....

Originally I implemented `getLine` (terrible name!) as a way to get multiple lines of input from stdin in a relatively safe way. The implementation borrows almost all of its ideas from the `sekret.de` post. Because I knew the implementation and it was close to hand on my machine, I used it for this version and just swapped out `stdin` for just any old file.

Edit: here's the implementation for reference, https://github.com/adammccartney/algorithms/blob/master/libs...

3.

/Proc Los(admccartney.mur.at ↗)

1 points · by adamcc · 3y ago · discuss

comment 3y ago · link · parent

Thanks for the info. To be honest I was aware of the fact that the `/proc/$PID` could disappear by the time `/proc/$PID/`. But felt a bit uninspired to search for a solution. I took a bit of time today to look into it and made some edits to the original post. Specifically, I tried to improve the error handling around the `fopen` call by checking for a possible NULL pointer and also setting up a call to `access` before even attempting. I wonder if this is a valid approach, or at least an improvement over the original?

comment 3y ago · link · parent

Thanks for this! Had not been aware of files such as `/proc/net6/` or `/proc/etc64/`. Will include this as an edit to the original post.

6.

Not knowing the /proc file system(admccartney.mur.at ↗)

169 points · by adamcc · 3y ago · 106 comments

7.

Mufun (Euclidean ducks and generative music)(admccartney.mur.at ↗)

1 points · by adamcc · 3y ago · discuss

comment 5y ago · link · parent

Just as an add on to this. Are there any self-taught programmers looking for lab partners for the OSTEP book projects?