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
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...
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...
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...
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...
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...
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...
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 ...
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...
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...
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...
"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...
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 ...
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...
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...
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...
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 ...
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...
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...
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...
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...
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...
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...
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...
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'...
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 ...
- ← Previous
- 1
- 2
- 3
- Next →