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 |
---|---|---|---|---|
Comment | Post #285823 |
I probably won't make this into an answer, but if security is a high priority, I'd recommend using an internal representation that is simply incapable of representing malicious code. That is, rather than using a rich but complicated representation, like HTML, use a much narrower representation that s... (more) |
— | almost 3 years ago |
Comment | Post #285843 |
In my experience, avoiding implicit transactions a la `TransactionScope`, is generally a good idea. It's very easy to include things that you do not intend into a transaction using `TransactionScope`, e.g. logging messages. Newer versions of EntityFramework do a better job with giving the developer c... (more) |
— | almost 3 years ago |
Edit | Post #285857 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Why static code analyzers such as SonarQube indicate a high code complexity for switch statements? It depends on why you have a large `switch` statement. I'm going to assume it's because you have a large `enum`. If not, then you probably have some complicated logic, and you should endeavor to break it into a more hierarchical form. For example, if you 12 cases, you might be able to do a check to s... (more) |
— | almost 3 years ago |
Edit | Post #285779 | Initial revision | — | almost 3 years ago |
Answer | — |
A: When stored procedures are preferred over application layer code? (This answer became more ORM v. "direct" SQL. If you're very narrowly focused on just stored procedures, then it's not super important to me that the logic be packaged up in stored procedures. That said, if you aren't using something like an ORM to generate the queries, it's not clear to me what bene... (more) |
— | almost 3 years ago |
Edit | Post #285778 | Initial revision | — | almost 3 years ago |
Answer | — |
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 additionally read data from other rows/tables, and 3) those that mutate other rows/tables. The first cat... (more) |
— | almost 3 years ago |
Edit | Post #285758 | Initial revision | — | almost 3 years ago |
Answer | — |
A: What advantages does Agner Fog's VCL have over OpenMP? The point of VCL is to allow you to work with SIMD operations explicitly. OpenMP `simd` is more or less just a way to provide hints to the auto-vectorization the compiler is doing, so to some degree is still subject to "the compiler is unable to vectorize the code automatically in an optimal way", ex... (more) |
— | almost 3 years ago |
Edit | Post #285744 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Kotlin FloatArray from Iterable<Float> In your situation, the most obvious thing to do is use a for loop over the `Iterable` or the `Iterable.forEach` extension method depending on your preference, and directly `put` floats into the `FloatBuffer`. This avoids any intermediate data structure. Indeed, I'd do this directly over `myList` to a... (more) |
— | almost 3 years ago |
Comment | Post #285394 |
If you add a line to print out the string you are passing to `JsonParser.parseString`, I believe the problem will become clear. That said, at a higher level it seems round-about to produce a string of JSON only to parse it back into an object again. There's surely a way to build a `JsonElement` direc... (more) |
— | about 3 years ago |
Edit | Post #285393 | Initial revision | — | about 3 years ago |
Answer | — |
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 endpoint, if needed, that takes some kind of "timestamp" (real or logical) and returns a list of files (o... (more) |
— | about 3 years ago |
Comment | Post #285389 |
Do the files in Project A get updated in place or are they immutable once they are uploaded/created either because there isn't an API to make changes to the files or because any "updates" just make new files? (more) |
— | about 3 years ago |
Edit | Post #285232 | Initial revision | — | about 3 years ago |
Answer | — |
A: Behavior of Pointer Arithmetic on the Stack This is absolutely undefined behavior. The C standard doesn't say anything about stacks or how they should behave or how local variables should be allocated on them. The word "stack" doesn't even occur in the C standard^Feel free to do a string search on [this working draft version of the 2018 C s... (more) |
— | about 3 years ago |
Edit | Post #285179 |
Post edited: Slight typo |
— | about 3 years ago |
Comment | Post #285179 |
Yep. The server affinity stuff (aka as stickiness in the literature) is exactly the kind of thing I was thinking of with "depending on how the server is configured".
The scenario you describe makes it sound like latency isn't that big a deal (within reason) and that these complex computations are ... (more) |
— | about 3 years ago |
Edit | Post #285179 | Initial revision | — | about 3 years ago |
Answer | — |
A: Handling high frequency requests with cancellations in an ASP.NET Core application There are two issues here. A performance problem and a correctness problem. The approach you suggest seems like it will help mitigate the performance problem while doing nothing for the correctness problem. Having some way of cancelling the computation if the result is not going to be needed seems... (more) |
— | about 3 years ago |
Edit | Post #285178 | Initial revision | — | about 3 years ago |
Answer | — |
A: Dealing with GETs with long query strings in ASP.NET Core tl;dr Just use a POST. There's likely literally no reason not to in your situation. 1. REST is not a standard. 2. Being RESTful in and of itself is not a virtue. 3. I strongly suspect that your current code/API design violates the guidelines of REST more often than it follows them so there's lit... (more) |
— | about 3 years ago |
Edit | Post #284633 |
Post edited: |
— | about 3 years ago |
Edit | Post #284633 |
Post edited: |
— | about 3 years ago |
Edit | Post #284633 | Initial revision | — | about 3 years ago |
Answer | — |
A: Is it dangerous to use json.loads on untrusted data? Short answer: No, it's not dangerous. Short of bugs in the implementation or monkey-patching, there's no reason it would or should allow executing of anything other than the JSON parsing code. This Stack Overflow answer goes into detail for the actual implementation at that time. I didn't find any... (more) |
— | about 3 years ago |
Edit | Post #284566 | Initial revision | — | about 3 years ago |
Answer | — |
A: Is there any justification for having a single tempdb database to be used by all databases on a SQL Server intstances? I can't speak for the designers' motivations, but here are some possible reasons: It's simple. Having one tempdb for everything is likely simpler to implement and simpler to configure. It works. A lot of the time the shared tempdb isn't a problem. When it is, your links provide some mitigatio... (more) |
— | about 3 years ago |
Edit | Post #284565 | Initial revision | — | about 3 years ago |
Answer | — |
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 `Optional` is part of the standard library and has been since Java 8 (which is when it would have made most ... (more) |
— | about 3 years ago |
Comment | Post #284563 |
There's some benefit to recognizing something is a monad in C#. In particular, it can (and should) support (a subset of) Linq syntax. This can allow you to write stuff like:
```csharp
var result = from x in f(a, b)
from y in g(c, x)
from z in h(x, y)
select... (more) |
— | about 3 years ago |
Edit | Post #284319 |
Post edited: sql-server refers to a specific product, Microsoft SQL Server; a tag for sqlite seems appropriate; base64 doesn't warrant a tag |
— | over 3 years ago |
Suggested Edit | Post #284319 |
Suggested edit: sql-server refers to a specific product, Microsoft SQL Server; a tag for sqlite seems appropriate; base64 doesn't warrant a tag (more) |
helpful | over 3 years ago |
Edit | Post #283967 | Initial revision | — | over 3 years ago |
Answer | — |
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) JavaScript rewriting the DOM. Back in the day, when SPAs were new, you'd see URLs like `http://example.com/#pi... (more) |
— | over 3 years ago |
Edit | Post #283834 | Initial revision | — | over 3 years ago |
Answer | — |
A: Is it a good idea to have a permanent branch for a feature? Your first diagram illustrates a pattern that doesn't really make sense and most likely doesn't reflect what you're actually doing. Specifically, it illustrates a pattern where the feature branch never gets updated from the master/develop branch. I suspect in practice you merge updates from master/de... (more) |
— | over 3 years ago |
Edit | Post #283818 | Initial revision | — | over 3 years ago |
Answer | — |
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 aspects that are valuable (idiomatic code, readability, efficiency, effectiveness). On a less meta note, ... (more) |
— | over 3 years ago |
Comment | Post #283805 |
For this particular example, we could specialize `env` to an `int`, i.e. the row index. One thing you don't mention or illustrate but is fairly important is that this function will need to allocate memory. This also makes it not very idiomatic C. So taking `output` pointer as an input would arguably ... (more) |
— | over 3 years ago |
Comment | Post #283805 |
Other than illustrating function pointers, this answer doesn't seem particularly helpful and doesn't really illustrate good or effective practices while also leaving implicit some pretty crucial information. Starting with your approach, there are two major issues: 1) it seems to assume (without expli... (more) |
— | over 3 years ago |
Comment | Post #283805 |
I'm not sure what you're referring to as being O(n^2), but the filter itself is O(n). The filter and map, i.e. the submatrix extraction as a whole, is O(n^2) but could trivially be made O(n) with a constant time slice method. If you were referring to the algorithm as a whole, then efficient implement... (more) |
— | over 3 years ago |
Edit | Post #282925 |
Post edited: "compound variable" is not a common term nor worth a tag |
— | over 3 years ago |
Suggested Edit | Post #282925 |
Suggested edit: "compound variable" is not a common term nor worth a tag (more) |
helpful | over 3 years ago |
Comment | Post #282691 |
Yep, that works. Thanks. (more) |
— | over 3 years ago |
Comment | Post #282691 |
Can you include a reference to qmake in the title and/or body of the question and not just have the tag do this work? Without looking at the tag, the question seems too broad to be answerable, and it's only when one notices the tag that the scope becomes clear. (more) |
— | over 3 years ago |
Edit | Post #282688 | Initial revision | — | over 3 years ago |
Answer | — |
A: updating a function within a struct You are correct in your analysis (though I would not call `newb` a "parameter" but a captured variable). What you want is for the closure (anonymous function) to take responsibility for `newb` and not just borrow it temporarily. In other words, you want move semantics and not a borrow. As menti... (more) |
— | over 3 years ago |
- ← Previous
- 1
- 2
- 3
- 4
- Next →