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)
I have a PHP program that does a SELECT and then updates some of the values based on an algorithm. Rather than updating one row at a time UPDATE example_table SET COLUMN_A = 1 WHERE primary_k...
Microsoft.Build.Evaluation.Project seems to have some rather odd ideas of what values to use when loading projects. In particular, I have a number of projects with the following dependency: <Pa...
I have a very large table that I need to iterate through with a PHP script and I can't do all of the results at once so I do it in sections with a LIMIT like for ($x = 0; $x < 10000000; $x += 1...
I am interested in performing a LEFT JOIN using LINQ-2-SQL when working with method call notation. This answer suggests a way that relies on GroupJoin but it is more verbose than expected: var le...
So I had a table with a primary key and a bunch of different columns. Columns A, B, and C were all unsigned ints (like the primary key column) and each column had a unique constraint I dropped the...
I have tables A and B and then I have a many to many join table with foreign keys to both called a_b. Neither foreign key can be null and the combinations for the foreign keys to A and B are unique...
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...
I need to drop all of the stored procedures from my MySQL database before I recreate them. How can I do so?
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...
I have a query that returns the owner of jobs on an SQL instance, select s.name as JobName , s.owner_sid , ISNULL(L.name,'AccessViaGroup') as LoginName --Trying to figure out how to turn that ...
In Dyalog APL, there's a predefined function in the dfns library to generate a matrix of permutations for a list of the numbers from 1 to n. I want to create the same functionality, except that it...
My project has the following set up for the production and preproduction ("clone") environment. Production is not accessible at all for the development team, only the preproduction database. Pr...
I am working on an Angular application using ngrx and I have a loader state + reducer that is used to display a loader. However, very short AJAX calls cause a flicker and I need to delay showing th...
I'm trying to create an encrypted¹ zip archive using bsdtar. Here's where I got stuck: bsdtar -c --options='zip:encryption' --passphrase "secret" -f test.zip test This is the error I get: bs...
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...
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 ...
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...
Which concept is best for managed background services? 1. RunAsync(CancellationToken): interface IWorker { Task RunAsync(CancellationToken cancellationToken = default); } ... IWorker worker =...
Can a Go package name validly contain a hyphen and/or an underscore? The godocs say that By convention, packages are given lower case, single-word names; there should be no need for underscores or...
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...
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...
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...
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...
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...
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...
I want to use LazyCache and UnityContainer together in an ASP.NET classic application (.NET framework 4.6.1+). Namely, to be able to inject IAppCache in various services. For ASP.NET Core and its d...
If one is using SASS to build a websites CSS and using version control one can either, Keep both the SASS and the resulting CSS files in version control. Only storing the SASS files in version con...
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...
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 ...
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...
Sometimes, either to reduce the amount of typing big table names or when joining a table to itself one will need to alias a table. Personally I find SQL statements with aliases harder to read and a...
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...
I have following setup: flutter plugin with an example app the plugin depends on a native library (flutter_plugin.podspec contains s.dependency 'native-lib', '0.1.0') for local development I pull ...
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)...
I have two tables with millions of records. Every so often I need to join them and exclude just a handful of records where a bit(1) column is set to 1 instead of 0. I can do it with either, WHERE ...
Context: Azure; Windows Server 2012; IIS 8 First up, here's the (redacted) web.config for reference <rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="false"&...
I have JSON that looks something like this: {"id":"n-fsdf-6b6", "name":"JohnSmith", "revisionDate":1591072274000} The JSON data is named CharacterInfo. It comes from a static external URL. The str...
I'm using Jenkins with a branch parameter to specify the branch to build from. Other stuff downstream needs the branch name to not have the leading "origin/" -- just "feature/blahblah" or "bugfix/1...
I have noticed some time ago that Entity Framework assumes a CASCADE behaviour (implicit value, if not specified) for referential constraints (FKs) when deleting items. This means that by default, ...
Say I want to implement a very basic group chat application. I use the H2 database, a user class, a controller, and a text file in the Resources folder that stores the chat texts. All texts would b...
I'm experimenting with different operators and have a hard time understanding the outcome of certain expressions. I try to combine the ++ operators with other operators such as assignment in the sa...
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...
I am training the following model using Keras as shown: model = tf.keras.models.Sequential([tf.keras.layers.Conv2D(64, (3,3), activation='relu', input_shape=(256, 256, 3)), tf.keras.layers.MaxPooli...
For holding ordered sets of keys, there are well-known data structures (the red-black tree, for example) that support O(log(n)) lookup and insertion algorithms. Of course this means that there triv...
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 ...
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 ...
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) { ...
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...
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...
In the interest of learning from the mistakes of other people: What is the worst code you ever saw? What made it so bad?