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 Moshiâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #284911 | Initial revision | — | about 3 years ago |
Answer | — |
A: Why are list comprehensions written differently if you use `else`? It's not a matter of order; Python simply does not directly allow `else` clauses as part of list comprehensions (docs). When we use ```python [num if num != 11 else 22 for num in hand] ``` We are actually using Python's version of the ternary operator; the `if` and `else` are not part of the ... (more) |
— | about 3 years ago |
Comment | Post #284844 |
@#36363 Actually, "body" just goes on the body element, but child elements inherit their CSS from it unless overridden. (more) |
— | about 3 years ago |
Edit | Post #284844 | Initial revision | — | about 3 years ago |
Answer | — |
A: Change font-family with JavaScript Without knowing your use case, the simplest modification would just be to target everything: ```javascript document.querySelectorAll("").forEach((e) => { e.style.fontFamily = "arial"; }); ``` (As an aside, if you want to target the body element, just use `document.body`. No need for sel... (more) |
— | about 3 years ago |
Comment | Post #284415 |
`textContent` (like it's name implies) only does text. If you want to replace HTML, you'll have to use `innerHTML` (more) |
— | about 3 years ago |
Comment | Post #284414 |
If you scroll down to "Using the standard libraries.", you can click on `stdlib.jar` to download the jar file (more) |
— | about 3 years ago |
Suggested Edit | Post #284413 |
Suggested edit: Made the title more specific, tagged (more) |
declined | about 3 years ago |
Comment | Post #283834 |
I updated the diagram to make it more clear. (more) |
— | over 3 years ago |
Edit | Post #283832 |
Post edited: Updated diagram |
— | over 3 years ago |
Comment | Post #283834 |
I regularly pull from the main branch, but I thought it would be the same regardless of which pattern I use, since I am pulling for updates basically every time I start working on the feature branch to make sure I'm on latest. So there would be a bunch of merges into the feature branch from main in b... (more) |
— | over 3 years ago |
Edit | Post #283832 | Initial revision | — | over 3 years ago |
Question | — |
Is it a good idea to have a permanent branch for a feature? I'm rather new to using git, so I'm not sure about the best practices regarding it. I have a feature branch branched off, and periodically when the feature needs to be updated I will add some commits to the branch and then create a pull request.[^1] Is it a good idea to have a permanent branch for... (more) |
— | over 3 years ago |
Edit | Post #283797 |
Post edited: Focused the title |
— | over 3 years ago |
Suggested Edit | Post #283797 |
Suggested edit: Focused the title (more) |
helpful | over 3 years ago |
Comment | Post #283671 |
@#8176 It doesn't do nothing, it puts the linked answer at the top *and then* sorts by score. It's only useless when there is only one other answer, but that's the same uselessness as when there is only one answer total in normal view. (more) |
— | over 3 years ago |
Comment | Post #283672 |
@#53242 Ah, merges do complicate things. I don't really think that there is a way around that though, at least with show-branch. The only workaround I can think of at the moment is using something like `git show-branch master topic^` to essentially undo the merge in the eyes of git-show-branch, but t... (more) |
— | over 3 years ago |
Edit | Post #283672 |
Post edited: Added disclaimer, this answer won't really do what OP wants but it is a method |
— | over 3 years ago |
Comment | Post #283672 |
@#53242 What do you mean by that? Anything past the common ancestor, basically by definition, will not differ between the branches (more) |
— | over 3 years ago |
Edit | Post #283672 | Initial revision | — | over 3 years ago |
Answer | — |
A: How do I ask git-show-branch to display a commit range? According to the docs, you could use the `--more` flag If you just want to look at some commits past the common ancestor, then you can add the `--more` flag to it. From the git-scm docs for git-show-branch, > `--more=` > > Usually the command stops output upon showing the commit that is th... (more) |
— | over 3 years ago |
Comment | Post #283667 |
See also *[Answers order is changed when we access a specific answer by its direct link](https://meta.codidact.com/posts/283346)*
This link you have is an answer link, which floats the linked answer to the top. (more) |
— | over 3 years ago |
Comment | Post #283667 |
@#8046 That is intended. See *[Randomize order of answers with same score](https://meta.codidact.com/posts/277855)* (more) |
— | over 3 years ago |
Comment | Post #283669 |
and that would show up as
<pre><code><span class="hljs-keyword">import</span> std.stdio;
<span class="hljs-keyword">void</span> main(<span class="hljs-built_in">string</span>[] args) {
<span class="hljs-built_in">string</span> greeting1 = <span class="hljs-string">"Good"</spa... (more) |
— | over 3 years ago |
Comment | Post #283669 |
E.g. you could do (code taken from https://software.codidact.com/posts/283059/283196#answer-283196)
```
<pre><code><span class="hljs-keyword">import</span> std.stdio;
<span class="hljs-keyword">void</span> main(<span class="hljs-built_in">string</span>[] args) {
<span class="hljs-buil... (more) |
— | over 3 years ago |
Comment | Post #283669 |
This is an absolutely terrible idea, but you could theoretically do it manually (or install highlight.js locally)
I.e.
1 Take your code
2 Add in the `span`s either manually or by running highlight.js locally
3 Copy paste the result
4 ???
5 Profit. (more) |
— | over 3 years ago |
Comment | Post #283052 |
@#36356 Sure, I've added a section for that (more) |
— | over 3 years ago |
Edit | Post #283052 |
Post edited: Added solution, touched up a bit |
— | over 3 years ago |
Comment | Post #283050 |
Your dark callback is setting the attribute to "light". (more) |
— | over 3 years ago |
Edit | Post #283052 | Initial revision | — | over 3 years ago |
Answer | — |
A: Why does Firefox block based on a restrictive default-src directive, when more specific, more permissive *-src exist? Each header is checked independently Having multiple Content Security Policy headers can only make it more restrictive I assume that each `Content-Security-Policy:` line you have is a separate CSP header. If you send each separately, then a source will be checked on each CSP separately. For ... (more) |
— | over 3 years ago |
Comment | Post #283015 |
@#8049
The headers are applied independently; default-src is the fallback *within the header*.
So for an inline style, we check the first header:
```
Content-Security-Policy: style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/;
```
All good here, we have 'unsafe-inline'. We then ... (more) |
— | over 3 years ago |
Comment | Post #283015 |
[Multiple Headers can only be more restrictive](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#multiple_content_security_policies)
I assume that each `Content-Security-Policy:` line you have is a separate CSP header. If you send each separately, then the `default... (more) |
— | over 3 years ago |
Edit | Post #282895 |
Post edited: Added some headers to make it look nice |
— | over 3 years ago |
Edit | Post #282895 |
Post edited: |
— | over 3 years ago |
Edit | Post #282895 | Initial revision | — | over 3 years ago |
Answer | — |
A: What's the difference between =, == and === operators in JavaScript? Assignment `=` `=` is the assignment operator. There's nothing much to say here. Abstract Equality `==` `==` is abstract equality - it will attempt to perform a type conversion before evaluating equality. E.g. ```javascript 1 == '1' 1 == true null == undefined ``` Objects only ... (more) |
— | over 3 years ago |
Comment | Post #282673 |
That specific post was created by a now-deleted user, which might be the cause of the error. (more) |
— | over 3 years ago |
Edit | Post #282488 | Initial revision | — | over 3 years ago |
Answer | — |
A: Why use an asterisk after a type? > Here I used asterisk after Node. Actually, why asterisk used for? What if I don't put any asterisk after Node (Both Node are structure). It's a pointer. A pointer, like its name implies, points to an actual object in memory. (More technically, it holds an address to the memory location). I... (more) |
— | over 3 years ago |
Edit | Post #282231 |
Post edited: Added language to the code block for syntax highlighting |
— | over 3 years ago |
Suggested Edit | Post #282231 |
Suggested edit: Added language to the code block for syntax highlighting (more) |
helpful | over 3 years ago |
Edit | Post #281660 | Initial revision | — | over 3 years ago |
Answer | — |
A: How to set text-align for whole column of HTML table? You cannot set `text-align` on a column element (Well, you can, but it won't have any effect) There are only a couple of properties that have an effect, namely `border`, `background`, `width`, and `visibility`. If you need to style a column outside of those attributes, MDN notes some pos... (more) |
— | over 3 years ago |
Comment | Post #281511 |
The question begging to be asked is "how?" There isn't, afaik, a standard for "password cookies" (which is a terrible name to refer to the session cookies that I assume you mean). (more) |
— | over 3 years ago |
Edit | Post #281348 |
Post edited: Fixed typos (missing semicolon in escape code, it's -> its) |
— | over 3 years ago |
Edit | Post #281348 | Initial revision | — | over 3 years ago |
Answer | — |
A: How to inhibit auto link generation? Method 1: `` (or other HTML tag) It appears that Markdown isn't detected within HTML tags, so you can wrap the URL-like in a span or other tag and it won't turn into a link. `dead.sh` -> dead.sh `dead.sh` -> dead.sh etc. Method 2: `.` (period escape) You can also escape the peri... (more) |
— | over 3 years ago |
Comment | Post #281036 |
Increasing the height of the enclosing `p` element by setting `padding: 1px` fixes the issue, though I'm still not sure of the cause. Therefore, it seems that for whatever reason, the borders are getting clipped by the element below them. (more) |
— | almost 4 years ago |
Comment | Post #280607 |
@Alexei I don't know if it's still the case, but cross-site duplicates weren't supported. (more) |
— | almost 4 years ago |