How can I include e.g., in citep

Question: When I reference some work, currently I get something like (Jimmy and Tan, 2003). I want an updated \citep where I can use (e.g., Jimmy and Tan, 2003). I should be able to call either the earlier reference such as, (Jimmy and Tan, 2003), or the updated citation (e.g., Jimmy and Tan, 2003) at will. How can I achieve that? Thanks.
Comment: As you mention `\citep` I assume you use `natbib`, the `cite` package doesn't define that.
Comment: yes I am using that. The solution works. Thanks.
Comment: Glad to hear it. Note that you can mark questions as solved by accepting the most helpful answer. This is done by clicking the checkmark next to the answer.
Answer: You can add prenotes and postnotes to the site with the optional arguments:
\citep{dude}
\citep[p. 42]{dude}
\citep[e.g.][]{dude}

See page 7 in natbibs manual.
When using only one optional argument (one pair of []), that becomes a postnote, when using two the first one is a prenote, the second a postnote.
Comment: is there a way to do that using \cite only?
Comment: @AndréCytryn The default implementation of `\cite` only has the postnote, but for example the `natbib` implementation has both pre- and postnote. So if you're using `natbib` you can do exactly as in my answer. If not, the answer will depend on the setup you're using, so please ask a new question and include a minimal example (see http://meta.tex.stackexchange.com/questions/4407/how-to-write-a-mweb-minimal-working-example-with-bibliography) that shows how you're doing things.
Answer: In addition to the answer by Torjørn T., given that the "e.g., Author, year" format is quite common, one can conveniently define a \citeg command (to be inserted before the \begin{document}) as
\newcommand{\citeg}[1]{\citep[e.g.,][]{#1}}

which automatically produces the prenote "e.g.,".
Comment: Though—just since it may not be obvious to a user who doesn't know this method—this new command can only be used to add "e.g." without a page reference.

How can I include e.g., in citep


How would I safely store a password locally?

Question: I have a program which allows another authorized user (with a password) to access someone else's computer without them having to be there. However, I don't know how to safely store the password without requesting the user reenter the password every time they launch the program. I have a few ideas, such as hashing the password and storing it to a file, but this could get cracked by a hash cracking program such as hashcat. I have read Safe ways to store passwords without hashing them and have thought about the CryptProtectData API. Would it protect the passwords from another application which is potentially malicious? Or is it on a per application basis?
Comment: You can make it safer, but never really safe. Your app has to read it, so someone can find those methods if they know what they're doing. You can make it a little safer by using the user machine's serial number as the key (or part of the key). (Windows provides a method that is partially based on this... the idea is to read a unique id from the hardware.) This is only safer in the case where someone gets the stored data but isn't able to execute code to read your serial number.  (or peek at your memory...)
Answer:
Would it protect the passwords from another application which is potentially malicious?

No
DPAPI (of which CryptProtectData is a part) cannot protect against a malicious application running under the same user. This is because any application running under the same user can request decryption of a DPAPI encrypted blob. It is possible to give DPAPI some additional entropy while requesting encryption, and then only an application that knows the additional entropy will be able to decrypt the blob, but you run into the original issue again. Where do you store the additional entropy, such that a malicious application cannot access it?
The only situation in which DPAPI offers any real security is if you're device gets stolen (or confiscated by some authorities) and you don't have FDE. In this case, provided that your Windows password is strong enough to resist bruteforce, the stored DPAPI encrypted data cannot be read.
In the end, it's just as @Polynomial says in the linked answer:

Any procedure you choose to obfuscate passwords is an exercise in futility against any half-determined attacker, so at most you're creating an illusion of security.

I have a few ideas, such as hashing the password and storing it to a file

The main problem here isn't that the hash can be cracked, it is that cryptographic hashes are irreversible. So when you need to log in, you won't be able to recover the password from the hash. If you design the application to send the hash instead of the password, the hash effectively becomes the password, and you're back to storing it as plaintext.

Edit: As clarified by OP in comments, the application in question is the server, not the client. For a server, there is absolutely no reason you should store the password in a reversible format. Hash it with a strong password hash like bcrypt or Argon2id and store the hash only. (Warning: Do not try to implement the hash functions yourself. Use a well-known and tested implementation.)
Comment: Thanks for the insight. Wouldn't a user logging in and the app hashes it be a safe solution? My application doesn't store any data and changing the password would just be a matter of changing the hash on the file or deleting it.
Comment: @TheUltimateGuide If I understand correctly, your application allows a user to access another computer remotely if they have the password. If you hash the password, how are you going to send the password to the remote computer for authentication?
Comment: The app has a client and a server. The server gets a password which it hashes and saves to a file. The client sends a header with a password and the server hashes it and compares the two hashes.
Comment: @TheUltimateGuide OK, so you are talking about the server application. I had assumed you were trying to store the password client side (the question you linked to is about a client). For a server, there is absolutely no reason you should store the password in a reversible format. Hash it with a strong password hash like [bcrypt](https://en.wikipedia.org/wiki/Bcrypt) or [Argon2id](https://en.wikipedia.org/wiki/Argon2) and store the hash only.
Answer: The easiest solution is to use PowerShell cmdlet Export-Clixml.
<snippet>

Example 3: Encrypt an exported credential object on Windows
In this example, given a credential that you've stored in the $Credential variable by running the Get-Credential cmdlet, you can run the Export-Clixml cmdlet to save the credential to disk.

Important
Export-Clixml only exports encrypted credentials on Windows. On
non-Windows operating systems such as macOS and Linux, credentials are
exported as a plain text stored as a Unicode character array. This
provides some obfuscation but does not provide encryption. PowerShell

$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential
$Credential | Export-Clixml $Credxmlpath
$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential
$Credential = Import-Clixml $Credxmlpath

The Export-Clixml cmdlet encrypts credential objects by using the Windows Data Protection API. The encryption ensures that only your user account on only that computer can decrypt the contents of the credential object. The exported CLIXML file can't be used on a different computer or by a different user.
In the example, the file in which the credential is stored is represented by TestScript.ps1.credential. Replace TestScript with the name of the script with which you're loading the credential.
You send the credential object down the pipeline to Export-Clixml, and save it to the path, $Credxmlpath, that you specified in the first command.
To import the credential automatically into your script, run the final two commands. Run Import-Clixml to import the secured credential object into your script. This import eliminates the risk of exposing plain-text passwords in your script.
</snippet>

Would it protect the passwords from another application which is potentially malicious?

Depends on the permissions granted to the potentially malicious application. If it has Administrator level permissions then no. If the malicious application can impersonate your account, or whatever credentials run this job, then it should be evident that you must address that issue first.

Or is it on a per application basis?

As the referenced page states, the file is restricted to the user and computer where the file is created. Applications on Windows systems must run in a user context and thus the importance of using the Principle of Least Privilege. If you have a potentially malicious application that can abuse user segregation, don't run it on the same system. Separate these two tasks to different systems as this will minimize risk.


Secret key model for a compression function cryptanalysis?

Question: How do we analyze the security of a compression function in the secret key model? More formally, let $H$ be a hash function and $F(IV,M)$ its compression function. Suppose we generate a MAC as follows:
$$
T=F(F(K,M),M_p),
$$
where $K$ is the MAC key and $M_p$ is the padded block. Can I say that if one observes the output of the inner compression function call, i.e., $F(K,M)$, and retrieves $K$, then this is a certificational weakness of the underlying compression function? (we do not consider it in any specific protocol)
Comment: Consider the hash function $H$ and its compression function $F(IV,M)$ are used in a secret IV MAC scheme where the Tag $T= F(F(K,M),M_p)$, where $K$ is the MAC key and $M_p$ is the padded block. Can I say that if one observes the output of the inner compression function call i.e., $F(K,M)$ and retrieve $K$, then this is a certificational weekness of the underlying compression function?
Comment: The question is unclear. When one talks about a compression function, all the input variables can be chosen arbitrarily (or you may consider them as a large single variable). Hence recovering chaining value does not make sense, as the input is known.
Comment: I'm sorry if the question doesn't make sense as I'm trying to understand the accepted cryptanalytic models. So what you're saying is this cannot be considered as a preimage attack for the compression function, if I'm chossing the input messages and collecting the oracle's responses then recovering the used chaining value? Thanks in advance.
Comment: Consider a compression function $F(A,B) = C$. The hash function $H$ is defined as follows: let $A_0$ be constant, then $H(M_1||M_2||\ldots||M_n) = F(F(...F(F(F(A_0,M_1),M_2),M_3)...M_n)$
Comment: Can you reformulate your question using this notation?
Answer: Yes, if $K$ can be recovered from $H'=F(K,M)$, this is a weakness.  The function $F$ is not preimage-resistant, and an attacker may easily generate correct tags for new messages (this is called a forgery). The proposed MAC scheme, however, is terribly weak, and forged tags for other messages can be easily produced (length-extension property):
$$
T(M\mathbin\|M_p\mathbin\|M') = F(T(M\mathbin\|M_p),M').
$$
Still, if original $K$ can be recovered, forged tags can be produced for even shorter messages.
However, there could be many $K$'s that produce the same $H'$. If the cost of finding the original $K$ is still higher than the exhaustive search, then such attack is useless for forgery, as the attacker would have to use the length-extension attack. However, the compression function is still vulnerable to preimage attacks, which may be exploited in other constructions (for example, meet-in-the-middle attacks on hash functions).


How to generating all flats of the cycle matroid of a graph?

Question: If $M$ is a matroid, I can use M.flats(k) in SageMath to list all the flats of rank $k$. But I hope that there is an algorithm or program to list all flats of the cycle matroid of a graph. And do not use the language of matroids in this process.
In the paper "GRAPH COMPOSITIONS I: BASIC ENUMERATION", a composition of G is defined as a partition of V(G) into vertex sets of connected induced subgraphs of G. All the compositions of a  graph G exactly corresponds to the flats of M(G)。 So my problem may be changed to "how to list all the compositions of a  graph G".
Comment: Since the answer can be exponentially large as a function of the number of vertices, not clear what you mean (there's an obvious algorithm that checks for each partition if it is a composition of G, but it's very inefficient).
Comment: This works previewed the graph is 2-connected otherwise, reduce the problem to the blocks.
Comment: https://stackoverflow.com/questions/20530128/how-to-find-all-partitions-of-a-set
Answer: Give the edges of the graph distinct weights. Then the flats are in 1-1 correspondence with the minimal forests, where a forest is defined to be minimal if no other lower-weight forest spans the same components.
You can define a tree structure on the minimal forests, where the parent of a minimal forest is obtained by deleting its heaviest edge. The root of this tree structure is the forest of single-vertex trees. Then the children of each minimal forest F are formed by choosing two components of F, and adding the lightest edge between them, as long as it is heavier than the previous heaviest edge.
Finding the parent of a given minimal forest is obviously easy. And you can list all the children of a given minimal forest in linear time, by labeling each heavy-enough edge by the pair of components it connects, radix sorting the edges by these pairs of labels, and for each set of edges with the same pair of labels, keeping only the lightest one.
One can then find all minimal forests by traversing the tree structure starting from the root. At any given tree, the next tree is found by going to the first child (if there are any children) or following parent links back up the tree structure until finding a parent for which we are not backtracking from the last child, and then going to the next child.
Each link in the tree structure takes time linear in the input graph size to traverse, so the total time is linear per generated minimal forest. You only need enough space to remember two forests (the one you are at now and the one you just came from).
In the same linear time per generated object you can generate the flats themselves, not just the minimal forest. For any given minimal forest, the corresponding flat is the set of edges that connect pairs of vertices in the same tree of the forest. So label all vertices with which tree they are in and loop through all the edges checking which of them have the same label at both endpoints.
(This is an instance of "reverse search"; for the general design of enumeration algorithms with this technique, see Avis & Fukuda, "Reverse search for enumeration", Disc. Appl. Math. 1996. I don't know offhand of references for the specific problem of enumerating flats of graphs.)
Answer: Matroids: A Geometric Introduction page 55 gives the theoretic result in purely graph theoretic terms in the last two sentences of this quote:

While it is pretty easy to pick out the flats from the picture of the geometry, it is a bit more difficult to find the flats of a graphic matroid from its graphic representation. To describe the flats of a graphic matroid, we consider a graph G = (V, E) and a subset F of the edges E. Note that the graph (V,F) has various connected components. Then, loosely speaking, F forms a flat in a graphic matroid if adding any edge to F reduces this number of connected components. More precisely, we let Π be a partition of the vertices of G, and then let FΠ be those edges of the graph both of whose endpoints are contained in the same part of the partition. Then FΠ forms a flat of M(G).

It shouldn't be hard for you to implement this for graphs. But doing that misses the point of matroid theory which tells us that we can write the code once in the more general setting and then apply it to graphs as a particular case.


When is it too old to go Trick or Treating?

Question: So, when do you all think it's too old for a child to go trick or treating? I'm just trying to figure out when that age would be.
Answer: I use Hallowe'en as a way to encourage artistic expression in my children. As they grow older, I continue to encourage them to dress-up and I model this by accompanying them in costume. However, as they grow older, the focus changes from them being the ones asking for candy to them creating more elaborate costumes and being chaperones for the little ones who do the asking, and if the resident is generous with them too, bonus!
The older the children are, the more effort I expect in their costumes. How often do you see works of art paraded to your door? Teenagers who present themselves as skateboarders are asked to do tricks or are turned away with the suggestion that they try harder next year. Other times, because teenagers are often the ones who knock later, my kids get to answer the door and see the kinds of costumes and transformational make-up masterpieces to which they can aspire. I do not have a problem trading candy to see that! Some kids don't even ask for anything, they just do their magic tricks or read their poems and wish us a happy Hallowe'en.
So, to answer your question, I think a person should stop going trick or treating when they no longer put age-appropriate effort into their costumes or when they aren't prepared to give something valuable in exchange for their treats.
Comment: Magic tricks and poem reading on Halloween? I've never even heard of such a thing!
Comment: I'm in Switzerland, and generally don't generally 'reward' ghouls, zombies and monsters, but a solitary ten-year-old dressed as Charlie Chaplin turned up last night, complete with 'dance' routine. Even treated us to a slapstick 'falling down the steps' after receiving his booty!
Comment: Yea, I was going to say the same thing...are we talking about the same halloween?
Comment: No kidding! It must be the neighbourhood I live in. Some of the kids go to a special arts-focus high school. It's certainly not what I grew up with, but my kids are, and I like it!
Comment: Round our way it's songs, tricks, poetry, light shows and even stunts - they earn their treats from ages 2 to 16 or so :-) +1 for this answer by the way - excellent way to look at it.
Comment: Precisely put. Drives me nuts when the after hours kids come by in no costume at all. I had a few ask "why don't you just give me the rest of the candy? nobody else is around." come one man, a little effort. Just a little.
Answer: I think that a child will make it clear that they would rather go to a Halloween party than to trick or treating. Having seen engineers and artists, and artistic engineers, creating some fantastic costumes, I don't think that there's an upper age limit on Halloween - even the dead and undead can be found at such parties.
Simply put, I think your child will let you know when they don't want to do the same thing and want to do something different, such as a party, a haunted maze, or some other activity.
At some point, you might find it interesting to introduce them to something quite different, such as Dia de los Muertos or a Halloween-inspired organ performance.
Comment: As for the "something different", there's also the option of charitable work. In university, I remember there being some sort of food drive, where some of the students went door to door collecting canned goods (and optionally dressed up, IIRR). Can't now remember what the charity/event was called.
Answer: My view is they are too old, when they decide they are.
We get a wide range of kids, although we don't give candy away - neither my wife and I really like to encourage that sort of thing, more importantly we get a small amount of treaters due to the location of our street.  Buying candy means we'd eat most of it after, so we give away small decks of playing cards, or small containers of Play-Doh.  When I took my son out we saw quite a few teens out dressed up, some were imaginative and other's just had on head bands with springy things on top.
Personally I'd rather have nGinius' neighbors, but we get a few well decorated houses (mine is slowly getting there) and often the kids and parents dress up similarly so it's like a roving party.
Answer: I find myself far less concerned with the older kids trick-or-treating than the parent with an infant who clearly should not be having candy coming to the door to get their candy.
I think a long as there is effort in dressing up and their are respectful, there is no problem with older kids going out. I do expect a thank you though and call kids out on it if they fail to say thank you!
Answer: I have a nice simple rule of thumb:
If they're old enough to do it by themselves (i.e. without an adult accompanying them) then they're too old.
Comment: Then I was too old at six  :D


Double slit experiment: Single photons of red light mixed with high intensity infrared light

Question: First this is only a presumtion. Let say we fire single photons of red light at the double slit to get a interference pattern on the screen. The distances between frindges would have certain quantities. Now, let them mix with intense infrared light which doesn't produce colored frindges. The only intention is to figure out does the infrared light force the red single photon to choose one of the paths produced by interferention of infrared waves at the slit. I think the single red photon produces a set of paths to the screen that are nothing else but reinforced EM field lines towards the screen but the intense infrared should produce higer values of the field and somehow make that the distances between red frindges at the screen get larger. Is this possibly thrue?
Comment: What direction are the IR photons coming from? Same as the red ones? A diagram might help.
Answer: The result will just be the incoherent superposition of the interference patterns of the two lightsources.


Why can't you divide matrices?

Question: I was just wondering that because one can multiply and add and subtract matrices, why can't    one divide them?
Comment: I've reopened this question because I think it is a reasonable mathematical question and that the answers add value to the site. The reason given for closure
(missing context or other details) doesn't seem applicable to me, since I'm not sure what additional context or details are appropriate or necessary.
Comment: Google 'polynomial matrix' and 'polynomial matrix division'. And regarding scalar matrices, you can just look at division as multiplying by the inverse (because that's exactly what any divison is), that's why aschepler said 'sometimes you can', as not all matrices are invertible.
Comment: But you can.${}$
Comment: please explain.
Comment: please link to a site.
Comment: Sometimes you can, that is.
Comment: Too broad, bro.
Comment: I am familiar with inverse matrices. Is that what you were talking about?
Comment: [Example](http://math.stackexchange.com/questions/54728/how-to-divide-polynomial-matrices).
Comment: THanks. I'm glad its not on hold
Answer: You CAN divide by matrices. To understand what division in the context of matrices mean, let us look at what division means in the context of real numbers.
$b/a$ in the context of real numbers denote the real number $x$ satisfying $x \cdot a=b$. Since multiplying two real numbers is commutative, the same real number $x$ also satisfies $a \cdot x = b$.
Similarly, in the context of matrices, $B/A$ means the matrix $X$ such that $X \cdot A = B$. However, in matrix algebra, multiplication is not commutative. Hence, in general, it is not true that $X \cdot A = A \cdot X$. Hence, you need to specify, whether you are dividing by a matrix on the right or on the left. Hence, if you are looking for a matrix $X$ such that $A \cdot X = B$, $X$ is denoted as $X = A\backslash B$.
$X = B/A$ means you are dividing by the matrix $A$ on the right and $X = A\backslash B$ means you are dividing by the matrix $A$ on the left.
Also, just like division by zero is not possible in the context of real numbers, you cannot divide by certain matrices, which are called singular matrices. Hence, the left division ($A\backslash B$) and right division ($B/A$) make sense only when $A$ is not singular.
Answer: You sort of can. If a matrix $A$ is invertible, then there exists a matrix $A^{-1}$ such that $AA^{-1}=A^{-1}A=I$, where $I$ is the identity matrix. This is analogous to $a^{-1}=\frac1a$ for a nonzero real number, which satisfies $aa^{-1}=a^{-1}a=1$. Recall that dividing a real number $b$ by $a$ is the same as multiplying it by $a^{-1}$, i.e. $b/a=ba^{-1}$. Similarly, for matrices we can define "$B$ dividied by $A$" as $BA^{-1}$.
However, there are a few problems that arise:

Not all nonzero matrices are invertible. This is because the set of matrices, unlike real numbers, has zero divisors: there are nonzero matrices $A,B$ such that $AB=0$. If you could divide $B$ by $A$, you would get $B=0/A=0$, a contradiction.
Matrices do not commute, i.e. generally $AB\ne BA$. This means we have to make a distinction between dividing on the left ($A^{-1}B$) and dividing on the right ($BA^{-1}$), while for real numbers these are the same.
Answer: Sometimes you can, sometimes you can't.  For square nonsingular matrices, you can multiply by the inverse of a matrix in order to get the identity.  For singular matrices, inverses do not exist.
See here for more information about that.
For non-square matrices, such inverses do not exist in the same regard, but there is a close approximation given by the Moore-Penrose Pseudoinverse.
Comment: @Joao Don't rush to accept answers. I'm not saying you shouldn't accept this one, but give it time for whoever wants to answer, answer. If you accept too early you might miss out some good answers.
Comment: Agreed, there are better answers here anyways!
Comment: thanks. Ill accept as soon as i can.
Comment: YEah thank im not accepting this one now
Answer: Dividing by $x$ is undoing multiplication by $x$ via multiplication with $x$'s inverse. Further, with nonzero numbers, there is a unique way to do this.
With matrices, a lot of this breaks down. For some matrices $X$, there is no way to undo multiplication by $X$ via multiplication with a would-be $X^{-1}$ matrix, because multiplication by $X$ has destroyed too much of the original information.
Even when there is way to undo multiplication by $X$, there can be multiple would-be $X^{-1}$ matrices that do it.
For some matrices, an inverse matrix both exists and is unique, and only for those matrices is it OK to do division in the way you are trying to do it. In a linear algebra class you will learn that these matrices are the square matrices with determinant not equal to $0$.
Answer: You can multiply, add, and subtract integers, but you can't divide them (and always get an integer). Also you can add and subtract real valued functions, but can't always divide, if one of the functions has a zero and the other doesn't, etc. Objects that admit an addition, subtraction, and multiplication (but maybe not division) are called rings, and they appear all over mathematics.
Answer:
you can multiply and add and subtract matrices, why can't you divide them?

The underlying reason is that although a matrix is analogous to a number, it is more analogous to (a parallel operation on) an array of several numbers, and the operation could be zero on one of the components.   For example, a diagonal matrix can have on the main diagonal both some $0$'s and some non-zero elements, the zero elements prevent it from having an inverse, and are the only thing that can stop an inverse from existing.  The explanation in the general case is essentially the same, by diagonalizing the matrix or slight modifications of that.

Why can't you divide matrices?


Would a question asking to identify a plug be on topic?

Question: I don't really ask questions here very often, and I want to know if a question asking to identify a certain proprietary connector would be on topic?
Comment: Identification of components is seen regularly on the stack and as long as pictures and description is clear it is usually no issue. Don't turn it into a shopping question by asking where to buy it, that would render the question off topic.
Comment: Doesn't matter, some bas***ds will still flag it as off topic.
Answer: In addition to Olin's answer about photo quality / size also make sure to include something in the photo to give an idea of dimensions because distances are of course hard to judge from a photo alone.  For example in a quesion DRO scales 4-pin connector identification I asked a while back I included a ruler in the photo along with some other measurements made using calipers.
Answer: Yes, that is fine.  However beware that the question might be closed if insufficient information is given.  Make sure to include a decent photograph that is clear, detailed and properly cropped to what you are trying to show.  All too often someone takes a unfocused picture with the item in question small and in the middle, but still dumps the full 10 Mpix image here.  The rules for decent and respectful presentation don't go away just because you want the answer badly.
In some cases, it can be useful to show a wider picture of the context the the part is being used in.  Also tell us what you know about the equipment and its application regime.  For example, it could be quite useful to know this where a microphone is expected to be plugged in, as apposed to something coming from a custom sensor, a antenna, a power supply, etc.
Comment: Well I'm a photographer so this will be no problem :)


Why is KI oxidized by H2SO4, whereas NaBr isn't oxidised?

Question: My textbook says that alcohols react with sodium bromide and sulphuric acid to form the corresponding alkyl bromides. At the same time they also mention that sulphuric acid mustn't be used with potassium iodide ($\ce{KI}$), because $\ce{HI}$ formed would be oxidized to $\ce{I2}$. Won't $\ce{HBr}$ formed from $\ce{NaBr}$/$\ce{H2SO4}$ oxidise to $\ce{Br2}$?
Comment: The original question has already been answered, but one way to work around the problem is to use phosphoric acid to make the hydrogen iodide. See https://en.wikipedia.org/wiki/Hydrogen_iodide.
Comment: The answer might be lying in the bond enthalpy of H-I and H-Br and the less stability of HI as compared to HBr.
Comment: What book is this? Would you share its title?
Answer: Iodide ions are much more powerful reducing agents than bromide ions:
$$\ce{2I- ->I2 + 2e-} \hspace{1cm}E^{o}=-0.54\ \mathrm{V}$$
$$\ce{2Br- ->Br2 + 2e-} \hspace{1cm}E^{o}=-1.0873\ \mathrm{V}$$
Iodide ions are so powerful, in fact, that they are capable of reducing sulfur from a +6 oxidation state in $\ce{H2SO4}$ all the way to -2 in $\ce{H2S}$ via the following half reaction:
$$\ce{HSO4- +9H+ +8e- -> H2S + 4H2O} \hspace{1cm}E^{o}=+0.80\ \mathrm{V}$$
The full reaction being being:
$$\ce{HSO4- +9H+ +8I- -> H2S + 4I2 +4H2O}\hspace{1cm}E^{o}=+0.26\ \mathrm{V}$$
A quick glance at the reduction potentials tells you that the analogous bromide reaction has a negative reduction potential and is therefore non-spontaneous.
[Source]
Comment: What about this video?
Solid Halides with Concentrated Sulfuric Acid
https://youtu.be/0vT0pkKMTDI

Isn't bromine produced, even without heating? Perhaps the OP should have mentioned cooling the reactants to prevent oxidation of bromide from happening?


Correlation between a nominal (IV) and a continuous (DV) variable

Question: I have a nominal variable (different topics of conversation, coded as topic0=0 etc) and a number of scale variables (DV) such as the length of a conversation.
How can I derive correlations between the nominal and scale variables?
Comment: The most natural measure of assosiation/correlation between a nominal (taken as IV) and a scale (taken as DV) variables is eta.
Comment: Related question: [How do I study the "correlation" between a continuous variable and a categorical variable?](http://stats.stackexchange.com/q/29489/22228)
Comment: If I understand correctly you want to say something about the relation beteen topic of conversation (as IV?) and conversation duration (DV). ''e.g. hypo= topic 1 means significantly shorter conversation than topic 2'', if this example is what you meant:
You would use a ANOVA for this (if more DV's MANOVA, or several anova's)
Is this what you mean? the sentence with your question is quite ambiguous..
Comment: Related question: [Correlation coefficient for non-dichotomous nominal variable and ordinal/numeric variable](https://stats.stackexchange.com/q/73065/3277)
Answer: The title of this question suggests a fundamental misunderstanding. The most basic idea of correlation is "as one variable increases, does the other variable increase (positive correlation), decrease (negative correlation), or stay the same (no correlation)" with a scale such that perfect positive correlation is +1, no correlation is 0, and perfect negative correlation is -1. The meaning of "perfect" depends on which measure of correlation is used: for Pearson correlation it means the points on a scatter plot lie right on a straight line (sloped upwards for +1 and downwards for -1), for Spearman correlation that the ranks exactly agree (or exactly disagree, so first is paired with last, for -1), and for Kendall's tau that all pairs of observations have concordant ranks (or discordant for -1). An intuition for how this works in practice can be gleaned from the Pearson correlations for the following scatter plots (image credit):

Further insight comes from considering Anscombe's Quartet where all four data sets have Pearson correlation +0.816, even though they follow the pattern "as $x$ increases, $y$ tends to increase" in very different ways (image credit):

If your independent variable is nominal then it doesn't make sense to talk about what happens "as $x$ increases". In your case, "Topic of conversation" doesn't have a numerical value that can go up and down. So you can't correlate "Topic of conversation" with "Duration of conversation". But as @ttnphns wrote in the comments, there are measures of strength of association you can use that are somewhat analogous. Here is some fake data and accompanying R code:
data.df <- data.frame(
    topic = c(rep(c("Gossip", "Sports", "Weather"), each = 4)),
    duration  = c(6:9, 2:5, 4:7)
)
print(data.df)
boxplot(duration ~ topic, data = data.df, ylab = "Duration of conversation")

Which gives:
> print(data.df)
     topic duration
1   Gossip        6
2   Gossip        7
3   Gossip        8
4   Gossip        9
5   Sports        2
6   Sports        3
7   Sports        4
8   Sports        5
9  Weather        4
10 Weather        5
11 Weather        6
12 Weather        7

By using "Gossip" as the reference level for "Topic", and defining binary dummy variables for "Sports" and "Weather", we can perform a multiple regression.
> model.lm <- lm(duration ~ topic, data = data.df)
> summary(model.lm)

Call:
lm(formula = duration ~ topic, data = data.df)

Residuals:
   Min     1Q Median     3Q    Max
 -1.50  -0.75   0.00   0.75   1.50

Coefficients:
             Estimate Std. Error t value Pr(>|t|)
(Intercept)    7.5000     0.6455  11.619 1.01e-06 ***
topicSports   -4.0000     0.9129  -4.382  0.00177 **
topicWeather  -2.0000     0.9129  -2.191  0.05617 .
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.291 on 9 degrees of freedom
Multiple R-squared: 0.6809,     Adjusted R-squared: 0.6099
F-statistic:   9.6 on 2 and 9 DF,  p-value: 0.005861

We can interpret the estimated intercept as giving the mean duration of Gossip conversations as 7.5 minutes, and the estimated coefficients for the dummy variables as showing Sports conversations were on average 4 minutes shorter than Gossip ones, while Weather conversations were 2 minutes shorter than Gossip. Part of the output is the coefficient of determination $R^2 = 0.6809$. One interpretation of this is that our model explains 68% of variance in conversation duration. Another interpretation of $R^2$ is that by square-rooting, we can find the multiple correlation coefficent $R$.
> rsq <- summary(model.lm)$r.squared
> rsq
[1] 0.6808511
> sqrt(rsq)
[1] 0.825137

Note that 0.825 isn't the correlation between Duration and Topic - we can't correlate those two variables because Topic is nominal. What it actually represents is the correlation between the observed durations, and the ones predicted (fitted) by our model. Both of these variables are numerical so we are able to correlate them. In fact the fitted values are just the mean durations for each group:
> print(model.lm$fitted)
  1   2   3   4   5   6   7   8   9  10  11  12
7.5 7.5 7.5 7.5 3.5 3.5 3.5 3.5 5.5 5.5 5.5 5.5

Just to check, the Pearson correlation between observed and fitted values is:
> cor(data.df$duration, model.lm$fitted)
[1] 0.825137

We can visualise this on a scatter plot:
plot(x = model.lm$fitted, y = data.df$duration,
     xlab = "Fitted duration", ylab = "Observed duration")
abline(lm(data.df$duration ~ model.lm$fitted), col="red")

The strength of this relationship is visually very similar to those of the Anscombe's Quartet plots, which is unsurprising as they all had Pearson correlations about 0.82.
You might be surprised that with a categorical independent variable, I chose to do a (multiple) regression rather than a one-way ANOVA. But in fact this turns out to be an equivalent approach.
library(heplots) # for eta
model.aov <- aov(duration ~ topic, data = data.df)
summary(model.aov)

This gives a summary with identical F statistic and p-value:
            Df Sum Sq Mean Sq F value  Pr(>F)
topic        2     32  16.000     9.6 0.00586 **
Residuals    9     15   1.667
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Again, the ANOVA model fits the group means, just as the regression did:
> print(model.aov$fitted)
  1   2   3   4   5   6   7   8   9  10  11  12
7.5 7.5 7.5 7.5 3.5 3.5 3.5 3.5 5.5 5.5 5.5 5.5

This means that the correlation between fitted and observed values of the dependent variable is the same as it was for the multiple regression model. The "proportion of variance explained" measure $R^2$ for multiple regression has an ANOVA equivalent, $\eta^2$ (eta squared). We can see that they match.
> etasq(model.aov, partial = FALSE)
              eta^2
topic     0.6808511
Residuals        NA

In this sense, the closest analogue to a "correlation" between a nominal explanatory variable and continuous response would be $\eta$, the square-root of $\eta^2$, which is the equivalent of the multiple correlation coefficient $R$ for regression. This explains the comment that "The most natural measure of association / correlation between a nominal (taken as IV) and a scale (taken as DV) variables is eta". If you are more interested in the proportion of variance explained, then you can stick with eta squared (or its regression equivalent $R^2$). For ANOVA, one often comes across the partial eta squared. As this ANOVA was one-way (there was only one categorical predictor), the partial eta squared is the same as eta squared, but things change in models with more predictors.
> etasq(model.aov, partial = TRUE)
          Partial eta^2
topic         0.6808511
Residuals            NA

However it's quite possible that neither "correlation" nor "proportion of variance explained" is the measure of effect size you wish to use. For instance, your focus may lie more on how means differ between groups. This question and answer contain more information on eta squared, partial eta squared, and various alternatives.
Comment: @Zhubarb the hard part was getting $R \approx 0.82$ for the bogus data...
Comment: +1 for a very nicely explained answer! Here you argue that the sign of $\eta$ or $R$ is always positive, because of course any decently fit model will result in fitted values positively (rather than negatively) correlated with the DV. Maybe I could add that in *some* cases the sign can be meaningfully assigned to $\eta$, e.g. if IV is ordered (I believe this is then called "ordinal" instead of "nominal"), or at least partially ordered. Imagine that topics in the OP range from arts to math; then we could use the sign of correlation between nerdiness and DV and assign it to $\eta$.
Comment: @ Silverfish - In particular, the method for finding a continuous variable to plot on the x-axis (fitted duration in the example above). I am mostly looking for a term than might appear in textbooks or Google. Thanks!
Comment: @DJBunk Try "observed vs fitted values" as a search term - suspect most of your hits will be for its use as a regression diagnostic but it works for e.g. ANOVA too.
Comment: @amoeba Herein I think lies a subtle point. Suppose we run a simple linear regression and obtain PMCC $r=-0.9$ - then as x increases, y tends to decrease (this is the sort of directional effect you are talking about). Nevertheless the multiple correlation coefficient for such a regression is still $R=0.9$ (as fitted value of y increases, observed value tends to increase). Now $\eta$ is more like $R$ than $r$...
Comment: That is correct, but I guess what I am saying is that sometimes it can make sense to consider "signed $\eta$" that is more like $r$ than like $R$.
Comment: @amoeba, you could just multiply $\sqrt{eta^2}$ by $-1$, but it really is creating a new measure that you will have to explain every time, & I don't see how it has really done anything meaningful for you.
Comment: @gung, perhaps this is not the best place to discuss this at length, as mine was only a marginal remark. Still, what I had in mind only makes sense for ordinal (or partially ordinal) IVs. I would argue that the direction of the effect can be meaningfully defined there, and so "signed $\eta$" could in principle be used and convey some useful information. I appreciate your point that this is unconventional.
Comment: great answer Silverfish. Quick question I ran the same analysis on y data set (which has 9 measures and 1 categorical variable - was hoping to find how much each one individually affects the category) - and all of them got very small R-squared. What's the interpretation? Does it mean that any of them individually explains the categorical variable? thanks
Comment: @Silverfish What if categorical variable is dependent variable having more than 2 levels and continuous variable is independent variable? I tried to do ANOVA on this case and got warnings and some errors.
Comment: @Silverfish - is there a name for this method, or is this something you put together yourself?
Comment: @DJBunk Having a bit of a mind-blank here - let me know which bit you mean by "This method" and I'll see if I can answer!
Comment: @Silverfish Could you please answer this question: https://stats.stackexchange.com/questions/363543/how-to-measure-the-correlation-between-nominal-and-numeric-variables Thanks a lot.


Redhat LVM changing stripes?

Question: If I start with three physical devices in a volume group and stripe a logical volume across all three physical disks, can I later add a fourth disk to the vg and re-stripe it across all four disks? I've been trying to divine this from various docs and it is unclear.
Answer: Actually, you would do the following:
1) Unmount the file system that mounts the volume.
2) Use pvcreate to initialize the device to be added to the volume group.
3) Use vgextend to add that device into the volume group.
4) then you would use lvresize to increase logical volume if necess
5) Then you would run e2fsck -f on the file system, as you cannot resize it without running that command.
6) Then you would execute resize2fs command on the file system.
7) Finally, you will remount the file system.
So partly from memory, assuming that /dev/sda/b/c are the drives under volume group vg with a lvm group lv and d is your new drive and that is mounted under /mnt/l:
<code>umount /mnt/l
pvcreate /dev/sdd
vgextend vg /dev/sdd
lvresize -L +5000 lv
e2fsck -dev /dev/vg/lv
resize2fs /dev/vg/lv
mount /dev/vg/lv /mnt/l
</code>
On every be sure to run pvdisplay (to very that the physical volumes are added), vgdisplay (to verify that the volume group has been extended) and lvdisplay (to verify that logical volumes have been extended).
Comment: Thanks. To be clear, this can be used to not only extend an lv across disks in a concatenated fashion, but, specifically, to increase from a three-disk stripe set to being striped across four disks, etc?
Comment: You can use -i to specify the number of stripes when extending the disk. If you are still not sure, you can always backup the data, remove and then recreate the LV volume if you are not sure.
Answer: Yes, the command is lvextend. After extending the volume, you need to extend the file system as well. So, your question is more like if you can extend the file system, as you do not specify what you use.

Redhat LVM changing stripes?


I am looking for a software named instawallet used as a bitcoin wallet in 2011

Question: I am looking for instawallet a windows vista desktop software bitcoin wallet that produces mnemonics.  If you know of a download link or have a copy of the software, please let me know.
Comment: related: https://bitcoin.stackexchange.com/q/103446/13866
Comment: there is also a software named instawallet. i used it in march of 2011. mnemonic producing window s desktop wallet similar to electrum. bitcoin wallet
Comment: At least BIP39 was only proposed in 2013, so I would be surprised if you had a wallet that produced mnemonics in 2011. If you have a mnemonic, you can probably use a generic recovery tool, though.—If you would like to clarify your question, please edit the question post instead of adding answer posts.
Comment: Are you sure your wallet wasn't Electrum version 1? It had mnemonic seed-phrases two years before the 2013 BIP-39 standard, so presumably in 2011.
Answer: According to the Bitcoin Wiki, Instawallet was launched in April 2011 (you're probably misremembering using it in March) and closed in 2013 after a hack. Because it was a web wallet, there is no software for you to download to recover the funds.
The wiki claims that users of Instawallet "can file a claim form to get their funds", but I couldn't find a source for this and the website is down anyway so I don't know where you'd file that claim.
Comment: I used the instawallet desktop software for my first bitcoin wallet. I have the mnemonic from march 2011 but cant find the software for download. the standards of the wallet in particular the wordlist was different i think and was not adopted into the bitcoin standards later in 2011 and 2012.  interesting that all the sudden here in 2023 I finds a company with the same name as instawallet desktop wallet.  I have been in the bitcoin arena since 2011 and first heard of instawallet online service in 2023.  wtf.  Just when i need the desktop software.


teenage love/lust

Question: I am 16 years of age and a female. When I was younger (before hitting puberty) I had this male friend that I would hang out with at school. I ended up moving but we found each other on social media a few years later. Our conversation is very halal, me asking about his family and studies vise versa. The problem is lately I cannot get him off my mind. I'm thinking about him many hours of the day and it's starting to disturb my life. I get aroused when I think about him although I never think sexually of him. Matter of fact I always dream about how if we ever get married I would strive to be a good wife and aim for a relationship like the prophet had with his wives. For some time I ignored it and thought "teenage hormones" but it's really disturbing me. I would be eating breakfast and think about how one day me and him could pray fajr together then have breakfast. I'm not sure what to do? I'm obviously way too young to get married and have tried to stop talking to him but nothing helps. Please tell me if I'm doing anything haram.
Answer: Assalamu Aleykum. I hope this post finds you in good health and Imaan. The prophet peace be upon him once said "We do not see for those who love one another anything like marriage." -Source: Sunan Ibn Mājah 1847. Grade: Sahih (authentic) according to Al-Albani.
Your love for this brother is clear, and no doubt it's normal. But online communication at a time where you know for sure you will not attain marriage is distracting you from your worldly obligations and your spiritual obligations. It's not productive. As for the islamic legal ruling, communication with a person that you're intending to get married should be restricted to necessary conversations..like "I feel like we connect personally, what are your plans for marriage?, when? how?" and so on. But some people naturally cant even handle this and they get aroused even saying "Assalamu Aleykum" or "Good Morning". This is when you should fear for yourself as a human being that could slip up and or cannot get this person off of their mind, something unintended could be planned and be executed when your sexual emotions are at an all time high. So it's best if you could tell this brother respectfully that you like him but you get emotional and get distracted in life and you need a break until you can take halal actions (There is only one halal action which is..marriage). If this brother fears Allah, he will understand. If not, there are plenty more fish in the sea. It's also a good test to see if this person is a good muslim.
The Messenger of Allah, peace and blessings be upon him, said, "Verily, the lawful is clear and the unlawful is clear, and between the two of them are doubtful matters about which many people do not know. Thus, he who avoids doubtful matters clears himself in regard to his religion and his honor, and he who falls into doubtful matters will fall into the unlawful as the shepherd who pastures near a sanctuary, all but grazing therein. Verily, every king has a sanctum and the sanctum of Allah is his prohibitions. Verily, in the body is a piece of flesh which, if sound, the entire body is sound, and if corrupt, the entire body is corrupt. Truly, it is the heart." - Source: Ṣaḥīḥ al-Bukhārī 52, Ṣaḥīḥ Muslim 1599. Grade: Muttafaqun Alayhi (authenticity agreed upon) according to Al-Bukhari and Muslim
ALLAH KNOWS BEST. May Allah's peace salutations be upon our prophet and to all those who will follow him until the last day. Assalamu Alleykum Warahmatullahi Wa Barakatuh
Comment: Jazak Allah for your response. If you don't mind me I'm rather confused as to how I can love someone at such a young age. So is this love or lust. Because if it's lust I will cut everything off with this guy. If not then I will just be aware of my actions until a proper age.
Comment: @Jana You have to ask yourself what made you fall for this guy..is it his deen? His character? His knowledge? His looks? Like you said it could be first love and blind infatuation. Masha Allah you are upright to be trying to get to the bottom of your issues and solve them. Allah will guide you to the right answer insha Allah. Pray the 2 raka'a of istikharaa and make the dua "Allahuma arina haqqa haqqaan warzuqna tiba'a, wa arina baatilaa baatilan warzuqna atiba'a." Oh Allah show me the truth as truth and help me follow it, show me falsehood as falsehood and make me stay away from it"
Answer: You are so brave to ask such question. It means you care about your life and spirit. I don't get the people voting your question down, it could be very helpful for other teenagers like you and yourself.
I recommend you take it easy and put your trust in your God. As our dear friend Falmata said, Allah knows best, so don't worry about anything.
Try to keep the relationship healthy or pause it if you're not able to keep it healthy. Talk to the boy about this but beware, he has his own opinions, he may not be muslim or not even believe in God. If you are good with your beliefs, make sure he cannot hurt your Imaan. But if you're confused and puzzled about your beliefs, just open up to the world and God, you will find it. Hear him out first, he may no be willing to marry you and you need to stop your feelings before it gets out of your control.
Peace.
Comment: Thank you so much for your response. @yusha I would like to say I wasn't asking for any support rather I was asking for guidance as I'm quite young and not very knowledgeable. Jazak Allah.
Comment: Because this is not a supporting site that's why the down votes
Comment: @Yusha, I hope your concern on "site" isn't more than for your brothers and sisters especially those in need. I gave an upvote. Please read surah Al-Asr once again and ponder upon it.
Comment: @Yusha I didn't say to support her, she clearly doesn't need your support. I meant her question is relative to the purpose of the website and she's asking about the order of Islam in this case. So there is no reason to vote down. Those who do it are the people who think they're better than ordinary human beings like Jana and don't understand any human can slip out of Serat-Al-Mostaqim. We need to help eachother. Thanks.
Comment: I am not talking about in islam. I am talking about this site. If you are going to use this site you need to follow the rules. There are other Islamic sites that allows you to ask this kind of questions. Also in case someone get the wrong idea, I didn't down vote anything here, I was just telling the reason why people down voted. I don't even have the points to down vote.

teenage love/lust


What is the best way to reduce high ISO noise?

Question: Even on a 5D ISO noise is a challenge. I use PS raw photoshop and Adobe Bridge. I want to minimise loss of image quality.
Comment: The use of the word "minimise" seems to imply you believe there is a magic recipe that will result in the smallest possible loss of "image quality" (however you define that). I don't think that's the case.
Comment: there are probably several answers on this site already. Look at the 'Related' list on the right hand side of your question
Answer:
What is the best way to reduce high ISO noise?

Put more light on the subject when you shoot it.
Noise is not a property of a specific ISO, it is a property of the Signal-to-noise ratio. By increasing the signal (adding more light) you can reduce the exposure which also reduces the influence of noise by increasing the signal-to-noise ratio.
Image info: ISO 3200, f/2.8, 1/1600 second. The subject was bathed in the bright light from a spotlight.

Same set, same camera and lens (although at 70mm instead of 200mm). ISO 3200, f/2.8, 1/320 second. The subject was on a much darker part of the stage. Even with the 2 1/3 stops slower shutter speed there's still less light entering the camera and the image is noisier. Using more aggressive noise reduction reduced the fine detail in the image.
Answer: I believe noise will always be a problem, however using Adobe Lightroom's noise reduction slider can reduce noise quite well while retaining a fair amount of sharpness and quality.
Answer: When taking pictures of static objects (buildings, landscapes) you can use image stacking. By taking many pictures, aligning them and averaging over the aligned images, you'll average out the noise. Noise reduction should then be turned off, as that will allow details that are hidden under the noise floor to emerge. Noise reduction should be applied after averaging over the pictures.
When shooting under dark conditions the long exposure noise reduction should be enabled, as this performs a dark-frame subtraction, removing the hot pixels. Taking one dark-frame exposure yourself to use that multiple times to save time is a bad practice, because the dark-frame will itself contain noise that you want to average out as well.
Each picture should be taken by the "exposing to the right" method. Here you expose to the limit where you just avoid overexposure. In post processing you can then reduce the exposure which then reduces the noise. E.g. suppose that by exposing to the right you can increase the exposure by 2 stops. This will then reduce the noise by a factor of 4 in each picture. If you take 25 pictures and average over them, then that will reduce the noise by a factor of square root of 25 = 5. So, you can reduce the noise by a factor of 4*5 = 20 just by taking the effort to take more than one picture and exposing for longer.
Comment: If one has to use high ISO, then ETTR is obviously not an option. If you could open wider or use a longer exposure, you'd do that in the first place, so ETTR just means... even higher ISO.
Comment: @fkraiem That depends, e.g. if you shoot at night using a tripod, you may  want to shoot with exposure times of the order of seconds instead of tens of seconds for various reasons (e.g. you don't want star trails in astrophotography). This then leads to an ISO of, say, 3200 or 6400, but not 100. ETTR is meaningful under those circumstances, when shooting at a fixed exposure time (say 1 second), you're going to get a lot less noise when shooting at ISO 6400 than at ISO 100.


Order of product of group elements

Question: Let $G$ be a finite non-commutative group of order $N$, and let $x, y \in G$. Let $a$ and $b$ be the orders of $x$ and $y$, respectively. Can we say anything non-trivial about the order of $xy$ in terms of $a$ and $b$? If it helps, you may assume that $a$ and $b$ are coprime.
Comment: To be more explicit: for all three positive integers $a,b,c$, there exist a finite group and elements $x,y$ such that $x,y,xy$ have order $a,b,c$, with the only trivial restriction: if one of $a,b,c$ is $1$, then the other two are equal.
Comment: Let me also mention that the case when $a,b,c$ are all even is trivial: one can then find three such elements in the direct product of three dihedral groups $D_a\times D_b\times D_c$, each with generators of order two $u,v$, namely $x=(uv,u,v)$, $y=(v,uv,u)$, $xy=(u,v,vu)$.
Comment: No, it is more-or-less answered here: https://mathoverflow.net/questions/130697/how-to-find-quotients-of-infinite-triangle-groups-or-von-dyck-groups
Comment: Only in the comments, to be fair...
Comment: Given $a,b,c\ge 2$, estimating/computing the smallest size $n$ such that there is such a pair in the symmetric group $S_n$, looks like an interesting problem. For $a,b,c$ even, the above gives an upper bound of $a+b+c$.
Comment: YCor, your example is interesting to me, but I didn't quite understand how $u$ and $v$ are picked. I understand that you can pick $u$ to be a generator of order 2 (this represents a reflection), but how are there two distinct generators of order 2? In the dihedral group of order $2n$, shouldn't there be one generator of order 2 and one of order $n$ (the rotation part)?
Answer: The following theorem (which does not take the order $N$ of the group $G$ into account) shows that all possible combinations of $a$, $b$ and the order of $xy$ are possible. See Theorem 1.64 from Milne's course notes on group theory.

For any integers $a,b,c > 1$, there exists a finite group $G$ with elements $x$ and $y$ such that $x$ has order $a$, $y$ has order $b$, and $xy$ has order $c$.
Comment: :what can we say about such a group,....it was asked in exam that "consider such group with above property,then G, (1)cannot be cyclic,(2) G has to non abelion......which one is true,1) or 2)?
Answer: I strongly suspect that the answer is "very little", unless you are looking for bounds on the order of $xy$ in terms of $N$ or something like that.
Example. Let's focus on the example $a = 2$ and $b = 3$. It is well-known that
\begin{align*}
\mathbf Z/2 * \mathbf Z/3 &\stackrel\sim\to \operatorname{PSL}_2(\mathbf Z)\\
x &\mapsto \begin{pmatrix}0 & -1 \\ 1 & 0\end{pmatrix},\\
y &\mapsto \begin{pmatrix}0 & 1 \\ -1 & -1\end{pmatrix},
\end{align*}
where $x$ and $y$ are the generators with $x^2 = 1$ and $y^3 = 1$. The product $xy$ maps to
$$\begin{pmatrix}0 & -1 \\ 1 & 0\end{pmatrix}\begin{pmatrix}0 & 1 \\ -1 & -1\end{pmatrix} = \begin{pmatrix}1 & 1 \\ 0 & 1\end{pmatrix},$$
which has infinite order. For any $n \in \mathbf N$, the surjection
$$\operatorname{PSL}_2(\mathbf Z) \twoheadrightarrow \operatorname{PSL}_2(\mathbf Z/n)$$
gives a finite group of order roughly $n^3$ in which $xy$ has exact order $n$.
Example. Another example, still with $a = 2$ and $b = 3$, is the group
$$G = \mathbf Z/n \wr S_3 = (\mathbf Z/n)^3 \rtimes S_3,$$
where multiplication is defined by
$$(a_1,a_2,a_3,\sigma)(b_1,b_2,b_3,\tau) = (a_1+b_{\sigma(1)},a_2+b_{\sigma(2)},a_3+b_{\sigma(3)},\sigma\tau).$$
Then one easily checks that $x = (1,-1,0,(12))$ has order $2$ and $y = (0,0,0,(123))$ has order $3$, and $xy = (1,-1,0,(23))$ has order $2n$. This time we get any even number as the order of $xy$, inside a group of order $6n^3$.

Order of product of group elements


Get Phone Number on Android

Question: How to get Phone number on Android, it shows "Unknown" on Settings > About Phone > Status > My Phone Number
Answer: This is just showing whether your phone number is saved to the phone number description property on your SIM card. Some networks always program this in for you, many don't. Some phones let you write to this property, some don't, some read it, some don't.
It has nothing to do with what actual phone number is attached to that SIM card by the phone company.
It is possible to put your phone number in there, and is easier than you might think:
Go into Contacts -> [Menu] -> More -> Settings -> Own numbers -> [Menu] -> Create and type your phone number into the Number field, now Save.
Then switch your phone off and on again, and it should show the correct number (or whatever number you entered) in the status now.
Comment: too bad that my Contact's settings only show "Sort list by" and "View contact names as"

Get Phone Number on Android


Word/slang for person who cries easily watching movies

Question: I'd like to know from native speakers what would they call or what slang would they use for a person who cries easily watching even the silliest of movies (meaning very little drama). For example, watching Home Alone when Kevin meets his family again.
Comment: Probably I would use a term that refers to someone who cries easily in general: https://english.stackexchange.com/q/346709/191178
Comment: "tears up easily". to tear up has two meanings, though
Comment: None of the answers are specific to movies—they can apply to anything. But it's not clear what the exact scope or context of this question should be.
Comment: @JasonBassford - Good point.  In all honesty, I meant my answer as a comment, but somehow typed it in the wrong text box.
Comment: What about "a big softie"? Although that's very general and not specific to watching movies.
Answer: an emotional person is prone to emotions.
emotional - (adjective) "readily affected with or stirred by emotion: an emotional person who often weeps."
Answer: I'd normally call them a sap. Meaning someone who is overly emotional and cries at the slightest sad thing.  However I can't find that definition in the dictionaries I looked at.  I will also note that a "sappy" movie is one that plays to one's emotions in an effort to elicit a response- like crying:
For example here's sappy used "in the wild" (thanks @Conrado):

Everyone needs a good cry every now and then. Especially since it's summer and we have plenty of time on our hands to watch sappy movies, eat chocolates and bury our sorrows.

Source: identity-mag.com
Comment: @Conrado- I approved it (with an edit) :-)
Comment: I've never actually heard of *sap* being used to mean somebody overly emotional. (Although *sappy* means sentimental.) But *sap*, as far as I know, just means gullible.
Comment: @JasonBassford - That seems to be confirmed by the dictionaries I looked at, but I can tell you that "calling" someone a sap when they cry at a certain type of "Hallmark channel" movie has been been a common thing in my sphere of experience.
Comment: Jim, I've suggested an edit showing an example from in the wild using "sappy movie", but SE says now that it has to be approved by trusted community members etc. If the machine doen't ask you to confirm, feel free to reject them anyhow.
Comment: Perhaps since OP asks for slang, an Urban Dictionary entry is allowed? "**sap**:
someone who is spilling out their guts about how they feel and such." https://www.urbandictionary.com/define.php?term=sap


What is the correct way to seed CSPRNG functions?

Question: When using CSPRNG (crypto secure pseudo random number generation) functions seeding is an important step. So what is the best way to seed a random number function?
Comment: [This thread](https://security.stackexchange.com/q/94646/145405) might be helpful.
Answer: As anywhere in engineering, there's no "unique" best way; there's always going to be tradeoffs between:

entropy of the source of randomness,
rate of the entropy (i.e. how many bits/second can you get?),
suitability of the source distribution,
computational resource and energy usage,
lack of side-channel attacks on the entropy generation,

and finally, and really not unimportant,

cost.

For example, if you had a truly random source of entropy that you could ask arbitrarily often per second, you'd need to do little CSPRNG – you'd basically have a CSRNG, nothing pseudo about that! All that the generation would do would be a bit of distribution shaping to get uniformly distributed bits, which is what most crypto algorithms need.
Now, since you don't have that, in general, you'd want a source that is

uncorrelated, actually even
unpredictable,
unmanipulatable, and
doesn't have any side effects, neither whether it's currently working, nor about the random data it's producing.

As such, high-quality sources used where it actually matters are often of a quantum nature: spontaneous emissions of photons in excited matter, often.
However, as anything, "the best possible" will set you back a couple thousand dollars, not fit in your rack server, laptop or smartphone, and actually be resistant to ... no attack anyone would ever try to do, realistically.
So, as always: Model your threads. Then define the number of truly random bits per second you'll need. See whether built-in methods (CPUs these days have truly random number generation – is that enough for you, assuming that you can isolate that CPU well enough to make any kind of side channel attack impossible?), together with state-of-the-art entropy pools. For all things I can imagine, Linux' /dev/urandom, using the ChaCha20 algorithm on such hardware sources, is cryptographically secure!


Does the Statement $\lim_{f(x)\to a}k(x)$ Make Sense

Question: In a formal mathematics context does the statement
$$\lim_{f(x)\to a}k(x)$$
where $f(x)\neq c$, where $c$ is a constant, make sense? For example does
$$\lim_{x^2\to 0}x$$
make any sense in a formal and rigorous setting.
Comment: Edited, I excluded the possibility of constant functions.
Comment: I suppose if $f$ is invertible, it wouldn't be unreasonable to define $$\lim_{f(x) \to a} k(x) = \lim_{y\to a} k(f^{-1}(y))$$ but what is the utility? If $f$ isn't invertible, it makes no sense: e.g. what is $$\lim_{(x^2-1) \to 0} x?$$
Comment: With some tweaking, this is a good, natural question. As @User8128 notes, a necessary condition for this to make good sense would be that $f$ is locally invertible everywhere. Even then, in general topological spaces, it is not true that continuous + invertible implies that a function is _open_. In situations where that _does_ hold, then, yes, your $f$ has at least a local inverse, etc.
Answer: It's not quite standard notation, but the meaning is pretty clear:
$$ \lim_{f(x) \to a} k(x) = B$$
would mean:
For every $\epsilon > 0$ there exists $\delta > 0$ such that
whenever $0 < |f(x) - a| < \delta$, $|k(x) - B| < \epsilon$.
Answer: For every $c>0$ there exists $d>0$ such that $|f(x)-a|<d$ implies that $k(x)-l|<c$


Reasonable amount of video game time for an 8 year old kid?

Question: So, my kid brother, who's 17, has been visiting me, my wife and kids. My son, Blake, loves Uncle Zach and loves spending time with him, which is great. Zach has brought some video games for him and Blake to play while he's here. The games are appropriate and fun for him, and I enjoy playing with them sometimes. But, I want to make sure he is outside and does physical activities so that he's healthy. My question to all you is: What is a reasonable amount of time for my son to play video games, daily?
Comment: Are you asking in general, or simply for the time that Zach is there? Because if he's just visiting for a few days and the video games disappear with him when he leaves, the amount of time they spend playing video games doesn't really matter.
Comment: @Pascal: Oh, the games are actually gifts be bought for Blake, so he'll keep them after Zach leaves
Comment: Possible duplicate of [How much time is too much time playing educational computer games?](https://parenting.stackexchange.com/questions/4818/how-much-time-is-too-much-time-playing-educational-computer-games)
Comment: Keep in mind that "video games" is grouping several very different things together. For example, a digital version of a board game played with family on the living room TV is a significantly different experience from sitting alone in a room playing a shooter. I would judge this by the content of the game and the context in which it happens, not just as an absolute time limit for any kind of video game. (The continued question would then also be why you're distinguishing between videogames and TV time, as the core issue is the same either way)
Answer: The American Academy of Pediatrics updated recommendation is one hour per day for children over 2 years old. (Yes, it's the same for a three year old and an eight year old.). Lurie Children's Hospital has a blog post that discusses the new recommendations and shows some additional resources you can use.  Screen time includes video games, television, and any other time spent in front of a screen.
In my personal opinion this is appropriate for general screen time; a child who has a particular hobby or skill that involves a computer or tablet may reasonably exceed this when doing productive activities (I.e. programming, drawing on a tablet, writing stories, etc.), but gaming should still be limited at least until teenage years if not further.
Comment: I'd like to know how you keep children occupied when that time limit expires. Busy parents rely on the digital babysitters, 1 hour....C'mon a kids movie isn't even 1 hour.
Comment: @SiXandSeven8ths That sounds like a good question to ask :)
Comment: @user20343: Recommendations do not take into account personal situations. As with many things, exceptions exist. For example your child is not going to otherwise be exercising on a long distance flight, so the advice does not necessarily apply (or not in the exact same way). However, I would offer the thought that not knowing how to entertain your children without the aid of TV might indicate that the parent's parental abilities/repertoire needs to expand. I cannot conclusively judge anyone here but it is a valid question to at least consider.
Answer: The National Institutes of Health recommends that screen time in total be limited to about 2 hours every day. In a part of their effort to increase awareness of potential health issues in children related to too much screen time, they have started the We Can program. Among other tools they have available, they offer a downloadable/printable chart that helps you begin an initial assessment of how much screen time your child gets over the course of the week.
I recommend starting with that chart, figuring out the average time spent on playing games or watching TV and then figure out from there how to reduce it down to an acceptable time for both you and your child.
I'd also like to mention that when approaching this topic with your son, if you believe it is an issue, that you should also be mindful of your screen time with your devices if you have some. My wife and I have been asked more than once why it's OK for us to check our phones continually despite setting restrictions on our son for his limited screen time. Granted we may be doing work or other non-recreational business on our phones but remember that perception is everything.
Comment: "...you should also be mindful of your screen time with your devices if you have some..." Such an important message!!
Comment: @anongoodnurse: I consider myself reserved when it comes to tech. No more than 3 and a half hours a day, not counting work
Comment: @BryanRivers - In my opinion, that's a *lot* of screen time, even for an adult. Obviously, people are free to do with their time what they want, but the message you send your son will be very mixed. As Joe's source blog stated, "It's essential for parents to be good role models...."
Answer: Another option would be that your son has to associate the amount of time playing the video game to an equal (or multiple of an) amount of some other constructive activity, e.g. for every hour of video games, they have to spend an hour reading and/or playing outside and/or doing extra chores (in addition to their daily duties; children shouldn't expect an reward for things that they're expected to do).


Is a wave function a ket?

Question: I just started with Dirac notation, and I am a bit clueless to say the least. I can see Schrödinger's equation is given in terms of kets. Would I be correct to assume if I were given a wavefunction, say $\Psi(x)=A\exp(-ikx)$, would I be able to just use the notation $\lvert \Psi\rangle =A\exp(-ikx)$?
Comment: Was your question answered?
Answer: The definition is
$$
\psi(x)=\langle x| \psi\rangle, ~~~\leadsto \\
|\psi\rangle= \int dx ~~\psi(x) | x\rangle , ~~\leadsto \\
|\Psi\rangle= \int dx ~~ A e^{-ikx}| x\rangle .
$$
Wavefunctions are coefficients of coordinate kets.

NB You may also then check
$$\langle p|\Psi\rangle= \int dx ~~A e^{-ikx} \langle p|x\rangle ={A\over \sqrt{2\pi \hbar}} \int dx ~e^{-ix(k+p/\hbar)} \\
={A\over \sqrt{\hbar}} \delta (k+p/\hbar). $$
Answer: A ket is an abstract vector which describes the state of your system. A wavefunction is a representation of that vector in a particular basis, usually the position basis (although you will sometimes also hear about, e.x. "momentum-space wavefunctions"). The way the position-space wavefunction $\psi$ is defined is by letting $\psi_\alpha(x)$ denote the component of the vector corresponding to the state $\alpha$, in the direction of the position eigenvector with eigenvalue $x$. This is seen in the equation
$$\psi_\alpha(x) = \langle x\vert\alpha\rangle$$
Therefore, it would be incorrect to say something like $\lvert\alpha\rangle=\psi_\alpha(x)$, since $\lvert\alpha\rangle$ is a vector in the state space, whereas $\psi_\alpha(x)$ is just some scalar complex number telling you the $\lvert x\rangle$ component of $\lvert\alpha\rangle$.
Answer: The relationship of the values that wave functions take to "kets" is the same as that of vector components to vectors - which makes sense since "kets" are a type of vector, just one in a space that is more general and quite easily (very!) infinite-dimensional. In Euclidean space, you have a vector of the form
$$a_1 \mathbf{e}_1 + a_2 \mathbf{e}_2 + \cdots + a_n \mathbf{e}_n$$
where $\mathbf{e}_j$ are basis vectors, which have the property that combinations like the above generates every other vector in the space. The components are the coefficients $a_j$. Note that the relationship
$$j \mapsto a_j$$
is a function whose domain is the finite index set $\{ 1, 2, \cdots, n \}$ that indexes the dimensions of the space. This function is exactly the analogue of the wave function in the ket case, only here, the "index of dimensions" is a point in space, so that there now are as many dimensions as there are points in space, and we need to add up an uncountable number of terms, so we want to use an integral:
$$|\psi\rangle = \int_{P \in \mathbb{R}} [\psi(P)\ dV]\ |P\rangle$$
. And that's it.
Now an _eigen_ket is something that only makes sense in the context of also having a particular linear operator we are interested in - a certain kind of ket-valued function of kets. If $\hat{A}$ is a linear operator, that is, that takes a ket as an input argument and outputs another ket, then if there's a particular ket $|\psi_E\rangle$ for which it acts like a scaling, i.e.
$$\hat{A}(|\psi_E\rangle) = a |\psi_E\rangle$$
for some number $a$, then we say $|\psi_E\rangle$ is an eigenket of the operator $\hat{A}$. If you think of kets as infinite-dimensional vectors, then eigenkets are those whose "direction" doesn't change when the operator is applied. There is no such thing as "an eigenket" by itself, without any reference to a particular linear operator that works this way when applied to it.
It should also be mentioned that once you have a vector space, you can also consider alternative sets of basis vectors. These give different vector components, and the same goes for kets as well - which means there are different kinds of "wave function", such as a momental wave function (dimension index is momentum values), or an energetic wave function (dimension index is energy), and so forth.
Answer: Yeah, as a beginner you can basically do this with no problems, but a physicist would tend not to do that because it's mixing notations. $|Y\rangle$ is a state, i.e. a vector. $Y(x)$ is a function that eats a value of $x$ and spits out the value of the wave function $Y(x)$. So whereas $Y(x)$ "depends" on an input, $|Y\rangle$ does not, and the expression $|Y\rangle = Y(x)$ isn't "balanced" on both sides.  A slightly more correct expression would be to write
$$
\langle x | Y\rangle = \int dx' \delta(x-x')Y(x') =Y(x)
$$
But really this is a minor quibble.
Comment: I wouldn't call this minor, and introducing the correct formalism from the start helps a lot in avoiding confusion later on.
Comment: Depending on how one looks at it, a function is a vector, just as a ket is. In fact, the Hilbert space of kets $|\alpha\rangle$ is isomorphic to that of wavefunctions $\psi_\alpha(x)=\langle x|\alpha\rangle$. The difference is that kets keep the basis hidden, while in the wavefunctions it's explicitly chosen.
Answer: You are indeed confusing eigenket and eigenfunction. The eigenkets are the possible forms your system takes after a measurement, they are the eigen vectors (eigenkets) of  the measurement operators (ex $\hat{H}$) you choose to apply on your eigenfunction (your system). The eigenfunction of a system can be expressed as a superposition of eigenkets (integral ->continuous or series ->discret).
They are both vectors in the Hilbert space you are working in thought
Don't hesitate if you need clarification
Answer: It depends on the equation, that is: $V(x)$. If it's free particle ($V(x)=0$), with $\hbar=1$, then:
$$ \psi(x) = Ae^{-ikx}$$
is proportional to the momentum eigenstate:
$$ |k\rangle$$
Then:
$$ \hat p |k\rangle = \hbar k|k\rangle = k|k\rangle$$
is easier to deal with then:
$$ i\frac{d}{dx}\psi(x)=i\frac{d}{dx}Ae^{-ikx} = -i^2kAe^{-ikx}=k\psi(x)$$
and likewise for:
$$ \langle k'|k\rangle = \delta(k'-k)$$

Is a wave function a ket?


A question about rational.

Question: Is that true : Every positive rational number $q$ can be written as $q = \sum_{i=0}^{k}1/n_i$ , where $n_i,k$ are positive intergers and $n_i\not=n_j$ if $i\not=j$.
Answer: Express the fraction $\dfrac{a}{b}$ as a sum of $a$ copies of $\dfrac{1}{b}$.  (For technical reasons, if $b=1$, use $2a$ copies of $\dfrac{1}{2}$.) Major flaw: the denominators are not all different.
Using repeatedly the identity
$$\frac{1}{k}=\frac{1}{k+1}+\frac{1}{k(k+1)},\tag{$1$}$$
 we can express any $\dfrac{1}{n}$ as a sum of distinct unit fractions with all denominators as large as we wish.
So leave the first $\dfrac{1}{b}$ alone. Express the second one as $\dfrac{1}{b+1}+\dfrac{1}{b(b+1}$. For the third $\dfrac{1}{b}$, use Identity $(1)$ repeatedly to express $\dfrac{1}{b}$ as a sum of distinct unit fractions with denominators all greater than $b(b+1)$. Continue.
The algorithm we have described is quite inefficient. There are much better algorithms available, going back to Fibonacci's greedy algorithm.
Answer:
An Egyptian fraction is the sum of distinct unit fractions, such as .
  That is, each fraction in the expression has a numerator equal to 1
  and a denominator that is a positive integer, and all the denominators
  differ from each other. The value of an expression of this type is a
  positive rational number a/b; for instance the Egyptian fraction above
  sums to 43/48. Every positive rational number can be represented by an
  Egyptian fraction. Sums of this type, and similar sums also including
  2/3 and 3/4 as summands, were used as a serious notation for rational
  numbers by the ancient Egyptians, and continued to be used by other
  civilizations into medieval times. In modern mathematical notation,
  Egyptian fractions have been superseded by vulgar fractions and
  decimal notation. However, Egyptian fractions continue to be an object
  of study in modern number theory and recreational mathematics, as well
  as in modern historical studies of ancient mathematics.

From Wikipedia.
Read here: http://en.wikipedia.org/wiki/Egyptian_fraction

A question about rational.


How to calculate the Funding Benefit of Equity for a profitability or FTP calculator for a credit union

Question: I am creating a RAROC/FTP model for different loan types on a credit union balance sheet.
I am stuck on how to calculate the funding benefit of equity that would be netted out of my cost of funds benchmark. An example below shows the funding benefit @ 0.17%.  Does anyone know where that may be sourced from or what calc method is being used to arrive at that result?
Answer: You're essentially calculating the Weighted Average Cost of Capital.
Target Capital Ratio * Risk Weight * Cost of Funds = Funding Benefit of equity %
Ex:
Risk weight = 75%
Capital Ratio = 10%
Cost of Funds = 5%
Funding Benefit of Equity = 38bps


Can we run firefox and Nightly simultaneously?

Question: When I start nightly, new window of firefox is starts again, so I have to close firefox and start nightly, then if I open firefox Nightly's new window opens. What I am asking is can I run them both simultaneously?
Answer: There are several ways of running to instances of Firefox simultaneously described in the Mozilla wiki:
You can either export MOZ_NO_REMOTE=1 and start firefox (like MOZ_NO_REMOTE=1 firefox or export MOZ_NO_REMOTE=1; firefox) or use the -no-remote argument like firefox -no-remote.
To automatically do this on every login, you can add the export MOZ_NO_REMOTE=1 line to your shells profile file (like ~/.bash_profile).
Comment: thanks but the exporting is not working
Comment: What's the error / unexpected behaviour you're getting?
Comment: I get no error but I cant open Nighlty and Firefox same time
Answer: I think the main problem is that the executable 'firefox' is placed in /usr/bin/ for both. Take a look at this link: http://www.ghacks.net/2011/08/23/how-to-run-firefox-stable-beta-aurora-and-nightly-simultaneously/


How to use a Quantum input in a VQC in Qiskit?

Question: I am currently working on a project about Quantum Image Encoding, mainly with FRQI and NEQR algorithms.
These codification methods use different circuit architectures (and not only parameters) depending on the image you are working with. My idea was to append an ansatz to these circuits and assess if it is possible to perform a classification task. However, the Qiskit functions that I have tried (VQC, QNN, TwoLayerQNN...) can only take classical data as inputs (as far as I know). I can't either use this encoding circuit as a feature map, as these circuits will change depending on the input (as I explained before).
I was wondering if any of you know how to solve this problem, by taking the Quantum output of my encoding circuit and using it as an input for an ansatz.
Thank you so much!!
Answer: To my knowledge, encoding of quantum machine learning is still a hot research topic. Hence, in short, I think you could propose your own new encoding method for this condition.
Here, we can make a simple example. Let's take FRQI as example.
https://qiskit.org/textbook/ch-applications/image-processing-frqi-neqr.html
After FRQI State quantum state representing the image, we could get a subcircuit. Then you could directly take this subcircuit as the encoding of quantum machine learning. For instance,
https://qiskit.org/textbook/ch-machine-learning/machine-learning-qiskit-pytorch.html
<code>    def __init__(self, n_qubits, backend, shots):
        # --- Circuit definition ---
        self._circuit = qiskit.QuantumCircuit(n_qubits)

        all_qubits = [i for i in range(n_qubits)]
        self.theta = qiskit.circuit.Parameter('theta')

        self._circuit.h(all_qubits)
        self._circuit.barrier()
        self._circuit.ry(self.theta, all_qubits)

        self._circuit.measure_all()
        # ---------------------------

        self.backend = backend
        self.shots = shots

</code>
You can replace the angle encoding here with the subcircuit of FRQI State you just made.


Nomination of candidates in 1824 election

Question: The traditional method of nominating candidates before 1824 in America was "King Caucus", informal congressional caucus. For the 1824 election, William Crawford was nominated by Caucus and four other candidates (three of which stayed in the race) were nominated by other means. By exactly what means were they nominated? More generally, what is the procedure for determining who is on the presidential ballot? Is there some office that the list is submitted to or some committee that puts their stamp on it or what?
Comment: Could you clarify in the question why the information in the [wikipedia page](https://en.wikipedia.org/wiki/United_States_presidential_election,_1824) is inadequate?
Answer:
. . . . The election of 1824 brought
  an end to both the Democratic-Republican-dominated "era of good feeling" and the
  use of a congressional caucus as a nominating device. Although the Democratic-
  Republican caucus nominated William Crawford of Georgia as its candidate, three
  other candidates (John Quincy Adams, Henry Clay, and Andrew Jackson) were also
  nominated by rival factions within the party. After a bitter contest and an electoral
  college deadlock, Adams was elected President by the House of Representatives. Senate Reference Paper

Today the political parties nominate candidates; in the early days of the Republic nominations arose from caucus'.  The election of 1824, in which the party nominated multiple candidates and as a consequence lost the election, shaped the current system.
I can't find a clear reference, but the ballots are printed by state board of elections, generally under the supervision of the State's Secretary of State.  Candidates qualify by submitting a nomination petition.
Answer: Note that the first Congressional nominating caucus was in 1796, and was only to select a VP nominee. Thus the "King Caucus" system really only operated for POTUS candidates for 6 election cycles (1800-1820).
In the USA, the presidential election is essentially a set of separate elections where every state simultaneously votes for its state's choice of presidential electors. As such, the responsibility for drawing up and printing a state's ballot is entirely up to that state. A state could in theory, if it felt like it, refuse to put a major party's candidate on the ballot. Before the Civil War (particularly prior to 1836), it was actually relatively common for states to appoint their electors with no popular vote whatsoever.
In current practice, states delegate this task to their own state election boards, which have specific rules that have to be followed (as per that state's laws). For instance, in my own state of Oklahoma, parties get to pick their nominees, but a party only gets a line on the ballot if it received 10% of the vote in the last major election. This makes Oklahoma one of the toughest states in the country to get on the ballot.
1836 is an interesting case, in that the Whig party tried nominating different candidates in different regions of the country. The hope was that this would thwart a popular Democratic-Republican candidate by deadlocking the Electoral College and throwing the election into the House, where they had a majority. It didn't work, and hasn't been tried since.
Comment: It was not just in 1860 that South Carolina selected presidential electors by the state legislature. It was their practice throughout the Antebellum era.
Comment: @Oldcat - Thanks for the comment. I looked into it, and that is in fact the case. It looks like SC **never** had a popular vote for POTUS before the war. They were unique in that respect only since 1832. Going back further before that, appointed electors become increasingly common. I'm removing the misleading note, and editing the answer to mention this.
Answer: There was no official "procedure for determining who was on the presidential ballot" because during this period there were no official ballots.
In most states, voters were required to write the name of their preferred candidates on scraps of paper, but this was problematic because it required people to remember a large list of names, and votes were often disqualified because of misspelled names.
To help voters, the parties supplied their own ballots with only their party's candidates printed on them. You could copy names from the ballot onto a scrap of paper, or in some states you'd simply place the printed party ticket into a ballot box. Here's an example of one such ballot (source):

How Did Parties Choose Which Names Went on their Ballots?
There was never anything official or binding about nominations stemming from the Congressional Caucus. State parties were always free to ignore the Caucus and print their own ballots with their own presidential candidate.
OP asked, "By exactly what means were [the other candidates] nominated?" The other candidates were usually nominated the same way that Crawford was, but in miniature, by state caucuses.
Again, because of the unofficial nature of nominations, any group dissatisfied with the state party's nominees could simply print their own ballots. This is what happened in 1828: The Jacksonians did not need to worry about "getting on the ballot," because they could distribute ballots with Jackson's name to potential supporters.
(Update: Shortened significantly from original. See edit log if dying to know more.)


what is the percentage of stars with planetary systems?

Question: I'm having hard times understanding the equation of Drake, i can´t find the number of the variable that refers to the stars with planetary systems (fp)
Comment: If you just want the question in the title answered, I did a quick google search and found that nearly every sun-sized star has a solar system. That means 17% of the stars in the universe have solar systems. I got this information from 'universe today' (http://www.universetoday.com/99309/nearly-all-sun-like-stars-have-planetary-systems/), I also checked multiple sources.
Comment: [Here's](http://www.seti.org/weeky-lecture/planets-everywhere-7th-kepler-planet-catalog) a recent SETI talk on the topic, at least from the Kepler telescope perspective. The title of it is pretty much the answer. Planets have been found also around neutron stars and white dwarfs, although they have a violent history, and free floating. There are signs of possible planets in the Oort cloud.
Answer: For the purposes of the Drake equation you may as well assume that every star has a solar system.
At present, the exact fraction is unknown since the search techniques are limited to finding planets with certain characteristics. For example, transit searches tend to find close-in, giant planets; doppler shift surveys are also most sensitive to massive planets with short orbital periods, and so-on.
One can try and account for this incompleteness, but although some examples have been found, we are in the dark about the fraction of stars that have an Earth-sized planet at distances further than the Earth is from the Sun, or the fraction of stars that have any kind of planet orbiting beyond where Saturn is in our solar system.
For the Drake equation, you need to know the fraction of stars with planetary systems times the number of "habitable" planets per system is. There have been attempts to estimate this from Kepler data.
Possibly the best estimate at present is from Petigura et al. (2013), who estimate that 22% of sun-like stars have an earth-sized (1-2 Earth radii) planet that receives between 0.25-4 times the radiative flux of the Earth.
Obviously this is a lower limit because it doesn't include planets smaller than the Earth. It also doesn't include the moons of giant planets, which may also be habitable.
We still know very little about this fraction when it comes to M-dwarf stars, which are the most common type of star in the Galaxy...
Comment: any thoughts? [Serious alternate form of the Drake Equation, or graffiti?](https://astronomy.stackexchange.com/q/41544/7982)


How do I save edits from an ArcMap editing session using VB.Net?

Question: I have figured out how to do a map save document, but I would also like to be able to save edits whether or not I am also saving the map document.
Comment: Are you wanting to start and stop an edit session by code or just save during an existing edit session?
Comment: I just want to save the edits when I have already started an edit session. I also don't want it to stop the edit session.
Answer: You can save edits using ArcMap Command Save Edits, see code below.  This will not stop the edit session.
Dim pUID As New UID
Dim pCmdItem As ICommandItem
' Use the GUID of the Save command
pUID.Value = "{59D2AFD2-9EA2-11D1-9165-0080C718DF97}"
' or you can use the ProgID
' pUID.Value = "esriEditor.SaveEditsCommand"
pUID.SubType = 3
pCmdItem = My.ArcMap.Application.Document.CommandBars.Find(pUID)
pCmdItem.Execute()

Comment: I'll try this out later. Thank you. Sorry about posting this on the other question before.
Answer: In looking for this answer I ran across ESRI documentation that indicates the Save Edits command does perform a stop/start on the edit session. So the edit session is being stopped (and saved), but then a new session is immediately being started.

Most editor methods for managing an edit session have a direct correlation to geodatabase methods. This is also true from the Editor's UI with the exception of the Save Edits command. In this case, the Editor's Save Edits command calls IWorkspaceEdit.StopEditing(True) and IWorkspaceEdit.StartEditing internally.

If you have a reference to the workspace object being edited this does the same as @artwork21's answer, in C#, though, as my VB.net is rusty.
IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)workspace;
bool saveEdits = true;
workspaceEdit.StopEditing(saveEdits);
bool withUndoRedo = true;
workspaceEdit.StartEditing(withUndoRedo);


TI-83 Series Graphing Calculator Emulator

Question: Back in middle school I set up a Windows/DOS TI-83 calculator emulator for some of my teachers.  I can't for the life of me remember the name, but I'm looking for a Mac TI-83 emulator (or any TI-8x family of calculators, TI-83 Plus, TI-84, etc) for Mac.  Anyone know of any Mac or cross-platform solutions?
Comment: I would consider this on-topic.  I certainly considered and used my TI-81 as a portable computer at the time so I don't see why it wouldn't count as a retro-computer now.
Comment: This seems to be a test question based on this [meta question](http://meta.retrocomputing.stackexchange.com/q/181/12). I see no reason why this doesn't belong here. There is a large and vibrant community of programmable calculator hackers that should be welcome here.
Comment: One question per post, please. I edited the second related question out, but it would make a fine new question. (And nice catch of my typo.)
Comment: Thanks @jdv, new question [here](http://retrocomputing.stackexchange.com/q/1045/621).
Comment: This has come up in the close votes queue. I will not vote (since I am a mod it would be binding) but others should. If this question remains, I (or somebody else) will make a tag for it, but if not...
Comment: I consider this off-topic, as TI are still selling TI-83+ calculators that are compatible with the TI-83. So they're not remotely retro.
Answer: Wabbitemu is a modern emulator supporting many TI platforms, it supports TI-73, TI-81, TI-82, TI-83, TI-83+(SE), TI-84+(SE), TI-84+CSE, TI-85, and TI-86


Why do hair on head not get pilo-erected?

Question: Whenever we have "goosebumps", there is a momentary piloerection, due to which hair on our elbows and legs get "erected" and "stand" almost perpendicular to the surface of our skin. But why do our "head hair" not get erected ?
Comment: This seems to also be true  about facial hair and pubic hair
Answer: Piloerection of head hair does happen as often as it occurs elsewhere on the body, but head hair length tends to make it difficult to see. Close observation, especially with short hair, should make it visible.
Piloerection of head hair is something more commonly felt by the person it is happening to rather than seen by others (or in mirrors); when you get that "goose-bump" sensation across your scalp, that will be due to pilo-erection.
(PS added) I haven't provided citations - this is not a phenomena that has had much specific academic research and I have not found any stating it occurs - or stating it does not occur (except in association with balness) despite looking, but is almost universally experienced, often without close examination or reflection about what specifically happens.
Citing references for baldness resulting in absence of piloerection on the scalp is not quite the same as a reference specifically stating it happens, but ... Professor Rodney Sinclair, head of dermatology at the University of Melbourne says - "You can't get goose bumps on the scalp when you go bald and you can't regrow hairs either because the follicles can't regenerate." ( https://www.futurity.org/goose-bump-muscle-1324242-2/ ) ( https://link.springer.com/article/10.1007%2Fs12565-016-0359-5 )
Answer: Many sources say that it does.  See the word "horripilation", for instance.  Or no less an authority than Shakespeare, who tells us
<code>I could a tale unfold whose lightest word
Would harrow up thy soul, freeze thy young blood,
Make thy two eyes, like stars, start from their spheres,
Thy knotted and combined locks to part
And each particular hair to stand on end,
Like quills upon the fretful porpentine
</code>
(For those unfamiliar with English Literature, the source is William Shakespeare's play "The Tragedy of Hamlet, Prince of Denmark", Act I, scene 5, lines 15-20, first performed ca 1602, and published in various versions between 1603 and 1623: https://en.wikipedia.org/wiki/Hamlet )
Comment: I find Shakespeare a respectable, yet a non-scientific source.