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 r~~
| Type | On... | Excerpt | Status | Date |
|---|---|---|---|---|
| Edit | Post #296489 | Initial revision | — | about 1 month ago |
| Answer | — |
A: Can all compiler errors be caught by language server? Compilers raise many errors other than syntax errors. A compiler can act as a language server and expose all of the errors it raises through that interface. Not many compilers do this yet, but in principle nothing stops them from doing so. At our current point in history, though, a compiler is ... (more) |
— | about 1 month ago |
| Edit | Post #296350 | Initial revision | — | 2 months ago |
| Answer | — |
A: How to apply a unit constraint in SymPy From the documentation for `solve`: > If any equation does not depend on the symbol(s) given, it will be eliminated from the equation set and an answer may be given implicitly in terms of variables that were not of interest: > > ```python > >>> solve([x - y, y - 3], x) > {x: y} > ... (more) |
— | 2 months ago |
| Edit | Post #296227 | Initial revision | — | 4 months ago |
| Answer | — |
A: How do authors of custom URI schemas prevent conflict with those registered with IANA in the future? Section 3.8 of Mr. 7595, Request For Comment (RFC) includes the following advice (emphasis mine): > Some organizations desire their own namespace for URI scheme names for private use (see Section 6). In doing so, it is important to prevent collisions and to make it possible to iden... (more) |
— | 4 months ago |
| Edit | Post #296178 | Initial revision | — | 4 months ago |
| Answer | — |
A: Configure Git branch to push to different remote than it pulls from `pushRemote` is not exclusive to `gh`. From `man git-config` (or the documentation website): > `branch..pushRemote` > > When on branch ``, it overrides `branch..remote` for pushing. It also overrides `remote.pushDefault` for pushing from branch ``. When you pull from one place (e.g. yo... (more) |
— | 4 months ago |
| Comment | Post #295402 |
`NDArray` appears to be defined as a trait, not as a match type, so I don't think the two examples are analogous. There are lots of ways to potentially define that trait and implement it in `random_normal`, and the ones that come to my mind don't require any of the recent advances in Scala 3. How... (more) |
— | 7 months ago |
| Comment | Post #295402 |
I don't know what paper you're referencing, but in general, `S` doesn't contain all of the information in the value `shape`. A type that depends on `S` can therefore only use the information in the `S` variable, and not the information in the `shape` variable. A dependently-typed language could u... (more) |
— | 7 months ago |
| Edit | Post #295402 | Initial revision | — | 7 months ago |
| Answer | — |
A: Do Scala's match types implement full dependent types? Dependent types are types that depend on values. Scala's match types enable expressing types that depend on types. Scala's other type system features include path-dependent types, which allow types to depend on paths that represent values, but outside of literals and singletons, there is no way t... (more) |
— | 7 months ago |
| Edit | Post #294897 |
Post edited: |
— | 11 months ago |
| Edit | Post #294897 | Initial revision | — | 11 months ago |
| Answer | — |
A: How to pipe grep(1) and use compatible exit codes? Instead of trying to juggle conditional traps, it's far simpler to exit conditionally or send a signal when commands or command groups fail. ``` set -Eeuo pipefail shopt -s lastpipe Allow a subshell to signal the parent process for a fatal error. trap 'exit 2' USR1 if test -z "$"; the... (more) |
— | 11 months ago |
| Comment | Post #294729 |
I think you have it right! `Function<?, ?>` is the broadest function type. Each `?` represents whatever is least informative. For the output of a function, the least informative thing is that the function returns an `Object`. That's obviously correct, right? For the *input*, though, the least inf... (more) |
— | 11 months ago |
| Edit | Post #294729 |
Post edited: Minor clarification |
— | 11 months ago |
| Edit | Post #294729 |
Post edited: Add details about type parameter variance |
— | 11 months ago |
| Edit | Post #294729 | Initial revision | — | 11 months ago |
| Answer | — |
A: Trouble understanding java lambdas and generics Unbounded wildcards are not equivalent to `Object`. When you give `code` a type, you are typing the variable, not the value. So `Function code` means that it's valid to assign to the `code` variable any function value that can accept an `Object` and return an `Object`, and therefore it's valid... (more) |
— | 11 months ago |
| Edit | Post #291668 |
Post edited: |
— | over 2 years ago |
| Edit | Post #291668 | Initial revision | — | over 2 years ago |
| Answer | — |
A: How is this code "dividing" by a string? You very likely have a `pathlib` `Path` (or `PurePath`) object there. `pathlib` overrides the division operator to perform platform-aware path appends. ```py >>> import pathlib >>> pathlib.Path('/foo') / 'bar' PosixPath('/foo/bar') ``` (more) |
— | over 2 years ago |
| Edit | Post #291555 | Initial revision | — | over 2 years ago |
| Answer | — |
A: Why is the `Data.Int` type not a `Semigroup` in PureScript but `String` is? > Is this for purely technical reasons as there would have to be at least 2 Semigroup instances (for addition and multiplication), but type classes cannot be implemented multiple times for the same type? Yes, basically this. When there is more than one plausible way to interpret a type as an i... (more) |
— | over 2 years ago |
| Comment | Post #291533 |
Can you reproduce this with no other syntax rules in the buffer (you can clear the current buffer with `:syntax clear`)? I'm unable to but I'm using Neovim.
If not, can you use that to find the rule that conflicts? (more) |
— | over 2 years ago |
| Edit | Post #291514 | Initial revision | — | over 2 years ago |
| Answer | — |
A: How to iterate over numpy array axes in array slicing? `slice(None)` will give you a value that's equivalent to a bare `:` in slice syntax. So you can write, for example, ```python for i in range(4): print(newarray[tuple(slice(None) if i == j else n for j, n in enumerate([0,1,2,3]))]) ``` (more) |
— | over 2 years ago |
| Edit | Post #291490 | Initial revision | — | over 2 years ago |
| Answer | — |
A: In javascript is there really a good reason to never check for boolean true || false such as if(var){}else{}? ``` if(typeof(var) !== 'undefined' || typeof(var) !== null || var !== ''){}else{} ``` is a wild thing to write for anything other than a variable that takes either undefined, null, or a string as possible values. If you expect `someVar` to be a boolean, I don't know who would tell you tha... (more) |
— | over 2 years ago |
| Comment | Post #291228 |
Intuitively, sure, although it's not a very big intuitive leap if you have `bind h` and you know you want `bind (switch f)`. It's as mechanical as algebra once you're used to it. (more) |
— | over 2 years ago |
| Edit | Post #291228 |
Post edited: |
— | over 2 years ago |
| Edit | Post #291232 | Initial revision | — | over 2 years ago |
| Answer | — |
A: Why does `let map f = id >=> switch f` work in F#? > when I look at the type signatures, it is not supposed to work. The types work because they're parameterized. The types of the combinators involved are (renaming all parameters to be unique for clarity): ``` id : 'a -> 'a switch : ('b -> 'c) -> 'b -> Result (>=>) : ('d -> Result) ->... (more) |
— | over 2 years ago |
| Edit | Post #291228 |
Post edited: |
— | over 2 years ago |
| Comment | Post #291228 |
I don't think this particular formulation is typical in other FPLs—the `switch` combinator is a bit unusual. But it follows easily from your other definitions; I'll expand my answer to detail how. (more) |
— | over 2 years ago |
| Edit | Post #291228 | Initial revision | — | over 2 years ago |
| Answer | — |
A: How to implement `map` using the fish (>=>, Kleisli composition) operator in F#? > Is there a "cleaner" implementation similar to `map`'s? Yes: ``` let map f = id >=> switch f ``` This follows from two of your other equations: ``` map f = bind (switch f) g >=> h = g >> bind h ``` So if you want to get `bind (switch f)` out of `(>=>)`, you can start by maki... (more) |
— | over 2 years ago |
| Edit | Post #290805 | Initial revision | — | over 2 years ago |
| Answer | — |
A: Why does `Zip` require `Semialign` There's good reason to believe this is simply historical accident. The `Semialign` class came first, and used to include `zip` and `zipWith` directly. When those members were separated out into their own class, the motivation was types that had `align` but not `zip` (one example is `NEMap`), so `... (more) |
— | over 2 years ago |
| Edit | Post #290338 | Initial revision | — | almost 3 years ago |
| Answer | — |
A: What does "namespace" mean? A namespace is a category to which a name can belong. Think of family names for people: I may be friends with several Jims, and if only one of them is present I can just call him Jim. But if multiple are present, I can disambiguate which I mean by saying Jim Jones or Jim Smith. ‘Jones’ and ‘Smith... (more) |
— | almost 3 years ago |
| Comment | Post #290250 |
Have you read https://software.codidact.com/help/formatting? (more) |
— | almost 3 years ago |
| Comment | Post #290032 |
Yes, for a new file you need to run `git add -N foo.txt` first (short for `git add --intent-to-add`). This adds the file to the index but without any content, which allows `git add -p` to make a diff containing the whole file. (more) |
— | almost 3 years ago |
| Edit | Post #289969 | Initial revision | — | almost 3 years ago |
| Answer | — |
A: Set transform of SVG element `` does seem to be a bit finicky for this case, doesn't it? You can use `` if you set the `values` attribute on it instead of the `to` attribute, like this: ``` ``` (more) |
— | almost 3 years ago |
| Comment | Post #289831 |
After over a century of use, it's *not* an analogy, meaning ‘to behave like an electrical short circuit’; it's an idiom, meaning ‘to bypass’. Judging a newer application of the idiom by the etymological source of the idiom is kind of counter to the way language works, I think. (more) |
— | almost 3 years ago |
| Comment | Post #289831 |
I think you're overthinking the short-circuit connection to electrical engineering. ‘Short-circuit’ has been in use as a figurative expression meaning ‘to bypass’ in non-EE contexts since [at least 1900](https://www.google.com/books/edition/Intestinal_Obstruction/HzI4AQAAMAAJ?hl=en&gbpv=1&pg=PA53... (more) |
— | almost 3 years ago |
| Edit | Post #289579 |
Post edited: revert meddling |
— | about 3 years ago |
| Comment | Post #289628 |
I've not used Crossfilter before, but from scanning the documentation I would assume that this is a group in the sense of SQL's [`GROUP BY` statement](https://en.wikipedia.org/wiki/Group_by_(SQL)). (more) |
— | about 3 years ago |
