"Flow" between computers (Logitech mouse) DLP

Question: From a DLP perspective, does anyone know what DLP controls to block or monitor this Logitech Flow?
Answer: DLP generally works at the filesystem level, scanning files when opened and/or written to disk.  Files copied onto a system using Logitech Flow will trigger DLP at the same points as usual; DLP cares about filesystem operations and not about the method (network, Flow, carrier pigeon, ...) used to get the file in place for interaction with the filesystem.
Comment: Ok let me ask it this way, we block USB storage, network storage like Dropbox and such. What controls if not using say 802.1x and someone for some reason got admin to install flow on work PC and personal block this insider threat because of this really pretty cool enduser technology. I assume as the whitepaper was rather vague this is just using peer-to-peer over standard peer-to-peer ports 6881-6889 or HTTPS? I guess I could just fire up wireshark and answer most of my own questions I have. :)

“Flow” between computers (Logitech mouse) DLP


Updating Droid X running leaked Gingerbread to official release without root

Question: I have a stock unrooted Droid X running a leaked version of the Gingerbread update (system version 4.5.588). How can I update to the official release (system version 4.5.596) without root?
Comment: If you're running a leaked ROM, you've already voided your warranty. Why don't you want to root?
Comment: Can I root without wiping my device?
Comment: @Skywalker Generally speaking, yes. I haven't looked very far into methods of rooting the Droid X, though.
Comment: i used z4root to root my brothers Droid X (I don't know of it's availability any more, but i am sure you can find it if you google it). It was as easy as installing the app, and clicking "root". No data loss at all.
Comment: zroot isn't working for me with the official gingerbread release.
Comment: GingerBreak does work however
Answer: There should be someone who has the official release that you can download and just upgrade like you did with the leaked version.  Like this post here.  It says it's for rooted users, but I don't see anything in the instructions that should require root.
Comment: "When you finish with this process, whether you are coming from Froyo or a leaked GB, you will be on official .596 with root access." This doesn't help someone who doesn't want to have root at the end of the process.
Answer: You going to want to sbf your phone back to .340 first. Here is a great forum post showing how. I did it with my linux box, you can do it with windows but drivers can be an issue from what I have heard. Once you sbf your phone you can pull it down OTA. Warning this erases everything and you will loose root. The official release has not been rooted yet to my knowledge.
I have done it 2 times now I was running lexlite gingerade and sbf to install leaked gingerbread and then I sbf to install the offical release.
*Edit: * Looks like I was wrong it has been rooted there is just no easy root method. See @CaseyB post.
Let me know if you need any more help.


How can we neglect copper losses in open circuit test then neglect core losses in short circuit test of transformer?

Question: When we perform open circuit test, we measure the core losses and we neglect the copper loss resistance (and also the leakage flux inductance?). But when we perform the short circuit test we measure the copper losses neglecting the core losses.
What are the things that make that possible?
And also why only apply rated vlota7 only?
Answer: In an open circuit test, the current flowing in the secondary is zero hence copper loss is zero in the secondary. In the primary, the only current is the magnetization current and, it is this current that causes core saturation. It's usually a small fraction of full load primary current hence, those copper losses associated with core saturation current are quite small and can be ignored.
In a short circuit test, the applied voltage on the primary is very much smaller than that applied in proper applications hence, the magnetization current is very much smaller and, because of this, core losses are fairly negligible. Copper losses dominate short circuit testing because the applied voltage to the primary is chosen to produce the equivalent of full-load currents.
Answer: In open circuit test the current in the primary winding is small and the secondary has zero current. Losses happen mainly in the core assuming the primary is properly designed for the voltage.
In short circuit test the voltage is low. The core magnetization is low because the coupled primary and secondary currents cause opposite magnetizations and do not increase the magnetization what's caused by the primary voltage and primary inductance.
Answer: Consider that copper losses are proportional to I^2, while core losses are practically independent of load.
Therefore, for a full load current (referred to the primary) 10x the magnetising current, the copper losses will be 100x greater than in the open circuit case, and for the short circuit test, much greater still. Or, the copper losses in the open circuit test are small enough to be neglected.
The magnetizing loss is about the same in both tests, but it is relatively small when compared to 100x the copper loss so it is much easier to measure in the open circuit case, and there is nothing to be gained from measuring it twice.


Consecuitive Coin Flip Probability

Question: What formula would someone use to calculate the probability of having $n$ consecutive heads out of $x$ flips, and what formula would it be if it were at least $n$ consecutive heads (with a fair coin) out of $x$ flips? I would think it would be something divided by $2^x$, but I don't know where to go from there.
Comment: Is your first question asking for "probability of having only $n$ heads that are consecutive"?
Comment: Yes, whereas if n=3, then we would only consider the cases with four consecuituve flips in the second formula.
Comment: So you want $n$ consecutive heads **flanked** by tails in the first case.
Comment: Yes, but one side of the row of consecuitive heads may be open. Ex. HHHTH would qualify for the first case if n=3.
Answer: For your first question we require $n$ heads out of $x$ flips. We can relate to the fundamental formula of probability to yield our answer. That is,
$$\mathcal{P}(\mathrm{n\ Consecutive\ Heads)}=\frac{\mathrm{Number\ of\ Favourable\ Outcomes}}{\mathrm{Number\ of\ Total\ Outcomes}}.$$
Now the number of total outcomes will be equal to $2^{x}$. To find the number of favourable outcomes, we have to talk about a couple of things. First, it should be clear that since we require $n$ consecutive heads, this is only possible when the "sequence" of heads start at the very latest, on the $(x-n+1)\mathrm{th}$ flip. Take an arbitrary example - say you flip the coin 5 times and want 2 consecutive heads - where is the latest flip that we can start?
The next thing to mention is that to ensure we only get $n$ consecutive heads, the outcome of the flips next to the sequence of heads must be tails!
This is all we have to consider. If we do get 2 sets of $n$ consecutive heads, it does not matter for our question. So lets begin the calculations.
Assume that our sequence of heads starts in the first position. Therefore, by the multiplication principle, the number of outcomes given our assumption is
$$\mathrm{Sequence}_{\mathrm{1st\ Position}}=([1\times 1...\times 1]\times1)\times 2\times 2\times ...\times 2.$$
In the square brackets we clearly want the outcomes to be head. Thus, only 1 possible outcome of a flip is possible, namely head. Immediately outside the square bracket we require a tail to ensure that the sequence of heads is strictly of "length" $n$. The rest of the multiplication can either be head or tail. But the question is, how many $2$'s are there? Well, out of the $x$ flips, $n$ went to the sequence of heads, and $1$ went to the tail. Therefore there must be $(x-n-1)$, $2$'s. Thus,
$$\mathrm{Sequence}_{\mathrm{1st\ Position}}= 2^{x-n-1)}.$$
By symmetry it should be clear that (recalling our LAST position for the sequence of heads to be at $x-n+1$
$$\mathrm{Sequence}_{\mathrm{(x-n+1)th\ Position}}= 2^{x-(n+1)}.$$
Finally, we have to consider the number of outcomes if the sequence of heads starts in positions that we have not covered. Well, this is a simple alternation as we require another tail on the side of the sequence. Therefore,
$$\mathrm{Sequence}_{\mathrm{ith\ Position}}= 2^{x-(n+2)},$$
where $i$ is a positive integer in $[2,x-n]$. Why $x-n$? Well $i$ is the value that is not at the first and last possible position that I mentioned earlier to be $x-n+1$. Therefore, the number of favourable outcomes is given by
$$\mathrm{Number\ of\ Favourable\ Outcomes} = 2^{x-(n+1)} +(x-n+1)2^{x-(n+2)}+2^{x-(n+1)}$$
$$=2^{x-n} + (x-n+1)2^{x-(n+2)}$$
$$=2^{x}2^{-n} + (x-n+1)2^{x}2^{-(n+2)}$$
$$=2^{x}[2^{-n} + (x-n+1)2^{-(n+2)}].$$
Therefore
$$\mathcal{P}(\mathrm{n\ Consecutive\ Heads)}=\frac{2^{x}[2^{-n} + (x-n+1)2^{-(n+2)}]}{2^{x}}.$$
$$=2^{-n} + (x-n+1)2^{-(n+2)}.$$
I encourage you to use the same problem solving process used here to solve your latter question.

Consecuitive Coin Flip Probability


On the spectrum of random regular graph

Question: For a random $d$-regular graph, where $d$ can be fixed or can grow slowly with the size of the graph $n$, what can we say about its spectrum - Do you believe it has simple spectrum?
Thank you,
Comment: On the principle that it is easier to ask questions than to answer them: could you please edit your question and give a bit more information on what you've already tried to do towards answering this problem? For instance, why do you think it might have simple spectrum?
Answer: Yes, I believe that it will have simple spectrum for d >= 3 and it feels like something that should have been proved, though I can't actually find it.
There is a loose association between automorphisms of a graph and multiple eigenvalues, and as most regular graphs have trivial automorphism group we lose this source of multiple eigenvalues. There are no other (frequently occurring) "reasons" for a graph to have multiple eigenvalues and so in general they won't be there.
ADDED:
Here are some exact numbers for connected (pairwise nonisomorphic) cubic graph: disconnected graphs vanish numerically and so we can ignore them.
10 vertices - 19 graphs - 6 with no repeated eigs = 31% simple
12 vertices - 85 graphs - 18 with no repeated eigs = 21% simple
14 vertices - 509 graphs - 316 with no repeated eigs = 62% simple
16 vertices - 4060 graphs - 2181 with no repeated eigs = 54% simple
18 vertices - 41301 graphs - 26446 with no repeated eigs = 64% simple
(Actually this is growing more slowly than I expected... )
Answer: In 1986, Noga Alon conjectured
in a Combinatorica article that,
for any degree $d \ge 3$ and for any $\epsilon > 0$,
most $d$-regular graphs on $n$ vertices have all their eigenvalues except $\lambda_1=d$
bounded above by $2 \sqrt{d−1} + \epsilon$.
In 2003,
Joel Friedman established this conjecture:
"A proof of Alon's second eigenvalue conjecture,"
2003.
Some further developments on the distribution of the eigenvalues are reported
in a paper by Miller, Novikoff, and Anthony Sabelli,
"The Distribution of the Largest Nontrivial Eigenvalues in Families of Random Regular Graphs"
in Experimental Mathematics, 2008.  Perhaps some of these references will help.
Answer: I guessed no but Gordon has changed my mind for degree greater than 2.
If it has degree 2 it is a union of cycles. Eigenvalues are  $2\cos(\frac{2 \pi j}{k})$ for various $ k$. In particular 2 has multiplicity the number of components.
For random regular graphs of degree more than 2 I'd wildly guess that the eigenvalue behavior is like that of a  large random symmetric matrix. This has been well studied, but not by me, all I know is the phrase "Gaussian Orthogonal Ensemble".
Some experiments with degree 3 graphs suggest that with 30 vertices one component is highly likely and there is a repeated eigenvalue ( most often 0) about 2% of the time. At 60 vertices it is more like 0.2%.
Comment: Think you're right: http://arxiv.org/abs/hep-th/0310002 , which would make it follow Wigner's Semi Circle law.  As a heuristic, you can think of Erdos-Renyi random graphs as essentially being regular in their mean degree, so it's not so surprising that actual regular graphs have the same property...
Answer: I am posting this answer to provide some additional references and information regarding the bulk spectrum of the adjacency matrix. (I believe that with probability $1$ the eigenvalues will be simple)
McKay's Law [1] for random $d$-regular graphs states that the spectrum weakly converges to the spectrum of the universal cover of the graph, which is a $d$-regular tree in this case. The spectral measure is given by $$d\mu_{\text{McKay}}(x)=d\mu(x)=\begin{cases}
\frac{d\sqrt{4(d-1)-x^{2}}}{2\pi(d^{2}-x^{2})}dx & |x|\leq2\sqrt{d-1}\\
0 & |x|>2\sqrt{d-1}
\end{cases}.
 $$
In other words, if we take a random $d$-regular graph $G_n$ with adjacency matrix $A_n$, and eigenvalues $\lambda_n\leq \dots \leq \lambda_1=d$, then for every $-2\sqrt{d-1}\leq a<b\leq 2\sqrt{d-1}$ we have
$$\frac{\#\left\{ \lambda_{i}:\ a\leq\lambda_{i}\leq b\right\} }{n}=\int_{a}^{b}d\mu_{McKay}(x)+o_{n}(1)$$
with probability going to $1$ as $n\rightarrow \infty$.
Tran Vu and Wang [2] showed that if $d\rightarrow\infty$ as the size of the graph goes to infinity then the spectrum converges to Wigner's semicircle law. Note that for low fixed degree we don't get the semi circle - this is because the $2k^{th}$ moments are not simply the $k^{th}$ Catalan number multiplied by the spectral radius to the power of $2k$ - the base point has degree $d$ and this affects the calculation when $\frac{d}{d-1}\neq 1+o(1)$.
For a brief description of these results along with more references, I recommend Yufei Zhao's note Spectral Distributions of Random Graphs
References:
[1] Brendan Mckay, 1981, The expected eigenvalue distribution of a large regular graph.
[2] Linh Tran, Van Vu, Ke Wang, 2010 Sparse random graphs: Eigenvalues and Eigenvectors.
Answer: Fwiw, a plot of the spectrum of the sum of 10 random permutation matrices
shows the (semi)circle law:

On the spectrum of random regular graph


Reset default roles and capabilities

Question: I've been having a difficult time adding custom post type capabilities to roles (Adding capabilities to default roles) and I suspect that my muddling around may have caused some problems. I also have installed and de-installed various plugins some of which added capabilities. As a result My WP Role object is a bit of a mess. Does anyone know of a way to reset capabilities or do I need a fresh install?
Answer: If you don't want to install a plugin to just to do this one task, you can call the WordPress function directly to rebuild the roles and their capabilities.
if ( !function_exists( 'populate_roles' ) ) {
  require_once( ABSPATH . 'wp-admin/includes/schema.php' );
}

populate_roles();

Comment: Thanks! it worked like a charm and was difficult to find.
Comment: This is the most simpler and robust solution that restores all the standard roles and caps in the WordPress way. This should be a selected answer. Thanks a lot.
Answer: I use User Role Editor. You can delete added roles, and reset roles from the plugin page.
To reset the administator role, you can, as of WP 3.4+, add
define('URE_SHOW_ADMIN_ROLE', 1);

to your wp-config.php file. After having done so, you need to go to Users > User Role Editor and click "Reset".
Comment: @bungeshea Point 3 of "When should I edit posts?" (on the very page you linked to) reads "To include additional information only found in comments, so all of the information relevant to the post is contained in one place" --> That's what the user mantis did. How's that not okay?
Comment: Can I use it and then de-install it?
Comment: Yes, since you are just resetting the roles back to the original state, there should be no problem with deleting the plugin.
Comment: Ok, I'll give it a go then.
Comment: As with any plugin, I would recommend copying your database beforehand, just in case it doesn't do what you want you always go back.
Comment: Unfortunately, It couldn't reset administrator which is the one I wanted to reset.
Comment: As long as you have WordPress 3.4+ you can add the following to your wp-config.php file

    define('URE_SHOW_ADMIN_ROLE', 1);
Comment: I tried that. Just add and save? I did `print_r(get_role( 'administrator' ));` and all my custom capabilities are still there as are those inserted by various plugins.
Comment: After adding the URE_SHOW_ADMIN_ROLE you need to go to Users > User Role Editor and click "Reset"
Comment: Brilliant. Thank you. It didn't fix my problem but at least I can rule that out.
Comment: @mantis Please don't edit others' posts to add extra information. Please read http://wordpress.stackexchange.com/help/editing
Comment: Ok, sorry, I tried to undo the edit it but wasn't allowed.
Answer: I find an easier way to reset roles and their associated capabilities is to use wp-cli.
wp-cli has a built-in method for resetting roles. You can specify any that you want to reset. For example:
wp role reset author contributor editor subscriber

There is also an --all flag, which you can use like this:
wp role reset --all

Warning that this will include resetting the administrator capabilities, which may remove access to some plugins, so use with caution.

Reset default roles and capabilities


Could shatnez now include cotton since cotton was not available during the command?

Question: Deuteronomy 22:11 defines shatnez as wool and linen. But cotton wasn't available then. If cotton is fine then that would also mean a cotton garment with leprous disease would be fine since it is not included in Leviticus 13:47-48. Should shatnez include cotton? Does shatnez really mean to imply not mixing animal and vegetable fibers?
Comment: Plenty of other animal hairs were known back then and yet it only specifies wool. Why would this be different?
Answer: Shaatnez was always understood to just mean wool and linen, but not any other type of material. Cotton was known in the times of the Mishnah and Talmud, but is not included in sha'atnez.
Answer: The logic about tzara'at (let's assume the flawed translation of "leprosy") actually flows the other way -- in fact, the Torah specified "wool, linen, and leather", and it applies only to those materials.
Maimonides, Laws of Leprous Afflictions 13:1--4:

יג,א  אין מיטמא בנגעים אלא בגדי צמר ופשתים בלבד, או השתי או הערב של צמר ופשתים, וכל כלי העור, ...
יג,ג  צמר גמלים וצמר רחלים שטרפן זה בזה--אם רוב מן הגמלים, אינו מיטמא בנגעים; ואם רוב מן הרחלים, מיטמא בנגעים; מחצה למחצה, מיטמא בנגעים.  והוא הדין בפשתן וקנבס שטרפן זה בזה.  ורחל בת עז, אין צמר שלה מיטמא בנגעים.
יג,ד  בגד שהיה שתייו פשתן וערבו קנבס, או שתייו קנבס וערבו פשתן--אינו מיטמא בנגעים;

The only garments that become contaminated via afflictions are wool, linen, wool or linen thread, or any leather garment ... if one blended camelhair and sheep's-wool, if the majority is camel, the garment is not susceptible to impurity by affliction; majority sheep, it is, half-and-half, it is; same for a blend of linen and canvas; nor does the wool of a sheep-goat hybrid qualify.

The Torah picked some very specific materials for certain commandments, and it applies only to those. It's not our place to assume we know why and then extrapolate out to new prohibitions.
(On Shaatnez -- note that Abel's sacrifice was a sheep, while the midrash tells us that Cain's plant-sacrifice was linen -- so those two don't mix. Except in the high priest's uniform, but that's another question ...)
It's not about "was the substance known at the time" -- goat hair clearly was known, for instance (used in the Tabernacle, and called simply izim ["nanny-goats"], never "wool"), yet the Torah chose to specify wool and linen. If the Torah wanted to use general language it could certainly have done so -- for instance in Deut. 23:20 "don't take interest from money, not from food, not anything you would use for interest!" -- it could have written "any thread you spin from animals or plants", yet it chose not to.
The full blessing for "bread", for example, only applies to five Biblical grains. There's some fascinating discussion on whether the laws of contamination via metal apply to all metals, or only those specified in Numbers 31:22 -- the Torah could have used some generic description of metals -- "anything you heat and shape" or the like. (This actually comes into play with kohanim, who are to avoid contamination-via-corpses, flying over cemeteries; the standard airliners are made of aluminum or composites.)


Prove that $\gcd(M, N)\cdot \mbox{lcm}(M, N) = M \cdot N$.

Question: I'm not sure how to go about this proof. I just need help getting started. Is there a way to prove it algebraically?
Comment: What tools do you want to use? It is an immediate consequence of Unique Factorization, and the representation of gcd, lcm in terms of the prime power factorization.Or else one can use more basic machinery.
Comment: The latter would be fine.
Comment: It is also a consequence of the [Chinese Remainder Theorem](http://en.wikipedia.org/wiki/Chinese_remainder_theorem).
Comment: @lhf Could you elaborate on that here please: https://math.stackexchange.com/questions/3438900/prove-that-operatorname-gcd-m-n-times-operatorname-lcm-m-n?noredirect=1#comment7071098_3438900
Answer: Take the prime-power decomposition of $m$ and $n$. We have
\begin{array}
.m &=&p_1^{a_1}\times p_2^{a_2} \times \ldots \times p_k^{a_k} \\
n &=&p_1^{b_1}\times p_2^{b_2}\times \ldots \times p_k^{b_k}
\end{array}
where each of the $p_i$ are distinct primes and each of the $a_j$ and $b_{\ell}$ are non-negative integers. For example, if $m=4$ and $n=18$ then we write $m = 2^2 \times 3^0$ and $n = 2^1 \times 3^2$.
The important part of this trick is that we write both $m$ and $n$ as a product of the same primes, even if some of the powers are zero. By definition:
\begin{array}
.\text{lcm}(m,n) &=& p_1^{\max(a_1,b_1)}\times \cdots \times p_k^{\max(a_k,b_k)} \\
\text{gcd}(m,n) &=& p_1^{\min(a_1,b_1)}\times \cdots \times p_k^{\min(a_k,b_k)}
\end{array}
Clearly $\max(a_i,b_i) + \min(a_i,b_i) = a_i + b_i$ and hence
\begin{array}
.\text{lcm}(m,n) \times \gcd(m,n) &=& p_1^{a_1+b_1} \times \cdots \times p_k^{a_k+b_k} \\
&=& (p_1^{a_1} \times p_1^{b_1}) \times \cdots \times (p_k^{a_k} \times p_k^{b_k}) \\ \\
&=& m \times n
\end{array}
Comment: I believed the prime power factorization was more number theoretic as the Chinese Remainder Theorem is more in that flavor, although some algebraists like to think it's theirs because there's a generalization with PIDs and comaximal ideals... but anyway, you did a good description of that proof. +1
Answer: There are many proofs. We give two,  one that uses the Unique Factorization Theorem, and another that uses Bezout's Identity.
First Proof:  Let $p_1, p_2,p_k$ be the primes that occur in the prime power factorization of $M$ or $N$ or both. Let
$$M=p_1^{\alpha_1}p_2^{\alpha_2} \cdots p_k^{\alpha_k}\quad\text{and}\quad N=p_1^{\beta_1}p_2^{\beta_2} \cdots p_k^{\beta_k}.$$
Note that we are allowing some of the $\alpha_i$ and $\beta_j$ to be $0$.
You may have already seen the theorem that the gcd of $M$ and $N$ is equal to
$$ p_1^{\delta_1}p_2^{\delta_2} \cdots p_k^{\delta_k},$$
and their lcm is
$$ p_1^{\mu_1}p_2^{\mu_2} \cdots p_k^{\mu_k},$$
where $\delta_i=\min(\alpha_i,\beta_i)$ and $\mu_i=\max(\alpha_i,\beta_i)$.
Then the theorem follows from the fact that $\delta_i+\mu_i=\alpha_i+\beta_i$. (The minimim of two numbers, plus the maximum of two numbers, is the sum of the two numbers.)
Second Proof: We use Bezout's Identity, which says that if $d$ is the gcd of $M$ and $N$, there exist integers $x$ and $y$ such that $Mx+Ny=d$.
Note that $d$ divides $MN$. Let $m=\frac{MN}{d}$. We show that $m$ is the lcm of $M$ and $N$. This will finish things.
Certainly $m$ is a common multiple of $M$ and $N$. Let $n$ be a common positive multiple of $M$ and $N$. We will show that $m$ divides $n$. That will show that $m\le n$, making $m$ the least common multiple.
We have
$$\frac{n}{m}=\frac{nd}{MN}==\frac{n(Mx+Ny)}{MN}=\frac{n}{N}x+\frac{n}{M}y.\tag{1}$$
The right-hand expression in (1) is an integer, and therefore $\frac{n}{m}$ is an integer, that is, $n$ is a multiple of $m$.
Comment: That proof using Bezout's identity is beautiful..... +1
Answer: Theorem 1: For any $N,M$, $$\gcd\left(\frac{N}{\gcd(N,M)},\frac{M}{\gcd(N,M)}\right)=1$$
Theorem 2: For any $N,M,K$, $$\mathrm{lcm}(NK,MK)=K\cdot\mathrm{lcm}(N,M)$$
Theorem 3: If $\gcd(N,M)=1$ then if $N|K$ and $M|K$ then $NM|K$.
Corollary: If $\gcd(M,N)=1$ then $\mathrm{lcm}(N,M)=NM$.
From these, you can prove the above result.
(1) and (3) have nice proofs using Bézout's identity. (2) is a direct proof. The corollary follows from Theorem (3), and the final result follows from (1) and the corollary.
Answer: I don't know what you mean by ''algebraically''. I'll show you a proof.
I write $(m,n)$ for $gcd$ and $[m,n]$ for $lcm$. If $(m,n) = 1$, then $m$ and $n$ both divide some integer $r$ if and only if $mn$ divides it (easy consequence of the Euclidean algorithm); it means that $[m,n] = mn$. Otherwise, let $(m,n) = d$. Then since $(m/d, n/d) = 1$ and $[km,kn] = k[m,n]$ for any integer $k$, we have
$$
[m,n] = \left[ \frac md d , \frac nd d \right] = \left[ \frac md, \frac nd \right] d = \frac md \frac nd d = \frac {mn}{d},
$$
hence $[m,n](m,n) = [m,n]d = mn$.
Comment: Patrick, in the second line do you mean $[m,n]=mn$?
Comment: @user84413 : Yes, typo. I didn't pay enough attention, thanks!
Answer: Please correct me if I'm wrong (I mean it!), but it seems to me that unique factorization (let alone the Euclidean algorithm or Bezout's identity) is not needed to prove this.  I'll give a proof of the generalization of the theorem for an arbitrary integral domain $R$ (but see notes right after the statement explaining how to specialize the theorem to the case $R = \mathbb{Z}$).

Let $R$ be an integral domain, and let $a, b$ be elements of $R$ having both a gcd $d$ and an lcm $m$ in $R$.  Then there exists a unit $u \in R$ such that $dm = uab$.

Note: as the wording suggests, uniqueness of gcds and/or lcms is not assumed here.  Also, when $R = \mathbb{Z}$, the only units (aka "invertible elements") are $\pm 1$, and furthermore, if one adopts the common convention that both the $\gcd(a, b)$ and the $\mathrm{lcm}(a, b)$ are defined to be positive, then the $\gcd(a, b)$ and $\mathrm{lcm}(a, b)$ are unique, and the theorem's punchline therefore reduces to $$\gcd(a, b) \times \mathrm{lcm}(a, b) = |ab|\;.$$

Proof:  Since $ab$ is a common multiple of $a$ and $b$, it follows from the definition1 of lcm that there exists a $\delta \in R$ such that $\delta m = ab$.  On the other hand, again by the definition of lcm, there exist $i,j\in R$ such that $ai = m = bj$.  Multiplying through by $\delta$ yields
$$\delta ai = \delta m = \delta bj\,.$$
Replacing the middle term with $ab\;(=\delta m)$ and cancelling $a$ from the left equality, and $b$ from the right one, we get that $\delta i = b$ and $\delta j = a$.  This shows that $\delta$ is a common divisor of both $a$ and $b$.
The definition of gcd now implies that there exists a $u \in R$ such that $\delta u = d$, and therefore,
$$dm = u\delta m = uab\;.$$
It remains to be shown that $u$ is a unit.  Now, again by the definition of gcd, there exist $r, s \in R$ such that $dr = a$ and $ds = b$.  Define $\mu = rds$.  Then
$$d\mu = dr\,ds = a\,ds = dr\,b = ab\;.$$
Cancelling $d$ in the first three equalities above shows that $\mu = as = br.$  This means that $\mu$ is a common multiple of both $a$ and $b$, and therefore, by the definition of lcm, there exists $v\in R$ such that $\mu = vm$.
Substituting this expression for $\mu$ into the equality $d\mu = ab$ established above yields $d\,vm = vdm = ab$, which becomes $uvdm = uab$ after multiplying through by $u$.  Putting this together with the previously obtained $dm = uab$ gives $uvdm = dm$, which, after cancelling out the $dm$ factor reduces to $uv = 1$.  Hence $u$ is a unit.

1 This proof repeatedly invokes the definitions of gcd and lcm for a general integral domain; these definitions are entirely consistent with those for the gcd and lcm in $\mathbb{Z}$, but, for the sake of clarity and completeness, here they are: $d \in R$ is a divisor of $a \in R$ if there exists $r \in R$ such that $dr = a$; $d$ is a greatest common divisor (gcd) of $a, b\in R$ if (1) it is a divisor of both $a$ and $b$, and (2) any other divisor of $a$ and $b$ is also a divisor of $d$; note that, in general, for any $a, b \in R$ there may be any number of gcds—including none; if $d$ and $d^{\prime}$ are both gcds of $a$ and $b$, then they are associates (i.e. there exists a unit $u \in R$ such that $d = ud^{\prime}$); this is so because they must be divisors of each other.  Similarly, $m \in R$ is a multiple of $a\in R$ if there exists $q \in R$ such that $m = aq$; $m$ is a least common multiple (lcm) of $a, b\in R$ if (1) it is a multiple of both $a$ and $b$, and (2) any other multiple of $a$ and $b$ is also a multiple of $m$.  Similar considerations on uniqueness as those for gcds apply to lcms.  In particular, if $m$ and $m^{\prime}$ are both lcms of $a, b\in R$ then $m$ and $m^{\prime}$ are associates.
Comment: does this proof show that $\gcd(a,b)\cdot lcm(a,b) \sim ab$ (i.e., that the product of the gcd and lcm is associate to the product of the two elements)?
Comment: @ALannister: yes
Answer: Given $n,m$ and $d=\gcd(n,m)$, we can then denote $n=da$,$m=db$ where $a,b$ are coprime. In that language, $\operatorname{lcm}(n,m)$ would be $dab$ (it is fairly straightforward to show that they both divide each other), which gives us the claim.
Answer:
CLAIM $\hspace{5.5 cm }(a,b)[a,b]=ab$

P. Let $d=(a,b), e=\dfrac{ab}{[a,b]}$. We will prove that $d=e$. Recall we define $d$ as the (unique) positive number such that $d$ divides both $a$ and $b$, and if $d'$ is any other common divisor, $d'\mid d$. We wish to show $e$ has these two properties. First, note that $$\frac{a}{e} = \frac{{\left[ {a,b} \right]}}{b} \in {\Bbb Z}$$  $$\frac{b}{e} = \frac{{\left[ {a,b} \right]}}{a} \in {\Bbb Z}$$ since both $a,b$ divide $[a,b]$, so $e$ is a common divisor. Now suppose $d'$ is another common divisor. Recall that $[a,b]$ is the unique positive number such that $a,b$ both divide $[a,b]$ and whenever $a,b$ both divide some $f$, $[a,b]$ divides this $f$. We will use this to finish off the proof. Since $d'$ is a common divisor, $\dfrac{ab}{d'}$ is an integer. Moreover, both $a,b$ divide it, so it is a common multiple. It follows that $$\frac{f}{{\left[ {a,b} \right]}} = \frac{{ab}}{{\left[ {a,b} \right]d'}} = \frac{e}{{d'}}$$ is an integer, do $d'\mid e$, whence $d=e$. $\blacktriangle$
Answer: Here's another proof that doesn't use unique factorization. Let $d = \mathrm{gcd}(a, b)$ and $e = \mathrm{lcm}(a, b)$. We will need the following facts:

If $d'$ is a divisor of both $a$ and $b$, then $d' \mid d$.
If $e'$ is a multiple of both $a$ and $b$, then $e \mid e'$.

Now, to show that $ab = de$, we will show that $ab \mid de$ and $de \mid ab$.
($ab \mid de$) Consider the quotient $ab / e$, which must be an integer by (2). Since $b \mid e$, we can write $e = cb$ for some integer $c$, and so $ab / e = a / c$. This shows $ab / e \mid a$; by similar logic, we also have $ab / e \mid b$. By (1), we get $ab / e \mid d$, which implies $ab \mid de$.
($de \mid ab$) Now, consider the quotient $ab / d$. Since $d$ divides both $a$ and $b$, we have $a \mid ab / d$ and $b \mid ab / d$. By (2), we get $e \mid ab / d$, which implies $de \mid ab$.
Answer: There will be 2 cases
Case 1 when $m$ prime to $n$
Then generally there lcm is mn
And gcf is 1
$(m,n)[m,n]=1×mn =mn$
Case 2 when $m$ is not prime to $n$
Like 2,4 gcd is 2 lcm is 4 not = 2.4
In such cases lcm is the large number.in example 4 and gcd is 2 the small number
$(m,n)[m,n]=m\cdot n=mn $
Hence proved


Can ArcGIS handle missing values to create a contour map?

Question: I am trying to create a contour map for a waterbody. It turns out that in several locations there is no data. I just don't want to use the missing values as zero in ArcGIS because it would create several other contours by interpolating actual value and the zero value. Can someone suggest to me any good way of handling N/A or no values in ArcGIS to create contour maps?
Comment: If the NoData areas are tiny, this would be a form of "patching gaps": please see the discussion at http://www.quantdec.com/SYSEN597/GTKAV/section9/chapter_29d.htm (around 80% down the page).
Comment: When you say"create a contour map for a waterbody, are you talking about bathymetric contours??
Answer: Use the Contour with Barriers tool in ArcGIS for this. The missing areas can be barriers.  See this blog post for more info.


Should I purchase Baby Carseat for 6 months baby?

Question: I show many parents using baby carseat when they traveling with their child. But if baby is too small then is it good to use baby car seat? A six month old baby not able to seat properly so how could he comfortable in Carseat.
I want to discuss, Please suggest me should I purchase Baby Carseat for 6 months baby?
Comment: in an infant car seat the baby doesn't "sit" the way you do in a chair. They sort of lie in it and it supports them.
Comment: If you plan to use an infant car seat on a plane, check the airlines website for more information. US airlines require that it have certification beyond the fact that you need one that will fit in the airplane seat! Quantas talks about their and other country requirements [here](http://www.qantas.com/travel/airlines/car-seats-child-restraint-systems/global/en).
Answer: Its the law in most Australian states, so yes, you should buy one.  No discussion required.

Children younger than six months must be secured in a rearward facing restraint
Children aged six months to less than four years must be secured in either a rear or forward facing restraint
Children aged four years to less than seven years must be secured in forward facing child restraint or booster seat

http://www.mynrma.com.au/motoring-services/nsw-child-restraint-laws.htm

When driving with children up to 7 years of age, you must ensure they are restrained in a properly fastened and adjusted Australian Standard (AS) approved child restraint. Driving includes when the vehicle is moving or stationary (for example, when stopped at traffic lights), but not when parked. Only child restraints that carry the AS sticker have been tested and approved as meeting standard AS/NZS 1754.
Child restraints purchased overseas may only be used in Queensland if they comply with AS/NZS 1754.
We recommend you use a child restraint that is less than 10 years old. The restraint will have a sticker showing approval and a date stamp for when the restraint was manufactured.
Don't use a child restraint that has been in a crash. If you use a second hand child restraint, get a copy of the manufacturer's instructions, so you understand how to use it safely.

https://www.qld.gov.au/transport/safety/rules/children/

Children aged under six months must use an approved, properly fastened and adjusted rearward-facing child restraint.
Children aged between six months and four years old must use a properly fastened and adjusted rearward-facing child restraint OR a forward-facing child restraint.

https://www.betterhealth.vic.gov.au/health/healthyliving/child-safety-in-the-car
For an overview of laws around the world regarding babies and infants and car restraints, see the Wikipedia article on the topic (suggested by Dorothy).
Comment: @Dorothy yup, was going to come from that angle if Australia didnt have laws in this area, but they do so that closes the discussion :)
Comment: @Dorothy if you want to go ahead and add that as a supporting answer, I'd gladly upvote it! If not, then sure, it would be a great addition to my own.


Azure SQL Database vs. error 8152 enhancement

Question: How can I take advantage of the enhancement for error 8152 (https://blogs.msdn.microsoft.com/sql_server_team/string-or-binary-data-would-be-truncated-replacing-the-infamous-error-8152/) in Azure SQL Database? Even when logged in as the Server admin, I can't set the trace flag.
Answer: You cannot enable traceflags in azure sql database (single database).
You can enable traceflags when using azure sql database managed instances:

DBCC TRACEON documentation

Since the azure sql database service is based on the latest stable sql server version

It's (azure sql database) based on the latest stable version of the
  Microsoft SQL Server database engine.

Azure sql database service documentation
And  in your linked source it is stated that:

...Note that for now, even in SQL Server 2019 CTP 2.0 the same trace
  flag 460 needs to be enabled. In a future SQL Server 2019 release,
  message 2628 will replace message 8152 by default....

We should hope to see this more detailed error message enabled by default for the azure sql database service in the future, once that build is deemed stable.
Comment: It's now March 2021 and it still doesn't seem like it's possible to use Trace 460 with Azure SQL :/


Design, storage and retrieval of dynamic forms

Question: What is the design behind custom dynamically generated forms?
Would like to implement something like drupal's CCK.
In the control panel, the owner of the form designs what fields should be in the form and in what order the form fields should be in, as well as the field's attributes such as "required: yes/no"
Once the form has been designed the end user fills it and submits.
Currently I'm able to get the user to create the custom form, the problem is with the storage and retrieval of the content of the form.
Usually, when one writes a form, who's data is stored in the db, the code that will be needed to enter the form's data into the database is also written. How is this code to be written when the form is always changing with different fields almost every time?
Basically, what I need is to understand the database design that will allow the storage and retrieval of custom forms, despite the number or type of fields.
I do not want to have a new table for each form submission, nor do I want to manually write code for each form.
These are the main field types that I will need

Text Box
Select List
Radio Buttons
Checklist
Date Field
Text Area

Below is the database design that I came up with
table1
id, formid, type, position, name, value, select(foreign), multiple
id: Unique id for that record, auto
formid: the unique form id, all fields in a particular form will share the same formid
type: it could be textbox, select list, radio ....
position: is the fields the 1st, 2nd, or 5th?
name: the unique name for the field
value: if it is a textbox, the default value is entered here. If the type of field does not need a value, then it stays as a null.
select (foreign): if it is a select list box, then the foreign idnumber will be present.
multiple: if you want to allow multiple selection in that listbox, then the value will be 1 or else it will be null
table2
id, select, value
So, if you want a select list box field, in table1, you will have the type as selectbox, and you will have the value of the foreign key related to "select" in table2.
If you want a text area, type in table1 will be text area, and if need a default value, you enter it, or else it will be null
table1 does not have the list of all attributes, but you get the point. Depending on what field type you want, determines which attribute you will need to fill. If that attribute will need to store extra data, e.g. a select list box, simple do a relation, as it has been done with table2
To render the form, the system interprets the data in the database and create fields accordingly.
So far so good, but, how do you store the data in the database when the fields are always changing?
What sort of db design is needed to store such data?
Is the above the right way of generating forms dynamically?
Answer: I found this:
http://formutils.riaforge.org/


Steganography using video and audio stream in java or C++

Question: I need to load the video and modify it. How can I read bit by bit the stream and change it for purposes of Steganography. I was not able to find any example of showing video file in bits. Thanks very much in advance.
Comment: possible duplicate of [Video Steganography](http://stackoverflow.com/questions/9567818/video-steganography)
Answer: First you have to get what is a video. Between the data on disk (or received from the net) and the final pixels of the frame shown into a window (the actual image of a single frame), there's an algorithm (unless your video is just a "sequence" of uncompressed pictures). Once you are able to put yourself in the middle (reading decoded data), you can alter the data. But then, you've to put them back in the original format, that is often if not always a compressed data with a lossy complicated algorithm that easily will destroy your "injected" hidden bits, unless you are so clever to avoid that choosing the way you elaborate the stream carefully.
The same problem exists for hiding data into a jpeg image (known methods use the coefficients of the DCT, which are stored someway into the final jpeg file format). Googling you can find links like this, which I've not checked but the idea as said is known and you can find resources on it.
Hiding data into a video maybe is not so different, but it is not, as you can see, as direct as injecting it into a uncompressed or losslessly compressed image / text / sound / whatever.
Back to being able to "see" video as "bits": once you load a video file, once you decode it, maybe frame by frame (use a library...), you obtain bytes; extracting and modifying bits is a matter of cool operations like shift and bitwise-and/or/eor. To have an idea of what it could mean to decode a video file, you can search for source code of players (e.g. mplayer) and codec it can use (if you want to have details, but indeed you're interested just in using a codec the way the player would do).


How to analyze multiple Likert-scale data?

Question: I have been stuck in a problem recently.
I designed a survey, in which the participants observed several images. These images are gathered from different cultures, e.g. Culture A, Culture B and Culture C. For each image, I asked the participants a question: To what extent do you believe this image comes from each culture and three Likert-scales from 1-5 (1 for completely disbelieve, 5 for completely believe) are offered.
After gathering the answers, I'd like to do some analysis on the them.  Since culture B and C have more similarities with each other than they with culture A,  what I'd like to know is,  after observing an image, if the extent on believing it from culture B and C are more 'similar' or their distributions show no significant difference. What I am considering is one-way ANOVA (since there are 3 groups) or pairwise t-test (since the variables are somewhat correlated), which is more proper for this issue?
Hope someone could offer me some suggestions.
Thanks in advance :-)
Answer: Since you're dealing with variables on the ordinal scale (categorical variable with ordering), a first step can be to start by looking at the correlation matrix using Spearmans rank correlation and directly investigate the correlation between culture B and C, for example, and then move on from there.


Is it possible to leave canada by train or car unvaccinated and vice versa?

Question: Can an unvaccinated Canadian citizen or noncitizen leave the country by car or train and likewise return by car or train?
Comment: Added a U.S. tag because it is relevant to the vice versa since the U.S. is the only country to which one can travel by train or car form Canada. Added "immigration" tag since even temporary visits are typically governed by a body of law known as "immigration law".
Answer: The only train service between the U.S. and Canada is via Amtrak and its Canadian partner Viarail. Amtrak's website states (as of today):

In addition to the standard entry documentation requirements, the
Canadian and United States Governments have several additional
requirements for travel into Canada and the United States.
Travel into United States: Non-U.S. citizen passengers must be fully
vaccinated with a U.S.FDA or a WHO approved COVID-19 vaccine. See
details on the United States Department of Homeland Security website.
Travel into Canada: All passengers must use the ArriveCAN app before
travel and wear a mask in Canadian stations and on board trains while
traveling through Canada. Non-Canadian citizens must be fully
vaccinated and carry the vaccination record that was uploaded into
ArriveCAN. See details on the Government of Canada and Viarail
websites, and additional Cantrail thruway bus service to Vancouver
travel requirements.

The requirements are essentially the same for travel by car between the U.S. and Canada.
Comment: What if you are an US citizen who is international student in canada with a student visa. Would getting back into canada be impossible unvaccinated?
Comment: @Outsider It would appear so.
Comment: I think the restrictions have changed, meaning this is no longer the correct answer as of oct 30th 2022?


Difference between Income-Expenditure Identity and the Goods Market Equilibrium condition

Question: Is there any difference between the Income-Expenditure Identity and the Goods Market Equilibrium condition. Both are $Y=C+I+G+NX$. If it is an identity, why do we solve for the equilibrium output? Shouldn't it always hold? If someone could clarify this it would be very helpful.
Answer: The output defined with spending approach: $Y\equiv C+I+G+NX$ is an identity because it holds by definition. By definition output must be equal to sum of spending, investment government spending and net exports. However, this is actually not the equilibrium condition.
The equilibrium condition is that goods market demand $Z$ must be equal to output in the equilibrium. Hence the equilibrium condition is that $Z=Y$ (this is really just macro version of saying that demand = supply, since output $Y$ is the supply). This is the equilibrium condition not the identity $Y\equiv C+I+G+NX$. However, given that the equilibrium condition is that $Z=Y$ we can from that deduce the following: $Z=Y \implies Z= C+ I + G + NX$ in equilibrium.
This might be easier to explain with graph. Consider the following graph from Blanchard et al. Macroeconomics a European Perspective pp 47. In the graph below the demand is the purple line while the identity $Y \equiv C+I+G$ (they omit net exports for simplicity) is the $45°$ line that just definitionally says output is equal to output.
Answer: This is an important question which is usually covered in good undergraduate texts. You are correct in pointing out that the two appear to be same. But there is a subtle difference.
The difference comes through the definition of $I$. The Income-Expenditure Identity is an accounting identity in which $I$ is the realized investment expenditure which includes changes in inventory.
In the Goods market equilibrium, $I$ (in some good texts denoted by $I_p$) is the investment demand or planned investment expenditure (hence the subscript $p$). This is a function of real interest rate $r$ which gives you IS curve with equilibrium a function of income $Y$ and interest rate $r$. Clearly, this does not include the changes in inventory (at least not the unplanned ones).
You can see this link for some more details and examples.


According to Quran/Hadith, what points to remember when choosing a bride/wife?

Question: According to Quran/Hadith, What is the general guideline to choose a woman as bride/wife for a Muslim male?
What points to remember?
What points must be met?
Answer: Ali Akber Mazaheri writes:

The notion that a man and a woman must 'know' each other before they
  decide to marry, so that they may then be able to live happily
  together is an illusion. Had there been any element of truth and
  validity in this, the divorce and separation rates in societies which
  practice it would not have shown a steady rise. Similarly, the
  marriages which take place without such pre-marital contacts would not
  have been known to last happily.

The Shariah permits the intended spouses to see each other for the purpose of selection and also permits asking and giving opinions if asked (without it being considered as gheebat under certain conditions.)
We should never resort to deceive the opposite party or conceal a defect during the selection process. Such things can have serious ramifications if exposed after marriage
The school of Ahle-Bait (a.s.) has not left us to follow our whims and fancies. We have been taught the best method of selecting a suitable spouse. The most important criterion is piety or religiousness.
A. Religiousness
The author of Youth and Spouse Selection says, "The person who does not have religion, does not have anything."
When a man came to the Prophet (s.a.) to seek guidance for selecting a spouse. He (s.a.w.s.) said, "It is binding upon you to have a religious spouse."
Knowing the human weakness for beauty and wealth, the Messenger of Allah (s.a.w.s.) has forewarned, "A man who marries a woman for the sake of her wealth, Allah leaves him in his own condition, and one who marries her (only) for her beauty, will find in her (things) which he dislikes (unpleasing manners) and Allah will gather up all these things for one who marries her for the sake of her faith (religiousness)."
B. Good Nature
The next important criterion is good nature.
Imam Reza (a.s.) wrote in reply to a person who had asked him if it was advisable to marry his daughter to a person known for his ill nature, "If he is ill-natured (bad tempered), don't marry your daughter to him."
The same will apply where the bride-to-be lacks a good nature. Such a woman, though she may be beautiful and rich, would make the life of her husband miserable. She can never be patient in the difficulties that arise in married life.
C. Compatibility
The Prophet (s.a.) gave no recognition to class distinction, but in marriage, he stressed upon compatibility. The marrying partners must be Kufw of each other, so that there are no unnecessary misgivings later.[21] It is better for a religious woman who is committed to laws and principles to marry a man like herself.
A man questioned the Prophet of Islam (s.a.w.s.), "Whom must we marry?"
He replied, "The suitable (matches)."
"Who are the suitable matches?"
The Prophet (s.a.) responded, "Some of the faithfuls are match for others."
Imam Sadiq (a.s.) said, "An intelligent and wise woman must not be matched except with a sage and wise man."
D. Decent Family
The Messenger of Allah (s.a.w.s.) has given great emphasis on taking into consideration a good family background when we intend to marry.
He said, "Marry in the lap of a decent family, since the semen and the genes have effect."
The Holy Prophet (s.a.w.s.) also said, "Look very carefully and minutely as to where you are placing your child because genes and hereditary qualities are transferred in a concealed and unintentional way and have their effect."
E. Reason
The Commander of the Faithful, 'Ali (a.s.) strongly forbade marrying a foolish and insane person. "Avoid marrying a stupid woman, since her company is a woe (distress) and her children too get wasted."
F. Physical and Mental Health
Though religiousness and piety are most important, it does not mean that we totally disregard the physical appearance and beauty of the prospective spouse.
The Holy Prophet (s.a.w.s.) says, "When one intends to marry a woman, he should ask about her hair, just as he asks about her face (beauty), since the hair is one of the two beauties (of women)."
*G. Whom can you Marry?*
"Islamic law has placed certain restrictions on the choice of your spouse depending upon blood relationships and religious affiliations." Maulana Sayyid Muhammad Rizvi has summarized these laws in a beautiful way:
a. Restrictions based on Relationship
There are certain blood relations which are considered haraam for you as far as marriage is concerned. (As a general rule, anyone who is your mahram is forbidden to you for marriage.) The list of such relatives is given in the Qur'an as follows:
For Man: mother, daughter, paternal aunt, maternal aunt, niece, foster-mother, foster-sister, mother-in-law, step-daughter, daughter-in-law, all married women, sister-in-law (as a 2nd wife) (See the Qur'an, ch. 4, verse 23-24)
For Woman: father, son, paternal uncle, maternal uncle, nephew, foster-mother's husband, foster-brother, father-in-law, stepson, son-in-law.
b. Restrictions based on Religion
A Shi'ah Muslim man can marry: a Shi'ah Muslim woman and a non-Shi'ah Muslim woman. However, if there is danger of being misled, then it is haraam.
He can also marry a Jewish or Christian woman in mut'a only. But he cannot marry a woman of any other faith.
A Shi'ah Muslim woman can marry: a Shi'ah Muslim man or a non-Shi'ah Muslim man, although it is better not to do so; and if there is danger of being misled, then it is haraam. But she cannot marry a non-Muslim man.3
C. Cousin Marriages
Though Shariah does not forbid marriage between first cousins, but there are opinions advocating against them mainly due to a probable risk of the offspring inheriting genetic defects/diseases.
Reference:
Islamic Marriage (from chapter 4, Selection of Spouse)


vim: Making tabbed behaviour default

Question: TIL that vim 7 has the ability to work with tabs which is cool.
Is there a way to tell vim through .vimrc that whenever I open multiple files, open them in tabs [instead of having to use -p always]
Comment: create an alias maybe?
Comment: I understand you are asking me to alias vim to vim -p..
But can that be done in the vimrc file?
Answer: Hm, I think slightly better then the tabedit autocommand from Ingo is
<code>:au VimEnter * set tabpagemax=9999|sil tab ball|set tabpagemax&vim
</code>
which at least avoids the empty tabpage being created.
Comment: Probably `all` is better than `ball` here so as to create a new tab for each page in the argument list rather than the buffer list? But I don't know under what cases the behaviour would differ between using `all` or `ball`.
Answer: How about this:
<code>:autocmd VimEnter * argdo tabedit
</code>
This edits each file in the argument list (i.e. all files passed on the command line) in a new tab page. It's probably still a bit raw and doesn't handle corner cases too well, but see this as a starting point.
Comment: For some reason when I try this & execute `vim 1 2 3`, the files are open in tabs all right but there is a fourth tab with an empty file. Any guesses why?
Comment: Same here. Also it asks me to press ENTER once for every file before opening all of them:

    `"file1" 6500L, 2173458C
    "file_a_b_c" 2553 lines, 816646 characters
    Press ENTER or type command to continue
    "file_b_c_d" 10 lines, 100 characters
    Press ENTER or type command to continue`

and so on..
Comment: @Paddu That's because of `:tabedit`; it should probably just `:edit` the first one. I hinted at this "raw" behavior; feel free to tweak it as you please.
Comment: @radiantRazor Use `:silent` before either `argdo` or `tabedit` (should work in both locations), this way you will not get these messages. Try using `:execute "argdo tabedit" | tabclose 1` in place of `argdo tabedit` to remove both messages and first tab page.
Comment: @ZyX, I added in my .vimrc `autocmd VimEnter * execute "argdo tabedit" | tabclose 1` and executed `vim 1 2 3` and found that three tabs where open, fir the files `2`, `3` and an empty file.

vim: Making tabbed behaviour default


what alternative topological shapes could alien life take on?

Question: I've always been intrigued by the idea that alien life would be completely different from life on this planet. recently, I've been doing some research and found out that humans, along with other vertebrates and even some invertebrates are topologically shaped like toruses. but there are also some invertebrates that are topologically shaped like spheres. and it made me wonder, what other possible shapes could life on other planets appear life?
Comment: There are several books or tv series produced on just alien life on a single planet. Please narrow this down a lot, if you want it to stay open
Comment: basically: _every_ shape. or even shapeless - imagine a sentient heap of goo.
Comment: @L.Dutch: The question is explicitly about [topology](https://en.wikipedia.org/wiki/Knot_(mathematics)), not about the geometry of the alien beings. A learned discussion of whether is conceivable to have a living entity topologically equivalent to a thickened [tame](https://en.wikipedia.org/wiki/Wild_knot) [non-trivial knot](https://en.wikipedia.org/wiki/Knot_(mathematics)) would be quite interesting.
Answer: Not Much
An animal in three dimensions must occupy all 3 of these dimensions
Given this, it seems like the only topological shapes possible for life would be the ball, or some variation on the solid torus
However, there are still a few things you can play with on the topological level. For example, you could give your aliens an even genus (where there are an even number of holes through the body, which could be an interesting constraint to work in
Comment: I think there are many. Dimensions: trees are fractal, which is a broken dimension. Snake and worm actually cover no more than 2 dimensions. In 3d, you have cylinder (another way of looking at the snake)... you can have tetrahedron.. there are many basic geometrical shapes that can be built on that. A variation in limb count could be regarded as "topological variation". What about  *head count*.. if you take function into account, not only topology, it becomes huge.
Comment: @Goodies A snake or multilimbed creature would still be a multi-holed torus if the topology is based on the digestive tract. A tree being fractal is interesting but it may topologically be a sphere or an highly multi-holes torus.
Comment: This touches the subject of topology. Mathematically, a tree is definitely *not* a sphere or torus. But nearly all lifeforms on Earth are based on the cylinder, even the octopus could be regarded as a cylinder: mouth, anus, space in between.. the limbs are extensions sprouting from that basic shape. If you go look at alien life, I don't think it is so limited. An alien lifeform could be a cloud-like shape shifter with no fixed topology at all. I don't think shape is really limited, when you propose *any* alien life with gravity X, evolution Y under atmospheric circumstances Z, all unknowns.
Comment: It depends on why the OP has the definition of a sphere or torus, I assume a sphere is a cell so it can absorb nutrients across its surface, similar to a tree as it draws from its leaves and roots. A cylinder is just a stretched out torus and it is too simple to say life is either shape as animals have more than just 2 holes, there are 9 or more.
Comment: @Goodies: In [topology,](https://en.wikipedia.org/wiki/Topology) there are no tetrahedrons or cylinders; those things are balls (aka spheres). Topology is not geometry, and the question is about topology.
Comment: @JimDaniels: The question is explicitly about topology. There is nothing to disambiguate.
Answer: Handlebodies

From a topological point of view, the only possibilities for an animal (or any solid body) are:
Solid Ball:

Solid Torus:

Solid Double Torus:

Solid Triple torus:

and so on.
Of course two topological types might look different. For example the torus is topologically equivalent to a coffee mug:

and the triple torus is topologically the same as the 3-handlebody:

So your creature is always a ball with some tubes removed. The number and arrangement of the tubes determines with topological type you get.
A simplified model of an animal with one tube removed going from the mouth to anus is indeed a topological torus.
But a real animal has more than one tube missing. For example the urethra adds a second tube connecting to the first tube near the end; the nostrils add two more tubes that connect to the first tube near the start (hence you can spit water or hot coffee out your nose) and the ears add two more tubes that connect to the start (hence you can swallow to relieve pressure on your ears).
The upshot is that topological type is not an interesting way to describe animal shapes. For example an octopus with a single digestive tube and no ear canals etc is the same topologically as a cow with no ear canals etc.
The extra limbs (protrusions) do not make a difference to the topological type because you can always stretch a rubber shape without tearing to make extra limbs.
Likewise intrusions like the uterus and lungs don't change the topology since they go inwards but not out the other side.
That means a stomach that takes in food, digests and absorbs nutrients, then spits waste back out the mouth hole does not change the topology either. If there are no other tubes then the animal is topologically a sphere.
In fact topology cannot even distinguish between an (imaginary) animal with two unconnected digestive tubes -- perhaps one for food and one for water -- and an animal with a single large tube (digestive tract) that goes all the way through, and a second smaller tube (urethra) that connects the outside to the first tube!
This is what you should play with to make your aliens truly alien.  Having a body plan where some of the tubes do not connect to each other. This is not a topological notion but should be easy to understand. Formally you could describe it by designating an "inside" and "outside" of the animal and only allowing us to stretch and squeeze the inside and outside separately.
Answer: I think the obvious outlier is the octopus; they are extremely intelligent problem solvers, invertebrates, eight arms, three separate hearts, five lobed ring brains, distributed brains (they have neurons in their arms) and they can solve complex puzzles human six year olds cannot solve, and they can use tools, even by example: A care giver for an octopus accidentally dropped a scraper into the tank; and the octopus grabbed it and began using it, as intended, to clean the inside glass of its own tank.
I don't think being water animals should restrict them; in fact it means they are already adapted to a near weightless environment; like outer space. No artificial gravity needed.
And just like we have to carry our air with us in space, they'd have to carry their water with them, but that is not a show stopper. Just a heavier lift.
Octopi are actually much more adept and dexterous than humans at manipulating objects; their suckers mean they can easily grip an object firmly without any handles -- We are restricted by what we can wrap a hand around; they are not restricted to such small sizes.
If octopi had human levels of intelligence, I think they have all the physical attributes needed to create a fairly sophisticated undersea civilization, with science and advanced mechanical technology.
Note that octopi can also survive for up to minute out of water. They cannot breathe so they are "holding their breath" in a way, depending on oxygen already in their blood. But they can come out, manipulate or grab things, and even navigate "walking" to other tidal pools, crossing a few yards.
Kind of like us being able to navigate under water for a short time.
No reason a human-intelligence octopus could not invent a mechanical pump and a "breathing" apparatus that circulates fresh water in a "land suit" that leaves their arms free and allows them to work on land for extended periods of time. Much like our dive suits.
I would not discount octopi-like aliens.
Comment: Topology is not geometry, and the question is about [topology](https://en.wikipedia.org/wiki/Topology). An octopus is topological torus just like a human.


Should we use only one-hot-vector for LSTM input/outputs?

Question:
Should we convert our inputs to on-hot-vectors and expect one-hot-vectors as output?
I mean can we feed LSTM with a vector like x=[12, -234, 54 , 78 , 12 , 6], and have a label vector like this: y=[13, -230, 50, 80 , 9 , 7]? (And we don't use one-hot-vectors at all).
Will such network work properly? Or it's better to convert inputs/outputs to a one-hot-vector and this is essence of LSTM?
If feeding LSTM with one-hot-vector isn't a necessary rule, and we like to feed our network with such vectors in my previous question, should we again use softmax() function for out outputs? Or we can use better options for such problem(or even don't use any functions there)?
If we must(or better) to use softmax, how can we interpret it's result?
If it's better to convert our inputs/outputs to one-hot-vectors, can we use two or three hot vectors(I mean: x =[1,0,0,1,0,0] or x=[0,1,1,1,0,0])? Does this work properly or it disrupts the LSTM performance?
Answer:
This depends on what your data is representing and what you want to predict.  My understanding of One-Hot-Encoding is that this should only be used for encoding of categorical features.  For example, if you have a feature representing a category of K classes, you should one hot encode this as well as the Y variable (if you are trying to predict this categorical variable).  Of course, have the final layer be a softmax to output a distribution of size K.
This highly depends on what your data is representing.  If categorical, see above.  If just a simple numeric, you should not one hot encode this.  You could, I guess, if this set of integers is finite and small, but there is no need to learn the extra weights. You should only be using a softmax when you want to output a vector of K dimension where the entries all sum to one (perfect for representing a probability distribution over K classes).  The final layer should output whatever it is you want to predict.  If you want to predict something as simple as a numeric variable at the next time-step, just have a dense layer of size 1, with some activation function (relu probably).  More information about what exactly you are trying to predict is needed to know how to recommend anything concrete here.
I'm not sure about this.  You could have inputs and outputs represented this way, but you wouldn't use a softmax activation at the end.  You would use a dense layer outputting  a vector the size of your X variable, that is, if that's the variable you are trying to predict.  I'm not super well trained in various types of use cases for LSTMs, but from my experience, I can't think of a reason to do this.
Comment: Thank you very much kylec, unfortunately I have not enough reputations to give you a +vote at this time. BTW, about your question in part 2, I am trying to do stock price prediction, and by [200 210 199 205 100 etc.] I mean [open high low close volume etc.] numbers. What do you think about it? I am confused that what input/output vectors should I have for this porpuse? Also what activation functions?
Comment: All good!  I'm still a newbie to StackOverflow (well, actually participating, at least) so I'm restricted as well.  I'm assuming all of your variables are numeric, so if you are trying to predict all these numerical features (essentially have a prediction for the entire next time-step), have your Y variable be the next time-step values for each variable, and at the end of your network have a Dense layer with units equal to however many numeric variables you are trying to predict.  I'd start with a relu activation for this layer.
Answer:
In my experience, one-hot encoding helps the model to distinguish differences in data where small changes would have large outcomes in the result.  Say, if it's pixel data of an image, a small change in one pixel would have little or no effect on what the image represents, so the model can easily differentiate that data without one-hot encoding it.

The final layer's activation function should be chosen based on the kind of data you're trying to model.  Use no activation (a.k.a. linear) and MSE loss if you just want it to predict numbers with no restriction.  For example, if the model needs to be able to predict the number 1000, then let it use linear activation in the final layer.  Refrain from using ReLU here if you need the model to also be able to output negative numbers.  Use softmax activation with categorical cross-entropy loss if the model is intended to make a prediction on what the best "choice" is for something.  This almost always takes the form of classification.  Use sigmoid activation with binary cross-entropy loss if the model is to answer a bunch of "yes or no" questions about the data.  For example, a model takes text as input and outputs multiple numbers between 0 and 1, and perhaps the first number indicates whether or not the text has a positive connotation, and maybe the second number indicates whether or not the text uses a wide range of vocabulary.  This is what we call binary classification, and we're completely allowed to have multiple "classes" for it.  The main difference between sigmoid and softmax is that softmax normalizes the sum of the output whereas sigmoid does not.  So softmax makes the output behave like a probability distribution, and sigmoid makes each number in the output be independent of one another, but still behaving as though it's a probability of "yes" for that specific part of the label.

Having said that, use binary classification (sigmoid activation and binary cross-entropy loss) if the labels in your data set are vectors consisting of only zeros and ones but are not restricted to being one-hot vectors.

For a final note, these rules apply to almost any neural network architecture, including LSTM/GRU and convolutional neural networks.


VS2010 ASP.NET: How can I set a breakpoint in my Javascript?

Question: I know Javascript breakpoints are possible because I used to do it all the time in my previous job using VS2010.  At my new job now, VS tells me it can't set the breakpoint.  Instead, I have to put debugger; in my code and then choose another instance of VS for debugging, but I don't want to do it that way.  It's much easier to set a breakpoint, attach the debugger to the dev server, and run my code.
Edit: I just thought about it and will add that I was also using Telerik's RadCodeBlock in the past.  Let me look into that more and see if that's why I was able to set script breakpoints.
Comment: More of a sanity check than an answer.. Have you made sure that the build is set to Debug and not Release?
Comment: Yep, it's debug, although I am not sure how that would affect it.
Comment: Just came across this: http://forums.asp.net/t/1587093.aspx/2/10?Can+t+insert+breakpoints+in+JavaScript+in+VS+2010 I wonder is there a hotfix/solution. The post is dated Aug 2010.
Answer: This only works when you view your website using the build-in webdevserver and view the website in IE. In the solution explorer of VS2010 you will see the dynamically created pages being listed somewhere in the tree. The same holds for the javascript. You can place breakpoints inside these files, which will be picked up by by the debugger. In this way you can debug the javascript just as easily as your other code.


Disabling Samsung Calendar on Galaxy S4 mini

Question: I'm trying to disable my Samsung calendar so that I don't get two notifications of events on my Galaxy S4 mini.
In settings I don't seem to have any options to change application settings.
Comment: I think the name of Samsung's Calendar app is "S-Planner" in app list. Find it and you can follow steps in below mentioned answer...
Answer: The best solution is,

Goto -> Settings -> Apps/Application manager -> Find Calendar

and then do Show Notification to Disable or tap for disable.
and also after find the Calendar in Apps, you can disable it or Clear cache or anything you want.
hope this helps.


Should "unmeasurable" be used to describe missing data due to obstacles in obtaining measurements?

Question: I am seeing the term "unmeasurable" used occasionally to describe measurements that could not be taken due to unusual circumstances. For example, audio qualities might not be measurable if there is a high degree of signal noise in the sample. Most dictionaries do not include this term, although "immeasurable" is included. However, I feel that "immeasurable" implies that something was so large or great that numbers could not be applied to it (e.g. immeasurable loss / damage / wealth). Is "unmeasurable" a term that I should add to my own lexicon?
Comment: There's nothing untoward in using 'unmeasuarble' for the situation you describe. As you correctly point out, 'immeasurable' means something quite different.
Comment: Some dictionaries do define unmeasurable: https://www.merriam-webster.com/dictionary/unmeasurable and
https://en.oxforddictionaries.com/definition/unmeasurable
Answer: Immeasurable implies that something is too large or extensive to measure. However, unmeasurable implies that something cannot be measured objectively.
The terms are subtly different in the usage and I suppose you should add it to your lexicon.
For better explanation, please read the following link:
http://libroediting.com/2012/08/24/unmeasurable-or-immeasurable/


Ruby generate unique integer for use as a primary key

Question: I need to generate a unique integer that will be assigned to the id field within a rails app. What is the best way of doing this. (using the usual auto increment is not an option and it has to be an integer.)
Comment: Just out of curiosity I have to ask why autoincrement is not acceptable?
Comment: duplicate of http://stackoverflow.com/questions/7126065/rails-3-migration-autoincrement-on-non-primary-key-column
Answer: Ruby 1.9 has UUID version 4 generation included in module SecureRandom:
> require 'securerandom'
 => true
> SecureRandom.uuid
 => "4b3a56db-4906-4a44-a262-975d80c88195"
> SecureRandom.uuid.gsub("-", "").hex
 => 56667719780883163491780810954791777167

A bit lengthy, but unique for sure.
Answer: You could also use securerandom's .random_number() method if you don't want to do the gsub bit:
SecureRandom.random_number(100000000000000000000000000000)

https://www.rubydoc.info/stdlib/securerandom/1.9.3/SecureRandom#random_number-class_method
Comment: Yeah I think SecureRandom didn't have that back in 2011.
Comment: Lol probably should have paid attention to when the year was...didn't need to bump this thread  that doc link is from the Ruby version you referenced though ♂
Answer: I don't understand why you can't use auto increment, but have you considered using a random number?
id = rand(1000000)
while(Post.find(id) != nil)
  id = rand(1000000)
end

Comment: The solution I used in the end was

    self.id = "#{Time.now.year}#{Time.now.to_i}#{Time.now.usec.to_s[0..2]}".to_i

If anyone can think of any issues with this, please let me know.
Comment: This solution is victim of concurrent race. Under hiload different instances of your applications can generate same integers. Good example is here http://bit.ly/nKqrq3 (MongoDB ObjectID): this is a 12-byte value consisting of a 4-byte timestamp, a 3-byte machine id, a 2-byte process id, and a 3-byte counter.


Alcohol consumption and central nervous system

Question: After alcohol intake, the cerebrum related functions like vision and speech is affected first and later on there's problem with the cerebellar functions like balancing and hand-eye coordination.
My question is- why is it so? Why do they appear in that order?
Like does it have anything to do with differential rate of absorption in cells, or anything else like related to anatomy rather than physiology.
Comment: Can you give a source for your statement? There is a big difference between being affected and feeling something. I would say your oral/esophagal and gastric mucosas would be the first body part affected (hence oral cancers in drinkers who smoke.) The liver is next. Alcohol affects a lot of body parts, so this question is fairly unclear to me. Could you possibly edit to make your question clearer? Thanks.
Comment: @anongoodnurse - i didn't exactly read that in a book or anything. It's just a question which was asked in some competitive exam. Cerebrum was preferred over cerebellum as the answer. Plus, here, I'm talking about not the long term effects of alcohol drinking. I'm asking which body part is affected first just after intake of alcohol.
Comment: @anongoodnurse -I think i have made my question a little bit clearer.
Comment: The first body part(s) affected after drinking alcohol are the oral/esophagal and gastric mucosas. Have you ever swallowed whisky and felt it burn? As to cerebellum vs. cerebrum, read about which does what, and think about which is affected first when you drink. You'll figure it out.
Comment: @anongoodnurse - i do get your logic. That's true that the mucosal lining will be the first affected part, then liver since the absorbed alcohol will go through hepatic portal vein to it. Then any cerebral effects should be seen. But my question isn't about what symptoms are seen and in what order. It's rather about why cerebral related things are affected first (like vision and speech) and then later on cerebellar symtoms appear like problems in balancing and hand eye coordination? PS: i can't do the practical you said since I'm 18 and 21 is an average drinking age in india!! Hehe =)
Comment: I'll try to edit my question accordingly
Answer:
After alcohol intake, the cerebrum related functions like vision and speech is affected first and later on there's problem with the cerebellar functions like balancing and hand-eye coordination. My question is- why is it so? Why do they appear in that order?

It is and it isn't complicated. When you include what each does, it's an interesting question.
We know from experience (and even research, though the ethics of carrying out such research is questionable) that of the noticeable effects on the brain, the first part of the brain (that we can see the effects of) are on the cerebrum. At relatively low doses, the drinker feels more relaxed, more talkative, less inhibited. (there is also a measurable decrease in information processing and reaction time, as well as other less obvious effects.) All these are under the control of the cerebrum.
At this stage, the cerebellum is affected as well, but not grossly (in a manner that we can observe as change in behavior.) The cerebrum is critical to functioning; the cerebellum is critical to survival. Although it's presented as a teleological argument, the simple fact is that effects of alcohol and other sedatives on various parts of the brain are dose-dependent.

First, dose-dependent functional magnetic resonance imaging (fMRI) changes were revealed in orbitofrontal (OF) and motor (but not cerebellar) regions; visual and medial frontal regions were unaffected. Second, cerebellar regions were significantly associated with driving behavior in a dose-dependent manner. Finally, a global disruptive effect of alcohol on the ICA time courses was observed with highly significant differences in OF and motor regions. Alcohol thus demonstrated some behavioral effects and unique, disruptive, dose-dependent effects on fMRI signal within several brain circuits. The fMRI data also suggest that the deficits observed in alcohol intoxication may be modulated primarily through OF/anterior cingulate, motor and cerebellar regions as opposed to attentional areas in frontoparietal cortex.

If you want to know why different parts of the brain require higher doses to become impaired, that is easy in theory but very complicated in reality. In theory, the brain is no different than any other complex organ in the body: it's made up of different cells. Sure, they're all neurons (excluding glial/etc cells), but not every neuron is the same, just like not every cardiac myocyte is the same. In reality, the answer is unknown.

Neuronal mechanisms underlying alcohol intoxication are unclear. We find that alcohol impairs motor coordination by enhancing tonic inhibition mediated by a specific subtype of extrasynaptic GABAA receptor (GABAR), α6β3δ, expressed exclusively in cerebellar granule cells. In recombinant studies, we characterize a naturally occurring single-nucleotide polymorphism that causes a single amino acid change (R100Q) in α6 (encoded in rats by the Gabra6 gene). We show that this change selectively increases alcohol sensitivity of α6β3δ GABARs. Behavioral and electrophysiological comparisons of Gabra6100R/100R and Gabra6100Q/100Q rats strongly suggest that alcohol impairs motor coordination by enhancing granule cell tonic inhibition. These findings identify extrasynaptic GABARs as critical targets underlying low-dose alcohol intoxication and demonstrate that subtle changes in tonic inhibition in one class of neurons can alter behavior.

The above sounds like a reason, but it is debated still. I think it's safe to say that like so many cellular reactions, the answer will come down to receptors and their activation or inhibition, be it for GABA/NMDA, combinations or others.
Alcohol impairment of behavior in men and women
Differential effects of ethanol on motor coordination in adolescent and adult rats
Alcohol Intoxication Effects on Simulated Driving: Exploring Alcohol-Dose Effects on Brain Activation Using Functional MRI
Modulation of GABA A receptors in cerebellar granule neurons by ethanol: a review of genetic and electrophysiological studies
Ethanol affects NMDA receptor signaling at climbing fiber-Purkinje cell synapses in mice and impairs cerebellar LTD
Comment: In the fMRI part; visual and medial frontal regions were unaffected. It means that they are affected but not in dose dependent manner. Am i interpreting it correctly?
Comment: It means (sorry to be a stickler) that no activity was seen at that dose on fMRI. I can't really say more. :)
Comment: Okay, got it! Thanks! It really helped a lot  .No need to be sorry. =)


Generating a Possession Genitive Case in GF

Question: I checked the GF library for "'s" as in "My friend's house", but I couldn't seem to find the right method to create such a relation. May someone guide me on this problem.
Answer: There's indeed no function for the 's possessive in the core RGL. The closest you can get using just the RGL API is "the house of my friend".
However, there is a module called Extend, which has a function GenNP : NP -> Quant.
So how to use Extend? You have been using the RGL API, where all of the mkX opers are available when you open the Syntax and Paradigms modules. The Extend module is much newer than the core RGL, so its functions are not shown in the synopsis. But you can use them just like you'd use the Syntax and Paradigms modules. Here's an example usage:
resource Test = open SyntaxEng, ParadigmsEng, LexiconEng, ExtendEng in {

  oper
    -- "the house of my friend"
    house1 : NP = mkNP the_Det (mkCN (mkN2 house_N) (mkNP i_Pron friend_N)) ;

    -- "my friend's house"
    house2 : NP =
      let myFriend : NP = mkNP i_Pron friend_N ;
          myFriends : Quant = GenNP myFriend ;   -- GenNP is from ExtendEng
       in mkNP myFriends house_N ;
}

If you have any further questions on how to use Extend, I'll be glad to help!
Copy that into a file called Test.gf, and open your GF shell as you normally do. Then you can import the file with the flag -retain, that allows you to evaluate opers with the cc command. Like this:
(You need to be inside the GF shell, not on the command line)
> i -retain Test.gf
> cc -one house1
the house of my friend

> cc -one house2
my friend's house

Answer: If you search the English RGL for implementations of the genitive case (Gen for the most part), you may find something useful for your implementation.
For example, you have addGenitiveS in CompatibilityEng.gf and regGenitiveS in ResEng.gf.
> cc -table ResEng.regGenitiveS "dog"
ResEng.Nom => dog
ResEng.Gen => dog's


What would be the result of using chicken livers when making liverwurst?

Question: Is liver just liver or is there some basic difference in beef, swine, chicken. If I take a liverwurst recipe and use chicken liver instead of pork am I gong to get the same results within + or - 10%. Is liver from a shoat the same taste as a 60 kg sow?
Comment: I would just try different ingredients and taste test them. Personally I am a purist (pork only, please). To me the bacon and fat content are key, and you can't get that with chicken. Is there a particular reason why you want to substitute?
Answer: Let me do a breakdown of the typical ingredients of liverwurst ("Leberwurst") roughly based on food laws in Germany (aka liverwurst country):

roughly 10% - 30% (sometimes up to 40%) liver:
mostly pork because it's cheapest, using partly veal or poultry is more expensive but tastewise no big difference.
muscle meat and bacon, again typically pork, but beef, veal and poultry is also used either alone or as add-in.
usually a generous amount of spices.

The liver is influencing taste and texture, but the used regular meat and especially the spices play a big role, too. Using a "too dominant" liver or too much in total can be overwhelming, but there's no accounting for taste. While pork, veal and poultry livers are comparatively "mild" and can be used interchangeably (or as you said, the results will be in your +/- 10% range), beef liver has a tendency to make the liverwurst bitter, so it's use is not recommended.
Answer: Every recipe and article I've seen implies that there are only two options for traditional, German-style liverwurst.

Pork (more common)
Beef (usually calves' liver)

From Wikipedia:

Liverwurst usually contains pigs' or calves' livers. Other ingredients are meat (notably veal), fat, and spices including ground black pepper, marjoram, allspice, thyme, ground mustard seed, or nutmeg.

That being said, liverwurst is, essentially, a type of pâté (the French term)... of which the most iconic is, arguably, goose liver pâté or "pâté de foie gras":

The most famous pâté is probably pâté de foie gras, made from the livers of fattened geese.

Other regional versions include chicken livers:

In Russia and Ukraine, the dish is mostly prepared with beef, goose or chicken liver and thus is commonly known as печёночный паштет (Russian, pechyonochniy pashtet), however other meats also can be used.

So, it seems that it's up to you to decide what liver you want to be based on your taste preferences and how traditional you want to be.
As to your secondary question, none of the articles I could find specifically mention the age of the pig, though it's common to use veal liver if using beef instead of pork.
Comment: careful: Beef may get bitter, veal doesn't. Save your beef liver for other purposes...


Trigger a script when user tries to disconnect remote session (Remote Desktop)

Question: We want to run a script when user tries to disconnect a remote session
(using Remote Desktop) by clicking the  "X (close)" button. Any help on the event that gets triggered on clicking "X/close" button in remote session would also help us. The Script should run before the disconnection is complete. Basically when the system prompts user for confirmation of disconnection.
We are using Windows Server 2016.
Comment: (1) If you're running Windows Server 2016, why did you tag your question [Windows Server 2012] and not [Windows Server 2016]? (2) When you say "when user tries to disconnect", do you mean that (a) the script should run before the disconnection is complete, and/or (b) the script should be able to prevent the user from disconnecting (I suspect that this will be impossible)? Please do not respond in comments; [edit] your question to make it clearer and more complete.
Answer: I dont believe this is possible.  Hitting the X is closing the application.  The user's Remote Desktop application warns the user that this will end the session, but all this is done client side. There is no way for the remote server to know the session is disconnected till it happens and therefore, you couldnt run a script in that manner.


Default download folder for draw.io

Question: Can I change the default folder that draw.io saves its' xml files, and and downloaded image files, to? At the moment they keep going to my Downloads folder which doesn't work for me.
Comment: The download location (assuming that you're saving them to your local device) is a function of your web browser, not that of the draw.io site.  You should be able to change your browser's default download location in its configuration.
Answer: It depends, see below. Some browsers don't provide the permissions to perform a folder selection when downloading a file, browsers are very restrictive about file system access.
For these browsers, the only option here is to change the download folder in the browser options while using draw.
If you use Chrome 83 or later draw.io supports Native File API, which will open your operating system save dialog, allowing you to save anywhere.
Answer: Even if the default folder cannot be changed, in Firefox and IE (not Chrome), you can choose which folder you want to save in when you click "Save as..."

Default download folder for draw.io


why do we need to hash before we use a private key to digitally sign a transaction? isn't just using a private key enough?

Question: why is a hash needed for digital signatures? isn't it redundant since the point of hashing is to ensure contents are not tampered with , which the digital signature can do as well (on top of ensuring txn comes from the person)
Answer: I  addition to Claris' answer, if your question is about ECDSA, the hashing step is actually an essential part of the signature scheme and not just a step we choose to do before invoking it. Without it, the signature would not be secure. This is because given a public key, it is possible to compute (signature, message hash) pairs such that the signature is valid for the given public key and computed message hash. However, the message hash won't be the hash of a known message then, and thus making ECDSA verifiers redo the hashing is sufficient to prevent this attack.
Answer: Hashing ensures we get a constant length input for the signature operation.


Can I have two different types of water heater in the same house?

Question: I currently have an indirect fired 55 galon water tank. The house is pretty big and the former owner had a second, power vented water heater on the other side of the house. It seems he also had the two water heaters working the whole house Can I use a tankless water heater for the second water heater? Do I need to cut off the flow so the each heater only sends hot water to certain fixtures?
Comment: I'd be more inclined to switch the boiler up to a modern gas-fired mod-con and abandon the old oil-fired setup, oil tank and all, than to switch to a gas tankless for hot water heating; you'd get more bang for your buck that way, I'm sure
Comment: What's heating the indirect tank, and why are you interested in tankless?
Comment: Oil fed boiler heats the indirect. I am interested in tankless as it seems from my research they ill last longer, and I have found some that would be cheaper than the power vented water heaters. There is a propane line in place to where the second water heater would go.
Comment: Hello, and welcome to Home Improvement. If you give us a few more details, then @ThreePhaseEel 's comment will likely make a good answer for you.
Comment: Thanks all. The boiler is only 7 years old and its Buderus, so it's very good quality. I do not have natural gas, I am in a very rural area. I could switch to propane. It's a big old farm house and there are so many other pressing needs that replacing the boiler is not a feasible option at this time. I think my best bet is to install the second heater and have each heater dedicated to certain fixtures. My main curiosity is how the two different types of heaters would work if they were connected to each other the way the existing hooks up are set up now.
Comment: Are the existing heaters connected in series or parallel?
Comment: @ThreePhaseEel Propane is usually not cost-competitive with oil.
Answer: Yes. There is no problem with having 2 separate water heating appliances. There's also no problem in them being powered differently.
Tankless is not forever, but you are correct that they CAN last longer. However, if you have a decent plumber around any anode rod water heater can meet and absolutely beat a tankless' lifetime with measured replacement of the anode rod...including your existing water heater, if still sound and/or rust-free.
Also, there is an electric alternative at Home Depot by Westinghouse for the BEST EVER water heater. It's all stainless steel and therefore doesn't need nor use an anode rod. More expensive versions are just buying the warranty on the same exact heater, but they MUST be installed by a pro that follows instructions.
Your final and possibly best option is, to delete the 2nd water heater entirely and install a recirculating pump. This keeps the hot water hot at the distant baths, so there's no waiting. This is really ideal if you don't need the capacity of another tank.
If you do need the or some more capacity, then a bigger boiler tank could work extremely well with the recirculating pump.
Comment: The drawback to a recirculating pump is that you're constantly heating water, pumping it through the pipes, then returning it to be reheated. For the 8+ hours/day that nobody's at home and the 8 or so hours at night when everybody's sleeping, this is wasted energy. If the pump is on a timer, though, and only operates when the house is occupied, that _can_ be of benefit. Cost is high, though, with a pump at each fixture and all the return plumbing...
Comment: @FreeMan Why would you need a pump at each fixture? Wouldn't one pump just pump the hot water in a circulation loop. Then each fixture could tap into that loop.
Comment: @LeeSam assuming that all hot water runs from the heater, past each tap, to the last one in the line, then yes, that would work. If the house is plumbed in PEX with a home-run for each fixture, then each will need its own pump. If the tank is in the middle of the house with a run heading in each direction, then there would need to be 2 or more (one for each line heading out of the heater).
Comment: @FreeMan I guess it depends on how far the overall distance is to the farthest fixture. I've only seen one.
Answer: Three Phase Eel's comment is valid.  Look at redoing the whole system.  If you have natural gas in your area look at hooking up to it.
The rest of this is off topic to your original question, but I think relates enough to TPE's comment to be worth posting.
Gotchas:  Heating units were often oversized for the building.  My contractor sold me a 90,000 BTU/hr boiler that rarely runs more than 2 minutes in 15 even in mid winter.  I have since realized that I could heat my house with a demand water heater.
Sanity check for boiler operation:

Measure it's current duty cycle.  This takes a lot of patience, or you can put something like a kill-a-watt meter on it.  Usually heating appliaces are hard wired, so you would have to modify it to use a plug for the Kill-a-watt.
(If you find that it draws 300 watts for the blower, then it uses .3 kWh per hour of operation.  If it uses 1.2 kWh per day, then it it ran 3 hours.  3/24 = 12.5% duty cycle)
Now find the difference between the temp you want inside (70), and the average temp outside this week.  Suppose that is 25 degrees.
Look up what your coldest expected temp in winter is.  Easiest way is to look up your plant hardiness zone, then look up the temperature definition for that zone.  Suppose it's zone 3 which once in 10 years gets -40.
Currently it takes a 12.5% duty cycle to keep your house 25 degrees warmer than outside.
In your worst reasonable winter it's 70 - -40 = 110 = 4.4 times your current difference.  So your present unit should have been running 4.4 times 3 hours or 13.2 hours on the worst weather you are likely to have.

That would mean that your previous unit was oversized by almost a factor of 2.

It's probably worse than that.  In cold weather we are better about closing doors and windows.
So by doing this you can 'right size' your replacement unit.

This still is a terrible way to do things, as even if you size it perfectly to your worst case, it's underused most of the time.  The best system I've seen for this was a school that had 5 small gas boilers.  Each was about 200,000 BTU/hr.  Each one had an 'on' point 2 degrees differerent.  So one boiler would turn on at a temp of 140F and off at 150.  The next would turn on at 138 and turn off at 152.  The third would be at 136 and 154.  During most of the year boilers 2 and 3 would sit there.  #1 would carry the load.
The other two were set up similarly for domestic hot water, but at lower temps.
They were also set up on quick connects.  If we had trouble with a unit, we could disconnect it in about 10 minutes, put it in a pickup, drive it to town, and they could fix it, without our paying $120/hour for their time driving.
Comment: Those three school boilers - it is good practice to rotate the lead boiler, so #1 does not get older than the others...
Comment: They didn't do that with the boilers.  The main heating water circulation pumps, however they did.  Was this box full of relays that alternated between two 5 HP pumps.  It had a front panel: Off, A, B, Both.  #3 heating boiler was considered a 'hot spare'  In my time on maintenance it came on only when the outside temps were below -35, and there was a wind blowing.
Comment: I went to a large dairy that had 5 big boilers (7 feet in diameter and 15ft long) and they rotated the lead boiler each week - so that the hours in use was "evened" out - not exactly but close enough...
Comment: The drawback to wear-leveling is that when one fails due to age/use, the others won't be far behind, thus incurring relatively huge replacement costs. By allowing #1 to wear out well ahead of the others, it can be replaced, then put in position #3, bumping the old #2 to #1 and the old #3 to #2. This spreads the time of replacement cost, making life easier on the checkbook. Of course, the newer boiler is likely more efficient than any of the old ones, so a rotation may not be the best method, either. Use the most efficient most of the time.
Comment: The most extreme version of this I've run into:  Boiler makeup feed for a 500 MW plant:  Three pumps:  Normally Alternated A,B.  If either failed, would alternated between the remaining one and C.  D was on a pallet near by.  They regularly had drills shutting a manual valve to force a switch over, then replacing the pump.  E was in the storeroom.  F was back at the factory getting re-specced.  They *really* didn't want to lose water to the boiler.