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

15%
+1 −14
What is the worst code you ever saw? [closed]

In the interest of learning from the mistakes of other people: What is the worst code you ever saw? What made it so bad?

1 answer  ·  posted 3y ago by meriton‭  ·  closed 3y ago by Mithical‭

60%
+1 −0
What is happening under the hood to the selected data in a MySQL cursor?

I have a number of MySQL stored procedures that use a cursor to go through a select and then pass the results to other stored procedures one row at a time. This can take a while to run, what is hap...

0 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Charlie Brumbaugh‭

66%
+2 −0
In MySQL, is it possible to disable triggers for only certain queries or users?

Almost every table in my DB has triggers that fire on INSERT, UPDATE, DELETE and write the changes to a separate read only DB. This makes it possible to track changes and undo things well after the...

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

62%
+3 −1
What is the difference between a hook and a code injection?

I would define a hook as: A piece of code which changes the response to a certain event, without changing the original code that caused the event How is that different than "code injection", if a...

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

83%
+8 −0
Is there a way to estimate the execution time of a statement in MySQL?

From time to time I will have large structural changes to make on my MySQL DB, things like adding columns, changing datatypes, adding indexes etc. These types of changes result in downtime and what...

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

82%
+12 −1
What is the difference between operator precedence and order of evaluation?

When doing something simple such as this int a=1; int b=2; int c=3; printf("%d\n", a + b * c); then I was told that operator precedence guarantees that the code is equivalent to a + (b * c)...

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

91%
+19 −0
Should a salt be stored in the same database as the hash?

To protect against dictionary and rainbow table attacks it is well known that passwords should be salted before hashing. The salt (unique to each password) gets stored with the hash, often in the s...

5 answers  ·  posted 3y ago by jla‭  ·  last activity 3mo ago by bencurthoys‭

66%
+2 −0
How to perform LINQ joins with multiple fields in a single join?

Note: this is an aggregate of the answer provided for this question. I want to get the LINQ equivalent of the following from SQL: SELECT .. FROM entity1 e1 JOIN entity2 e2 ON e1.field1 = e2.fie...

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

57%
+2 −1
How can I reduce the size of .svn folder?

Note: This question and its answer are an aggregate of the most up to date information about this topic from here. I have noticed that .svn folder has grown a lot and I want to reduce it. How can ...

1 answer  ·  posted 3y ago by Alexei‭  ·  edited 3y ago by r~~‭

71%
+3 −0
How long in days is a MONTH in MySQL?

If one finds where the past number of months equals the past number of days like this, select distinct DATE_SUB(now(), INTERVAL 92 DAY),DATE_SUB(now(), INTERVAL 3 MONTH) The numbers that are curre...

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

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‭

72%
+6 −1
Which abstraction should I choose for background services and why?

Which concept is best for managed background services? 1. RunAsync(CancellationToken): interface IWorker { Task RunAsync(CancellationToken cancellationToken = default); } ... IWorker worker =...

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

33%
+0 −2
How do I find all the tables in a database that don't have a specific column?

I need to add one column with the same name to all of the tables in my database, how can I find which tables don't currently have a column with that name?

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

50%
+4 −4
Is concatenation a logical AND?

As a person with no significant background in mathematics and computer science I thought that concatenation and AND are logically identical if not very similar because both add something to somethi...

3 answers  ·  posted 3y ago by deleted user  ·  edited 3y ago by deleted user

60%
+1 −0
In a stored procedure, is it possible to get the total number or rows updated by different statements?

I have a bunch of stored procedures that look like something this CREATE PROCEDURE example() BEGIN UPDATE STATEMENT A; UPDATE STATEMENT B; UPDATE STATEMENT C; END// When I run them thr...

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

40%
+0 −1
How do World Wide Web interactions happen in a general level? [closed]

I understand that any World Wide Web interaction works this way: Stage 1: Client (human or software) ⟶ User agent ⟶ HTTP/S web-server request (with an unresolved domain) Stage 2: ISP-initiated Rou...

0 answers  ·  posted 3y ago by deleted user  ·  last activity 3y ago by Alexei‭

web
80%
+6 −0
Is it recommended for ASP.NET Web API actions to always include a CancellationToken?

Note: This is basically a question from Stack Overflow that was closed for a very long period of time and I fear it might get closed again as primarily opinion based. I am wondering if my ASP.NET C...

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

50%
+0 −0
How to calculate the Hamming weight of a binary string?

A presently unanswered question on Stack Overflow asks: Does there exist a popcount function in libreoffice calc? and clarifies that "I often use BASE(A1;2;8) to show a number in binary".

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

50%
+1 −1
Count the number of occurrences in a text string

If I have some text in a cell, how can I find the number of times another piece of text appears in it? For example, suppose A1 contains Peter Piper picked a peck of pickled peppers.. pick occurs 2...

2 answers  ·  posted 3y ago by pnuts‭  ·  last activity 10mo ago by Dirk Herrmann‭

66%
+2 −0
How to protect the git respository for a public_html folder on a Linux server?

On a Linux server, if you leave the .git folder unprotected in the public_html folder, its possible that someone could download the folder and then gain access to your files. There are two ways I h...

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

66%
+2 −0
Nodejs wrap async function in synchronous function

I am writing a spoof of the fs module; the actual storage mechanism is not the the filesystem but rather a database. Overall, however, the api will function exactly like fs. So far my code is compa...

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

86%
+11 −0
Can regex be used to check if input conforms to a very strict subset of HTML?

Tldr; I don't need to parse HTML, but I need to check if user submitted input conforms to a very strict subset of HTML. Can regex be a suitable tool for this? Details I have a frontend sanitiser th...

4 answers  ·  posted 3y ago by jla‭  ·  last activity 3y ago by Stephen C‭

71%
+3 −0
Include a Blazor Webassembly project into an existing ASP.NET Core project

When creating a new Blazor Webassembly project, there is a checkbox ASP.NET Core hosted where if selected will create three projects at once, a blazor webassembly project, an ASP.NET Core project, ...

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

66%
+2 −0
Validating xsd schema that contains import from external http source in Java 11

In the example.xsd file I have an import to an external xsd file that looks like this: <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test.example.com" ...

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

71%
+3 −0
connect with SLOT/SIGNAL: QPushButton clicked signal not received by main window

I added a QPushButton to my ui file named pushButton, and manually connected it using connect. There are no errors or warnings emitted at any point in the compilation stage The button does show up...

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

81%
+7 −0
How do I customize merge behavior for a shared git repo?

I often find it useful to arrange things so that each commit on master's first-parent is a discrete change. It allows git log --first-parent --oneline to be used as a concise, automatically-generat...

1 answer  ·  posted 3y ago by ajv‭  ·  last activity 8mo ago by GrantMoyer‭

81%
+7 −0
Function call; `this` gets bound to unexpected value

I recently encountered a strange situation in javascript; if I have: let obj = { a: function() { return (this === obj) ? this.b : 'bye'; }, b: 'hello' }; I can call obj.a with this bound...

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

50%
+1 −1
How to temporarily disable a MySQL user?

Sometimes I will need to temporarily lock out other MySQL users when I am making large structure changes and want to make sure that nobody else is inputting or changing the data. The other use case...

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

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‭

60%
+1 −0
Access TypeScript class outside bundled code

I'm developing the design framework for a certain Q&A site. We are currently using an external dependency for the tag selector on the post editor, but it has some disadvantages (not fitting int...

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

77%
+12 −2
What gets allocated on the stack and the heap?

I was told by my professor/book that computer programs use two kinds of memory and that all variables get allocated either on the stack or on the heap. Is this true? How can I tell where a variable...

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

71%
+3 −0
What options can be set via swing.properties?

The default Swing look and feel can be set in $JAVA_HOME/conf/swing.properties What else can be set in this file? I can't find any other documentation of it.

1 answer  ·  posted 3y ago by ajv‭  ·  last activity 3y ago by Stephen C‭

77%
+5 −0
Is it unsecure to use a password on the command line to run a MySQL script on Windows?

Its possible to execute a MySQL file from the command line like so, mysql -u USER -pPASSWORD < FILENAME which triggers a warning, mysql: [Warning] Using a password on the command line int...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by ghost-in-the-zsh‭

86%
+11 −0
What is undefined behavior and how does it work?

I have created this sensational program: #include <stdio.h> int* func (void) { int local=5; return &local; } int main (void) { printf("%d\n", *func()); } This prints 5 even thoug...

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

80%
+6 −0
How are integers interpreted in contexts that expect a date?

I found a confusing construction in several stored procs in an MS SQL 2008 R2 database: DATEADD(dd, 0, DATEDIFF(dd, 0, some_date)) As I understand it, these are the relevant function signatures: D...

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

71%
+3 −0
Can renaming a MySQL column be sped up by dropping indexes or foreign keys?

I need to rename one column in 170 tables in a MySQL database and its going really slow. The columns all have an index plus a foreign key on them, would dropping the index/temporarily removing the...

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

77%
+5 −0
How does Caveat work?

One of the fonts available (to me) on Google Docs is Caveat. The following is in 18-point Caveat on Google Docs: I found that Caveat is available at https://github.com/googlefonts/caveat/tree/ma...

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

60%
+1 −0
How to upgrade a recent (>= 8) Angular CLI?

Angular CLI official page indicated how to install the CLI, but provides no information about how to upgrade it. I am interested in how to upgrade the CLI.

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

77%
+5 −0
Mapping generic handler to generic query in MediatR

I am using MediatR in an ASP.NET Core 3.1 application and I want use a generic query and a generic request that deals with getting lists of some standard items I am using in drop-downs and similar:...

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

66%
+2 −0
Xcode, SDL app showing in a single quarter of the window.

Why SDL (the Simple Directmedia Layer) apps are showing in a single quarter of the window, while the other three are blacked out, and what can I do about it? I'm using Xcode. I think this started h...

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

71%
+3 −0
Error: 18456, Severity: 14, State: 5; SSMS > Network sever from PC

I just completed my first install of SQL as a server-based, Enterprise Edition. I wanted to check it out using SSMS on PC using my Admin Access. But could not connect. For security reasons my adm...

1 answer  ·  posted 3y ago by James Jenkins‭  ·  edited 3y ago by Alexei‭

83%
+8 −0
How can I define a method on [&mut T] where T: MyTrait?

I'm trying to make a trait method callable on mutable slices of a type implementing that trait (see main). Rust doesn't like me for it. use core::convert::AsMut; trait A { type B; fn f(m: ...

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

86%
+11 −0
Does using an Integer have any speed/performance benefits over a string in JSON

I'm working on an API to respond some data about a bunch of orders and items. The order and item numbers are always an integer (it's the order.id and item.id value, respectively). Originally the re...

3 answers  ·  posted 3y ago by Welz‭  ·  last activity 3y ago by .                                                .‭

84%
+9 −0
Why don't format specifiers work with lists, dictionaries and other objects?

When I want to print a number or a string, I can use f-strings (Python >= 3.6) or str.format, and I can use just the variable between braces, or use format specifiers. Ex: num, text = 10, 'abc' ...

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

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‭

71%
+3 −0
How to calculate how much data is stored in a MySQL column?

I am considering either removing some columns or changing the datatypes if I could significantly reduce the amount of storage that is currently used by those columns. Some of the columns are ints a...

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

80%
+6 −0
How to store credentials for PHP scripts on a Windows machine?

I have a number of command line PHP scripts that are either run by a user or by Windows Task Scheduler. These scripts use DB and API credentials and I am wondering if there is a better way of stori...

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

90%
+18 −0
What must a C compiler do when it finds an error?

What exactly must a C compiler do when it finds a compile-time error? The most obvious kind of errors are language syntax errors, but the C standard also speaks of constraints, which are rules tha...

1 answer  ·  posted 3y ago by Lundin‭  ·  edited 2y ago by ghost-in-the-zsh‭