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 Derek Elkins
| Type | On... | Excerpt | Status | Date |
|---|---|---|---|---|
| Edit | Post #295389 | Post undeleted | — | 8 months ago |
| Edit | Post #295389 |
Post edited: The matrix view was not quite right |
— | 8 months ago |
| Edit | Post #295389 | Post deleted | — | 8 months ago |
| Edit | Post #295389 | Initial revision | — | 8 months ago |
| Answer | — |
A: Constant-time modular multiplication library in Java? Standard Disclaimer: As always for this kind of thing, for production use, you should use an existing library written by experts to do as much of this as possible. Meta Note: I also highly encourage looking into ECC (and particularly Curve25519) as it has a lot of usability and performance ben... (more) |
— | 8 months ago |
| Edit | Post #295296 | Initial revision | — | 8 months ago |
| Answer | — |
A: how to run Vim's `:set` command using `vim --remote-expr` You could make a function to do what you want, but assuming you don't want to do that for some reason, you can use the `execute` expression. This takes an Ex command, so you can just do: ```console $ vim --remote-expr "execute('set invnumber')" ``` You may want to do: ```console $ vim... (more) |
— | 8 months ago |
| Edit | Post #295181 | Initial revision | — | 9 months ago |
| Answer | — |
A: Python http.server how can I programatically refresh the browser page? The typical solution is to inject some JavaScript so that the client can be notified of changes. Nowadays, you'd typically use Web Sockets for this so that the server can actively notify the client when changes are made. This leads to the quickest reaction to changes of the source files. The othe... (more) |
— | 9 months ago |
| Comment | Post #294076 |
This approach will only work for "value" objects, and even then it will have caveats, e.g. loss of numerical precision and the inability to handle objects with cyclic reference graphs. For example, this clearly won't work for a "service" object that holds, say, an open network connection.
This... (more) |
— | over 1 year ago |
| Comment | Post #294074 |
This question could be improved by making it more self contained by adding a one sentence description of a "shadow/shaded" class. Also, the tags `gradle` and `maven` seem irrelevant. You don't need to be using gradle or maven for this technique to be relevant. If you only want to consider the iss... (more) |
— | over 1 year ago |
| Comment | Post #284565 |
This is not a problem with `Optional`. It's a problem with `null`. You could just as well say that Java has a problem with `Integer`: there are the integers but also `null`. There are many well-known ways in which `null` doesn't accomplish the same thing as `Optional` and is worse, e.g. nested `O... (more) |
— | over 1 year ago |
| Edit | Post #280700 |
Post edited: |
— | over 1 year ago |
| Comment | Post #293984 |
Your digression with integration seems fairly nonsensical and a non sequitur, especially in this case. Finite summation is clearly a linear operation, so obviously we can just write $$\sum_{i=1}^n\frac{i+1}{2} = \frac{1}{2}\left(\sum_{i=1}^n i\right) + \frac{1}{2}\left(\sum_{i=1}^n 1\right) = n(n... (more) |
— | over 1 year ago |
| Comment | Post #293984 |
While we (computer scientists) do almost always only care about asymptotic complexity, it is totally reasonable to talk about exact operation counts. Without knowing the context of where the OP got these formulas, we can't say whether they were intended as asymptotic formulas (but then you'd usua... (more) |
— | over 1 year ago |
| Edit | Post #293932 | Initial revision | — | over 1 year ago |
| Answer | — |
A: Extracting Firefox Local Data Having looked up how Snappy compression works, I'm going to upgrade my comment to an answer as I'm almost certain this is what's happening. Based on the Firefox source code, it inserts `LSValue`s which are strings with some meta-information specifying how they should be stored. Relevant here i... (more) |
— | over 1 year ago |
| Comment | Post #293929 |
Looking at the schema of the `data` table and the source code of Firefox, I would check what the `compression_type` field is on the `data` table. If it is 1, then the field is compressed with Snappy compression. That might explain what you're seeing. From a relatively short glance at the source c... (more) |
— | over 1 year ago |
| Comment | Post #293912 |
@#8176 My comment was responding to your initial comment, not to the one immediately preceding my comment. Whether n^n is "empty" or not is generally considered a nonsensical question. Even within ZFC where *everything* is a set - and so the question is at least well-formed - it would depend on y... (more) |
— | over 1 year ago |
| Comment | Post #293912 |
@Lundin This is not ambiguous or even remotely unusual wording. Given the set {1, 4, 27}, say, the subsets of this set are {1,4,27}, {1,4}, {1,27}, {4,27}, {1}, {4}, {27}, and {}. The last is the empty subset. The sum of all the non-empty subsets would thus be 32, 5, 28, 31, 1, 4, and 27. (This e... (more) |
— | over 1 year ago |
| Edit | Post #293639 | Initial revision | — | over 1 year ago |
| Answer | — |
A: What is the advantage of creating instances from a method rather than constructor? There are at least two reasons I can see that would motivate this decision (and similar decisions generally), but first it pays to read what the documentation says. Quoting the pages you reference we have: > This constructor allows you to create instances by directly supplying the underlying ... (more) |
— | over 1 year ago |
| Comment | Post #293041 |
Actually, most programming languages *do* have an exclusive-or operator, namely inequality, e.g. `!=` in languages with C-style syntax. (more) |
— | over 1 year ago |
| Edit | Post #292981 | Initial revision | — | almost 2 years ago |
| Answer | — |
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't a function but a class. What's happening in the constructor should not be "unrelated code". Also, ... (more) |
— | almost 2 years ago |
| Edit | Post #292941 | Initial revision | — | almost 2 years ago |
| Answer | — |
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 the weights dominate.) Going from fp32 (or fp16) to an integral type is no longer simply a matter... (more) |
— | almost 2 years ago |
| Comment | Post #292701 |
Your first code example isn't really idiomatic modern JavaScript. With the `class` syntax, you can *and should* declare methods separately from the constructor rather than mutating `this` to add fields that happen to be functions. So you should have:
```javascript
export class MyProject {
... (more) |
— | almost 2 years ago |
| Comment | Post #292701 |
It's pretty unclear what you *want* the result to be. What I think is most likely is either 1) you want to explore the old-style way of making "classes" in JavaScript, or 2) you want to explore how OO can be mimicked with higher-order functions without using JavaScript's built-in OO features. Onl... (more) |
— | almost 2 years ago |
| Edit | Post #292685 | Initial revision | — | almost 2 years ago |
| Answer | — |
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 same version of a package installed with different versions of its dependencies. `stack` takes an a... (more) |
— | almost 2 years ago |
| Edit | Post #292663 |
Post edited: Mention nohup |
— | almost 2 years ago |
| Edit | Post #292663 | Initial revision | — | almost 2 years ago |
| Answer | — |
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 `help disown` for details relevant for your shell. Most likely it's `bash`, where the details are... (more) |
— | almost 2 years ago |
| Comment | Post #292311 |
I don't understand. The page you link to itself links to a definition on Wikipedia which gives the historical context. It certainly makes it clear that the answer to "is this something pytest invented" is "no". (more) |
— | about 2 years ago |
| Comment | Post #292291 |
This is more compelling, but it is also what `git merge/pull --verify-signatures` is for. If you expect all commits to be signed you can set the config `merge.verifySignatures` to true to have this happen automatically. In the case where you expect a mix of signed and unsigned commits, then you c... (more) |
— | about 2 years ago |
| Comment | Post #292291 |
Sure. If you have some reason to think the next merge/rebase may cause issues, getting the hash ahead of time may be a bit more convenient. That said, a `git fetch` won't change the `git log` output, so you could just as well `git log` before the `git pull`. If you meant to actually look at the l... (more) |
— | about 2 years ago |
| Edit | Post #292291 | Initial revision | — | about 2 years ago |
| Answer | — |
A: Is `git pull` dangerous? While any piece of software receiving input from an untrusted source is additional attack surface, generally speaking `git pull` is not a security threat. Three things happen when you `git pull`: a `git fetch`, a `git merge` or `git rebase` (depending on config), and any hooks you've defined m... (more) |
— | about 2 years ago |
| Comment | Post #292287 |
This first piece of advice doesn't make sense given the "danger". The correct advice would be to set the `pull.ff` and/or `merge.ff` config to `only` rather than use `--ff-only` all the time. (more) |
— | about 2 years ago |
| Edit | Post #292230 | Initial revision | — | about 2 years ago |
| Answer | — |
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 services, the plugins will need an API key. This is easy to accomplish. The plugin interface simpl... (more) |
— | about 2 years ago |
| Comment | Post #292142 |
I did say they were related. The difference is whether you use what GitHub has or you just give GitHub the output of a tool of your choice. As far as I know, GitHub Pages does not support server-side includes. If it does, then feel free to add an answer explaining how to use it with GitHub Pages.... (more) |
— | about 2 years ago |
| Comment | Post #292190 |
This answer doesn't seem to add anything beyond my answer, so I'm curious what value you saw in posting it. (more) |
— | about 2 years ago |
| Comment | Post #292143 |
I wouldn't say that "a lot of boilerplate" is a consequence of a declarative definition. It's a consequence of configuration languages often being extremely weak with little to no abstraction facilities. Often this is resolved by using full-blown programming languages, but those have many downsid... (more) |
— | about 2 years ago |
| Edit | Post #292153 |
Post edited: typos |
— | about 2 years ago |
| Edit | Post #292153 | Initial revision | — | about 2 years ago |
| Answer | — |
A: How can I create and modify a struct over iterations of a loop? tl;dr: Use `currentsection.asmut().unwrap()` instead of just `currentsection.unwrap()`. Ownership is a core language-supported concept in Rust and this means what might be a single method in most languages can multiply into several that differ in their behavior with respect to ownership.You ca... (more) |
— | about 2 years ago |
| Comment | Post #292149 |
This code doesn't do anything with the `current_section`s, i.e. it doesn't appear to store them in a `sections` array like the pseudo-code. Is that intentional? (more) |
— | about 2 years ago |
| Edit | Post #292142 | Initial revision | — | about 2 years ago |
