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 matthewsnyder‭

112 posts
75%
+7 −1
Q&A Automatically install all packages needed

When running various Python scripts, I often need to do this annoying dance: $ python script.py ... ModuleNotFoundError: No module named 'foo' $ pip install foo $ python script.py ... Module...

3 answers  ·  posted 2y ago by matthewsnyder‭  ·  last activity 1y ago by meta user‭

Question python-3 pip
75%
+4 −0
Q&A How to prevent Visual Studio Code from opening an extra blank window?

When I run code . in a directory, Visual Studio Code opens two windows. The first is empty, the second shows directory I was in as expected. I checked ~/.config/VSCode/Workspaces and there is only...

2 answers  ·  posted 2y ago by matthewsnyder‭  ·  last activity 2y ago by matthewsnyder‭

Question vs-code
75%
+4 −0
Q&A Readable syntax for executing many callables with useful side effects

In Python, multiprocessing is easy to do if you follow a "list projection" paradigm. Say you want to take a list of inputs X and apply some function f to every x_i, such that y_i = f(x_i) and the y...

1 answer  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by mr Tsjolder‭

75%
+4 −0
Meta Are AI prompt engineering questions on topic?

Recently, AI models like ChatGPT have shown themselves capable of generating content and even source code. Just like with human helpers, clear and precise communication is key (especially when aski...

1 answer  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by manassehkatz‭

Question discussion
75%
+4 −0
Q&A Prevent vscode from inserting new lines in the middle of my code on format.

It sounds like you have a Java formatter configured (by default?) and VSC is applying it to your code automatically (on save?). How code is formatted If your only gripe is these specific stylisti...

posted 1y ago by matthewsnyder‭

Answer
75%
+4 −0
Q&A How do I pull new changes in git submodules?

I have a git repository with some submodules. When the submodule repos get new commits on the remote, how can I pull them all?

0 answers  ·  posted 1y ago by matthewsnyder‭

Question git git-submodule
75%
+4 −0
Meta How can Q&A sites coexist with LLMs?

New LLMs like ChatGPT are now creating competition with Q&A sites like Codidact and StackOverflow. Moreover, this is parasitic: LLMs get "boosted" by Q&A sites because they can use them for...

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

Question discussion
75%
+4 −0
Meta How can Q&A sites coexist with LLMs?

My take on this: Q&A sites used to fill two distinct roles, but only one of these (the more boring one that doesn't matter anyway) is usurped by LLMs. The interesting one is not yet in danger o...

posted 1y ago by matthewsnyder‭

Answer
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
71%
+3 −0
Q&A When using the compare function in Array.prototype.sort, how to avoid an element to be processed more than once?

Create a hash map and precalculate the sort key in it: // Set up: Create mock input let u = ['4', '16', '8', '2', '6']; function expensive_key_fn(x) { console.log("Doing expensive operation...

posted 1y ago by matthewsnyder‭

Answer
71%
+3 −0
Q&A Terms for types of functions with respect to side effects

I know that 1 is sometimes called a pure function - although apparently a pure function must also not vary when the input is constant. By negation, the other kind are called impure functions, alth...

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

Answer
71%
+3 −0
Q&A How can a Python program send itself to the background?

Is it possible for a Python program to send itself in the background? For example, on Linux you can do nohup some_cmd & and any program will run in the background. Some programs also support s...

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

71%
+3 −0
Q&A Alternatives to `EXPLAIN ANALYZE` for queries that won't complete

You can try to break up the query into CTEs, and then see if any of the individual CTEs are unusually slow. I am guessing the query is not just one select, but probably has subqueries, window func...

posted 1y ago by matthewsnyder‭

Answer
71%
+3 −0
Q&A How to provide meaningful names for emails in Maildir?

I am writing some scripts that operate on emails in Maildir format. A lot of things are easy in this format, but the filenames are absolutely incomprehensible. For example, one script moves mails ...

1 answer  ·  posted 1y ago by matthewsnyder‭  ·  edited 1y ago by Alexei‭

Question email maildir
71%
+3 −0
Q&A How to open VS code with a particular path expanded?

When you do: cd /some/path code . VS Code opens with that location shown in the "Explorer" sidebar. However, the state of the file tree and the currently open files will be the same as what wa...

0 answers  ·  posted 1y ago by matthewsnyder‭  ·  edited 1y ago by matthewsnyder‭

Question vs-code
71%
+3 −0
Q&A Advanced Regex extension for VS Code

VS Code supports regex search, but the search/replace UI is just a tiny dialog box. It's okay if you know regex well and the expression is not complex, but when trying to apply complicated expressi...

0 answers  ·  posted 1y ago by matthewsnyder‭  ·  edited 15d ago by trichoplax‭

71%
+3 −0
Q&A PEP20 on namespaces: What exactly is it saying to do?

PEP20 aka the Zen of Python has a statement: Namespaces are one honking great idea -- let's do more of those! What exactly are we supposed to "do" according to this? Is it saying we should h...

1 answer  ·  posted 1y ago by matthewsnyder‭  ·  last activity 11mo ago by BlckKnght‭

71%
+3 −0
Code Reviews GnuTLS config for my own root CA, for use on internal server

I am trying to generate my own root CA certificate. Context My goal is to sign an intermediate CA with this certificate, and then install the intermediate CA on my own client machines. The interm...

2 answers  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by matthewsnyder‭

71%
+3 −0
Q&A Privilege escalation from Python like from systemd

When you try to do a privileged systemd operation without the privilege, you get an escalation prompt: $ systemctl stop docker ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ==== ...

1 answer  ·  posted 12mo ago by matthewsnyder‭  ·  last activity 12mo ago by Karl Knechtel‭

71%
+3 −0
Q&A What is the general process for merging two git branches, reviewing edits on each branch?

For completeness, I'll add some more obscure ways: If your goal is to simply move some changes from one branch to another, you can also use git rebase and git cherry-pick. These give you more cont...

posted 9mo ago by matthewsnyder‭

Answer
71%
+3 −0
Q&A How to format Markdown in terminal

When printing Markdown text to the terminal, how can I get a bit more formatting so it looks nicer? I realize that this is a bit of a contradiction, since terminals generally use only one font. Bu...

1 answer  ·  posted 9mo ago by matthewsnyder‭  ·  last activity 6mo ago by Michael‭

71%
+3 −0
Meta Should I delete my trivial, lack-of-research question?

I don't think the question is trivial. Maven is very complex and confusing at first. The documentation is also quite something. It's not easy to figure out what's going on unless you already know. ...

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

Answer
70%
+5 −1
Q&A Use cases for raising a 'NotImplementedError' in Python

This is in the docs. To paraphrase: Used for abstract methods that must be overridden in subclasses When the implementation is still WIP, but you want to leave a placeholder for the method name...

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

Answer
66%
+4 −1
Q&A How to overwrite lines of STDOUT in Python?

print() normally adds text to STDOUT, it does not erase existing text. https://linux.codidact.com/posts/289869 describes various ways of doing the overwrite in shell scripts. How can you do this ...

2 answers  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by hkotsubo‭

Question python-3
66%
+2 −0
Q&A How to group a flat list of attributes into a nested lists?

The obvious way would be to simply start with an empty list of lists, loop through the input, and for each item decide which sublist to put it in. It's not super dev-friendly to remember which lis...

posted 1y ago by matthewsnyder‭

Answer