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 Canina
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Answer | — |
A: How to provide meaningful names for emails in Maildir? This is pretty much exactly what `formail` is good at. Specifically useful for this case, `formail` lets you extract headers, given an email message on RFC 822-esque format. In bash, if you have the name of a Maildir message file in `$FILE`, you can do something like this: $ FROM="$(form... (more) |
— | 8 months ago |
Answer | — |
A: grep AND search for multiple words in files Your `grep` invocation will first search for files which contain `foo` and print a list of the lines from each which contain the word `foo`; the second `grep` invocation will take this list and filter it down to only those lines of output which also contain `bar`. A complicating factor is that XML... (more) |
— | 11 months ago |
Answer | — |
A: How to proportionally convert a number in the range of -1 and 1 to a number in the range of 0 and 319 My initial approach would be to increase `n` by 1 (thus shifting the original range from -1..+1 to 0..+2), turn that range into 0..+1, and then simply map from that to your 0..+319 output range. float result = (n+1)/2 319; This will map -1 to 0; 0 to 159.5; +1 to 319; and your example +0.1... (more) |
— | over 1 year ago |
Answer | — |
A: Renaming GNU/Linux tag to gnu All three obvious current possibilities are problematic, but for different reasons. Ignoring the matter of how to format the tag name for a moment... GNU/Linux focuses on one (admittedly very important) part of the userland, plus the kernel, while ignoring other (also important) parts of the ... (more) |
— | almost 2 years ago |
Answer | — |
A: How to manage user-specific application data on Linux? The traditional approach is to create either a single dotfile, or a single dot-directory, directly under the user's home directory, named for your application. Thus `/.thromblemeisteradmin` (which could be a plain file or a directory containing any number of files). Sometimes a directory has a name s... (more) |
— | almost 2 years ago |
Answer | — |
A: How to delete contents of a specific field, if it matches a pattern and there is nothing else in the field The awk `gsub` function takes as its first argument a regular expression indicating the substring to be replaced, and replaces a matching substring with the value of the second argument, which is the replacement string. Since your regular expression, `/-/`, is not anchored, it will match anywhere ... (more) |
— | about 2 years ago |
Answer | — |
A: C++ exit code -1073740940 Nothing. Or anything. Or whatever you want it to mean. As a general rule of thumb: If you explicitly exit from a program with a specific exit status, then you know the meaning, or set of meanings, of that exit status value. This knowledge will inform your answer. If you don't exit fr... (more) |
— | about 2 years ago |
Answer | — |
A: Appropriate HTTP status code for "user confirmation required" I doubt that there is an actual standard HTTP response code to indicate exactly what you're looking for. `202` (Accepted) is close, but doesn't really seem to me to be about a situation where the client should resubmit the request; by the definition in the RFCs, it's more of a "the request has been a... (more) |
— | over 2 years ago |
Answer | — |
A: Regarding the implementation of data structures. Since this is pretty clearly a homework exercise, and the point of those is for you to learn, I'm going to be evil and not spoon-feed the answer to you. However, I will give you some pointers. First, consider what the `struct book` actually contains. What is the actual variable type of its memb... (more) |
— | over 2 years ago |
Answer | — |
A: Why would a form value inserted with value property won't be effective? It works fine for me. Here's a minimal working example: When I open that document in Firefox and simply click "display", "old value" is displayed in the alert popup. When I click "change" and then "display", "new value" is likewise d... (more) |
— | over 2 years ago |
Answer | — |
A: What is the difference between a decoupled, Headless and RESTful content management system? Since you ask if a CMS necessarily must be implemented using all three, the answer clearly becomes a theoretical "no" if a CMS can be implemented with anything less than all three, and a practical "no" if a CMS has been implemented with anything less than all three. REST designs have five constrai... (more) |
— | over 2 years ago |
Answer | — |
A: How to align my content to the left? Misconception - This isn't so much an issue of left/right alignment, as the browser beginning the rendering of each consecutive block wherever the content of the preceding block ends, instead of past the bottom of the preceding block. Issue - Since the text content of each text block doesn't r... (more) |
— | over 2 years ago |
Answer | — |
A: Hash sum mismatch (only for openjdk-11-jdk) "Hash Sum mismatch" printed by `apt-get` on Debian and derivatives means that the file as downloaded had a different cryptographic checksum (hash) than what's listed in the packages list. In this case, the package list is the one at http://us.archive.ubuntu.com/ubuntu/dists/focal-updates/main/bina... (more) |
— | over 2 years ago |
Answer | — |
A: How to initialize variable assignment in a non-OOP interpreter? I honestly have no idea why you feel that OOP would be necessary in order to keep track of variable assignments in a language interpreter. People wrote both interpreters and compilers long before object-oriented programming was even invented. It might help to start by going back to what a "variabl... (more) |
— | over 2 years ago |
Answer | — |
A: How do I filter an array in C? It looks like `filter()` effectively takes two arguments; the array to be filtered, and a predicate expression resulting in a boolean indicating whether the entry should be included in the output or not. (I also note that the implementation in your question appears to be at least O(n^2) time compl... (more) |
— | over 2 years ago |
Question | — |
Why does Firefox block based on a restrictive default-src directive, when more specific, more permissive *-src exist? I am working on a website which unfortunately uses a mix of linked and inline CSS and Javascript (and, even more unfortunately, I can't do a lot about the use of inline CSS and Javascript), and am trying to set up an appropriate Content-Security-Policy for it. When I serve the content (over proper... (more) |
— | almost 3 years ago |
Answer | — |
A: Using Software Codidact as a private community within a company You can, in a sense, do I believe even better than using Stack Overflow's hosted, proprietary service. You can run your very own instance of the Codidact software (that is, QPixel) locally, on a server fully under your control. The source code for QPixel is available on Github, along with insta... (more) |
— | almost 3 years ago |
Question | — |
How can I write an egrep (grep -E) regexp that matches lines containing two stanzas in arbitrary order? I have line-based data on the form ```` x1=y2; a3=b4; c5=d6; ... ```` Matching this with a extended regular expression is fairly straightforward; for example, one can do something not entirely dissimilar from ```` ^([^;]+; )x1=y2; ([^;]+; )c5=d6; ```` to match the `x1=y2` stanza anywh... (more) |
— | over 3 years ago |
Answer | — |
A: In MySQL is there a limit to the number of keys in a IN() clause? I'll readily admit I'm not too familiar with MySQL specifically, but personally, I would try to avoid listing all the primary key values in an ad-hoc query. What I would rather do personally is to run a separate query to select the rows to update, and then include a condition that the rows to be u... (more) |
— | over 3 years ago |
Answer | — |
A: Is omitting braces for single statements bad practice? > While \[the Apple "goto fail bug"\] is pretty interesting, it's anecdotal evidence. I understand that it's still possible to produce bugs like this. One could also reasonably argue that it could have been avoided if they used `else if` instead of `if` or didn't use `goto`. Aviation safety is bui... (more) |
— | over 3 years ago |
Answer | — |
A: What is our policy on tags? > 1\. What type of tags will we allow? (Should specific tags like UrlRewrite be allowed?) I would argue that urlrewrite (or perhaps more appropriately since Microsoft renders it as URL Rewrite, url-rewrite) is actually a specific case of the more general concept of url-rewriting. So is, say, mod-r... (more) |
— | over 3 years ago |
Answer | — |
A: Is an ORDER BY required when looping through MySQL records with LIMIT? Any time an SQL `SELECT` query does not have any explicit ORDER BY clause, I personally find it useful to mentally read it as saying "I don't care about ordering of the output of this query". If you make the decision that you don't care about ordering, then nothing will be affected if the ordering... (more) |
— | over 3 years ago |
Answer | — |
A: dig -6 works but dig -4 does not From the further details you added, it does indeed sound like you have some stale connection state on your system. The fact that you can get DNS replies when you query a DNS server by IPv4 address, but not by host name, strongly suggests a resolver configuration issue, and from what you say, your /et... (more) |
— | over 3 years ago |
Answer | — |
A: Should a salt be stored in the same database as the hash? The purpose of a cryptographic salt is to make the same input (password) hash to different values in different instances, yet retain the hash function's deterministic properties. Salting accomplishes that by concatenating a random value with the password itself before hashing, and storing the value o... (more) |
— | over 3 years ago |
Answer | — |
A: Is it unsecure to use a password on the command line to run a MySQL script on Windows? As with every other security-related question, the first step toward answering this is that you'll need to answer for yourself: what are you trying to protect against? Security isn't a binary quantity, it's a continuum; or rather, a set of continuums, one for each potential threat. You aren't eith... (more) |
— | over 3 years ago |