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 »

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.

Activity for meriton‭

Type On... Excerpt Status Date
Answer A: Delete all occurrences of a character in a webpage with vanilla JavaScript
With the help of a little recursion, it's straightforward to go through all text nodes and replace their contents: ``` function replaceIn(e) { if (e.nodeType == Node.TEXTNODE) { e.nodeValue = e.nodeValue.replaceAll("a", ""); } else { for (const child of e.childNodes) { repl...
(more)
about 2 years ago
Answer A: Java cannot find class within same package
eclipse has a built-in compiler. When developping in eclipse (or any other Java IDE), you can run from eclipse, you can package as a JAR file from eclipse, and even run a full fledged maven / gradle build from eclipse. There is no need to ever run javac by hand when you have a Java IDE. One reason...
(more)
about 2 years ago
Answer A: Mocking methods with arguments
You mean, aside from giving the team that made `B` a stern talking to? ;-) You could introduce another layer of indirection, and mock that. For instance like this: interface MockFriendlyB { public void add(T arg); } class UnmockedB implements MockFriendlyB {...
(more)
about 2 years ago
Answer A: How to create an object, call one of it's methods and pass it as an argument as a oneliner?
It seems to me that you are hobbling yourself by making design constraints more absolute than they need to be. For instance: You don't want to change the code under test, not even a tiny little bit. You don't want to introduce a helper function, because helper functions clutter the code (is tha...
(more)
about 2 years ago
Answer A: How to unittest method that involves contacting remote servers?
> I'm actually mainly interested in testing foo() Ok, so let's do that. > I could make it public, but I really don't want to do that just so that the test class can access it Java has 4 different access modes: `private`, default access, `protected`, and `public`. The typical solution is to u...
(more)
about 2 years ago
Answer A: Why is my last input box not centering (class: powerwall-battery-input)?
To investigate such problems, open the developer tools of your browser, and use the inspect this element feature to inspect the bounding boxes of the various elements. in Chrome: press F12 to open dev tools click the icon at the very top left of the dev tools, which has a tooltip that reads ...
(more)
about 2 years ago
Answer A: Best practices in setting up a development & production environments
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 an SQL-Script, or code using the O/R-Mapper. Before deploying, we would generate SQL-Scripts for mig...
(more)
about 2 years ago
Answer A: Detecting if a user has stopped interacting with a web view for a certain time
The weakness of responding to idle state is that the app might be closed before the idle state is reached, and that a closing app might no longer be able to communicate with the outside world. Saving to local storage rather than remote systems may therefore be more robust and cheaper, allowing more f...
(more)
about 2 years ago
Answer A: How to prevent token from being refreshed
It's worth noting that logging out a user goes way beyond not fetching a token, because your UI needs to inform the user he is about to be (or has been) logged out. And if your UI closes or locks itself, it probably doesn't matter if it has a current token. So I'd handle this fully in the UI; for ...
(more)
about 2 years ago
Answer A: Can I set a memory limit for the .NET Core garbage collector to collect objects more aggressively?
Generally speaking, the frequency of garbage collection is a space / time tradeoff: collection effort live object size GC overhead ----------------- = ---------------- memory freed dead object size In defaulting to collect garbage only whe...
(more)
over 2 years ago
Answer A: Using nested paths vs. flat ones for API resources
Actually, while REST mandates a great many things, it does not constrain the structure of URLs. To wit: The paper that coined the term "REST" describes resource identifiers as black boxes, and makes no reference to their internal structure. In fact, if we take a strict reading of the REST architectur...
(more)
over 2 years ago
Answer A: Regarding the heap sort algorithm.
As you know, a max heap is a binary tree such that each parent is greater than its children. The most compact and efficient way to represent such a tree is an array, where each index corresponds to a node in the tree, numbered from the root, level by level, from left to right, as shown in the foll...
(more)
over 2 years ago
Answer A: Questions easily answered by studying a beginner-level book
How to ask says: > Do some research > > Before asking a new question, first take a look around. Has your question been asked before here on Software Development Codidact? You can do a search for keywords related to your question, or take to your favorite search engine to see if your answer is a...
(more)
over 2 years ago
Answer A: Specify framework / library version in the answer
We already have such a text field. In fact, we have several: The big one we type our answer into, and the small one we type our comments into. And this approach even allows to specifically express which part of an answer is version dependent, or to express disagreement about the designation. The o...
(more)
over 2 years ago
Answer A: Why did my question get a downvote?
I believe this should be answered by the downvoters on a case by case basis. Only they know the particular reason they downvoted that particular question. I am not a fan of canned feedback, because it often is overly generic and subject to interpretation. Often, more concrete feedback is both cle...
(more)
over 2 years ago
Answer A: Are general questions (hopefully resulting in comprehensive, 'canonical' answers) in scope
I think that questions about programming paradigms fall under the umbrella of "questions about software design or software architecture" and are thus on topic. There have also been several questions about OOP that remain open, including a very conceptual one. Granted, that last question met with a...
(more)
over 2 years ago
Answer A: Retrieve user details from service in Angular
There are quite a few bugs there :-) Let's start with with the big one: In Angular (and most client side web frameworks) requests to the server happen asynchronously. That is, when a method does an http call, the method doesn't wait for the response, but continues immediately. So when you do...
(more)
over 2 years ago
Answer A: What are the disadvantages of using static methods in Java?
If it were always better to use `static`, the language would have been designed to always assume `static`, or at least default to `static`. That the language defaults to making methods not static indicates that the designers of the programming language envisioned static methods to be rare. Java is...
(more)
over 2 years ago
Answer A: How much research effort is expected from the asker by the community?
> Should someone be warned when their question lacks for effort? Actually, we don't know about their effort. Nor do we actually need effort, itself. What we need are particular results of effort, and for these to be clearly communicated through the question. Thus, we should never write somethi...
(more)
almost 3 years ago
Answer A: How much research effort is expected from the asker by the community?
> How much research effort is expected from the asker by the community? The kinds of research I expect varies with the question type. Before asking us ... about concepts or the meaning of words, askers should spend some time (say, an hour) with Wikipedia and Google. to write code, askers sho...
(more)
almost 3 years ago
Answer A: What's the correct way to merge a branch and its dependent branch back to master?
> I think a branch is a set of commits and a commit is a set of deltas, so my concern is that merging feature-B to master would reflect only the work that is unique to feature-B Not quite: a branch is a pointer to the state of a repository at a particular point in time (as represented by the commi...
(more)
almost 3 years ago
Answer A: What is a good modern language to use for a Business Rules project?
Caveat When making a decision of such lasting impact, you should conduct your own evaluation according to the criteria that matter to you. This post does not attempt to replace such an evaluation, but perhaps highlight some things to consider, and some solutions to look at. Requirements The ...
(more)
almost 3 years ago
Answer A: Mixing "operational" database models with archiving ones in the database context
Generally speaking, switching data access technologies to avoid a naming conflict seems overkill. Doing that will increase the set of technologies contributors must be familiar with, and impede code reuse. So, how to solve the similar names part? I'd probably choose names that are obviously differ...
(more)
almost 3 years ago
Answer A: Do we need more specific up/down vote reasons for Software Development community?
I agree that these buttons should have tooltips explaining what the buttons are for. That would be far more useful than showing the result of a simple calculation on the displayed votes, and seems like a simple change to make. Making this site configurable would be ideal, but even a "this question...
(more)
almost 3 years ago
Answer A: What are the risks of using iFrame as a temporary migration step for an internal web application?
I think a lot of the bad press about iframes stems from W3C deprecating them in HTML 4 strict mode, which caused the herd of web developers to internalize that iframes are bad and should be avoided. However, this deprecation was due to accessibility concerns that have long since been resolved, an...
(more)
almost 3 years ago
Answer A: How to set text-align for whole column of HTML table?
In addition to what Moshi already told you: Among web designers, W3Schools has a somewhat tainted reputation, because it often makes things simpler than they really are. In my experience, this lack of accuracy often causes more wasted work than reading a more reputable source to begin with. My go-...
(more)
almost 3 years ago
Answer A: Etiquette for posting comments
> Should be avoided > > secondary discussions or debates on controversial points (please ask a question on meta). Just when is a discussion secondary? I think r used the term "digressive", which I find to convey the intent better. I get that we don't want to derail comment threads with lengt...
(more)
about 3 years ago
Answer A: Etiquette for posting comments
Proposal: > Can Include > Helpful feedback I'd refrain from restricting the topic of feedback, because there are many possible topics: Clarifying the question Explaining why OP would be better served by asking a different question Explaining how OP could have found a solution himself...
(more)
about 3 years ago
Question How are we supposed to give feedback for poor questions if such comments are deleted?
The question https://software.codidact.com/posts/281517 is currently voted at -3. I wrote several comments to explain why, so the author can hopefully ask better questions in the future. This morning, I found all but the first of these comments deleted without warning. Alexei gave the followin...
(more)
about 3 years ago
Question Is it worth using the Java Platform Module System in application code?
Is it worth using the Java Platform Module System introduced in Java 9 to structure application code? Given that the Java Platform Module System introduced in Java 9 doesn't manage dependency versions, I understand I still need a dependency management tool such as Maven - but if I am already using...
(more)
about 3 years ago
Answer A: Why often times data compression causes data loss?
> I understand data compression as making data structures nearer (if they are mere machine code without any abstract representation) or representing them in less and less abstract computer languages (from the "complicated" to the "simple"). Nonsense. Let's turn to Wikipedia for a better definit...
(more)
about 3 years ago
Answer A: How to properly deal with impersonation in a Web application? (security vs. usefulness for tech support)
My first instinct would be to track both identities, using one for access control, and the other for audit purposes. For instance, rather than storing: User createdBy; you'd store User createdBy; // for auditing User createdOnBehalfOf; // for access control All access con...
(more)
about 3 years ago
Question Why do I, a logged in user, have to solve a captcha to post?
You should know I am not a bot by now ;-)
(more)
about 3 years ago
Answer A: How to enable or disable a bunch of reactive form controls?
Actually, TypeScript is perfectly able to type check the code you posted. Here's what the compiler thinks: const functionName = disable ? "disable" : "enable"; // inferred type: "disable" | "enable"; this.form.get("foo")[functionName]; // inferred type: // FormControl["...
(more)
about 3 years ago
Answer A: Is there a problem in making Captcha an HTML builtin with an attribute setting which type of Captcha
As the comments in that thread mention, Captcha is a service, not mere software. The distinction is that Captcha are in an arms race with spammers, and must continually evolve to remain effective. In particular, many popular Captcha approaches have been made obsolete by advances in AI: The "disto...
(more)
about 3 years ago
Answer A: Dye all label asterisks Red with vanilla JavaScript
In HTML, style information is applied to elements; it can't be applied to individual characters in a text node. Therefore, if you want to style the `` differently, it needs a dedicated element. You can use a pseudo element for that, but since an element can't have two after pseudo elements, you c...
(more)
about 3 years ago
Answer A: What should healthcheck of an Web API application actually check?
> I am interested in a guideline to understand how dependencies are considered when building the healthcheck functionality for an API. Like any functionality, the implementation of this feature should be guided by specific requirements. Who will be using that feature? What for? For instance, i...
(more)
about 3 years ago
Question How to reason about transaction isolation during development
Consider the following code: public class OnlineShoppingService { @Transactional public void cancelOrder(String id) { if (shipmentRepository.findShipmentForOrder(id) != null) { throw new ConflictException("Shipped orders can not be cancelled!"); ...
(more)
about 3 years ago
Answer A: What is the latest, efficient way to create a login page in JAVA?
A login page is but the tip of the iceberg. For a login page to function, you need a way to store users and their passwords, verify passwords in a safe way, prevent the login form from being bypassed by requiring a login before accessing a protected resource, and thus designate resources as protected...
(more)
about 3 years ago
Answer A: Is it necessary for a build server to remove node_modules before an AOT build?
I suspect this is an outdated practice: Prior to npm 3, npm did not keep track of resolved dependencies, and npm install would try to reconcile the existing with the declared dependencies. Since `nodemodules` is not commonly under version control, this meant that the build would depend on hidden s...
(more)
over 3 years ago
Answer A: How can I make --reset-author the default?
Rather that doing `git commit --amend --date=` every time you commit, you can coalesce commits at merge time using `git merge --squash`. That said, for non-trivial topic branches, it is usually valuable to retain the commits in the topic branch to figure out why a particular change was made. For i...
(more)
over 3 years ago
Answer A: Is omitting braces for single statements bad practice?
Advantages of Mandatory Braces When in Rome, do as the Romans do. Since every popular coding standard for java mandates the use of braces, and every popular code style checking tool enforces their use, omitting these braces is highly unusual, making your code slightly harder to maintain for those...
(more)
over 3 years ago
Answer A: The size of the code format window is much too small.
Seconded. This looks accidental, since the height is set to 20em, but the line-height is set to 1.5em, resulting in 20/1.5 = 13 lines being displayed. I wonder what that line-height is for? I know of no code editor that uses an increased line height? I'd therefore consider both increasing t...
(more)
over 3 years ago
Answer A: Community feedback: What type of questions can I ask here?
> questions dealing with how to write software documentation This seems overly broad. I mean this would include Mark Bakers entire book, but technical writing has an established codidact community, hasn't it? Suggest to remove this from the list.
(more)
over 3 years ago
Answer A: Community feedback: What type of questions can I ask here?
> questions about which tools, frameworks, or technologies to use, unless they are directly related to development (e.g. code, schema changes documentation tools) Don't understand. Frameworks or technologies are always related to development, aren't they? Also, the double negative (in don't .....
(more)
over 3 years ago
Answer A: Community feedback: What type of questions can I ask here?
> questions about the system, network, or server administration Which system? I think it is clearer without "the": > questions about system, network, or server administration
(more)
over 3 years ago
Answer A: Community feedback: What type of questions can I ask here?
> questions asking for implementing a certain feature (or homework). You should include your (partially working) trials in the post asking to explain what a certain code does. A great many questions ask for help implementing a feature. That's not the problem. The problem is help-vampires, so I'd ...
(more)
over 3 years ago
Answer A: Community feedback: What type of questions can I ask here?
> questions about best practices as long as enough detail is provided to answer using external references or expertise consensus It's not a "detail" if it is essential, is it? Can we explicitly state which information is required? And why must references be "external"? What about: > ques...
(more)
over 3 years ago
Answer A: Community feedback: What type of questions can I ask here?
> questions about software design, software architecture, or modeling > questions related to software design/review - what item goes where when using a certain technology stack These seem redundant? And I have no clue what "what item goes where when using a certain technology stack" is supposed t...
(more)
over 3 years ago
Answer A: Community feedback: What type of questions can I ask here?
Overall feedback: > To better understand what is on-topic and what is offtopic, please read the following sections. followed by a total of 16 bullet points ... folks, no first time visitor will carefully read through 16 bullet points to get a sense of whether they are allowed to ask their quest...
(more)
over 3 years ago