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)
The webpage example.com has an edit webpage (from which one can edit example.com itself). example.com/index.php?title=עמוד_ראשי&action=edit I want that after I click ALT+Shift+E, I would im...
Our team deals with a legacy application that relies on a rather old deployment process and infrastructure: we deploy the application on an environment very similar to the production called Clon...
I have a project Anonymised.Theme which contains XAML resource dictionaries for a theme. This is used by about a dozen applications which simply include it by merging <ResourceDictionary Source...
How do I delete contents of a specific field, if it matches a pattern, and there is nothing else in the field? I have a several GB tsv file, and I am interested in a specific field (72). If it cont...
I want use single layout xml file for two different activities in android. Is it possible? How can I do it?
This data tree is comprised of clickable buttons and I want to expose all branches, in a single action, instead of clicking each vertical arrow button anew. I have tried the following code which d...
Using Angular-IMask, I'm programatically updating the field that has IMask. So I'm getting the error: "Element value was changed outside of mask. Syncronize mask using mask.updateValue() to work p...
I wish to display the first and second branches of a link tree with JavaScript. I want to show these branches in a single action, instead of clicking each vertical arrow (link) anew. HTML examp...
When writing any form of custom function such as this: void func (int* a, int* b) Should I add code to check if a and b are null pointers or not? if(a == NULL) /* error handling */ When po...
I'm working on an integration with a proprietary (black box) system. There is some TCP communication that occurs between two microservices. I've managed to sniff the traffic and it's being sent in...
It would seem that the C standard library is a collection of diverse functions that pretty much just ended up in the standard by tradition or "accident", rather than through some careful plan or ra...
I was tasked with an assignment where I should get a box to move to the 4 corners of the viewport by hovering on a button. Most of the code is already finished except for figuring out how to get th...
I try to ignore paths in the Codeql code scanning file. But every scan it seems that scanning doesn't ignore these files, do you have any tips?
What does ptr() mean in this code? #include<stdio.h> #include<stdlib.h> void PrintHello() { printf("Hello\n"); } int Add(int a, int b) { return a+b; } int main...
I am trying to combine MVVM in WPF using Microsoft.Toolkit.MVVM. Somethings are working as expected. The text boxes bind to fields and update in both directions. The button command executes and cha...
I have a page to change the user password in my website, this page can only be used if the user have a logged in! The change password page have 3 inputs: Old Password, New Password and Con...
I have to migrate a bunch of text from an old application into a new one. Some of these texts contain HTML tags and entities (HTML editor was used) and now they do not want to support this in the n...
I have a code block like this: try { ... x.foo(); // This is the line that forces us to have the try block ... } catch (ArrayIndexOutOfBoundsException e) { logger.error(e.getM...
I was trying to initialize a simple two dimensional array as follows: const arrays = Array(3).fill([]); However, when I tried to push an entry into one of the arrays, it seems like it gets push...
The Caesar cipher is a substitution cipher in which the letters of an ordered alphabet are cyclically shifted by a given number. A detailed description can be found e.g. here. Let u be the index o...
Let's say I have this class I want to mock class A { public void add(T arg) { B b = A.getB(); U val = somefunc(arg); V ret = b.add(val); } } I have a spy o...
I had installed Ruby. rvm install 2.6.6 I had Ruby which version was 3.0.0. I had removed it. Then, installed 2.6.6. When I try bundle install I got no error. When I tried following command...
I am attempting to write a program to simulate Hunt The Wumpus in the K programming language. The game requires a grid that is created by the vertices of a Dodecahedron, which is cyclic and triangu...
I have two tables: Table1: Name Description Amount 123 Description123 123 456 Description456 456 789 Description789 666 101 Description777 101 133 De...
I'm trying to use H2O to serve a multi-file PHP website without routing—just having a separate PHP file for every page. The relevant part of my H2O config currently looks like this: paths: "/":...
I have the following scenario (in MySQL 8): CREATE TABLE `steps` ( `id` int NOT NULL AUTO_INCREMENT, `number` varchar(30) DEFAULT NULL, `parent_number` varchar(30) DEFAULT NULL, `timestamp` ti...
Assume I have this class Foo class Foo { private int x; void setX(int x) { this.x = x; } } And I have a Junit test like this: Bar bar; @BeforeEach void setu...
I'm facing rsync full syncs every once upon a time, I think it's because DST, notice an hour of difference: $ ls -l tier2/VIDEO-2020-06-17-15-10-27.mp4 /Volumes/KINSTON2/dat/laptop_kinstones/tier2...
Let's say I have this class: class myService { private boolean foo(T arg) { return arg == 42; } public Response bar(U arg) { if(foo(U.field)) { return Response.st...
I have some code connecting to an active directory via ldap. Something like this: public Response add(User user) { try { LDAPConnectionPool ldapPool = ldapConnectionPool.getPool();...
I am trying to check a JSON array for a certain element. However, when I try to instantiate a JsonElement to search the list for: JsonElement builderElement = JsonParser.parseString( "{\"disc...
I have an array friends = Array.new friends[0] = "Mad man" friends[1] = "hey" There's two ways to print it (using print or puts). At first I tried print print friends which gave: ["Mad...
I use the devise authentication gem for a Rails application and it's very convenient. Typically I want my users to confirm their registration by email. Therefore the User model looks like class U...
In Vim, it's possible to tell it to read from stdin instead of a file, by using vim -. This is so that you can pipe the output of one command into Vim, to view/edit it there. The problem I'm facin...
Is it legal ISO C to declare a function as noreturn with a non-void return type (but of course not actually returning)? As far as I can read from the standard, it seems legal. Example: noreturn ...
I've created a function that calls scanf passing a void pointer as argument: void read(const char *format, void *p) { scanf(format, p); } And tested it with different types: int n; read...
Background This is kind of a subquestion to How to properly use malloc? When allocating, there are basically two common ways of using the sizeof operator: int *p; p = malloc(n * sizeof *p); /...
Let's say I have a table with 10,000 rows and instead of selecting all of the rows at once I select 1,000 at a time like LIMIT 0,1000 LIMIT 1000,1000 etc. Without an ORDER BY statement the or...
I found a form I wanted to duplicate on a roof construction website. All my input boxes are centered except the last one that's a bit off and I cannot figure out why. Here is my code: HTML <...
I am interested in finding out all the aspects I need to cover in order to correctly assess if a user has stopped interacting with a web page. So far, I found the following: Idle Detection API -...
Consider this code: #include <stdio.h> int main(void) { static void *ptr; if(ptr == NULL) puts("It's NULL!"); } I wonder if this is guaranteed to print "It's NULL!" I know ...
I have an Angular application. The frontend has a mechanism that periodically fetches some information like this: ngOnInit(): void { setInterval( () => { this.http.get(... ).sub...
I am caching some very static information (changes once per day) in my ASP.NET Core application. This is normally done when needed ("lazy"). One such cache item is a 50K list of items that are tak...
Our team is finally focusing on writing more automatic testing and one of my ex-colleagues recommended to try out the Verify library. The tool does the following: runs the test and compares the...
There are a lot of articles and presentations that show little love for ORMs. This is mainly because some queries are so complex and heavy on the database that they lead to significant issues in p...
I'm starting a small site with some online tools. Tried to include Google Adsense but I initially got rejected because the site was still on construction. Yet I've seen in the forums that they are...
During a presentation of a pipeline configuration, a colleague showed a SonarQube integration and one of its reports. A warning was caused by overrunning the max value for the code complexity thres...
Our team will have to migrate an old application to use a new tech stack. One of the features involves the usage of HTML editors which serialized the content as HTML and I am able to see valid HTML...
I'm trying to write a MIME message to the console. ByteArrayOutputStream out = new ByteArrayOutputStream(); MimeMultipart replyMsg = mdnCreator.createMDNData(); replyMsg.writeTo(out); out.close...