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.
Search
I need to load a site based on a cookie. I wrote code to validate that, like this. if(!isset($_COOKIE['cookie'])){ $domain = $_SERVER['SERVER_NAME']; setcookie('cookie', $cookie, time() ...
As a baseline, here's what we did in my last company: For tests, we used an in-memory database, whose schema was initialized by our object-relational mapper, with initial data loaded either from...
I understand that in object oriented programming, an object is an instance of a class. Not necessarily. JavaScript famously supported object-oriented programming but did not support classes un...
As with anything computer science-related that dates back to the 1960s and 70s, things just happened at a whim. Everything was new and highly experimental back then. Nobody knew how to write or des...
The standard does not talk about object files and/or linking, but it does talk about translation units. In typical compilers, a single translation unit translates into a single object file. Obviou...
Server-side solution If you can customize the server-side search functionality, you could add some logging information there. The advantages in this case are: store the data in a useful format ...
To use the identifier Node without typing struct Node, you must use a typedef: typedef struct Node{ // this here is a stuct tag int data; struct Node* next; // this has to be struct Node...
Following Alexei's comment I tried the following code which worked: window.addEventListener('keydown', function(event) { if (event.ctrlKey && event.altKey && event.key === 'l') ...
This isn't the cleanest approach but at least it works. One can define two different templates (each of them contains ItemsControl with single difference in ItemsPanelTemplate) and switch between ...
Based on my experience auto-mapping has some drawbacks: "find all references" not working as expected - anyone relying on the "find all references" functionality or similar will miss the impli...
The approach I would take given the constraints you've stated is to make much simpler and safer changes to Project A. Namely, 1) provide an API endpoint for fetching a file, and 2) provide an API e...
Our team is currently transferring all functionality (+ some changes) from small and very old project A (almost code freeze) to project B (actively developed). As part of the data migration, there ...
It's fairly obvious, but the greater the difference between the input object and the mapped output, the less valuable auto mapping becomes. The configuration and fluent syntax for the exception...
On this answer I just reacted with “works for me” with comment, but then retracted it because of what finally turned out to be a mistake on my end, and deleted also the comment (and thus the commen...
How to write a macro that discards the const qualifier, for any type? I hope some combination of typeof and a cast will do, but haven't found the combination. I tried this, without luck: #define...
Now, (x != 42) which is false yields 0 OK so far. so I have expected to get in console "-42" No. As you say, the expression evolves: (x == 42) * -1 + (x != 42) * x (1) * -1 + (0) * x...
I decided to tackle this again via the route of creating a new solution project-by-project, and this time the configuration manager actually did something useful. Specifically, it added a property ...
Misconception This isn't so much an issue of left/right alignment, as the browser beginning the rendering of each consecutive block wherever the content of the preceding block ends, instead of pas...
Since you ask if a CMS necessarily must be implemented using all three, the answer clearly becomes a theoretical "no" if a CMS can be implemented with anything less than all three, and a practical ...
If I execute in browser console: document.write("Hello"); A new DOM document with the text Hello appears in the same browser window. From MDN documentation: Note: Because document.write() w...
I propose that we add the following: Off-topic Questions about code golf, programming puzzles and challenges. Please use Code Golf instead.
I am trying to re-build an unpacked apk, because it was unpacked the required libraries are already included, deleting the prepacked libraries would be feasible if it weren't for the fact that some...
I try to exactly match a login page in a website, for a user script manager (USM) script, which I run with Tampermonkey. This pattern didn't work: // @match https://example.com/#/login ...
To use this StackExchange answer as a starting point, the latest POSIX standard does not specify a cc command at all: POSIX 1003.1-2001 (Single Unix v3) specifies c99 instead of c89, to use an u...
For the regular expression to only match a full field of hyphens, you have, as others already have explained, to put the ^ anchor at the begin of the regular expression and the $ anchor at the end ...