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 Moshi
This question probably stems from misunderstanding what case sensitivity is. Being case insensitive does not mean only allowing one case - in fact, it implies the opposite! If one case was treated ...
Use --add/-a to add a folder code <file> -n -a <folder>
RFC 3986 defines a suffix reference as follows (emphasis my own): 4.5. Suffix Reference The URI syntax is designed for unambiguous reference to resources and extensibility via the URI scheme. ...
Statements and expressions are two syntactic categories that are used by many programming languages. Since they are syntactic, they depend on the programming language's syntax. In a real sense, a s...
I installed Node.js using NVS to manage my node installations. This works great, except that I haven't been able to figure out how to debug using VS Code. When trying to launch, I receive this err...
You can cast the result of the expression to the desired type def load_json_data(filepath: str) -> Dict[str, Any]: with open(filepath) as json_data: return cast(Dict[str, Any], js...
The Code using Microsoft.EntityFrameworkCore; public class BloggingContext : DbContext { public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; } ...
I'm trying to do some DOM manipulation in jQuery, but am having issues with creating wrapper elements. For some reason, prepending to the wrapper doesn't work after I call wrap. Code <html>...
What's going on is that the compiler is deciding on what function to call at compile time rather than runtime. Since the type of vh is Vehicle *, it is essentially creating this call: vh->Vehic...
(Full code available for cloning here) I've run into some odd behavior of EF-core's Find method. It seems like the returned entity doesn't include the rest of the data. MWE Models using Micro...
The problem is that you are using row twice with different types. for row in self.diagram: # row is str here for row in self.seed_diagram: # row is list[str] here Renaming one or the other m...
My most recent question was tagged with interface-type. I had seen the interface tag when I was creating the question, but the usage information says Please avoid using this tag, as it is too g...
Consider the following method as an example: List<int> Foo() { // ... } Are there any disadvantages of returning an interface instead of a concrete implementation in C#? IList<i...
Grouping related items into modules is of course generally good practice, but it serves a practical purpose as well. The important part here is the #[cfg(test)] annotation. The #[cfg(test)] anno...
Why do we have the "Participate Everywhere" ability when we haven't yet done anything? Bootstrapping. Our communities are still small, so after we rolled out the abilities system we decided to p...
I've heard that in modern C++, smart pointers are preferred to raw pointers for ownership (the so-called RAII principle, as I understand it). This makes sense, and since then I've always used them...
Think of what your for loop is doing, specifically at iterations 11 and 12. for i in range(1,n+2): while not g(i): i+=1;continue a.append(i) In pseudo instructions: for-loop iterati...
What exactly is the Python Global Interpreter Lock (GIL)? As someone who is relatively new to Python, is this something I need to be aware of, or is this just some implementation detail of the inte...
From the docs Example to exclude everything except a specific directory foo/bar (note the /* - without the slash, the wildcard would also exclude everything within foo/bar): $ cat .gitignore...
tl;dr, the lifetime of "second" is static The heart of your confusion is this: Since we are taking a long-lived reference r to a string slice inner which is destroyed at the end of its scope, ...
From the Git docs "reset" copies the old head to .git/ORIG_HEAD To restore that commit, you can run $ git reset ORIG_HEAD If you want to restore more than one reset, then you'll have to l...
Say we have an abstract class Foo declared as so: class Foo { public: virtual void test() = 0; }; Let's say that we make a derived concrete class FooDerived, and decide to mark it's ve...
Let's say I have a variant that can hold a bunch of different types of values (say I got them from parsing a JSON or similar). using Value = std::variant<std::monostate, int, double, std::strin...
I was playing around with mapped tuples and came across an interesting case where TypeScript cannot infer the types used: interface Foo<A, B> { (a: A, b: B): any } function test<...
The problem is that the fill function is filling the array with references to the same empty array[1], and therefore modifying that array will affect every entry because all of them are actually th...