Skip to main content

Toby Speight

🏴󠁧󠁢󠁳󠁣󠁴󠁿 Northwest Scotland

http://coilleais.com

Linux hacker and outdoor explorer - particularly of obscure islets and holes in the ground.

2d
awarded Revival
Jul
7
comment Demonstrate effects of summation order
@chux, you're right: these values are all positive. Your observation could form the basis of a review. But remember that the purpose of the code was to make the accumulation of error visible, rather than to present a fully robust summation. The description even says, "the adaptive pairwise version only works when all inputs are positive."
Jul
5
awarded Yearling
Jul
5
reviewed Approve suggested edit on Excel sheet manipulation program
Jul
4
revised Error handling for singly linked list in C
Spelling and grammar
Jul
1
awarded Necromancer
Jun
28
revised What is the purpose of the M1 pin on a Z80
Spelling and grammar
Jun
28
revised Do IDE data lines need pull-up resistors?
Spelling and grammar
Jun
28
revised Verbose sleep command that displays pending time seconds/minutes?
Typo fix
Jun
28
awarded Copy Editor
Jun
27
comment Writing a generic makefile for C projects
Sorry for the very short review - I have a lot going on until late July. I hope you get a more thorough answer as well!
Jun
27
reviewed Leave Open A thread-safe performant Money Transfer API in Java
Jun
27
revised What actual purpose do accent characters in ISO-8859-1 and Windows 1252 serve?
Spelling and grammar
Jun
27
comment Writing a generic makefile for C projects
That can be a problem, as they share the same names and we can end up linking a mismatching set of objects. I guess it depends whether their public interfaces depend on NDEBUG etc. (when we add that to CFLAGS release builds). Instead of rewriting %.o: %c rules, I find it better to start a sub-make in the output directory (something like +$(MAKE) $(builddir) -f ../Makefile $@ VPATH=$(PWD)). Then you can build as many configurations as you want, from a single source directory which doesn't need to be writeable by the user doing the build.
Jun
27
comment Sorting and filtering using dynamic parameters
To help reviewers give you better answers, we need to know what the code is intended to achieve. Please add sufficient context to your question to describe the purpose of the code. We want to know why much more than how. The more you tell us about what your code is for, the easier it will be for reviewers to help you. Also, [edit] the title to simply summarise the task, rather than your concerns about the code.
Jun
27
answered Writing a generic makefile for C projects
Jun
27
comment An Attempt at Creating a Type-Safe, Generic Swap Macro With Compile Time Error Checking
... The buffer size would need tuning from that 16 according to profile results; I don't know whether uintmax_t is a good way to get it aligned; for small transfers it's probably faster to use the existing char-by-char implementation (again, benchmark to determine the cut-over point, if any - that's probably very platform-dependent).
Jun
27
comment An Attempt at Creating a Type-Safe, Generic Swap Macro With Compile Time Error Checking
No, library memcpy() and family tend to be targeted towards specific compilers and specific processors (often not even written in C) rather than being portable code. To be honest, I wouldn't attempt one of those. You might get a performance boost by using memcpy() to swap a substantial chunk at a time via a buffer that's aligned (e.g. uintmax_t buf[16]; while (psize) { size_t size = min(sizeof buf, psize); memcpy(&buf, a, size); memcpy(a, b, size); memcpy(b, &buf, size); a += size; b += size; psize -= size); }. Obviously there's still work to do there:...
Jun
21
revised Calculate overlapping time periods in PowerQuery
Improve description of purpose in title
Jun
21
revised Project Euler 127 - abc-hits
edited tags
1 2 3 4 5