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 »
Q&A

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.

General Q&A about programming, scripting, software design & architecture, process, tools, testing, and more.

Filters (None)
77%
+5 −0
Terms for types of functions with respect to side effects

Mathematically, the purpose of a function is to return an output. However, in a programming context functions often have side effects. It is even common to call functions for the side effects alone...

2 answers  ·  posted 9mo ago by matthewsnyder‭  ·  last activity 9mo ago by Lundin‭

76%
+8 −1
Styling with classes vs styling with CSS

I've noticed that a lot of sites have something like this going on: <div class="has-margin-0 has-padding-4"> <div>...</div> <div>...</div> ... </div>...

1 answer  ·  posted 3y ago by Moshi‭  ·  last activity 3y ago by luap42‭

75%
+4 −0
How do I get IIS UrlRewrite to handle CSS-delivered woff files appropriately?

Context: Azure; Windows Server 2012; IIS 8 First up, here's the (redacted) web.config for reference <rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="false"&...

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

75%
+4 −0
What is a standard definition (or a CS theory based formal definition) for Escaping?

I personally would define "escaping" in software development in general and coding in particular as follows: Making an exception to match data which otherwise would not be allowed to be matched: I...

1 answer  ·  posted 3y ago by deleted user  ·  edited 3y ago by Alexei‭

75%
+4 −0
Would a MySQL database run more efficiently with smaller varchar lengths?

I have a database with quite a few VARCHAR fields. When the database was first built the lengths of the columns were set a bit larger than absolutely necessary. Now after, having used the DB for a ...

3 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by manassehkatz‭

75%
+10 −2
What are the pros and cons of a composite primary key versus a unique constraint?

Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a comp...

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

75%
+4 −0
Generate SIGSEGV without undefined behaviour.

In order to test that coredumps are generated and that they contain useful information which can be retreived with gdb I need to generate a SIGSEGV. Or anything else which causes a coredump. The co...

1 answer  ·  posted 3y ago by Estela‭  ·  last activity 3y ago by Lundin‭

75%
+4 −0
Is there an equivalent way of returning early in a MySQL stored procedure?

In programming instead of arrowcode where one has many layers of indented if statements, you can return a result as soon as possible. So instead of, if if end if end if It looks like if ret...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Moshi‭

75%
+4 −0
dig -6 works but dig -4 does not

I can't get a response from IPv4 dig on my server but I can get one from IPv6 dig. See the below output: $ dig +short myip.opendns.com a @resolver1.opendns.com # Doesn't return anything, this used ...

1 answer  ·  posted 3y ago by cobertos‭  ·  last activity 3y ago by Canina‭

75%
+4 −0
Implementing impersonation in an ASP.NET Core Web application

I am working at a proof-of-concept for porting an ASP.NET MVC application to an ASP.NET Core API + Angular SPA. One of the features of the existing application is the ability of an admin (typically...

0 answers  ·  posted 3y ago by Alexei‭

75%
+4 −0
How can I generate documentation from comments in SQL DDL?

I have some SQL scripts that contain DDL to create tables and schemas for a database. I'd like to be able to comment this SQL and then use those comments to generate output documentation (in HTML)...

0 answers  ·  posted 3y ago by Monica Cellio‭  ·  edited 3y ago by Monica Cellio‭

75%
+4 −0
How do I share a type between a client and server, but make a specific field optional for one and required for the other?

Let's say I have a client/server application with a data structure on the server side: type User = { name: string; superSecretGovernmentIdNumber: string; }; These fields are both non-nul...

1 answer  ·  posted 6mo ago by Emily‭  ·  edited 6mo ago by Emily‭

75%
+4 −0
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 7mo ago by Matthias Braun‭  ·  edited 7mo ago by Matthias Braun‭

svg
75%
+4 −0
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 7mo ago by raphaelschmitz‭  ·  last activity 5mo ago by raphaelschmitz‭

c#
75%
+4 −0
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 7mo ago by Iizuki‭  ·  edited 2mo ago by Alexei‭

75%
+4 −0
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 9mo ago by matthewsnyder‭  ·  last activity 9mo ago by mr Tsjolder‭

75%
+4 −0
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 8mo ago by ggorlen‭  ·  edited 8mo ago by ggorlen‭

75%
+4 −0
JavaScript redirect is getting "hijacked" and it is not onbeforeunload event.

My redirect in javascript somehow gets "hijacked" and I don't understand how. Previous developer (who is no longer working with the company) on page load initialized onbeforeunload event like so: ...

1 answer  ·  posted 9mo ago by Vanity Slug ❤️‭  ·  last activity 7mo ago by Vanity Slug ❤️‭

75%
+4 −0
How to make Husky run git hook?

How to make Husky run git hook? I have a working git hook, prepare-commit-message, but the moment Husky was installed, the hook stopped working. Not finding much luck, I then tried to make it a "H...

1 answer  ·  posted 10mo ago by LAFK‭  ·  edited 10mo ago by Alexei‭

75%
+4 −0
How to use self referential N-M relationship to make 2 users friends using RedBean PHP ORM?

I am working with PHP and RedBean PHP ORM. I have a table user like so: id | username ---|--------- 1 | Alice 2 | Bob I want Alice and Bob to become friends. So I want to create M-M juncti...

0 answers  ·  posted 10mo ago by Vanity Slug ❤️‭

75%
+7 −1
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 10mo ago by matthewsnyder‭  ·  last activity 8mo ago by meta user‭

75%
+4 −0
DocuSign eSignature API SDK: java.lang.NoClassDefFoundError errors.

I am trying to implement DocuSign's eSignature REST API by using Java SDK. I am following instructions here: https://developers.docusign.com/docs/esign-rest-api/sdks/java/setup-and-configuration/ ...

1 answer  ·  posted 10mo ago by Vanity Slug ❤️‭  ·  last activity 10mo ago by Vanity Slug ❤️‭

75%
+4 −0
Postgres command-line variable substitution error

According to the psql (version 14) man page, it's possible to set variables using the -v command-line parameter, then use the variable in a query, automatically quoted correctly, with :'variable_na...

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

75%
+4 −0
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 11mo ago by matthewsnyder‭  ·  last activity 10mo ago by matthewsnyder‭

75%
+4 −0
When is it OK for duplication of information between message header and payload in a distributed software application?

A friend is involved in rewriting a distributed software application and while discussing the architecture, we noticed that in many cases the messages had duplication between headers and payload. ...

1 answer  ·  posted 11mo ago by Alexei‭  ·  last activity 11mo ago by Derek Elkins‭

75%
+4 −0
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 9mo ago by matthewsnyder‭

75%
+4 −0
Are there other reasons why useEffect might not be defined apart from not importing it?

I am creating a button that once clicked will change from off to on with react and i am also creating a responsive clock through useEffect. Yet the code still return that useEffect is undefined th...

2 answers  ·  posted 11mo ago by Brian‭  ·  last activity 11mo ago by jmathew‭

75%
+4 −0
Can Matlab packages have subdirectories?

I'd like to organize my Matlab packages into folders. However, if I try to lay out my code like this +MyPackage |---foo.m |---SubDir |---bar.m then I'm unable to reach bar. F...

1 answer  ·  posted 12mo ago by zaen‭  ·  last activity 12mo ago by zaen‭

75%
+4 −0
How to define custom configurations in new-style .csproj?

Problem I'm trying to update some projects from old-style .csproj: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.mi...

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

75%
+4 −0
Static and thread_local initialization order

Is there any guarantee regarding initialization of static and thread_local objects? In example, is there any guarantee about the value printed by the following program? #include<iostream> s...

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

75%
+4 −0
Resize HTML canvas with respect to inner content

I am currently making an esoteric language which requires a theoretically infinite canvas. Basically, it should be able to resize and fit the contents of the drawing in and outside it's existing bo...

0 answers  ·  posted 3y ago by Razetime‭

75%
+4 −0
Capture args from repeatable flags in Golang pflags package

How do I create a flag that can be used multiple times in a command using the pflag package? For example, let's say I wanted to select multiple fields and did not want to have to use comma-separati...

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

75%
+4 −0
Is there a way to automatically fix MySQL tables where the auto_increment has fallen behind the correct value?

Due to a series of unfortunate events I have some tables where the auto_increment value got behind what it should be. If the auto_increment value is 9 and there are 20 rows in the table the next 1...

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

75%
+4 −0
Unable to `mount` overlayfs in Docker container when inside a LXC with a ZFS pool

Summary/Context I'm currently working to improve performance and throughput of our automation infrastructure, most of which is a combination of Bash/Shell scripts, Python scripts, Docker, Jenkins,...

1 answer  ·  posted 3y ago by ghost-in-the-zsh‭  ·  last activity 3y ago by ghost-in-the-zsh‭

75%
+4 −0
How to reason about transaction isolation during development

Consider the following code: public class OnlineShoppingService { @Transactional public void cancelOrder(String id) { if (shipmentRepository.findShipmentForOrder(id) != null) { ...

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

75%
+4 −0
List what file(s) an identifier was declared in?

I'm using Doxygen to help me figure out some library code. There's an enum I know I need to use, but I don't know which file it's declared in. Searching for that identifier in Doxygen yields the p...

1 answer  ·  posted 3y ago by Hyperlynx‭  ·  last activity 3y ago by summea‭

75%
+4 −0
How can I add "withCredentials:true" for HTTP requests generated by Swagger UI?

I have added Swagger UI for an ASP.NET Core 3.1 application and I have realized that all endpoints requiring Windows Authentication fail. This issue is created by the fact that generated HTTP reque...

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

75%
+4 −0
Declaring interface members with generic return types: "The type parameter [generic type] cannot be used with type arguments"

I'm trying to write an interface to define the set of operations I expect my repositories' Unit of Work implementations to have, and I want this interface to be fulfilled by EF Core's DbContext cla...

2 answers  ·  posted 3y ago by Marc.2377‭  ·  last activity 3y ago by Marc.2377‭

75%
+4 −0
How do I communicate with a subproject in qmake?

When working with a qmake subdirs project you may want to share configuration between multiple projects. In a less common case you may including a external project within your own as code and want ...

1 answer  ·  posted 3y ago by dmckee‭  ·  last activity 3y ago by dmckee‭

75%
+4 −0
Why does bash seem to parse `sh -c` commands differently when called via `execl`?

When I do this in a shell: $ /bin/sh -c 'echo hello world' hello world it's my understanding that I'm running a process with argv = {"/bin/sh", "-c", "echo hello world"}. That is, the quotes c...

1 answer  ·  posted 1mo ago by Emily‭  ·  last activity 1mo ago by Emily‭

75%
+4 −0
Simplest way of getting failure notification emails from kubernetes

What would be the simplest (and most lightweight) way of getting email notifications of failures in kubernetes clusters. Mostly interested in failing pods, so notifying on certain kubernetes event ...

1 answer  ·  posted 1mo ago by Iizuki‭  ·  last activity 22d ago by Iizuki‭

75%
+4 −0
Why does `Zip` require `Semialign`

The Zip class from Data.Zip requires an implementation of Semialign: class Semialign f => Zip f In my mind: Zip takes the intersection of two shapes. Semialign takes the union of two sha...

1 answer  ·  posted 2mo ago by WheatWizard‭  ·  last activity 2mo ago by r~~‭

75%
+4 −0
How do you add "Sign In with Google" to a Ruby on Rails web application that is using the Devise authentication framework?

I want to add the ability to "Sign in with Google" into a Ruby on Rails web application, that is using Devise to handle authentication. How do I do that?

1 answer  ·  posted 2mo ago by Julius H.‭  ·  last activity 2mo ago by Julius H.‭

75%
+4 −0
Is there any rationale for the lack of local constants in PHP?

The last few years, PHP has basically exploded with lots of modern language constructs that makes the life easier. But local constants are still missing, and I find that very strange. I have found...

0 answers  ·  posted 3mo ago by klutt‭

php
75%
+4 −0
How can one import two classes with the same name in Java8?

Some development tools provide an error message when a user tries to import two things (classes, packages) with the same name. Some programming languages offer a syntax to import one of those thing...

2 answers  ·  posted 3mo ago by tarhalda‭  ·  last activity 15d ago by Michael‭

75%
+4 −0
Why is global evil?

Many languages discourage global variables. Why is this?

3 answers  ·  posted 28d ago by matthewsnyder‭  ·  last activity 26d ago by mavavilj‭

75%
+4 −0
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 3mo ago by matthewsnyder‭  ·  last activity 3mo ago by Karl Knechtel‭

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

By default Gitlab CI jobs run on any commit. I would like to restrict some of them to run only on commits to specific branches. How to do this in .gitlab-ci.yml?

1 answer  ·  posted 5mo ago by Iizuki‭  ·  last activity 5mo ago by Iizuki‭

75%
+4 −0
Wikidata: How do I ask for the start date of a property in SPARQL?

I have a SPARQL query to Wikidata that returns the names and handles and parties of politicians for whom a Mastodon address is stored at Wikidata. Filtered by nationality and with an output of the ...

0 answers  ·  posted 4mo ago by wasuko‭

75%
+4 −0
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 5mo ago by Karl Knechtel‭  ·  last activity 5mo ago by Olin Lathrop‭