Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts by celtschk‭

20 posts
86%
+11 −0
Q&A Are there references in C?

C does have references, but it does not have pass by reference. A reference is simply an expression that references an object (object here is meant in the general sense, not in the OO sense; for e...

posted 3y ago by celtschk‭

Answer
85%
+10 −0
Q&A Is it possible to undo a git reset?

For some reason, I just wanted to undo a commit on my git repository, which I've done with the following command: git reset --soft HEAD~1 So far, so good. However, by mistake I issued the comma...

2 answers  ·  posted 2y ago by celtschk‭  ·  edited 2y ago by Alexei‭

Question git git-reset
83%
+8 −0
Q&A What is malloc's standard-defined behavior with respect to the amount of memory it allocates?

Since accessing the memory allocated by malloc beyond the size given to the call is undefined behaviour (which means that the standard poses no restriction to the behaviour of a program that does t...

posted 3y ago by celtschk‭  ·  edited 3y ago by elgonzo‭

Answer
81%
+7 −0
Q&A How to use grep to print only specific word from a string

While I agree with Dirk Herrmann that basename is the right tool for the job, I think it is still worthwhile to know how to do it with grep, because you might one day encounter a sufficiently simil...

posted 2y ago by celtschk‭

Answer
81%
+7 −0
Code Reviews A simple game with pygame

I've just started playing around with pygame and have written a small game in it, of which I'd like a review. Note that I'm not only a complete beginner in pygame, but I also have very little exper...

1 answer  ·  posted 3y ago by celtschk‭  ·  last activity 3y ago by Peter Taylor‭

81%
+7 −0
Q&A Invalid memory access when trying to dereference a pointer obtained through a function call

Your function returns a pointer to a local non-static variable. Such a variable exists only during execution of the function and is removed on return. This means you are left with a so-called dangl...

posted 3y ago by celtschk‭

Answer
80%
+6 −0
Q&A Why is it considered bad practice to use float for representing currency?

The main problem with using floating point is that the typical floating point type is binary floating point. But in binary floating point, most decimal fractions cannot be represented exactly. That...

posted 3y ago by celtschk‭  ·  edited 3y ago by celtschk‭

Answer
80%
+6 −0
Q&A Behavior of Pointer Arithmetic on the Stack

Not only does the C language not guarantee it, it also will fail on actual compilers, as soon as you enable optimisation (which you'll generally want to do because you want your code run fast, afte...

posted 3y ago by celtschk‭

Answer
80%
+6 −0
Meta Is this a good fit for Code Reviews, and if so, how to best post it?

I've just dived into pygame and written a little game in it, of which I'd like a review (it's my first try of pygame). However I'm not sure if it is a good fit for the site, and if so, how exactly ...

2 answers  ·  posted 3y ago by celtschk‭  ·  last activity 3y ago by Peter Taylor‭

75%
+4 −0
Q&A Why does fopen return NULL?

Besides the possible issues that Lundin told you, there is also the possibility that the current directory of the program is not what you think it is (note that the current directory is not necessa...

posted 3y ago by celtschk‭

Answer
75%
+4 −0
Code Reviews A class to access dicts using attribute syntax

I've written a class that allows to access dictionary entries of arbitrary dicts with appropriate string keys through attribute access syntax on an instance of the class. My questions are: Is...

3 answers  ·  posted 3y ago by celtschk‭  ·  last activity 6mo ago by mudskipper‭

Question python hashmap
75%
+4 −0
Q&A Is it possible to write protocols for enumerations in Python?

Having recently learned about protocols in Python, I now wonder if you can write a protocol for enumerations. That is, a protocol that says that you are supposed to pass an enum that has certain it...

1 answer  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by r~~‭

75%
+4 −0
Code Reviews A state machine in Python

I've written the following code implementing a state machine in Python, and I'd like some feedback on it. The basic idea is that each state has a set of corresponding actions that trigger a state ...

2 answers  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Nick Alexeev‭

71%
+3 −0
Q&A C Language Standard Linking Specifications

The standard does not talk about object files and/or linking, but it does talk about translation units. In typical compilers, a single translation unit translates into a single object file. Obviou...

posted 3y ago by celtschk‭

Answer
71%
+3 −0
Meta Reaction comment doesn't appear if previous comment for retracted reaction was deleted

On this answer I just reacted with “works for me” with comment, but then retracted it because of what finally turned out to be a mistake on my end, and deleted also the comment (and thus the commen...

1 answer  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Monica Cellio‭

66%
+2 −0
Code Reviews Detecting balanced parentheses in Python

You've got an inefficiency in your code, as you always do replacements 3/2 times the length of the string. That is unnecessarily expensive. By instead testing in each iteration whether the length ...

posted 3y ago by celtschk‭

Answer
66%
+2 −0
Q&A Turn all changes after latest origin/main into a branch

I have a git history that basically looks like this: * commit: XXX (HEAD -> main) | | * commit: YYY | | * commit: ZZZ (origin/main) | | ... Now I would like to turn everything after...

2 answers  ·  posted 3mo ago by celtschk‭  ·  last activity 3mo ago by matthewsnyder‭

Question git
66%
+2 −0
Q&A Why is the new auto keyword from C++11 or C23 dangerous?

A pitfall in C++ that I didn't see mentioned in the other answer is that it might give unexpected results with libraries using expression templates. What are expression templates? In a nutshell, ...

posted 3mo ago by celtschk‭

Answer
60%
+1 −0
Q&A How to manage user-specific application data on Linux?

Just as an additional information: If you are writing Python code, there's the useful package appdirs that provides a platform-agnostic interface to user-specific application data directories. For ...

posted 2y ago by celtschk‭

Answer
50%
+0 −0
Q&A How can I get the same "not all control paths return a value" behaviour across Clang and MSVC?

The reason why it is undefined behaviour instead of a hard error is that the problem of determining it is, quite literally, equivalent to the halting problem. So any implementation will either warn...

posted 1mo ago by celtschk‭

Answer