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 r~~
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 fo...
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 >...
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...
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 multip...
<set> does seem to be a bit finicky for this case, doesn't it? You can use <animateTransform> if you set the values attribute on it instead of the to attribute, like this: <animate...
No, you can't use and for this. In Python, a and b always, always, always means b if a else a. It cannot be overridden and cannot mean anything else. Likewise not, and any other boolean keywords, ...
As the walk documentation describes: When an array is encountered, f is first applied to its elements and then to the array itself In other words, walk is bottom-up. So when you apply your fi...
If systemd-run works for you, that is probably the simplest thing you can do here. Otherwise, you can use os.fork() from within Python to spawn a child that stays alive after the parent exits. If...
Use os.fork(). Example: import os import time pid = os.fork() if pid == 0: os.setsid() # Prevents the child from being killed if the parent dies time.sleep(10) os.system('some...
CPython only very recently started keeping a reference on frames to function objects internally, and that reference isn't exposed from inside Python. There's an old PEP that would have defined a _...
It isn't writable (but then again, neither are the dictionary views), but you might be interested in more_itertools.SequenceView.
Remember that jQuery selectors in general can match more than one element. If you had multiple <p> elements in your page, $('p').wrap(wrapper) would put wrapper divs around each of them. So ....
Chain of Responsibility doesn't strike me as appropriate for this problem, at least as I understand it. You want to use CoR if you have multiple different requirements for the processing of the sam...
IList<T> is not necessarily representative of the general case; it's an interface that is (A) widely implemented by a variety of classes from a variety of sources, which themselves (B) tend t...
You could trivially create a view that wraps the media table and includes a column that indicates if the media entry has more than one file associated with it. CREATE VIEW IF NOT EXISTS "media_rea...
Good question, but solid ‘meh’ on the issue. I don't think a preemptive ban is warranted. It's not as if we're being flooded, and it's also not as if that one ChatGPT answer is worse than the media...
See this comment: https://forum.qt.io/topic/60546/qpushbutton-default-windows-style-sheet#3 Stylesheets are a totally different beasts. The default native drawing doesn't use stylesheets. They ...
fn x [] = [] means that if the second argument to fn is an empty list, return an empty list. fn x (True:ys) = x : fn x ys means that if the second argument to fn starts with True, return a list th...
Eq is a type class, and type class names are capitalized (like types and constructors). Changing eq to Eq should get you past that error. Conversely, in SimpleEnigma = SimpleEnigma rotor1 rotor...
It's because of this rule: *{ background: rgb(3, 28, 87); } That applies the darker blue background to every element individually, and that isn't overridden when you change the background o...
I don't think this is possible using just the Pandas plotting API. You can use the lower-level Matplotlib API to do just about anything you can imagine: ax = df.plot.bar() vlines = [2.5, 5.5] # x...
There's one big difficulty with the proposed pattern. Enum instances are singleton instances of their particular class, and in general two enums from different classes are not equal even if they wr...
For writing pseudocode? No. BNF is a notation—in practice, a family of similar notations, like how Markdown is a family of similar markup languages—for defining grammars. In software development a...
Here is an animation of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the e...
From section 7.21.6.2 of this draft: [T]he result of the conversion is placed in the object pointed to by the first argument following the format argument that has not already received a conve...