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.

Posts by Derek Elkins‭

51 posts
75%
+4 −0
Q&A Differences between Haskell tools Stack and Cabal?

The short, broad strokes answer is that (modern) cabal-install uses a nix-style approach where there's a shared global cache, but you can have multiple versions of a package installed or even the s...

posted 3mo ago by Derek Elkins‭

Answer
75%
+4 −0
Q&A How do I filter an array in C?

First a meta note. Code golf isn't a great way to learn a language. It explicitly optimizes for something that generally isn't valuable (fewer bytes of source code) typically at the expense of aspe...

posted 3y ago by Derek Elkins‭

Answer
75%
+4 −0
Q&A Using http.get to get page from frontend

To start, Angular is a Single-Page Application (SPA) framework. This means your whole "site" is served from a single web page. Any apparent navigation within that site is just (Angular's) JavaScrip...

posted 3y ago by Derek Elkins‭

Answer
75%
+4 −0
Q&A Are there any downsides related to using Maybe or Optional monads instead of nulls?

This is mostly an addition to r~~'s answer which I mostly agree with. This elaborates on the "non-idiomatic" part a bit. Modern Java code doesn't have a problem using Optional. Why? Because Option...

posted 3y ago by Derek Elkins‭

Answer
75%
+4 −0
Q&A In the current development context (2020+), is there any reason to use database triggers?

This is somewhat of a non-answer because I also think the answer is mostly "no". I'll split kinds of triggers into three categories. 1) Those that only touch the affected rows, 2) those that addit...

posted 3y ago by Derek Elkins‭

Answer
75%
+4 −0
Q&A What are the drawbacks of using data snapshot testing?

This is more or less equivalent to a long used testing technique that I've commonly heard referred to as gold filing. The benefit of it is that it is very cheap to do, and it can catch even minor c...

posted 3y ago by Derek Elkins‭

Answer
72%
+6 −1
Q&A How to detach my terminal window from a program ran from it?

This is usually handled by the shell, so it depends on the shell. That said, the relevant command is named the same across many different shells. Namely, the disown command. You can probably enter ...

posted 3mo ago by Derek Elkins‭  ·  edited 3mo ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A Is it necessary for a build server to remove node_modules before an AOT build?

I can't really think of a compelling reason to remove node_modules as a matter of course. The most compelling one, is what you alluded to. If node_modules is "corrupted" in some manner, removing a...

posted 4y ago by Derek Elkins‭  ·  edited 4y ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A Why does a lack of object encapsulation constitute a security breach?

Let's pretend Java was a capability-safe language. Now let's consider the IDE scenario and imagine that we want to support Copilot-like AI plugins that use a 3rd-party service. To access these ser...

posted 5mo ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A Recursive traversal of composite tree of mutable "trait objects"?

A root.components field need not exist, so I'm not sure what you're hoping for. Also, I don't know if it's an issue with your description or your code, but the code will only return mutable referen...

posted 6mo ago by Derek Elkins‭  ·  edited 6mo ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A What does "parameterised type in the positive / negative position" mean in the context of invariant functors?

"Invariant" isn't really the right word to search, though that's clearly not obvious. The idea is that we have covariant functors where if we have a -> b we can make f a -> f b, and contravar...

posted 7mo ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A Where does the name of the `pure` function in the `Applicative` type class come from?

A direct answer to your question of where the name comes from is the paper that introduced Applicative functors, Applicative programming with effects (PDF). Quoting from there: The idea is that ...

posted 7mo ago by Derek Elkins‭  ·  edited 7mo ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A How to implement a relationship between 2 tables where the type of participation is mandatory and RESTRICT rule for both?

I would need to check, but I don't think PostgreSQL or most (any?) relational databases have a good way of expressing this "at most 8" constraint. It may be possible to express it in some way but p...

posted 1y ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A When is it OK for duplication of information between message header and payload in a distributed software application?

Nowadays DRY is usually with regards to code, not data. Regardless, even for data, DRY does not outlaw duplication, it just requires a single "authoritative" copy. There are certainly similar ideas...

posted 1y ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A Why is boolean value f (false) defined as a parsing-word while t (true) is not in Factor?

The answer is indicated on the page for f. Specifically, "[t]he f object is the singleton false value, the only object that is not true." In contrast, t is defined simply as SINGLETON: t where SING...

posted 2y ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A What allows a string slice (&str) to outlive its scope?

There are two things going on here. One which technically explains what's going on fully, and another potential misconception you have. For the former, &T implements the Copy trait regardless ...

posted 2y ago by Derek Elkins‭

Answer
71%
+3 −0
Q&A Transferring files from a legacy project to an existing one as varbinary

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...

posted 3y ago by Derek Elkins‭

Answer
70%
+5 −1
Q&A Can regex be used to check if input conforms to a very strict subset of HTML?

I mostly agree with the upshot of hkotsubo's answer, but I want to both tailor the answer more specifically to your question and give some more general advice. First, the restricted subset you desc...

posted 4y ago by Derek Elkins‭

Answer
66%
+2 −0
Q&A How to write a function that only accepts a list of `Error string` `Results` in F# on the level of types?

I'm pretty sure the answer is "no", especially in some reasonable way. If Result was defined in some object-oriented way, i.e. as an interface with Ok and Error being implementations of that interf...

posted 12mo ago by Derek Elkins‭

Answer
66%
+2 −0
Q&A In javascript is there really a good reason to never check for boolean true || false such as if(var){}else{}?

r~~'s answer is good, and I absolutely agree that the condition provided in the question is ridiculous and I've never seen anyone suggest it as a generic replacement for if(var). But I think the ac...

posted 8mo ago by Derek Elkins‭

Answer
66%
+2 −0
Q&A How to inject environment configuration values when deploying an Angular application in Kubernetes or similar infrastructure?

I'm not quite sure I see what the issue is. As far as I can tell, you could continue to do exactly what you're doing now, you'd just do the token replacement on the bundle.js when a container is pr...

posted 2y ago by Derek Elkins‭

Answer
66%
+2 −0
Q&A How can I create and modify a struct over iterations of a loop?

tl;dr: Use current_section.as_mut().unwrap() instead of just current_section.unwrap(). Ownership is a core language-supported concept in Rust and this means what might be a single method in most l...

posted 5mo ago by Derek Elkins‭  ·  edited 5mo ago by Derek Elkins‭

Answer
66%
+2 −0
Code Reviews Measuring arithmetic overflow checking overhead in C#

Benchmarking is hard and there are a lot of potential issues with your code. I agree with Olin Lathrop that you want at least a few seconds worth of run time, not just due to the potential for a lo...

posted 3y ago by Derek Elkins‭

Answer
66%
+2 −0
Q&A Best Practices for Precalculating Expensive Variables in Functions

If you want a best practice, I'm pretty sure the best practice is to do the straightforward and "naive" thing. From the perspective of OOP, your complaints are misguided. The unit of coherence isn'...

posted 2mo ago by Derek Elkins‭

Answer
60%
+1 −0
Q&A Why are model_q4.onnx and model_q4f16.onnx not 4 times smaller than model.onnx?

Going from fp32 to fp16 is done usually by essentially just rounding the weights. To this end, you should expect pretty close to a 2:1 reduction in size. (Of course, not everything is weights, but ...

posted 2mo ago by Derek Elkins‭

Answer