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 |
---|---|---|---|---|
Answer | — |
A: How to distinguish between single and multiple file media? 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. ```sql CREATE VIEW IF NOT EXISTS "mediaread" AS SELECT "media"., count("file"."uuid") > 1 AS "ismultifile" FROM "media" LEFT J... (more) |
— | over 1 year ago |
Edit | Post #287571 | Initial revision | — | over 1 year ago |
Answer | — |
A: Should we allow answers generated by ChatGPT? 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 median human answer here. I'd say let's upvote and downvote answers per usual without any particular restrict... (more) |
— | over 1 year ago |
Edit | Post #287534 | Initial revision | — | over 1 year ago |
Answer | — |
A: Qt Button changes drastically when setting its `border-radius`. 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 are a way to override native style dependent painting with HTML-like drawing. Usually if you change ... (more) |
— | over 1 year ago |
Edit | Post #287445 | Initial revision | — | over 1 year ago |
Answer | — |
A: What does this function definition mean in Haskell? `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 that starts with the first argument to `fn` and continues with `fn x` applied to the remainder... (more) |
— | over 1 year ago |
Comment | Post #287357 |
Re-read my answer; the information you need to resolve your latest error is right there. (more) |
— | over 1 year ago |
Edit | Post #287357 | Initial revision | — | over 1 year ago |
Answer | — |
A: Why does my code show an error at deriving (eq)? (SOLVED) NEW ERROR: At SimpleEnigma & SteckeredEnigma constructors which I need help on :") `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 ```hs SimpleEnigma = SimpleEnigma rotor1 rotor2 rotor3 reflectorB offsets SteckeredEnigma = SteckeredEnigma rotor1 rotor2 rotor3 r... (more) |
— | over 1 year ago |
Edit | Post #287069 |
Post edited: |
— | over 1 year ago |
Edit | Post #287076 | Initial revision | — | over 1 year ago |
Answer | — |
A: Child div doesn't inherit parent's div background-color It's because of this rule: ```css { 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 of a parent element. Consider applying your default background color to the `body` eleme... (more) |
— | over 1 year ago |
Suggested Edit | Post #287069 |
Suggested edit: (more) |
helpful | over 1 year ago |
Edit | Post #286780 |
Post edited: |
— | almost 2 years ago |
Edit | Post #286780 |
Post edited: |
— | almost 2 years ago |
Edit | Post #286780 | Initial revision | — | almost 2 years ago |
Answer | — |
A: How to add vertical lines for visual separation in pandas plot 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: ```py ax = df.plot.bar() vlines = [2.5, 5.5] # x-positions of the group separators ax.vlines(vlines, 0, 1, transform=ax.getxaxistrans... (more) |
— | almost 2 years ago |
Comment | Post #285116 |
If the developers care—and I'd hope they do, although all my browsers block such things for myself—SSO widgets can be isolated on their own page and thus only track the people who want to use them, at the cost of one additional click for those people. (more) |
— | almost 2 years ago |
Comment | Post #286491 |
This is a command that'll need to be supported by the OS of the base Docker image you're using, which you haven't told us. This is more of an OS question than a Docker question. Might be more on topic at Linux Systems. (more) |
— | almost 2 years ago |
Edit | Post #286430 | Initial revision | — | almost 2 years ago |
Answer | — |
A: Is it possible to write protocols for enumerations in Python? 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 wrap the same int value. So an expression like `foobar == EnumProtocol.FOO` is never going to be true if `... (more) |
— | almost 2 years ago |
Comment | Post #286412 |
Comments aren't for extended conversation. If you have more questions about JavaScript that aren't duplicates of your previous questions, and you can make the effort to make them good questions (i.e., you've researched them elsewhere, you've experimented on your own, you've read any relevant error me... (more) |
— | almost 2 years ago |
Comment | Post #286412 |
The clues that tell me that the mentioned line is not actual JavaScript are the following:
* `css selector`—there is no JavaScript syntax that allows two words, outside of a string literal, to appear next to each other with no punctuation between them, unless one of the words is a keyword (which... (more) |
— | almost 2 years ago |
Comment | Post #286412 |
Looks like a nice set of notes. When you have learned JavaScript, you will be able to do more than enumerate things that you have gotten to work; you will also be able to explain why something doesn't work.
There is nothing invalid or pseudocode-ish about `const iframes = iFrameResize()`. That cou... (more) |
— | almost 2 years ago |
Comment | Post #286412 |
Frankly, yes, it is evident that you are still learning JavaScript. There's nothing wrong with that—we're here on this site to learn and to help others learn! And you're right that you will eventually master the language by making mistakes and remembering what you learn from them. But don't be over-c... (more) |
— | almost 2 years ago |
Comment | Post #286412 |
I didn't see the comments that were deleted in that thread, but in my opinion elgonzo's initial comment is absolutely correct, both with respect to the facts of the matter and with respect to the advice that ought to be given to a junior JavaScript developer who posted the code you did.
With respe... (more) |
— | almost 2 years ago |
Edit | Post #286412 | Initial revision | — | almost 2 years ago |
Answer | — |
A: What is Backus–Naur form as applied in computer programming? 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 and computer science, a grammar is a set of rules for determining whether a sequence of symbols (charac... (more) |
— | almost 2 years ago |
Edit | Post #286045 |
Post edited: |
— | about 2 years ago |
Edit | Post #286045 |
Post edited: |
— | about 2 years ago |
Edit | Post #286045 | Initial revision | — | about 2 years ago |
Answer | — |
A: Algorithmically generating the grid formed by the vertices of a dodecahedron (Hunt The Wumpus) 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 edge graph of the Platonic dodecahedron is the same as the edge graph of the subdivided cube. There ar... (more) |
— | about 2 years ago |
Edit | Post #285966 | Initial revision | — | about 2 years ago |
Answer | — |
A: Is it OK to use scanf with a void pointer? 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 conversion result. If this object does not have an appropriate type, or if the result of the conversion ... (more) |
— | about 2 years ago |
Edit | Post #285827 | Initial revision | — | about 2 years ago |
Answer | — |
A: Migrating HTML strings to a more secure alternative Switching from HTML to Markdown to minimize risk of HTML injection doesn't make a lot of sense to me, since most Markdown implementations support a subset of HTML inline anyway. The better ones control what subset of HTML to allow by using a sanitizing library, such as (to take just one random exampl... (more) |
— | about 2 years ago |
Edit | Post #285752 | Initial revision | — | over 2 years ago |
Answer | — |
A: When stored procedures are preferred over application layer code? There are a few reasons for wanting to move computation closer to data. One is performance, which you've mentioned. Another is security. Databases enforce their own security boundary, and data that don't leave the database are data that can't be exfiltrated if your application layer is exploited some... (more) |
— | over 2 years ago |
Comment | Post #285541 |
I start my unit tests, point at my cache, and say, ‘Ha ha, you're so lazy!’
(Sorry.) (more) |
— | over 2 years ago |
Edit | Post #285303 | Initial revision | — | over 2 years ago |
Answer | — |
A: How can I modify the code above to accept string as user input and use strcmp to compare with the contents of the text file & then delete that line? Assuming you're actually looking for a substring of a line in the file and not a word (which would require, as @elgonzo indicated, figuring out how to deal with spacing and word boundaries in general), you should look up information about the function `strstr`. But also, `strstr` wants to accept a... (more) |
— | over 2 years ago |
Edit | Post #285223 | Initial revision | — | over 2 years ago |
Answer | — |
A: Problems with data structures and filestreams. My advice to you is to break this down into smaller problems and try to solve them one at a time, making sure you have a program that can compile and run at each step. First: figure out how to successfully read and write a single book. Write a function that reads book information from stdin and re... (more) |
— | over 2 years ago |
Comment | Post #285169 |
I'm, uh, not sure why I or anyone should take the opinions of unnamed, unlinked SO users more seriously than those of the authors of the very widely used software that I linked. But I think I'm going to check out of this argument now. Reader, make up your own mind how credible this claim is. (more) |
— | over 2 years ago |
Edit | Post #285204 |
Post edited: |
— | over 2 years ago |
Suggested Edit | Post #285204 |
Suggested edit: (more) |
helpful | over 2 years ago |
Edit | Post #285205 | Initial revision | — | over 2 years ago |
Answer | — |
A: How to clear the contents of a file? Simply opening a file for writing (using `fopen`) will clear it (‘truncate to zero length’, per the standard). Only opening a file in read or append mode will preserve its contents. See section 7.21.5.3 of a recent C standard (like this draft) to get it straight from the horse's mouth, or any of t... (more) |
— | over 2 years ago |
Comment | Post #285191 |
It's a badly worded question—the intent is clearly not ‘send an email with Ajax’; it's ‘use Ajax to submit data to the server’. Which is still confused, since ‘Ajax’ is nothing more than a somewhat obsolete name for a collection of web development patterns which includes techniques for submitting dat... (more) |
— | over 2 years ago |