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)
A Q on Stack Exchange from a very long time ago included: I have first names in one column and second names in another, I want to create a third column that contains the first character from the...
A user of Web Applications asked how to: +1 when the value is >=5, +2 when the value is >=10, +3 when the value is >=15, +4 when the value is >=20, +5 when the value is >=25...
When using Result or Option to get a value, the value is wrapped in a Ok or Some. For example, with pattern matching to get a Result: let var: Json = match serde_json::from_str(&my_string) { ...
I have a function that which does some calculations. I would like to assign the result of the function to the global environment from within the function, how do I proceed? A minimal example: meanF...
A user of Web Applications asked "How should I fix the formula?" with reference to: =IF($K4<2,$K4) applied as a Conditional Formatting [CF] formula to J4:J8, where the desired (green fill) f...
A self-answered question - How to get DATEVALUE to recognize RSS 2 pubDate (RFC822)? - written by spcsLrg on Web Applications Stack Exchange offers this formula: =DATEVALUE(TRIM(REGEXREPLACE(A1,"^...
Given ColumnA contains a Text header (A1), an allowed maximum number (A2), fifty tickboxes (A3:A62) and a formula in A63 of: =countif(A3:A62,TRUE) how can I block application of more than the a...
I am looking to take a partial derivative of a sympy polynomial with respect to a symbol in the polynomial. In the sympy documentation for poly.diff(...) it gives sample code like this: from sympy ...
I'm trying to set up a simple test project, to unit test a change I'm working on. The change is to a file inside some existing project. I've tried to set up the includes as the original has it, but...
Currently, we have a CRUD plus reporting application that talks to one MySQL database. Intermittently users will report locks when searching, currently, I can only get the approximate time of when ...
I have a couple of 3d example projects in gcode for my printer but the printer bed has a couple of bumps in the center (where things are printed by default) and in order to print the objects I woul...
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...
In the interest of learning from the mistakes of other people: What is the worst code you ever saw? What made it so bad?
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...
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...
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...
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...
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)...
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...
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...
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 ...
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...
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>...
Which concept is best for managed background services? 1. RunAsync(CancellationToken): interface IWorker { Task RunAsync(CancellationToken cancellationToken = default); } ... IWorker worker =...
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?
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...
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...
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...
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...
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".
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...
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...
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...
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...
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, ...
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" ...
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...
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...
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...
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...
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...
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...
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...
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.
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...
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...
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...
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...
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...
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...