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
 
75%
+4 −0
Q&A What is a .gitkeep file?

They are not a part of git the way .gitignore files are. It's just a convention to add empty directories to git repositories. Normally git ignores empty directories altogether. Adding an empty fil...

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

Answer
75%
+4 −0
Q&A Understanding mutable default arguments in Python

Workarounds Avoiding mutation Because problems are only caused by actually mutating the default argument, the simplest way to avoid problems is to... not do that. Pythonic code obeys command-quer...

posted 1y ago by Karl Knechtel‭  ·  edited 1y ago by Karl Knechtel‭

Answer
75%
+4 −0
Q&A Set transform of SVG element

I'm trying to set the transform attribute of a group within an SVG. Specifically, I'd like to set translate's value to 0 0. I tried using the set element for this but that didn't have an observab...

1 answer  ·  posted 1y ago by Matthias Braun‭  ·  edited 1y ago by Matthias Braun‭

Question svg
75%
+4 −0
Q&A How to pass command line arguments when using cargo run?

When developing a rust program you build and run using cargo run. However you cannot just append arguments to that as they will be caught (and likely rejected) by cargo itself. So how to pass argum...

1 answer  ·  posted 1y ago by Iizuki‭  ·  edited 10mo ago by Alexei‭

Question rust rust-cargo
75%
+4 −0
Q&A How should open source forks, with a mix of upstreamable and non-upstreamable commits, be maintained?

The ideal way is to separate the upstreamable and non-upstreamable changes. For example you could maintain two branches: public and private. All upstreamable changes are cherry picked to public an...

posted 1y ago by matthewsnyder‭

Answer
75%
+4 −0
Q&A How to pass command line arguments when using cargo run?

Specify your arguments after --: cargo run --offline -- --my-argument 42 --offline is just an example of cargo's own argument. They are passed before --. --my-argument and 42 will be passed to...

posted 1y ago by Iizuki‭  ·  edited 1y ago by Iizuki‭

Answer
75%
+4 −0
Q&A Is it possible to re-export types similar to JS?

I'm writing a library "MyLibrary". In there, I group code into sections that make sense. Let's say I have a folder "Reports" and a folder "Helpers". I would like to have my code separated while ...

1 answer  ·  posted 1y ago by raphaelschmitz‭  ·  last activity 1y ago by raphaelschmitz‭

Question c#
75%
+4 −0
Q&A Can you run Python code on text in VS Code?

In VS Code, is it possible to run Python code on the text being edited? I realize that I can save my text, create a .py file, switch to a terminal (including VS Code's own terminal) and run the .p...

1 answer  ·  posted 1y ago by matthewsnyder‭  ·  last activity 7mo ago by Alexei‭

75%
+4 −0
Q&A How can a Python program send itself to the background?

Use os.fork(). Example: import os import time pid = os.fork() if pid == 0: os.setsid() # Prevents the child from being killed if the parent dies time.sleep(10) os.system('some...

posted 1y ago by r~~‭

Answer
75%
+4 −0
Meta How should I organize material about text encoding in Python into questions?

The list you provided seems huge for a single Q/A. I think you're better off breaking them up, and linking to each other in the answers. The theory behind text encoding can be decoupled from Python...

posted 1y ago by Andreas witnessed the end of the world today‭

Answer
75%
+4 −0
Meta Tag creation/deletion criteria for Software Development?

Ok so we have fairly lax tagging rules here, as do most Codidact sites. Recently the Electrical Engineering community has started a clean-up of strange and off-topic tags. I wrote this over there: ...

1 answer  ·  posted 1y ago by Lundin‭  ·  last activity 1y ago by Alexei‭

Question discussion tags
75%
+4 −0
Q&A How can I properly type-hint methods in different files that would lead to circular imports?

I eventually also found out that the typing module has a global variable TYPE_CHECKING that can be used to only import during type-checking. Concretely, the following code for helpers.py seems to ...

posted 1y ago by mr Tsjolder‭

Answer
75%
+4 −0
Q&A Why does calloc accept 2 arguments, and with what arguments should one call it?

It has 2 parameters for weird historical reasons that nobody seems to know the rationale for any longer. Like most functions in the C standard library, the function API was not well-designed. Keep ...

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

Answer
75%
+4 −0
Q&A Replace leaf arrays with joined strings in a nested structure in jq

Consider the following arbitrarily-nested JSON as input to a jq filter: echo '[{"foo": [1, 2]}, {"bar": [{"baz": ["foo", "baz"]}]}]' | jq '.' My goal is to join leaf arrays into strings: [{"fo...

1 answer  ·  posted 1y ago by ggorlen‭  ·  edited 1y ago by ggorlen‭

Question json jq
75%
+4 −0
Meta Should self-answered Q&A use separate answers for different techniques/approaches (even if there's a caveat that applies overall)?

Looking back at my own Q&A How can I build a string from smaller pieces?, the answer is incredibly long. I'm essentially showing five different ways to solve the problem - because they all exis...

2 answers  ·  posted 1y ago by Karl Knechtel‭  ·  last activity 1y ago by Lundin‭

75%
+4 −0
Q&A What does "namespace" mean?

A namespace is a category to which a name can belong. Think of family names for people: I may be friends with several Jims, and if only one of them is present I can just call him Jim. But if multip...

posted 1y ago by r~~‭

Answer
75%
+4 −0
Code Reviews How to programmatically click through a list of elements if one has to wait for a click to load a set of predefined new elements?

It seems to get to job done, but the Promise will always remain pending You must call resolve() or reject() (or throw an error) inside the executor function of the Promise, otherwise the Pro...

posted 1y ago by Zer0‭

Answer
75%
+4 −0
Q&A What does "namespace" mean?

A well-known easter egg in Python displays some ideas about writing good Python code, credited to Tim Peters (one of the core developers). This question is about the last: Namespaces are one hon...

2 answers  ·  posted 1y ago by Karl Knechtel‭  ·  last activity 1y ago by Olin Lathrop‭

75%
+4 −0
Q&A How does a client verify a server's SSL certificate? What are the specific steps?

Found this old article at the bottom of the search results to be the best explanation to date: (The longer version is here, SSL Handshake (Sun Java System Directory Server Enterprise Edition 6.0 R...

posted 1y ago by toraritte‭

Answer
75%
+4 −0
Q&A How to troubleshoot ModuleNotFoundError?

I ran some Python code and it crashed with ModuleNotFoundError. What is the general approach for dealing with these situations?

2 answers  ·  posted 11mo ago by matthewsnyder‭  ·  last activity 11mo ago by Karl Knechtel‭

Question import python-3
75%
+4 −0
Meta The way I tried to mark up code did not work. What is the right way to do it?

Alexei's comment gave me the answer. Instead of using the code icon, put three backticks "```" at the start and end of the code. Each set of backticks must be on it's own line. Here's an example: ...

posted 1y ago by TecBrat‭

Answer
75%
+4 −0
Q&A How to run Gitlab CI jobs only in specific branches?

Compare $CI_COMMIT_BRANCH to your desired branch name in rules: # .gitlab-ci.yml stages: - test - deploy # This job will run always. test-job: stage: test image: bash script:...

posted 1y ago by Iizuki‭

Answer
75%
+4 −0
Code Reviews How to programmatically click through a list of elements if one has to wait for a click to load a set of predefined new elements?

I would like to download the old-time radio show I Love a Mystery from the OTRR website. I figured out how to construct the list of right URLs, const urlStub = "https://otrr.org/OTRRLibrary/jukebo...

1 answer  ·  posted 1y ago by toraritte‭  ·  edited 11mo ago by toraritte‭

Question javascript
75%
+4 −0
Q&A Command to format code from repo into single markdown file

Sylvester's answer is great, but I wanted to point out that interpolation only happens in double-quoted strings ("), not in single-quoted ones ('). If you have lines that don't need any variable o...

posted 1y ago by Michael‭  ·  edited 11mo ago by Michael‭

Answer
75%
+4 −0
Q&A What is the point of triggering CI/CD with an empty git commit?

Based on the SO comments, this is not a good general practice, and I believe the point of the posts mentioned in the question is that it can be done (but one probably shouldn't) this can be use...

posted 1y ago by toraritte‭

Answer