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 Moshi‭

51 posts
75%
+4 −0
Q&A Why does RFC 3986 (URI generic syntax) declare the "host" component to be case-insensitive when the syntax rules show it to be case-sensitive?

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

posted 1mo ago by Moshi‭

Answer
71%
+3 −0
Q&A VS Code: How to open a file and folder in a new window?

Use --add/-a to add a folder code <file> -n -a <folder>

posted 7mo ago by Moshi‭

Answer
83%
+8 −0
Q&A Name for host + path (parts of a URL)

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

posted 8mo ago by Moshi‭

Answer
83%
+8 −0
Q&A What are statements and expressions?

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

posted 9mo ago by Moshi‭  ·  edited 9mo ago by Moshi‭

Answer
66%
+2 −0
Q&A VS Code can't find node installation due to dynamically setting the PATH

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

0 answers  ·  posted 9mo ago by Moshi‭

71%
+3 −0
Q&A How to resolve the mypy error "Returning Any from function declared to return 'Dict[str, Any]'" in Python?

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

posted 9mo ago by Moshi‭

Answer
71%
+3 −0
Q&A Updating the database reverses previous changes

The Code using Microsoft.EntityFrameworkCore; public class BloggingContext : DbContext { public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; } ...

2 answers  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by FoggyFinder‭

71%
+3 −0
Q&A Adding elements to wrapper after calling wrap doesn't work

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

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by Mithical‭

85%
+10 −0
Q&A How to define an object with different subclasses in an if-statement?

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

posted 1y ago by Moshi‭

Answer
60%
+1 −0
Q&A EF-core Find method doesn't include other entities

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

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 11mo ago by Sylvester‭

80%
+6 −0
Q&A What's causing mypy to give an `[assignment]` error in this nested for loop?

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

posted 1y ago by Moshi‭  ·  edited 1y ago by Moshi‭

Answer
75%
+4 −0
Meta interface and interface-type tags

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

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by Alexei‭

Question discussion tags
86%
+11 −0
Q&A When would one not want to return an interface?

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

3 answers  ·  posted 1y ago by Moshi‭  ·  last activity 11mo ago by matthewsnyder‭

84%
+9 −0
Q&A What is the purpose of grouping the tests in a `tests` module and is it possible to split them?

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

posted 1y ago by Moshi‭  ·  edited 9mo ago by Moshi‭

Answer
80%
+6 −0
Meta Participate Everywhere ability without meeting the requirements?

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

posted 1y ago by Moshi‭

Answer
81%
+7 −0
Q&A Is there any benefit to using new?

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

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by deleted user

66%
+4 −1
Q&A Create a list of Niven numbers in Python

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

posted 1y ago by Moshi‭

Answer
77%
+5 −0
Q&A What is the Python Global Interpreter Lock?

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

1 answer  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by Derek Elkins‭

Question python python-gil
80%
+6 −0
Q&A How to configure .gitignore to ignore all files except a certain directory

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

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

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

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

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
80%
+6 −0
Q&A Is it possible to undo a git reset?

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

posted 2y ago by Moshi‭

Answer
77%
+5 −0
Q&A Why can't a derived class add a const qualifier to a method?

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

2 answers  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by Dirk Herrmann‭

77%
+5 −0
Q&A How should one match a specialized version of a variant?

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

1 answer  ·  posted 2y ago by Moshi‭  ·  last activity 11mo ago by Baum mit Augen‭

Question c++ variant
80%
+6 −0
Q&A TypeScript is unable to infer the correct type for a mapped tuple

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

0 answers  ·  posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

75%
+4 −0
Q&A Why does pushing to one array affect all the arrays in my two-dimensional array?

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

posted 2y ago by Moshi‭

Answer