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.

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
2.6k posts
 
80%
+6 −0
Q&A How kill a child process without read() hanging in the parent process?

There is an external program I'm calling from within my C/C++ program, by using fork() and execl(), and redirecting the stdio with dup2() to be able to read the output from the external program. I...

1 answer  ·  posted 3y ago by sktpin‭  ·  edited 3y ago by Lundin‭

80%
+6 −0
Q&A Are there any downsides related to using Maybe or Optional monads instead of nulls?

In my opinion, all of the downsides boil down to two objections: It isn't idiomatic (in C# and VB.⁠NET) It's slightly less performant The fact that it isn't idiomatic means that, as you note...

posted 3y ago by r~~‭

Answer
80%
+6 −0
Q&A Separate digits of a number in groups with different sizes

Before we start, I'd like to be a little bit pedantic regarding 00002451018 being a number. When we talk about numeric types/values, the zeroes at the beginning are irrelevant: 2, 02 and 000002 al...

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

Answer
80%
+6 −0
Q&A Are there any downsides related to using Maybe or Optional monads instead of nulls?

I have recently stumbled across the Maybe (or Optional) modal usage in .NET Code: example code or this one example article Based on everything I read, there are multiple advantages on relyi...

2 answers  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Derek Elkins‭

80%
+6 −0
Q&A Is it possible to undo a git reset?

From the Git docs "reset" copies the old head to .git/ORIG_HEAD To restore that commit, you can run $ git reset ORIG_HEAD If you want to restore more than one reset, then you'll have to l...

posted 2y ago by Moshi‭

Answer
80%
+6 −0
Q&A array of arrays vs array of pointers to store array of string literals

Let's consider the following code: const char a[][4] = {"aa", "aaa"}; const char *b[] = {"bb", "bbb"}; const char *const c[] = {"cc", "ccc"}; For shared libraries, both b and c arrays require...

0 answers  ·  posted 2y ago by alx‭  ·  edited 2y ago by alx‭

80%
+6 −0
Code Reviews Measuring the impact of using exceptions instead of return values in an ASP.NET Core application

Context This Q&A from SO suggests that throwing exceptions is incredibly expensive when compared to returning values (return codes): that with return codes instead of exceptions the same pr...

1 answer  ·  posted 2y ago by Alexei‭  ·  last activity 2y ago by Dirk Herrmann‭

80%
+6 −0
Q&A How to write a macro that discards the const qualifier, for any type?

Ignoring the numerous forms of undefined behavior that casting away const might invoke, the blunt but simple and standard solution is just to cast to (void*). char* foo (const char* str) { r...

posted 2y ago by Lundin‭  ·  edited 2y ago by Lundin‭

Answer
80%
+6 −0
Meta Should I post a link to the Github repo for code reviews?

Hello. Total noob here and noob to this site. I've written a non-trivial program in Python. Code review didn't take the whole thing (400+ lines of code). Should I post a link to my Github repo ...

3 answers  ·  posted 3y ago by joe‭  ·  last activity 1y ago by matthewsnyder‭

80%
+6 −0
Q&A How to unittest method that involves contacting remote servers?

I'm actually mainly interested in testing foo() Ok, so let's do that. I could make it public, but I really don't want to do that just so that the test class can access it Java has 4 diff...

posted 3y ago by meriton‭

Answer
80%
+6 −0
Q&A Continuously read from piped input using Vim

Unfortunately I think the simple answer is that you cannot do what you want with standard Vim (or NeoVim, which I also tested — although NeoVim is slightly more convenient in that you don't need to...

posted 3y ago by deleted user

Answer
80%
+6 −0
Q&A When does it not work to dereference the pointer for sizeof during malloc?

Background This is kind of a subquestion to How to properly use malloc? When allocating, there are basically two common ways of using the sizeof operator: int *p; p = malloc(n * sizeof *p); /...

1 answer  ·  posted 3y ago by klutt‭  ·  edited 3y ago by hkotsubo‭

Question c pointers malloc
80%
+6 −0
Q&A Is it OK to use scanf with a void pointer?

I've created a function that calls scanf passing a void pointer as argument: void read(const char *format, void *p) { scanf(format, p); } And tested it with different types: int n; read...

2 answers  ·  posted 3y ago by hkotsubo‭  ·  last activity 3y ago by Lundin‭

Question c pointers scanf
80%
+10 −1
Q&A How to avoid "exception is never thrown" when commenting out a line while debugging

While writing the question I actually came up with something that seems to work fairly well, and it's very simple. Just add if(false) in front of the statement.

posted 3y ago by klutt‭  ·  edited 2y ago by anatolyg‭

Answer
80%
+6 −0
Q&A When stored procedures are preferred over application layer code?

(This answer became more ORM v. "direct" SQL. If you're very narrowly focused on just stored procedures, then it's not super important to me that the logic be packaged up in stored procedures. That...

posted 3y ago by Derek Elkins‭

Answer
80%
+6 −0
Q&A Using nested paths vs. flat ones for API resources

Actually, while REST mandates a great many things, it does not constrain the structure of URLs. To wit: The paper that coined the term "REST" describes resource identifiers as black boxes, and make...

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

Answer
80%
+6 −0
Q&A When stored procedures are preferred over application layer code?

A person I used to work with several years ago was hired to rewrite a product using a .NET-based modern tech stack. One of the aspects that stroke me was that he believes that the product should mo...

2 answers  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Derek Elkins‭

80%
+6 −0
Q&A Continuously read from piped input using Vim

In Vim, it's possible to tell it to read from stdin instead of a file, by using vim -. This is so that you can pipe the output of one command into Vim, to view/edit it there. The problem I'm facin...

2 answers  ·  posted 3y ago by Hyperlynx‭  ·  last activity 3y ago by deleted user

Question console vim pipe
80%
+6 −0
Q&A Why object-oriented instead of class-oriented?

Why object-oriented instead of class-oriented? tl;dr Because you can "do OOP" without classes. Long answer A class is one possible way to implement object oriented programming. But it's n...

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

Answer
80%
+6 −0
Q&A Conditionally ignore files in git

Something like automatically ignoring all .pdf files for which a .tex of the same name exists? We can do something close to that. We can reject the commit if your change list contains pdf and ...

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

Answer
80%
+6 −0
Q&A Can I set a memory limit for the .NET Core garbage collector to collect objects more aggressively?

I have an ASP.NET Core 5 web application that provides functionality that involves file upload + rather large processing (memory consumption mainly). After each processing (with success or not) the...

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

80%
+6 −0
Q&A How to configure .gitignore to ignore all files except a certain directory

From the docs Example to exclude everything except a specific directory foo/bar (note the /* - without the slash, the wildcard would also exclude everything within foo/bar): $ cat .gitignore...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
80%
+6 −0
Meta Participate Everywhere ability without meeting the requirements?

Why do we have the "Participate Everywhere" ability when we haven't yet done anything? Bootstrapping. Our communities are still small, so after we rolled out the abilities system we decided to p...

posted 2y ago by Moshi‭

Answer
80%
+6 −0
Q&A Cast uninitialized variable to (void)

Yes, it is safe unless the variable is volatile. The term used in the C99 standard for the value of an "uninitialized" variable is indeterminate. From C99 standard: Section 6.2.4 Storage duratio...

posted 2y ago by Estela‭  ·  edited 2y ago by Ethan‭

Answer
80%
+6 −0
Q&A What's causing mypy to give an `[assignment]` error in this nested for loop?

The problem is that you are using row twice with different types. for row in self.diagram: # row is str here for row in self.seed_diagram: # row is list[str] here Renaming one or the other m...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer