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
 
72%
+6 −1
Code Reviews Parsing numbers from a text file

You don't need a regex for this. To find first you can simply iterate through the line until you find a digit. To find second you can do the same but in reverse. This is more efficient than running...

posted 9mo ago by matthewsnyder‭  ·  edited 9mo ago by matthewsnyder‭

Answer
72%
+6 −1
Q&A What's the fastest way to copy, preserving file attributes, on each platform?

I am looking copy files platform-dependently on Linux, Oracle Solaris, MacOS, BSDs, and Windows. I have found some system calls for each platform, namely sendfile(), copy_file_range(), fcopyfile()...

0 answers  ·  posted 10mo ago by Melkor-1‭  ·  last activity 10mo ago by Melkor-1‭

Question c linux unix solaris freebsd
72%
+6 −1
Q&A How can I git checkout the previous HEAD?

There are many ways to get the previous states of HEAD, and which one to use will depend on each situation. Git keeps reference logs (also called "reflogs"), that "record when the tips of branch...

posted 8mo ago by hkotsubo‭  ·  edited 8mo ago by hkotsubo‭

Answer
72%
+6 −1
Q&A Why is atoi dangerous and what should be used instead?

According to Which functions in the C standard library must always be avoided?, the atoi family of functions is dangerous and should never be used for any purpose. The rationale given in the answer...

1 answer  ·  posted 4mo ago by Lundin‭  ·  last activity 4mo ago by Alexei‭

Question c atoi strtol
72%
+6 −1
Q&A How to detach my terminal window from a program ran from it?

This is usually handled by the shell, so it depends on the shell. That said, the relevant command is named the same across many different shells. Namely, the disown command. You can probably enter ...

posted 7mo ago by Derek Elkins‭  ·  edited 7mo ago by Derek Elkins‭

Answer
72%
+6 −1
Q&A How to detach my terminal window from a program ran from it? [closed]

I want to run a program, e.g. Firefox, from terminal, but whenever I close the terminal, program closes too. How to detach my terminal window from a program ran from it?

1 answer  ·  posted 7mo ago by kujaw‭  ·  closed 7mo ago by Alexei‭

Question linux terminal
72%
+6 −1
Q&A How to unittest method that involves contacting remote servers?

Let's say I have this class: class myService { private boolean foo(T arg) { return arg == 42; } public Response bar(U arg) { if(foo(U.field)) { return Response.st...

1 answer  ·  posted 3y ago by klutt‭  ·  last activity 3y ago by meriton‭

Question java unit-testing junit
72%
+6 −1
Q&A What does a variable followed by parentheses ("ptr()") mean?

void (*ptr)() defines a function pointer. It says that ptr is a pointer to a function. But that function must have a void return type, and take an arbitrary number of parameters (that's what the em...

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

Answer
72%
+6 −1
Q&A Best practices in setting up a development & production environments

I am developing a web app that is tied to a database. My codebase is stored on a private GitLab instance. I would like to set up a workflow that would look something like this: I have a developm...

1 answer  ·  posted 3y ago by Mu3‭  ·  last activity 2y ago by Mithical‭

Question database devops
71%
+3 −0
Q&A Detecting if a user has stopped interacting with a web view for a certain time

I am interested in finding out all the aspects I need to cover in order to correctly assess if a user has stopped interacting with a web page. So far, I found the following: Idle Detection API -...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by meriton‭

Question javascript idle-detection user-interaction
71%
+3 −0
Meta Allow question and answers textareas to be resizable

Many questions and answers on Software might involve a lot of code that typically require more width and/or height to be displayed in a way that is easy to read. Why simply not enforce resize: non...

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

Question feature-request editor design
71%
+3 −0
Q&A How to prevent token from being refreshed

It's worth noting that logging out a user goes way beyond not fetching a token, because your UI needs to inform the user he is about to be (or has been) logged out. And if your UI closes or locks i...

posted 3y ago by meriton‭

Answer
71%
+3 −0
Q&A Why static code analyzers such as SonarQube indicate a high code complexity for switch statements?

During a presentation of a pipeline configuration, a colleague showed a SonarQube integration and one of its reports. A warning was caused by overrunning the max value for the code complexity thres...

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

Question c# static-code-analysis cyclomatic-complexity
71%
+3 −0
Meta Should we allow questions about software quality assurance?

I would like to ask a question about the pros/cons of using a library or more generally a way of assertion of complex data models. This is more related to testing than it is to actual coding, but ...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Monica Cellio‭

Question discussion questions ontopic
71%
+3 −0
Meta Suggestions for improving the UI regarding comments

See this picture How do you answer in that thread? Hmm, there are two buttons. One says "show more". I click on that and the thread collapse. Is that "more"? Ok, so I click on the thread agai...

0 answers  ·  posted 3y ago by klutt‭

Question discussion feature-request comments
71%
+3 −0
Q&A How to allow sign-ups without confirmation as an exception using devise confirmable?

I use the devise authentication gem for a Rails application and it's very convenient. Typically I want my users to confirm their registration by email. Therefore the User model looks like class U...

1 answer  ·  posted 3y ago by Trilarion‭  ·  last activity 3y ago by ArtOfCode‭

Question ruby-on-rails devise
71%
+3 −0
Q&A Algorithmically generating the grid formed by the vertices of a dodecahedron (Hunt The Wumpus)

I am attempting to write a program to simulate Hunt The Wumpus in the K programming language. The game requires a grid that is created by the vertices of a Dodecahedron, which is cyclic and triangu...

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

Question shape pseudocode k
71%
+3 −0
Q&A How to create an object, call one of it's methods and pass it as an argument as a oneliner?

If you do not mind having so much code on a single line, the builder pattern might be useful here. Something along the lines: Note: the example is adapted based on an implementation I have done in...

posted 3y ago by Alexei‭

Answer
71%
+3 −0
Q&A Conditions which always matches returns no result with CTE

I have the following scenario (in MySQL 8): CREATE TABLE `steps` ( `id` int NOT NULL AUTO_INCREMENT, `number` varchar(30) DEFAULT NULL, `parent_number` varchar(30) DEFAULT NULL, `timestamp` ti...

1 answer  ·  posted 3y ago by artaxerxe‭  ·  edited 3y ago by Alexei‭

Question mysql common-table-expression
71%
+3 −0
Q&A How to allow sign-ups without confirmation as an exception using devise confirmable?

You should be able to pre-set confirmed_at when you create the User instance: user = User.new(confirmed_at: DateTime.now) # plus any other details you want user.save!

posted 3y ago by ArtOfCode‭

Answer
71%
+3 −0
Q&A noreturn function with non-void return type

Syntax-wise it is a function specifier and may in theory appear everywhere where inline (or rather the syntax item function-specifier:) can appear, since the standard doesn't say otherwise. Though ...

posted 3y ago by Lundin‭

Answer
71%
+3 −0
Q&A Load site based on cookie value in PHP

I need to load a site based on a cookie. I wrote code to validate that, like this. if(!isset($_COOKIE['cookie'])){ $domain = $_SERVER['SERVER_NAME']; setcookie('cookie', $cookie, time() ...

1 answer  ·  posted 3y ago by hajakutbudeen‭  ·  last activity 2y ago by keyang‭

Question php cookies http-headers reload
71%
+3 −0
Q&A Best practices in setting up a development & production environments

As a baseline, here's what we did in my last company: For tests, we used an in-memory database, whose schema was initialized by our object-relational mapper, with initial data loaded either from...

posted 3y ago by meriton‭

Answer
71%
+3 −0
Q&A Why object-oriented instead of class-oriented?

I understand that in object oriented programming, an object is an instance of a class. Not necessarily. JavaScript famously supported object-oriented programming but did not support classes un...

posted 3y ago by Peter Taylor‭

Answer
71%
+3 −0
Q&A Why object-oriented instead of class-oriented?

As with anything computer science-related that dates back to the 1960s and 70s, things just happened at a whim. Everything was new and highly experimental back then. Nobody knew how to write or des...

posted 3y ago by Lundin‭

Answer