qid int64 1 4.65M | metadata listlengths 3 3 | prompt stringlengths 31 25.8k | chosen stringlengths 17 28.2k | rejected stringlengths 19 40.5k | domain stringclasses 28
values |
|---|---|---|---|---|---|
82,017 | [
"https://dsp.stackexchange.com/questions/82017",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/60034/"
] | I have the following transfer function:
<span class="math-container">$$H(z) =\frac{\alpha z}{(z-(1-\alpha))}$$</span>
I'd like to find zeros and poles of it by <code>scipy.signal.tf2zpk</code>:
<pre><code>from scipy.signal import tf2zpk
alpha=0.4
(zeros, poles, gain) = tf2zpk([0, alpha], [1, alpha-1])
</code></pre>
it... | A quick look at the documentation yields
<blockquote>
The b and a arrays are interpreted as coefficients for positive, descending powers of the transfer function variable.
</blockquote>
You did this correctly for the denominator, but your numerator is turned around in the code. Try
<pre><code>(zeros, poles, gain) = tf2... | If your numerator array is <code>[0, alpha]</code> then the numerator polynomial of the corresponding transfer function is <span class="math-container">$0\cdot z^1+\alpha z^0$</span>, which is not what you intended.
| https://dsp.stackexchange.com |
53,533 | [
"https://security.stackexchange.com/questions/53533",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/42148/"
] | IP Addresses are pretty common around the internet so they're often easily found in plain text. However, let's say there's a number of IP addresses configured on a server to allow access through a firewall to specific locations. So, 1) these addresses are allowed access to a protected server and 2) someone else owns th... | This is safe in general, though you should be concerned about any services on those machines that are exposed via stateless protocols such as UDP, as the source address can be spoofed. As such, if an attacker knows the IP, they could still send UDP traffic through the firewall by faking the source IP. If you've got no ... | Easiest way to be a bit more secure is to place the list of IP adresses in a password-protected zip file. 7-zip does this, it's free, uses AES-256, and can also encrypt the files inside in addition to the archive itself. Then you can give the other party the password to the zip file over the phone or via text message.... | https://security.stackexchange.com |
86,657 | [
"https://mathoverflow.net/questions/86657",
"https://mathoverflow.net",
"https://mathoverflow.net/users/1593/"
] | Throughout my upbringing, I encountered the following annotations on Gauss's diary in several so-called accounts of the history of mathematics:
<blockquote>
"... A few of the entries indicate that the diary was a strictly private affair of its author's (sic). Thus for July 10, 1796, there is the entry
ΕΥΡΗΚΑ! n... | I think part of the answer may be found by consulting Volume <em>X</em> of Gauss's <em>Werke</em>. "REV. GALEN" doesn't actually appear in the <em>Tagebuch</em> itself, a facsimile of which appears following page 482. It was jotted down by Gauss elsewhere, as explained on page 539, in the commentary (which runs for n... | I believe I have a reference for Schuhmann:
Schuhmann E. 1976 Vicimus GEGAN, Interpretationsvarianten zu einer Tagebuchnotiz von C.F. Gauss, Naturwiss. Tech. Medezin. 13.2, 17-20.
| https://mathoverflow.net |
342,125 | [
"https://softwareengineering.stackexchange.com/questions/342125",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/262387/"
] | Earlier today I was working on a simple program from a textbook.
Although I solved the question with confidence and a clear robust solution, the solution wasn't perfect as it had steps which were redundant.
<br><br>
The more I optimized and tried to make it perfect:<br><br>
The code became more:<br>
- Unreadable<br>
... | Don't try for perfection. Recognize that there's a balance that must be struck between "good" code and "perfect" code.
Let's say the code works well, is readable, maintainable, easy to work with, but has a small handful of things that might not be 100% the way you'd like. If you try to refactor those few things but ... | The only best practice that I know of for reducing bugs while optimizing code (or for any kind of refactoring, for that matter) is <strong><em>proper testing</em></strong>. (Which includes <strong><em>extensive testing</em></strong>.)
So, first you get your code to work, then you have all your tests in place which pr... | https://softwareengineering.stackexchange.com |
1,959,806 | [
"https://math.stackexchange.com/questions/1959806",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/222013/"
] | Assuming X is a discrete random variable over the natural numbers using the fact that $n=\sum^n_{k=1}1$ show $E[X] = \sum^\infty_{n=1}P[X\ge n]$
$E[X] = \sum_{n=1}^\infty P[X\ge \sum^n_{k=1}1]$
I'm not sure how to move out the summation in the inequality over to the left. Is this the right approach?
| Note that
$$ E[X] = \sum_{n=1}^{\infty} n P[X = n] = \sum_{n=1}^{\infty} \left( \sum_{k=1}^n P[X = n] \right) = \sum_{k=1}^{\infty} \left( \sum_{n=k}^{\infty} P[X = n] \right) = \sum_{k=1}^{\infty} P[X \geq k] $$
where the change of order in the summation is justified by the fact that everything is non-negative.
| In terms of characteristic functions:
$$X = \sum_{n\geq 1} n 1_{X=n} = \sum_{n\geq 1} \sum_{k=1}^n 1_{X=n} = \sum_{k\geq 1}\sum_{n=k}^\infty 1_{X=n}= \sum_{k\geq 1} 1_{X\geq k}.$$
Now take expectation.
| https://math.stackexchange.com |
2,733,016 | [
"https://math.stackexchange.com/questions/2733016",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/550810/"
] | I am given a simple quadratic equation
$$x^2-x-c=0, x>0, c>0$$
and then we define a sequence $\{x_n\}$ with $x_1>0$ fixed and then, if $n$ is an index for which $x_n$ has been defined, we define
$$x_{n+1}=\sqrt{c+x_n}$$.
With that I am asked to prove that $\{x_n\}$ converges monotonically to the solution of t... | <strong>Hint</strong>
$$x_{n+1}^2-x_n=c$$
$$x_{n+2}^2-x_{n+1}=c$$
so,
$$x_{n+2}^2-x_{n+1}^2-(x_{n+1}-x_n)=0$$
$$(x_{n+2}-x_{n+1})(x_{n+2}+x_{n+1})=(x_{n+1}-x_n)$$
suppose that $x_{N+1}<x_{N}$ for some $N$. What can you conclude?
After that, you have to study the relation between $x_1$ and $x_2$, which will depe... | $\begin{array}\\
x_{n+1}-x_n
&=\sqrt{x_n+c}-x_n\\
&=(\sqrt{x_n+c}-x_n)\dfrac{\sqrt{x_n+c}+x_n}{\sqrt{x_n+c}+x_n}\\
&=\dfrac{x_n+c-x_n^2}{\sqrt{x_n+c}+x_n}\\
\end{array}
$
If
$f(x) = x^2-x-c$,
$f'(x) = 2x-1$,
so $f'(x) > 0$
for $x > \frac12$.
The roots of $f(x)$
are
$x
=\dfrac{1\pm\sqrt{1+4c}}{2}
$,... | https://math.stackexchange.com |
108,806 | [
"https://physics.stackexchange.com/questions/108806",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/44703/"
] | Let $r_{P/Q}$ be the position vector of $\overrightarrow P$ relative to vector $\overrightarrow Q$ and $v_{P/Q}$ the velocity vector of $\overrightarrow P$ relative to $\overrightarrow Q$.
Suppose $|v_Q| > |v_P|$ and you want to set the direction of $v_P$ such that $|r_{P/Q}|$ becomes minimal at some point in time... | If $\vec{v}_P$ is parallel to $\vec{v}_Q$ and $|\vec{v}_Q| > |\vec{v}_P|$ then the distance will always increase. So minimizing the component of speed parallel to the motion of <em>Q</em> is critical. This is stated as $\vec{v}_Q \cdot \vec{v}_P = 0$.
| Some hints to get you started:
First, consider a Galilean referential in which the problem is simpler and assume some fixed $v_P$, without taking care of its magnitude.
Second, use what you know of the distance between a line and a point (projection).
Third, minimize the distance between the line and point wrt $v_P$... | https://physics.stackexchange.com |
185,119 | [
"https://physics.stackexchange.com/questions/185119",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/78776/"
] | Everyone have seen and knows how lightning occurs. But then I realized that lightning never occurs in straight lines but it follows branching. But Why is that so? Why can't lightning goes in straight line rather than generating multiple branches just likes in this picture ?
<img src="https://i.stack.imgur.com/zrrxb.jp... | I know this is a little more than you asked for, but lightning is very interesting.
A lightning event is usually called a <strong>flash</strong> and lasts about 0.5 seconds. It consists of a near-invisible <strong>stepped leader</strong> followed by a very bright <strong>return stroke</strong> backwards along the pat... | Lightning branches so that it can reduce the resistance of the path it takes to the ground. As you know, when you attach two identical resistors in parallel, the equivalent resistance is lesser than that of the two in series. Branching essentially does that. It creates more and more parallel paths by which the electron... | https://physics.stackexchange.com |
275,319 | [
"https://physics.stackexchange.com/questions/275319",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/24452/"
] | A particle in box problem can be simplified to second order differential equation as:
$$
-\frac{d^2}{dx^2}\psi(x)=E\psi(x)
$$
with the boundary conditions:
$$
\psi(1)=\psi(0)=0
$$
The goal is to find the energy $E$ (independent of x) and the wavefunction $\psi(x)$, where $0<x<1$.
The usual method is to guess... | Different choices of $\psi'(0)$ will just scale up and down the whole wavefunction. Because it is easy to see that if you start with a certain $\psi'(0)$ to get a solution $\psi(x)$, an IC of $C\psi'(0)$ will just yield the solution $C\psi(x)$. The solution of the equation is determined only up to a multiplicative cons... | <blockquote>
The usual method is to guess an energy $E′$, then start from $x=0$ and advance a small step $dx$ until reach $x=1$. Check if $ψ(1)=0$. If it is , the guess is right, else re-guess.
</blockquote>
This simply isn't necessary. There's a simple and exact solution for this quantum system.
The SE for a parti... | https://physics.stackexchange.com |
4,051,348 | [
"https://math.stackexchange.com/questions/4051348",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/758031/"
] | I have the following ODE: <span class="math-container">$$x''=\lambda x-x^3$$</span>
To work with it, I turned it into a system of equations:
<span class="math-container">$$\begin{matrix}
x' & = & y \\
y' & = & \lambda x -x^3
\end{matrix}$$</span>
Now I want to find a first integral for this system, as w... | If you have a separable situation like the present, then the connection between first integral/Hamiltonian/energy and the potential is
<span class="math-container">$$
H(x,y)=\frac12y^2+P(x)
$$</span>
So in this case you can chose <span class="math-container">$P(x)=\frac14(x^2-λ)^2$</span>.
| There was two mistakes in the equation :
<span class="math-container">$$y^2=\lambda x^\color{red}{2}-\frac{x^4}{\color{red}{2} }+C$$</span>
( Corrected in red ).
Then :
<span class="math-container">$$y=x'=\pm \sqrt{\lambda x-\frac{x^4}{2}+C}$$</span>
<span class="math-container">$$\frac{dx}{dt}=\pm \sqrt{\lambda x-\fr... | https://math.stackexchange.com |
1,063,660 | [
"https://math.stackexchange.com/questions/1063660",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/75514/"
] | I am trying to verify this simple property for a stochastic integral. Given that f(t,w) is a bounded, nonanticipating function for a given Wiener process $W_t$ show that $E((\int_{0}^{T} f(s,w) dW_s)^4) \le 36T\int_{0}^{T}Ef^4(s,w)ds$ .
I know that $E((\int_{0}^{T} f(s,w) dW_s)^2)=E(\int_{0}^{T} f^2(s,w)ds)$. I trie... | Applying Itô's formula for the Itô process
$$X_t := \int_0^t f(s) \, dW_s$$
and $f(x) := x^4$ gives
$$X_t^4 = 4 \int_0^t X_s f(s) \, dW_s + \frac{4 \cdot 3}{2} \int_0^t X_s^2 f(s)^2 \, ds.$$
Taking expecation yields
$$\begin{align*} \mathbb{E}(X_t^4) &= 6 \int_0^t \mathbb{E}(X_s^2 f(s)^2) \, ds. \end{align*}$$... | Here's a different argument. Define
$$X_t = \int_0^t f(s,\omega) dW_s \\
Y_t = X_t^4 \\
Z_t = X_t^2.$$
Apply the Ito formula to $Y_t$ and $Z_t$:
$$Y_t = 4 \int_0^t f(s,\omega) X_s^3 dW_s + 6 \int_0^t f(s,\omega)^2 X_s^2 ds \\
Z_t = 2 \int_0^t f(s,\omega) X_s dW_s + \int_0^t f(s,\omega)^2 ds$$
Now substitute and tak... | https://math.stackexchange.com |
15,546 | [
"https://mathoverflow.net/questions/15546",
"https://mathoverflow.net",
"https://mathoverflow.net/users/1676/"
] | I have an inclusion of topological spaces (actually manifolds with corners) $X \to Y$. I can show that for every $x \in X$ there is a neighborhood of $x$ in $Y$ of the form $U \times V$. Also, the intersection of $U \times V$ with $X$ is $U \times V'$.
In fact, $V$ is a neighborhood of the origin in $[0,1)^k$. Also... | The inclusion of a CW subcomplex $K$ into a CW complex $L$ is a cofibration. Briefly, we can extend a homotopy from the $n-1$-skeleton to the $n$-skeleton by projecting $e\times I$ to $e\times\{0\}\cup\partial E\times I$ for any $n$-cell $e$ not in $L$.
| I'm not sure whether this will be helpful to mpdude, but I thought I'd just point out that given a smooth manifold M and a smooth submanifold N, you can see very easily that the inclusion $N\to M$ is a cofibration, without any cell structure.
Simply observe that a tubular neighborhood gives you a mapping cylinder ne... | https://mathoverflow.net |
603,145 | [
"https://physics.stackexchange.com/questions/603145",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/183301/"
] | I understand that in quantum mechanics every vector from the state space (e.g. <span class="math-container">$|\Psi(t) \rangle$</span>) can be projected on to observables such as the momentum space basis vectors <span class="math-container">$|p\rangle$</span> or position space basis vectors <span class="math-container">... | How do you want to define momentum to begin with? Perhaps the best way is to define the momentum operator <span class="math-container">$\hat p$</span> to be the operator that satisfies the commutation relation <span class="math-container">$$[\hat x,\hat p]=i\hbar$$</span> with the position operator <span class="math-co... | Consider a particle in some state <span class="math-container">$|\Psi\rangle$</span>, and let's look at how its position and momentum space wavefunctions <span class="math-container">$\psi(x) = \langle x | \Psi \rangle$</span> and <span class="math-container">$\widetilde{\psi}(p) = \langle p | \Psi \rangle$</span> are ... | https://physics.stackexchange.com |
151,866 | [
"https://security.stackexchange.com/questions/151866",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/70916/"
] | I have viewed Gmail's certificate chain at my workplace, and I realised it's different. It looks like this:
<pre><code>Root CA
Operative CA1
___________.net
mail.google.com
</code></pre>
When I get the certificate chain at home, it looks like this:
<pre><code>GeoTrust Global CA
Google Internet A... | Yes, a company doing SSL interception could in theory read all your traffic if you use the company network. Depending on where you live and what kind of contract you have the ability for the company to do this might also be somehow part of the contract or working rules which might also include that you are only allowed... | In addition to scanning for malware, corporate IT also uses TLS intercept for data loss prevention (DLP), eg. making sure you're not sending proprietary documents through your personal e-mail.
In most medium to large companies, you must sign an "Acceptable Use Policy" as a condition of employment, and that policy wil... | https://security.stackexchange.com |
259,956 | [
"https://electronics.stackexchange.com/questions/259956",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/124785/"
] | I am trying to repair a headphone cable with a splice. The audio sounds really bad after the repair. I can hear instruments, but not the vocals. Also, the playback is mono, same sound on both sides.
If I short Left to Right, the audio gets quiet, but still sounds bad. If I short Left to Common, <em>or</em> Right to Co... | I had always assumed that it was just because they flipped states. And flop may refer to the optional reset (causing the circuit to flop). But, looking into a bit more ...
From the online etymology dictionary:
"<em>Flip-flop in the general sense of "complete reversal of direction" dates from 1900; it began to be us... | As almost everything around us expressions can be found in history;
Once the expression starts to be known we start deviating from the origin and start to use the same in other but similar situations
Our friends at the English Oxford dictionary come up with a this information.
Origin:
Mid 17th century (in the genera... | https://electronics.stackexchange.com |
165,559 | [
"https://electronics.stackexchange.com/questions/165559",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/72586/"
] | With the shields typically found on WiFi modules, what kind of metal are they? Are they coated? Here's an example:
<img src="https://i.stack.imgur.com/iZFxX.jpg" alt="enter image description here">
Thanks
| They could be made out of brass or other materials, but typically they're cold-rolled steel (CRS) with tin plating (for solderability and corrosion resistance).
You can easily check with a magnet.
| Tin-plated steel is the most common shield material used on these devices.
The steel provides the strength and shielding while the tin plate reduces the tendency for rusting and allows easy soldering.
| https://electronics.stackexchange.com |
4,529 | [
"https://chemistry.stackexchange.com/questions/4529",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/1106/"
] | I'm familiar with the periodic table / periodic system, but I wonder why it's called "periodic" since there seems not much periodic about (there seems to be little or no predictability of which elements are stable) and from physics I know Z-value of elements and that is not periodic either. So what is a "period" in thi... | I agree that the "periods" in the periodic table are not mathematically regular. The simplest definition is that a <em>period</em> begins when a new <em>s</em>-subshell starts to fill. Recall that in the <em>s, p, d, f</em> subshells there are 2, 8, 10, and 14 electrons, respectively, so the periods have to get bigge... | <blockquote>
So what is a "period" in this context?
To answer this directly, <strong>a period is a row of the table.</strong>
</blockquote>
As user467 indicates, the repeating periods reflect the filling-up of atomic orbitals. Because the valence electrons (those in the outer shell of an atom) determine many of th... | https://chemistry.stackexchange.com |
1,900,586 | [
"https://math.stackexchange.com/questions/1900586",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/361857/"
] | I took the negatives out of the square roots by making the equation: $$\frac{3-i\sqrt{8}}{1+i\sqrt{2}}$$
Then I multiplied it by the conjugate of the denominator: $$\frac{3-i\sqrt{8}}{1+i\sqrt{2}}*\frac{1-i\sqrt{2}}{1-i\sqrt{2}}$$
And then I got: $$\frac{3-3i\sqrt{2}-i\sqrt{8}+\sqrt{16}}{3}$$
Then, I knew that $\sqr... | Should be $-\sqrt 16$, also $-3-2=-5,$ not $-6$. Square roots that are included in the problem statement usually assume the positive root.
| You have done the multiplication wrong. $$(3-i\sqrt8)(1-i\sqrt2) = 3 - 2i\sqrt2 - 3i\sqrt2 \color{red}{-}\sqrt{16} = -1 -5i\sqrt 2$$
| https://math.stackexchange.com |
1,229,469 | [
"https://math.stackexchange.com/questions/1229469",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/153357/"
] | Hello all I am trying to redo a problem I had and I am stumped for some reasons. I just want to find the maximum and minimal distance from the curve $$7x^2-6xy+7y^2-6=0$$ to the origin. But I want to do this in the most efficient way as well.
I calculated $$f_x=14x-6y$$ and $$f_y=14y-6x$$ and setting these to zero and... | To solve your system of equations, note that $14- 6(y/x) = 2\lambda = 14-6(x/y)$. Thus, $x^2 = y^2$, and you need to find the points on your curve where $x = \pm y$.
| Another approach:
$Ax^2 + Bxy + Cy^2= 1 , $ with the condition $4AC - B^2 > 0$ , is an ellipse rotated about the origin.
Hence
$$ 7x^2 - 6xy + 7y^2 = 6 $$
is an ellipse as specified above.
Polar coordinates:
$$ x = r\cos(\phi) ; y = r\sin(\phi) .$$
Inserting:
$$ 7r^2- 6r^2\cos(\phi)\sin(\phi) = 6 ,$$
... | https://math.stackexchange.com |
12,003 | [
"https://mechanics.stackexchange.com/questions/12003",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/274/"
] | My car has the P0462 (Fuel Level Sensor low input) P0500 (Vehicle speed sensor circuit fault) but both the speedometer and the fuel gauge appear to be working normally. However the tach bounces between the approximate engine speed and 0 (not all of the time but frequently).
The car doesn't have any other symptoms it ... | After replacing the speed sensor and the fuel level sensor and resetting the codes. A new code came up U1001 (CAN communication) in addition to the other codes. I tracked the problem back to the instrument cluster where the fuel level sensor and the speed sensor signals travel through to the ECU. Replaced the instrumen... | You need to check the speed sensor at the transmission with an Ohm meter and find around 25 Ohms. One of the wires, usually purple attaches, to the back of the instrument panel. Make sure of a good connection and continuity in the wiring. Another fault that can occur is that the driving wheel on the transmission output... | https://mechanics.stackexchange.com |
22,360 | [
"https://cs.stackexchange.com/questions/22360",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/15375/"
] | What I'm trying to do is to show a problem in NP can be reduced to the min weight vertex cover problem
I've chosen the max independent weight problem =
input: A graph G with weights on each vertex,
output: An independent set with the max total weight
Before reducing, I've tried to show that the max indep. weight pr... | Max weighted independent set is the decision problem whose instances are pairs $(G,B)$ such that $G = (V,E,w)$ is a vertex-weighted graph that has an independent set of weight <em>at least</em> $B$. Nowhere is it claimed that $B$ is the maximum weight of an independent set. The problem (like many others) is defined in ... | The issue is with the version of the problem you are using. Note that as you define it, the output is required to be the maximum weight independent set, i.e. the optimum answer. $NP$ however is a class of <em>decision</em> problems, so the only valid outputs are Yes and No.
So if you want to show the problem is in $NP... | https://cs.stackexchange.com |
61,596 | [
"https://electronics.stackexchange.com/questions/61596",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/15810/"
] | What is the difference between the quantization noise and quantization error in ADC?
I understood that the quantization error you get when you convert analog to digital and quantization noise when you convert from digital to analog.
| The quantization noise is an abstraction, meant to represent the quantization error as a signal (so it can be compared to other forms of noise.
You consider the quantization noise as the difference between the (real) quantized signal and the (ideal) sampled one. Because of the loss of information due to quantization, ... | Quantization noise relates to AC signals - when a signal is digitized and then converted back to analogue, the digital steps that correspond to the digitization process can be seen on the analogue signal like a staircase running up and down the signal. This is an example of how q-noise can be regarded.
Q-error relates... | https://electronics.stackexchange.com |
736,789 | [
"https://physics.stackexchange.com/questions/736789",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/344304/"
] | Now the proof for the parallel axis theorem is fairly easy to follow but I couldn't understand a part which says,<br />
<span class="math-container">$$\int{dm}{\vec{r_c}}={\vec{0}}.$$</span><br />
This sums up the product of each particle's mass and it's perpendicular distance from the axis passing through the centre o... | Let us say you want to define the center of mass as the point where if a rigid body is rotating about with some arbitrary rotational velocity <span class="math-container">$\boldsymbol{\omega}$</span>, then the summation of translational momentum of all the particles on the body is <em>zero</em>.
Place the origin at the... | That's the definition of the center of mass point <span class="math-container">$\vec R$</span>:
<span class="math-container">$$\int \rho(\vec r) (\vec r - \vec R) \ \mathrm d^3r= 0 \iff M\vec R = \int \rho(\vec r)\vec r \ \mathrm d^3 r$$</span>
where <span class="math-container">$M\equiv \int \rho(\vec r)\ \mathrm d^3... | https://physics.stackexchange.com |
246,118 | [
"https://softwareengineering.stackexchange.com/questions/246118",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/62282/"
] | <ul>
<li>I have a hypothetical scenario where I need to pass data to APIs from multiple different providers, depending on the 'vendor identity' provided by one of the pieces of data.</li>
<li>If I have the data as objects within an enumerable parent object, what would be a good way to pass the objects to the appropriat... | I think it would help if you clarified how much difference in APIs there are. eg. Could ytou be using 2 location services where one takes lat/long co-ordinates, and the other XY co-ords; or are they more different like a location service and a pizza-ordering service?
Either way, your best bet is a message passing arch... | Seems like a good opportunity for message queues.
Queues are good for retrying errors and for keeping things loosely coupled. For example, the data you're passing could be pushed onto an incoming queue. Some process would grab it and decide which APIs should receive it, writing it to several outgoing queues. The ... | https://softwareengineering.stackexchange.com |
103,140 | [
"https://electronics.stackexchange.com/questions/103140",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/38353/"
] | I understand that serious HW firms can manufacture their own boards, but what are the disadvantages of using a development board 'in production', i.e. placing a PCIe card into a server and performing calculations on it?
| The biggest one is that it might not be available tomorrow.
In some cases, the manufacturers <strong>intend</strong> that the development board may be used in low volume production and pledge to maintain production over some period of time. They may also make available schematics and gerbers that allow you to produce... | Speaking from experience...
Many years back my company was experimenting with a low-volume FPGA application. At the time there were no production boards that met our needs and because of time pressures it wasn't feasible to design our own. We ended up going with a demo board produced by a well known Xilinx distribut... | https://electronics.stackexchange.com |
327,578 | [
"https://softwareengineering.stackexchange.com/questions/327578",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/181126/"
] | When I'm creating a docstring, sometimes I want to refer to a value, for instance:
<pre><code>def try_download(data, path):
"""Tries to download ATTEMPTS times, catching socket errors."""
</code></pre>
Where <code>ATTEMPTS</code> is just a constant int defined at the start of the file. But would it be better to w... | The approach you're describing doesn't actually produce a docstring. It doesn't result in the <strong>__doc__</strong> property of the function being set, which means that it's not available to the <strong>help</strong> function, and wouldn't be available to (typical) automated documentation generators. Here's a simpl... | In my opinion such use of docstrings would be unexpected. Docstrings are used to explain what does an object, explain its parameters or propose usage of the object.<br>
In your case you are saying something about the execution of your function, not how does it works so I wouldn't create it dynamically. If this is set ... | https://softwareengineering.stackexchange.com |
305,002 | [
"https://stats.stackexchange.com/questions/305002",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/172074/"
] | I have the following problem:
Assume there are three time series $h(t)$, $g(t)$ and $f(t)$.
The hypothesis is that prior to $t_1$: $h(t)=a\cdot f(t-t_2)$
and after $t_1$: $h(t)=b \cdot g(t-t_3)$.
Now the question is are there statistical or mathematical tests that would allow me to determine $t_1$? And prove that ... | The CI for the sum is equal to the CI of the mean, multiplied by the number of observations. So for example, if your CI for your mean of 5.3 was [4.8, 5.8] then the CI for the sum is [480,580].
That was a simple answer but there are a couple of points to bear in mind:
<ul>
<li>Arguably, the concept of "CI for the sum... | A confidence interval is a range within which a specified % of the samples fall.
So CI of 95% means that 95% of the values in the sample fall inside that specific range.
Hence asking for a 95% Confidence Interval of the sum, which contains 100% of the sample, doesn't make sense.
| https://stats.stackexchange.com |
102,939 | [
"https://physics.stackexchange.com/questions/102939",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/27546/"
] | As I understand, "dark matter" is what they call a theoretical substance which is only known by it's influence upon velocity curve of the galaxy.
If indeed the gravity of "dark matter" is so strong that it keeps our solar system in orbit, then it's force effects on Earth should be comparable with th... | To put a little mass into the discussion, the gravitational field due to a compact body of mass $M$ and distance $R$ is
$$ g = G\frac{M}{R^2} \,.$$
Tides arise because another body of size $r$ (measured from the subject body's center of mass) experiences a <em>different</em> gravitational attraction on either side of ... | The solar-system effects of dark matter are almost zero, if not exactly zero. While dark matter is the majority of matter in the galaxy, it is also very diffuse when compared to things like the sun and the Earth.
| https://physics.stackexchange.com |
1,039 | [
"https://mathoverflow.net/questions/1039",
"https://mathoverflow.net",
"https://mathoverflow.net/users/425/"
] | Let f:X→Y be a semismall resolution of singularities. Then the pushforward of the constant sheaf on X is a semisimple perverse sheaf on Y. Under these conditions, I know how to calculate the direct summands of the pushforward f<sub>*</sub>ℚ<sub>X</sub>[dim X].
My question is as follows: What more general st... | I'm a little confused about your question. If you just want to know what the summands are there's nothing special about f<sub>*</sub>ℚ<sub>X</sub>[dim X]. The only way I know of understanding that sheaf is a general algorithm for understanding all semi-simple perverse sheaves. The only fact you use is that a s... | I agree with Ben that the question is a little confusing.
There are two possible questions:
<em>How do you calculate direct summands of the direct image when we start with an IC (not necessarily the constant sheaf) on the source?</em>
In this case I think the direct image need not be perverse. In which case you are ... | https://mathoverflow.net |
229,190 | [
"https://math.stackexchange.com/questions/229190",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39513/"
] | Use the limit definition to show that $g'(0)$ exists but $g'(0)\neq \lim_{x\to 0} g'(x)$, where
$$g(x)=\begin{cases}x^2\sin\frac1x,&\text{when }x\neq0\\\\
0,&\text{when }x=0\end{cases}$$
I find that when $x\neq 0$, $g'(x)=2x \sin\dfrac1x-\cos\dfrac1x$.
My problem is that when I can't compute
$$\lim_{x\to0}... | Here’s a pretty large for showing that $g'(0)$ exists. By definition
$$g'(0)=\lim_{h\to 0}\frac{g(0+h)-g(0)}h=\lim_{h\to0}\frac{g(h)}h=\lim_{h\to 0}\frac{h^2\sin\frac1h}h=\lim_{h\to 0}h\sin\frac1h\;;\tag{1}$$
can you evaluate that last limit?
For the rest, you already have
$$\lim_{x\to0}g'(x)=2\lim_{x\to0}x \sin\... | Assume by contradiction that $\lim_{x \to 0} g'(x)$ exists. Then
$$\lim_{x\to0}g'(x)-2\lim_{x\to0}x \sin(1/x)$$
also exists, thus $\lim_{x \to 0} \cos(\frac{1}{x})$ exists.
Alternatelly, find two different sequences, $x_n, y_n$ so that
$$ \lim_n g'(x_n)=0$$
$$\lim_n g'(y_n)=1$$
| https://math.stackexchange.com |
112,292 | [
"https://dba.stackexchange.com/questions/112292",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/73643/"
] | I'm a noob when it comes to SQL or PHP and I'm a creating a rather simple car-sharing web site. The user can engage a trip someone created and can himself create a trip. Now I'm currently designing the SQL model, and I came across some doubts that maybe someone can help me with.
I want to save the user that created a ... | Without a lot more info, etc. couldn't you just create an EngageTrips table, and create an CreatedTrips table and hook a foreign key into those and then join the data once the function is run to bring that data for view to the end-user?
Also meaning control how the data is entered into each table at the data entry lev... | Your model has two different relationships between <code>User</code> and <code>Trip</code>. They should be modeled separately. They have different cardinalities.
One is the "created" relationship which is one-to-many. This is modeled by the foreign key in <code>Trip</code>, as you say in your question.
The second is ... | https://dba.stackexchange.com |
612,645 | [
"https://physics.stackexchange.com/questions/612645",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/288146/"
] | I am just starting familiarizing myself with special relativity, and want to understand if the following is a correct thought process:
Consider a star that is 100 light years away from Earth, from my perspective, where I am a stationary observer on earth at some moment in time.
Consider another observer that is passing... | You are right that the traveler need not age much when voyaging from one star to another many lightyears away. If the distance plotted from Earth is <span class="math-container">$d$</span> in the measurements appropriate to the rest from of Earth or Sun, then the proper time accumulated by the traveler is
<span class="... | <blockquote>
Does special relativity imply that I can reach a star 100 light years away faster than in 100 years?
</blockquote>
The time that you experience in your spaceship on your way to the star could be more than or less than (or equal to) 100 years depending on how fast your spaceship travels.
The time that an ea... | https://physics.stackexchange.com |
491,745 | [
"https://electronics.stackexchange.com/questions/491745",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/243585/"
] | Say <span class="math-container">\$v(t) = V_m\cos(\omega t+\phi)=\Re[V_me^{j(\omega t +\phi)}] = \Re[Ve^{j\omega t}]\$</span>,<br>
where <span class="math-container">\$V_me^{j\phi} = V\$</span>.
Integrating gives<br>
<span class="math-container">\$\int\limits_0^t v(t)\,dt = \Re\int\limits_0^t Ve^{j\omega t}\,dt = \R... | The operator, <span class="math-container">\$\frac{1}{j\omega}\$</span>, in the frequency domain is equivalent to <strong>indefinite</strong> integration in the time domain.
| There should be no constants as the initial conditions should be 0 and the circuit analysis involved is for linear circuits, otherwise stored energy will add non-linearity.
| https://electronics.stackexchange.com |
2,273,944 | [
"https://math.stackexchange.com/questions/2273944",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/444941/"
] | $$I = \int_0^\infty\frac{1}{x^4+x^2+1}dx$$
I have evaluated the integral directly and know the result is $\frac{\pi}{2\sqrt3}$ but I must be messing up my residues or perhaps my path of integration when attempting the contour evaluation. When attempting contour I arrive at $\frac{\sqrt3\pi}{3}$
Edit: here is the way I... | Hint:
$$2I=\int_{-\infty}^{+\infty}\frac1{x^4+x^2+1}\ dx$$
Use a semi-circle contour and notice that
$$f(z)=\frac1{z^4+z^2+1}$$
$$\operatorname{Res}(f,e^{\pi i/3})=\frac1{12}(-3-i\sqrt3)$$
$$\operatorname{Res}(f,e^{2\pi i/3})=\frac1{12}(3-i\sqrt3)$$
| The integral can also be evaluated using the result:
$$\int_0^{\infty}\frac{x^{-p}}{1+x}dx=\frac{\pi}{\sin(\pi p)}\tag{1}$$
which is an easily evaluated using a keyhole contour. Many integrals can be derived using this result, even if there is no straightforward substitution that leads to this integral. The integral ... | https://math.stackexchange.com |
4,868 | [
"https://stats.stackexchange.com/questions/4868",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/2113/"
] | Is it possible to do k-fold cross-validation to <strong>test</strong> all data, rather than using kfcv to find the optimal hypothesis as is typically done.
Example:
Say I want to use a svms on a dataset of size 1000. Could I use 900 events to train the svm for the testing of the other 100 events. Then use a separate ... | As far as I understand your question, it can be formulated this way:
<em>Instead of calculating a quality measure for each of the k validation-folds and then calculate the average, may I aggregate all folds an then calculate my quality measure, hence getting only one instead of k values?</em>
This question requires t... | Yes it is; and while this is a very reliable way of reporting error, I would say it is even encouraged.
| https://stats.stackexchange.com |
550,967 | [
"https://physics.stackexchange.com/questions/550967",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/263910/"
] | What does the coefficient physically mean for an operator that isn't an observable. For an observable the coefficient is the eigenvalue and is the value that will be measured, but for operators that aren't observables they can't be measured. An example is the Ladder Operator where <span class="math-container">$a\vert n... | Regardless of whether an operator <span class="math-container">$\hat{A}$</span> is an observable or not, if <span class="math-container">$\hat{A}|\psi\rangle = a | \psi\rangle$</span> then <span class="math-container">$a$</span> is simply its eigenvalue. That's the definition of the eigenvalues, it has nothing to do wi... | I think may be confusing two things here. One is the state, which is taken as normalized, and the other is the action of an operator on the state, which may not result in another normalized state.
Maybe the simplest example of that of an average value: given an operator <span class="math-container">$\hat A$</span>, i... | https://physics.stackexchange.com |
7,440 | [
"https://earthscience.stackexchange.com/questions/7440",
"https://earthscience.stackexchange.com",
"https://earthscience.stackexchange.com/users/2714/"
] | Does anyone know of any simple means for merging (inverse distance weighting method) hourly weather files (precip, temp, etc.) from different time zones?
I am creating weather data for HUC8s, and am using the 5 closest NCDC weather stations. But some HUC8s cross over different time zones. Has anyone figured out the ... | Many good data sources will come with a UTC offset column. This is helpful for harmonizing time zones since you can simply reverse the UTC offset to make a unified UTC dataset. If your data doesn't have the UTC offset, then you can link to it using a table like this:
<pre><code> TZ UTC Time
EST -5
EDT -4
... | Using your example of 10 AM EST and 9 AM CST, those are both exactly the same time and another way of specifying that time is 1500 UTC or 15Z (Z being historical for GMT, for your application the difference between UTC and GMT is negligible).
If you know the location of your stations then you can know their timezone. ... | https://earthscience.stackexchange.com |
9,842 | [
"https://physics.stackexchange.com/questions/9842",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/202/"
] | If, say, a particle with energy $E<V_0$, approaches a finite potential barrier with height $V_0$, and happens to tunnel through, where would the particle be during the time period when it is to the left of the potential barrier and to the right of the potential barrier? Surely there must be a finite amount of time f... | Isn't the whole point here that one cannot say where the particle IS exactly? One can only calculate the probabilities of it being at one place.
Tunneling means the probability of it being inside the barrier isn't zero (since we want the probability distrubition to be continuous). There is always penetration of the w... | As Marek sais, the particle may be found "inside" the barrier, if you like. It means you can really find it there as well as outside. But in QM a particle is a wave and is "created" by the whole volume involved. It is not permanently "localized" or "concentrated".
| https://physics.stackexchange.com |
26,009 | [
"https://cs.stackexchange.com/questions/26009",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/-1/"
] | If
$\qquad\displaystyle L_p = \{ \langle M \rangle : p \in P(L(M)) \text{ s.t. } p \text{ is a specific trivial property} \}$,
where a trivial property is a property that is shared by <em>all</em> recursively enumerable languages or is <em>not</em> a property of <em>any</em> recursively enumerable language, is it i... | If $p$ is a trivial property of r.e. languages, it either applies to all r.e. languages or applies to no r.e. language. That means that either
<ol>
<li>$L_p$ is the set of all TM descriptions or</li>
<li>$L_p=\emptyset$.</li>
</ol>
In the first case, a decider for $L_p$ ignore the input $\langle M\rangle$ and immedia... | Not sure if I understood your question correctly, but if $P$ is a trivial property, i.e., shared by all languages in $RE$, then $HALT$ language also has that property. So, $L$ in your definition could just as easily be $HALT$; it fits your definition. But, $HALT$ is not decidable. Hence, the answer is no.
| https://cs.stackexchange.com |
360,700 | [
"https://mathoverflow.net/questions/360700",
"https://mathoverflow.net",
"https://mathoverflow.net/users/158183/"
] | Let <span class="math-container">$\mathcal{L}$</span> be the language of arithmetic given as follows:
<ul>
<li><span class="math-container">$x::= {\sf v} \mid x'$</span></li>
<li><span class="math-container">$t ::= x \mid 0 \mid {\sf S}t \mid (t+t) \mid (t\times t)$</span></li>
<li><span class="math-container">$A ::= ... | Remark. Exact sequence <span class="math-container">$0 \to L \to E \to M \to 0$</span> corresponds to <span class="math-container">$Ext^1(M,L)$</span>, not to <span class="math-container">$Ext^1(L,M)$</span>.
Q1. <span class="math-container">$a \in k^\times$</span> acts on <span class="math-container">$Ext^1(L,M)$</sp... | That is we start with an arbitrary extension <span class="math-container">$0 \to M \to e_2 \to L \to 0$</span> represented by the class of the image <span class="math-container">$\Phi_{e_2}:=\delta(id_L)$</span> with respect the delta-map in lower row in second diagram below and it's pullback extension <span class="mat... | https://mathoverflow.net |
149,190 | [
"https://softwareengineering.stackexchange.com/questions/149190",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/36051/"
] | So I have a function that takes two dates. The SQL query gets all the results between the two dates. I currently have my function setup as such:
<pre><code>function myFunc(start, end)
</code></pre>
Where start is the most recent date and end is the oldest date.
Is this intuitive/correct or is there another namin... | Typically, you'd think that start <= end, so not really. Consider renaming it to give a hint to the business logic you are trying to implement.
| Why not just name them what they are? That would seem to be the most intuitive to me.
<pre><code>function myFunc(recentDate, oldDate)
</code></pre>
| https://softwareengineering.stackexchange.com |
1,788,406 | [
"https://math.stackexchange.com/questions/1788406",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | I'm working on an integral problem(the rest of which is irrelevant) and this integral arises, which has stumped me.
<span class="math-container">$$\int_{0}^{1}\int_{0}^{x}\left\lfloor\frac{1}{1-t}\right\rfloor dt \,dx$$</span>
<span class="math-container">$\bf\lfloor\quad\rfloor$</span> is Floor function.
Looking at ... | Denote $f(t) = \lfloor 1/(1-t) \rfloor$, and consider the function
$$
g(x,t) = \Theta(x - t) f(t),
$$
where $\Theta(u)$ is the Heaviside step function. Since $g(x,t) = f(t)$ on the original region of integration, we can expand the region of integration to the unit square:
$$
\int_{0}^{1}\int_{0}^{x} f(t) \, dt \, dx =... | $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
\newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
\newcommand{\dd}{{\rm d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
\newcommand{\expo}... | https://math.stackexchange.com |
451,215 | [
"https://physics.stackexchange.com/questions/451215",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/162923/"
] | I have a very basic question regarding the mean of the Langevin equation.
So we have an equation of the form:<br>
<span class="math-container">$$\dot{v}(t)=-\beta v(t)+ \xi (t)$$</span><br>
Where <span class="math-container">$\xi (t)$</span> is a Gaussian white noise with an average zero and a <span class="math-conta... | Let me answer the original question as I understood it literally. It has a methodological value.
I understand taking a mean value as some integration over a limited period <span class="math-container">$T$</span>: <span class="math-container">$$\langle f(t)\rangle=\frac{1}{T}\int_t^{t+T}f(\tau)d\tau$$</span> Only doing... | To see why the first is left when taking the mean, re-write the SDE as,
<span class="math-container">$$
\mathrm dv=-\beta v\mathop{}\!\mathrm dt+g(x,\,t)\mathop{}\!\mathrm dW,
$$</span>
where <span class="math-container">$g(x,\,t)$</span> is some function and <span class="math-container">$\mathrm dW$</span> the stochas... | https://physics.stackexchange.com |
55,797 | [
"https://electronics.stackexchange.com/questions/55797",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/18125/"
] | I am designing a simple ALU with <code>and</code>, <code>add</code>, <code>load</code> operations for 16-bit inputs. This is what I have so far:
<pre><code>module ALU(overflow,out,in1,in2,select);
input[1:0] select;
output[15:0] out;
output overflow;
reg[16:0] out;
reg overflow;
always @(in1,in2,select)
case(select)... | A simple solution could be to connect the junction of C5 and R1 via a 10k resistor to PB2, and connect the ISP connector directly to PB2.
This is a general solution that you can use whenever you want to override a signal with a stronger signal that will not be present (or is in tri-state) when the weaker signal must b... | You haven't specified which micro you're using, but in many(most) cases a 1uF cap is going to wreak havoc with the ISP programming clock.
I'd nopop the cap and go for a software debounce instead of brute-forcing it.
| https://electronics.stackexchange.com |
7,479 | [
"https://cs.stackexchange.com/questions/7479",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/4763/"
] | Summation of $O(n)$ from $1\le k\le n$.
I think it should be $O(n)$ only. Because we are addition $O(k)$ and maximum order will be $O(n)$. But answer is given as $O(n^2)$.
Correct me if I'm wrong.
| I think I understood you from your comments above. I think you have issues in the very basics of complexity analysis.
I think what you want to say is that you are summing the term $O(n)$, $O(k)$ times for $1 \leq k \leq n$ . right? In this case, the answer is $O(nk)$.
If $O(k) \in O(n)$ (for example $k = n/c$ for... | Suppose $T_n = O(n)$. That means that for some constant $C$, $T_n \leq Cn$. Therefore $$ \sum_{m=1}^n T_m \leq C \sum_{m=1}^n m = \frac{C}{2} m(m+1) = O(m^2). $$ If also $T_n = \Omega(n)$ then you can show in exactly the same way that the sum is $\Omega(n^2)$, so that no better bound is possible (for concreteness, you ... | https://cs.stackexchange.com |
67,295 | [
"https://mathoverflow.net/questions/67295",
"https://mathoverflow.net",
"https://mathoverflow.net/users/5259/"
] | Suppose $L$ is an effective divisor and $H$ is ample (On a smooth 3-fold) such that $L+H$ is nef.
Then show that $L+H$ is big ( $(L+H)^3 > 0$) ?
This was claimed in a paper, without proof. So I assume it should be well-known.
I am not sure if the restriction on dimension is necessary or not.
| This is indeed true. See for example Lemma 2.60 in Kollar-Mori <em>Birational Geometry of algebraic varieties</em>. In particular, it is shown that a Cartier divisor $D$ is big if and only if $mD \sim A + E$ for some ample divisor $A$ and effective divisor $E$. This is also proven in Corollary 2.2.7 in Lazarsfeld's ... | 2 basic comments:
1) $L+H$ big is not equivalent to $(L+H)^3>0$
example: $\mathbb P^2$ blown up at a point, $H=$ any ample and $L=mE$ where $E=$exceptional curve and $m\gg 0$.
2) this is the proof (as mentioned above, it can be found in books and it doesn't require $H+L$ nef):
$h^0(X,a(L+H))\ge h^0(X,aH)\ge \f... | https://mathoverflow.net |
263,932 | [
"https://softwareengineering.stackexchange.com/questions/263932",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/157464/"
] | Let's say I want to test a controller that gets some value from a service and then pass some of all of those values to the view.
Do you test that the view gets the result that the controller took from the service, without taking care of seeing the exact variables being passed, or do you test specifically for the varia... | Whenever you test a class or a method, you provide the inputs and then verify that it produces the outputs that it is responsible for.
If the documented behaviour of your class is to pass on whatever it gets, then you would write a test passing in "foo" and "bar", or "grumpy" and "slouchy", or any other set of inputs,... | This is where you have to apply a combination of dependency injection and mock tests. You would test the service and controller & view separately. Do this by mocking the service to return a recorded value and then test if you controller end up with this recorded value.
TDD is unit testing. You shouldn't test the ... | https://softwareengineering.stackexchange.com |
2,286 | [
"https://security.stackexchange.com/questions/2286",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/1270/"
] | I read an article (can't find link) recently that advocated dumping software firewalls if you had a hardware firewall.
I was just curious as to the take on Firewalls in general for a small-medium office. Assume we had a router with a dedicated hardware firewall behind it that filtered and routed traffic before it hit ... | First, all firewalls are software firewalls. Some have 'fastpath' technologies which offload packets matching fingerprints which have already been evaluated in software to ASICs or realtime systems, but firewall decisions are made by software stack. Most firewalls run on a variant of linux or BSD, with their own kern... | There have been arguments in the recent past for disabling PC firewalls, as some caused issues, especially if the PC was fixed location. These days, with a preponderance of laptops and windows 7, I would heartily recommend using the firewall software built in to Windows if that is all you have, or for mobile laptops, a... | https://security.stackexchange.com |
91,188 | [
"https://softwareengineering.stackexchange.com/questions/91188",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/5094/"
] | I have come across the expression software/feature bloat, but is this a real thing or should we rather be talking about things like performance problems, memory and disk footprint, user experience and on-demand installation? What am I missing here?
| In my experience, it is because feature bloat is a root cause of problems rather than a direct problem that it useful to think of it separately.
In addition to the potential problems for the end user listed in the original question, feature bloat can have significant maintenance cost. When adding a new feature it's i... | There are two meanings of this:
First is not about technical shortcomings, it's about user experience. Unnecessary features make it harder for user to figure out the application. User will perceive application as too complicated and will not know how to do basic stuff.
Second is that having too many rarely used fea... | https://softwareengineering.stackexchange.com |
416,657 | [
"https://softwareengineering.stackexchange.com/questions/416657",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/374439/"
] | There is a parent window that is the basis of the program, and there are several sub windows under it. Editor is one of the sub window and I'm making it. The code is as follows:
<pre><code>// This is Code-Behind
public partial class MyEditor : Window
{
private static readonly Lazy<MyEditor> lazy = new Lazy<... | By making MyEditor a Singleton, you have decided that there must not ever be more than one editor window. The big question is, is that decision backed by a requirement for the application.
If there is no such requirement, it is just a matter of time before someone comes up with a nice idea that requires the creation of... | Even if you know for sure that there will never be the need fore more than one <code>MyEditor</code> windows - the question you should ask yourself here is:
<strong>Does this simplify the code? - Or does it complicate things for no real benefit?</strong>
For example, if <code>Instance</code> might be accessed from diff... | https://softwareengineering.stackexchange.com |
461,661 | [
"https://electronics.stackexchange.com/questions/461661",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/111841/"
] | I would like to add a const string identifier at the start locations of few functions. The reason is that I need to maintain a table of function pointers, the indexes of which are to be in a specific order. I need to verify that only the intended function pointers are placed at each index of the table. My idea is that ... | It's not 100% clear in my mind what's going on to make you want to be paranoid in your situation. You say that you are maintaining a table of function pointers and need to verify them. But this actually suggests to me that other developer(s) are maintaining that table, not you, and that you don't trust that table and w... | The code at the beginning of a function needs to be actual executable function code. The data declarations that you are attempting to place at the top of the functions will be placed in the section of the program space allocated for data, or in the case of variables like you have declared as "const" will be collected t... | https://electronics.stackexchange.com |
484,323 | [
"https://stats.stackexchange.com/questions/484323",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/-1/"
] | In a univariate linear regression model, I understand that the unstandardized slope for the standardized predictor <span class="math-container">$z=(x - \mu)/\sigma$</span> is equal to <span class="math-container">$\beta_1 \sigma_y / \sigma_x$</span>, but I am wondering what the slope is when <span class="math-container... | In simple linear regression:
<ul>
<li>The slope is <span class="math-container">$\beta_1 = r_{xy}\frac{\sigma_y}{\sigma_x}$</span>
</li>
<li>The constant term is <span class="math-container">$\beta_0 = \bar{y} -\bar{x}\beta_1$</span>
</li>
</ul>
You can standardize the data, or shift and scale the data in any other way... | In simple regression, when <span class="math-container">$Y$</span> is also standardized, in addition to standardizing on <span class="math-container">$X$</span> the slope simply becomes the sample correlation coefficient between <span class="math-container">$X$</span> and <span class="math-container">$Y$</span>, <span ... | https://stats.stackexchange.com |
283,846 | [
"https://mathoverflow.net/questions/283846",
"https://mathoverflow.net",
"https://mathoverflow.net/users/75127/"
] | Let $X=\operatorname{proj}_nX_n$ be a Fréchet space. What is the relation between $\operatorname{proj}_nX_n''$ and $X''$? This should be known but I cannot find the reference.
| There is of course a canonical map $X''\to$ proj $X_n''$ which however need not be surjective if $X$ is a <em>non-distinguished</em> Fréchet space because then the inductive limit topology on $X'=$ ind $X_n'$ is strictly finer than the strong topology on $X'$. Examples are due to Köthe and Grothendieck and as far as I ... | I assume that you mean one of the essentially equivalent representatios of the space as a projective limit of a sequence of Banach spaces. Your object of enquiry is then not in general the bidual in the sense of lcs's but the dual of $X'$ provided with its natural bornology, i.e., it is the space of linear functionals ... | https://mathoverflow.net |
107,995 | [
"https://math.stackexchange.com/questions/107995",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/24159/"
] | Let $S\subseteq B$ be a dense subset of a complete Boolean algebra $B$. Is is true that $\sum S = 1$? Jech seems to use this fact several times in his book (e.g. the proof of 7.15) but I have been unable to prove it, if it is true.
Is it true if we tighten the condition to open dense, i.e. whenever non-zero $u \le v$... | Suppose $\bigvee_{a \in S} a = b < 1$. Then in particular every element of $S$ is $\leq b$, so no nonzero element of $S$ is $\leq b^c$, because $b \wedge b^c = 0$. So $S$ is not dense.
| Yes, the join of any dense subset of a Boolean algebra is $1$, because otherwise it would be bounded by some $b$ less than $1$, and so $\neg b$ would have no elements of the dense set below it, contradicting density.
There is no need to assume that the Boolean algebra is complete.
| https://math.stackexchange.com |
854,580 | [
"https://math.stackexchange.com/questions/854580",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Question:
<blockquote>
If $\;a,\, b,\, c,\, d \;$ are real and $\;ac = 2( b + d) $ ,then show that at least one of the equations: $\; x^2 + ax + b = 0 \;$ and $\; x^2 + cx + d = 0 \;$ has real roots.
</blockquote>
I've tried to solve this by adding both the discriminants which gave me $ (a - c)^2$ . Now how to p... | $(a - c)^2 \ge 0$, because every square of a real number is nonnegative.
Therefore, $a^2 - 2ac + c^2 \ge 0$, or $a^2 + c^2 - 4b - 4d \ge 0$, so $(a^2 - 4b) + (c^2 - 4d) \ge 0$. As both terms in this sum are real, and their sum is nonnegative, at least one of the terms must be nonnegative, and as these are the discrimi... | First equation's discriminant is
$$a^2-4b$$
Second equation's discriminant is
$$c^2-4d$$
If both discriminants are negative so is their sum, which is
$$a^2-4(b+d)+c^2=a^2-2ac+c^2=(a-c)^2$$
Since any squared real is non negative you get a direct contradiction.
| https://math.stackexchange.com |
23,454 | [
"https://security.stackexchange.com/questions/23454",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/11801/"
] | What is the best way of testing my Firewall configuration as i have deployed the Core Rule set provided by the OWASP. But my rule configuration was giving me too many false positives which i resolved by deleting many of the rules from the core ruleset. <em>Now that i have deleted some problematic rules how can i now m... | Much though some vendors would like you to think that a WAF is - (a) a requirement and (b) a black box you can dump down in front of your webapp to protect it from all possible attacks - it really doesn't work that way. A WAF configuration isn't binary 'secure' or 'insecure'; it will just be more or less effective at a... | You could run a web security scanner against your website and see what vulnerabilities still come up in the report. There are several offerings out there, some are desktop tools while others are SaaS: Acunetix, Cenzic, Qualys, White Hat, IBM AppScan, HP WebInspect.
Better yet if you can afford it, hire a pen-tester to... | https://security.stackexchange.com |
239,751 | [
"https://stats.stackexchange.com/questions/239751",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/134415/"
] | My tensorflow ML algorithm gives me an ROC AUC of 0.81 using the contrib.metrics.streaming_auc() function, whereas using the same logits and labels in sklearn's function gives me a score of 0.58. How can this be?
When I reduce the number of thresholds in the tensorflow function, tensorflow too gives me significantly l... | The <code>streaming_auc</code> keeps accumulating the scores of repeated calls to it, so that you can use it, for example, to get the AUC of several batch runs all accumulated. It does not just calculate the current AUC.
In order to use it to get just the current AUC, you can reset the local variables it uses (e.g. ru... | NO ! its because Scikit learn does not calculate AUC by discretizing a curve with variable thresholds like is done in tensorflow! SKlearn uses your values
this has just burnt me.
| https://stats.stackexchange.com |
3,107 | [
"https://mathoverflow.net/questions/3107",
"https://mathoverflow.net",
"https://mathoverflow.net/users/353/"
] | The well-known Hopf fibration $S^1 \rightarrow S^3 \rightarrow S^2$ has explicit constructions involving the geometry of $C^2$ and intersections of complex lines with the $3$-sphere. They don't seem to generalize easily to "higher" Hopf maps from $S^3 \rightarrow S^2$ with Hopf invariant not equal to one. Are there a... | You can get them by precomposing with a degree <span class="math-container">$n$</span> map from <span class="math-container">$S^3$</span> to itself. In particular, this gives an interpretation in terms of the group structure: if <span class="math-container">$h:S^3 \to S^2$</span> is the Hopf map (which is just modding... | Actually, yes, there is a construction involving complex projective line.
Consider all points (x<sub>1</sub>, x<sub>2</sub>, x<sub>3</sub>, x<sub>4</sub>) on a 3-sphere in the 4-dimensional space. Our goal is to map them to <span class="math-container">$S^2$</span> which is the same as <span class="math-container">$... | https://mathoverflow.net |
511,260 | [
"https://electronics.stackexchange.com/questions/511260",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/258011/"
] | I'm working on a PCB to both charge an Android tablet and also allow Android to connect to the PCB via Serial port (PCB includes an ATMega8u2 configured as a CDC, supplying a Serial port). To enable 500mA charging I have CC1 and CC2 pulled high via a 56k resistor. The CDC device is connected to the D+/D- pins. Here are... | It has been my long term experience with Android devices that the device will be in an host mode when it needs to communicate to a CDC device. This is especially obvious when you use a typical USB to Serial cable that has the CDC service built into a customized MCU at the end of the USB cable. Such devices require the ... | The way you are trying to setup your USB communication is the <em>old</em> way, i.e. according to the USB standards predating USB-C and USB Power Delivery.
In that setup, your device can either be charging or communicating but not both. In charge mode, the Android tablet must take the role of a <em>USB device</em>. Whe... | https://electronics.stackexchange.com |
138,565 | [
"https://physics.stackexchange.com/questions/138565",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/57075/"
] | <blockquote>
I recently came across a problem where an electrically neutral particle is at rest in a uniform magnetic field. The particle now splits into two charged particles of equal mass $m$; charge and mass being conserved. Now, we know that if one particle has charge $q$, the other must have equal and opposite c... | <blockquote>
Is there a center-of-charge kind of concept where that point remains stationary when a neutral particle splits into two or more charged particles ?
</blockquote>
Not when there are external forces acting on the system. As soon as the particle breaks down, the two charged particles experience magnetic fo... | Yes,the particles will have attractive forces between each other ,which can and will disturb their trajectories . But as far as the base question is concerned, I think we are supposed to neglect that interaction (as I saw another version of this problem which said so) .
I think your first view point is better .Basic... | https://physics.stackexchange.com |
526,083 | [
"https://physics.stackexchange.com/questions/526083",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/156173/"
] | 2-metric <span class="math-container">$\gamma_{AB}$</span> induced on the world sheet by the spacetime metric <span class="math-container">$g_{\mu\nu}$</span> is <span class="math-container">$$\gamma_{AB}=g_{\mu\nu}t^{\mu}_A t^{\nu}_B$$</span>
where <span class="math-container">$t^{\mu}_A=\frac{\partial X^{\mu}}{\part... | Having put the label <span class="math-container">$B$</span> on the covariant derivative <span class="math-container">$D_{B}$</span> there is no reason why such a derivative should be sensitive to the <span class="math-container">$\mu$</span> label. In other words you can differentiate <em>each</em> of the <span class=... | I'm going to propose an approach to justify the formula in the OP employing the idea of pullback bundles and pullback connections.
<h2>Introduction to the Setup</h2>
Let <span class="math-container">$\Sigma : W\subset \mathbb{R}^2\to M$</span> be the embedding of the worldsheet on spacetime. To connect with more usual ... | https://physics.stackexchange.com |
432,223 | [
"https://mathoverflow.net/questions/432223",
"https://mathoverflow.net",
"https://mathoverflow.net/users/8628/"
] | Let <span class="math-container">$X \neq \emptyset$</span> be a set. We say that <span class="math-container">${\cal F} \subseteq {\cal P}(X)$</span> is a <em>down-set</em> if <span class="math-container">${\cal F}$</span> is closed under taking subsets. Whenever <span class="math-container">$a \in X$</span>, we let <s... | Let <span class="math-container">$\kappa$</span> be a cardinal of
countable cofinality that is strictly larger than the continuum.
I will construct a counterexample to (C) on
<span class="math-container">$X=(\kappa\times \omega)\cup \omega$</span>.
Since <span class="math-container">$\kappa$</span> has countable cofin... | The usual definition of ideal also includes the requirement that <span class="math-container">$F$</span> is closed under unions.
But in this case, I claim that Chvatal's property holds for all infinite ideals.
First, if <span class="math-container">$a\in Y\in F$</span>, then <span class="math-container">$\{a\}\in F$</s... | https://mathoverflow.net |
2,839 | [
"https://physics.stackexchange.com/questions/2839",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | Why is the number of molecules in a standard volume of gas at a standard temperature and pressure a constant, regardless of the molecule's composition or weight?
Let's say I have a closed box full of a heavy gas, one meter on a side. It has a certain number of molecules inside. I want to be able to add a lighter gas ... | Dear Wade, your good question is easily answered if you consider "pressure" to be a derived quantity, and let us derive it.
An average molecule (or atom) of an ideal gas - and your proposition only holds for an ideal gas - has kinetic energy equal to
$$mv^2/2=3kT/2$$
It's because every degree of freedom carries $kT/2... | Avogadro's hypothesis holds only for ideal gases. For example, if we take a van der Waals gas with equation of state
$$ (P + n^2 a / V)(V - n b) = nRT $$
it is easy to see that, for fixed $P$, $V$, $T$, the number of moles $n$ depends on the parameters $a$ and $b$, which in general will change from one type of gas to t... | https://physics.stackexchange.com |
2,040,362 | [
"https://math.stackexchange.com/questions/2040362",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/249891/"
] | I am solving this question.
Finding the remainder of
$$\frac{289\times 144^{25}}{71^{71}}$$
This is how I have tried solving it. First it can be simplified to $\frac{17^2 \times 2 ^{50} \times 3^{25}}{71^{71}}$. Now if we use Euler Totient rule we get for $\phi(71^{71}) = 71(1-\frac{1}{71}) = 70 $.
For,
$$ \frac{... | ${289 \times 144^{25}} \approx 2.6 \times 10^{56} < 2.8 \times 10^{131} \approx 71^{71}$.
So the remainder is ${289 \times 144^{25}}$.
| <strong>Hint</strong>
<span class="math-container">$17^2 12^{25} 12^{25} = 17^2 4^{25} 36^{25} = 16\cdot 17^2 4^{23} 36^{25} < 71\cdot 71^2 71^{23} 71^{25}$</span>
| https://math.stackexchange.com |
43,147 | [
"https://mathoverflow.net/questions/43147",
"https://mathoverflow.net",
"https://mathoverflow.net/users/8430/"
] | I have a basic question that others have definitely considered.
Often there are papers that originally appeared in a language that one might not understand (and I mean a natural language here). I would like to cite the original paper, because that is where the credit belongs. But on the other hand, doing so violates t... | I think a common-sense approach is to cite the original paper (whatever the language) in order to give credit and attribution but only rely on arguments from papers you can understand in your proofs (so you don't violate the golden rule).
Regarding reviewers, the worst that can happen (I think) is that you use a cruc... | I think it's completely unreasonable to expect authors to have read and completely understood the details of every paper that they cite in their references. Most authors certainly do not do that. We'd never have time to write any of our own papers if we had to thoroughly digest every single other paper that is relevant... | https://mathoverflow.net |
37,677 | [
"https://softwareengineering.stackexchange.com/questions/37677",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/10785/"
] | In my short experience here at programmers.stachexchange, when someone needs help to get started at programming quite a lot of users suggest learning this or that language, but few suggest learning the basis of programming (data structures, flow structures, algorithms, paradigms, etc.) So I'm coming to the conclusion t... | You see, people usually experience feelings, and sometimes those feelings are a barrier to do the most important thing: team work.
There are those who have excellent problem solving skills, and those who manage to remember all the tiny little deatails of every language. And over the years I've met people having one an... | You need some of each.
But programming is not an individual activity it requires a team of developers. It is always useful to have a least one 'language lawyer' and one 'Solving Genius' and an 'architect' (keeps the big picture in mind) on the team. But in reality you need a modicum of all these skills to be a good pr... | https://softwareengineering.stackexchange.com |
199,852 | [
"https://stats.stackexchange.com/questions/199852",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/93079/"
] | I'm trying to build a Monte Carlo simulation of a production process, and one of my random variables is team productivity. Team productivity is defined as the ratio of the finished requests over the total number of requests for a time period. Saying that, team productivity is always a positive real number between 0 and... | Gelman's Bayesian Data Analysis satisfies this list. There's a solution guide for some problems online.
| I'll second the recommendation of <em>Bayesian Data Analysis</em>. It's thorough and written by some of the top people in the field.
| https://stats.stackexchange.com |
233,910 | [
"https://softwareengineering.stackexchange.com/questions/233910",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/124842/"
] | I'm working on some software at them moment and I'm not sure which route to take with this. I have some data to store somewhere on a mobile device. The data will never change, and has a hierarchical relationship, and will be used to populate the display. There is a reasonably amount of this data.
I have the following ... | I would use an object for this.
You said the data will never change, so you can easily store it in the application. The database would be overkill and increase the size.<br>
The XML file would be kinda overkill too and also increases the size.
So in my opinion the best option would be an enum or object.
| will it never change, or will it change? That's the question you really have to answer before you get a good response.
Static data that never changes (eg days of week names) are good to go in code;
Data that practically never changes (eg your server dns name) is also good to go in code, if it needs changing, its so... | https://softwareengineering.stackexchange.com |
3,301,296 | [
"https://math.stackexchange.com/questions/3301296",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/606985/"
] | Given that <span class="math-container">$\frac{d}{dx}(\frac{1}{x-3})=-\frac{1}{(x-3)^2}$</span>, calculate the derivative of <span class="math-container">$\frac{x}{x-3}$</span>
It looks like i need the quotient rule (which I have not learned), but since it gave the extra information there must be a quicker way of doin... | <strong>Hint</strong>:
<span class="math-container">$$\frac{x}{x-3}=\frac{(x-3)+3}{x-3}$$</span>
| Use the product rule. <span class="math-container">$\frac d {dx} (x(\frac 1 {x-3}))=(x)\frac d {dx} (\frac 1 {x-3}) +\frac 1 {x-3}=\frac {-3} {(x-3)^{2}}$</span>.
| https://math.stackexchange.com |
8,844 | [
"https://chemistry.stackexchange.com/questions/8844",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/4686/"
] | According to Wikipedia 4-methyl-1-pentanol is $\ce{C_6H_{14}O}$.
But here is what I got, which is slightly different.
Methyl = Think of methyl group, which is $\ce{CH_3}$.
Pentanol = <em>Penta</em> means we have 5 carbons, <em>-ane</em> ending means we have $2n+2$ hydrogens, i.e. 12 hydrogens and <em>-ol</em> ending... | Actually, the formula you arrived at is $\ce{CH3C5H12OH}$ = $\ce{C6H16O}$. In any case, in your "2n+2" step, you need to reduce that number of hydrogens by 2. One is eliminated where the methyl group is attached, and a second is eliminated where the $\ce{-OH}$ group is attached. So removing 2 hydrogens from $\ce{C6H... | You’re applying the $2n +2$ method wrongly. You need to stupidly count <em>all</em> the carbons in a fully saturated molecule and take <em>that</em> number as $n$.
In your case this is:
<ul>
<li>5 because <em>pent</em>anol</li>
<li>another 1 because methyl.</li>
</ul>
That gives you six carbons in total. $n = 6 \Rig... | https://chemistry.stackexchange.com |
33,170 | [
"https://electronics.stackexchange.com/questions/33170",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/5055/"
] | I was soldering some components on a PCB and suddenly i realized that i soldered a wrong resistor (i should solder a 10k ohm and I did solder a 1k ohm). I tried to remove it, with iron solder (it wasn't my first time), but for some reason a resistor's leg just got stucked and in the end broke it (violence and electroni... | Don't bother trying a solder sucker. Those suckers are next to useless for removing the thin film of solder between a component leg and the plating. You'd have to remove almost all of the solder in one go. If you don't then 1) the leg is still stuck in there, and 2) there's no enough solder around to conduct heat from ... | Carefully drill it out. You will destroy the through-hole plating so you will have to solder the lead of the replacement resistor at the top and bottom pads.
In future, use desolder braid when removing components, or a suitable desoldering system.
| https://electronics.stackexchange.com |
557,413 | [
"https://electronics.stackexchange.com/questions/557413",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/274639/"
] | I was practicing diode circuits and this question stucked in my mind. When a diode connected parallel to a DC voltage source, doesn't it have to take the value of the source rather than 0.7V according to Kirchoff laws ? ( the diode is forward-biased )
| In an ideal circuit with a ideal voltage source with a perfectly constant voltage output and no output resistance, and ideal diode with no resistance and a constant voltage drop, there is no answer. It is a contradiction, which is why it is ideal and doesn't actually exist. It is basically unstoppable force (the voltag... | You're using a simplified diode formula. Google "Shockley diode equation". In that, you'll find this: <span class="math-container">$$I = I_{ss}\left( e^\frac{V_D}{n V_T} - 1\right)$$</span>
So, a diode has a roughly exponential current vs. voltage characteristic. For most silicon small-signal diodes, opera... | https://electronics.stackexchange.com |
1,942,154 | [
"https://math.stackexchange.com/questions/1942154",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/372320/"
] | Question says $p$ and $q$ are distinct primes, $a$ and $b$ integers. What I don't quite grasp (it would be nice if someone could provide a proof) is that why since lcm($p$, $q$) = $pq$ it always follows that $a ≡ b$ (mod $pq$). I mean it makes sense, but I just want a proof.
| Well, $ a \equiv b \pmod{p}$ means that $p \mid (a-b)$ or $(a-b)=pk$ for some integer $k$. Next $ a\equiv b \pmod{q}$ means that $q\mid (a-b) = pk$. Since $q$ is prime, if it divides a product, it must divide one of the factors. Since $p$ and $q$ are distinct primes, $q$ doesn't divide $p$, so it must divide $k$, sa... | $a \equiv b \mod p$ means that the difference $a-b$ is divisible by $p$. Similarly, $a \equiv b \mod q$ means that the difference $a-b$ is divisible by $q$. Since $a-b$ is divisible by both $p$ and $q$, it must also be divisible by the least common multiple $lcm(p,q)$ of $p$ and $q$.
| https://math.stackexchange.com |
442,001 | [
"https://softwareengineering.stackexchange.com/questions/442001",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/405202/"
] | coders. I'm learning C programming language and found out such thing as <code>#define</code> directive that allows us to use <em>symbolic constants</em> (following Brain Kernigan). I know that this directives "insert" literals or expressions right into code. Their purpose, as I understood for now, to get rid ... | You should never use the preprocessor to define symbolic constants. C has had the <code>const</code> keyword since C90, which does the same thing and makes your intent clearer. It also provides better scoping (preprocessor definitions always have file scope, while normal declarations have the scope you'd expect from th... | Use "variables" (as <code>const</code> objects) when practical.
Better type control.
<hr />
Use symbolic constants in select cases.
Examples:
<strong><code>*scanf()</code> width control</strong>
Consider reading into a buffer of some fixed size via <code>*scanf()</code> to form a <em>string</em>. <code>"... | https://softwareengineering.stackexchange.com |
365,335 | [
"https://stats.stackexchange.com/questions/365335",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/217009/"
] | While looking through the concepts of multivariate time series I came across the term "Multiple" time series.
Is both the terms are pointing to the same meaning. What is the difference between them in time series analysis
| Multiple time series is just that: Multiple series instead of a single series.
Multivariate time series is usually contrasted with univariate time series, where each observation at a time $t$ is a vector of values instead of a single value. Typically for such series, the variables in the vector are closely interrelat... | <strong>Multivariate regression models:</strong> Pertaining to multiple <em>dependent</em> variables.
<strong>Multiple regression models:</strong> Pertaining to multiple <em>independent</em> variables.
<strong>Time series:</strong> Pertaining to <em>repeated measurements</em> of the same variables over time (typicall... | https://stats.stackexchange.com |
385,861 | [
"https://stats.stackexchange.com/questions/385861",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/140365/"
] | I have one group (<span class="math-container">$n=40$</span>) of subjects pre- and post-tested (<code>time</code>; coded <span class="math-container">$0$</span> and <span class="math-container">$1$</span>) on a continuous variable (<code>y</code>). I also have a <code>gender</code> variable coded <span class="math-cont... | This is a pretty standard specification.
<ul>
<li>Assuming that the conditional distribution of <code>y</code> (i.e., residuals from the model) are reasonably close to Gaussian, a linear mixed model is appropriate.</li>
<li>Interacting fixed effects of gender and time and a random intercept varying across <code>id</c... | Ben has provided a great answer. Another approach would be to use the <code>gee</code> or <code>geepack</code> packages for marginal model (using the default gaussian family for your data). You would have to pick an appropriate covariance structure and specify that in the <code>corstr</code> argument. In your case t... | https://stats.stackexchange.com |
221,000 | [
"https://softwareengineering.stackexchange.com/questions/221000",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/111356/"
] | I am currently a high school student, I've been assigned to manage a group in my school to develop a mobile app and the problem is that all of us have no experience in making a project in a team and the greater problem is that we have only till the end of the month to submit the app.
Can I have some tips to overcome t... | If you had more time i'd say do some research on agile/scrum but heres a cut down version:
1) Initially you want to sit down together and very carefully plan out your application and all of its features. You also want to sketch out(wireframe) the user interfaces remember that their are a huge variety screen sizes, tr... | <ul>
<li>Sit down together and make a planning.</li>
<li>Have 1 meeting (not more) on a regular base (every week) all together to be always updated on the status.</li>
<li>Split the application in different subtask and assign a task to everyone. If everyone starts putting hands everywhere it will be a mess.</li>
<li>De... | https://softwareengineering.stackexchange.com |
2,237,599 | [
"https://math.stackexchange.com/questions/2237599",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/362026/"
] | I'm sorry if I sound too ignorant, I don't have a high level of knowledge in math.
Interested in learning to integrate through other paths besides the real line in the complex plane, I searched how to do so in the internet. The most understandable "proof" of the "Line Integration Formula" was the following:
$C$ is a ... | Suppose we parametrize the contour $C$ as $\gamma(t),\; a \le t \le b$.
The contour integral $\int_C f(z)\; dz$ is the limit as $n \to \infty$ of "Riemann sums"
$$ \sum_{j=1}^n f(z_j)\; \Delta z_j$$
where $z_j = \gamma(t_j)$ and $\Delta z_j = z_j - z_{j-1}$, $a = t_0 < t_1 < \ldots < t_n = b$, if $\max(t_{j} ... | Before explaining about dz, take L as a Load/Force to be a function of x, say L= 4x. If we now care to give this a meaning we can say that this function represents a man moving in a straight line a distance x and as he does, he has to push against a force y which changes as he moves and described as 4x. Now, if... | https://math.stackexchange.com |
370,595 | [
"https://softwareengineering.stackexchange.com/questions/370595",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/305177/"
] | I'm working on a project with client that needs to rely on a proprietary data set. They also have custom data that logically fits alongside the proprietary data. What they do is use the same tables but with negative ids. So an Example would be
<strong>Table</strong>: Animals
<strong>Fields</strong>: animal_id, name,... | From a practical point of view, the only thing which really matters is: is it guaranteed that every code accessing the <code>Animal</code> table will handle those negative IDs correctly? Do you have the code completely under your control? I guess not, since you are talking about an "industry-standard" data model, maybe... | It's not a great idea.
The best way is to have your own id and link that to the external data id.
Lets say you have a string id for your Animal table
<pre><code>MyAnimals
MyId, name
230a33e0-ffa4-47ff-9ccb-b3bcf3a33166, Werecat
89f990d5-88eb-4055-b7fe-787cf75d0461, Werewolf
External... | https://softwareengineering.stackexchange.com |
320,950 | [
"https://mathoverflow.net/questions/320950",
"https://mathoverflow.net",
"https://mathoverflow.net/users/134600/"
] | I am new to H-spaces, delooping, etc. I know that not every <span class="math-container">$H$</span>-space has a delooping (e.g. Stasheff's theorem, one needs a group-like <span class="math-container">$A_\infty$</span> space). I also know that the same space can have inequivalent deloopings corresponding to different <... | Another example is <span class="math-container">$S^3$</span>. If I am not mistaken, there are exactly <span class="math-container">$12$</span> H-space structures on <span class="math-container">$S^3$</span>. Indeed, we can consider the long exact sequence
<span class="math-container">$$[S^4\vee S^4, S^3] \to [S^6, S^3]... | Alright, here's an example (assuming I didn't mess up). Let <span class="math-container">$S^3=\Omega \mathbb{H}P^{\infty}$</span> have the standard loop-space structure. Let <span class="math-container">$X = K(\mathbb{Z}, 6) \times S^3$</span> with the product <span class="math-container">$A_{\infty}$</span>-structure,... | https://mathoverflow.net |
102,646 | [
"https://stats.stackexchange.com/questions/102646",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/40740/"
] | I wish to sample standard linear Brownian motions on the interval $[0,1]$. I do this by dividing the interval into $n$ equal sub-intervals, deciding $B(0)=0$, and letting $B\left(\frac{k}{n}\right)=B\left(\frac{k-1}{n}\right)+\mathcal{N}\left(0,\frac{\sigma^2}{n}\right)$ for $k\ge 1$, after deciding for some $\sigma>... | Here's one possibility:
If you assume the answers are like independent coin-flips, you can work out the probability of getting any number correct. For example if the answers were 50-50 coin flips the change of getting at least 15 correct is about 2%. You might say "well, that's pretty unlikely, let's say that 15 or m... | @Glen_b offered one solution. It is correct for each individual, and that's fine. But you have 190 individuals. By chance, some of them will be above chance level and some below. For example, here is a <code>R</code> code for a single case of 190 people flipping 20 coins.
<pre><code>set.seed(19291010)
choices <- r... | https://stats.stackexchange.com |
203,289 | [
"https://softwareengineering.stackexchange.com/questions/203289",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/67280/"
] | I don't know if this happens to most Opensource libraries, but many of I know and use (for example OpenSSL, Webkit, ...) they all lack comments, or contain very few comments.
Not to mention their very few documents, it is hard to read their source code. We can hardly understand what a member variable means, or what th... | Writing source code is fun.
Writing documentation and commenting code is less fun.
When a developer works in a company which enforces good comments and documentation, there is no choice: either this developer writes those, or he's at risk of being fired.
When a developer contributes to an open source project, he's d... | <blockquote>
How can people collaborate to these opensource with very few comments
</blockquote>
Assumed you meant "How can people collaborate to these opensource code which is hard to read" - well, I guess an open source project with bad code will simply have fewer contributors than it could have had with good code... | https://softwareengineering.stackexchange.com |
95,386 | [
"https://security.stackexchange.com/questions/95386",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/81529/"
] | Obviously TLS is a must for any and all secure authentication. Please turn your paranoia settings up to 11 for this.
<strong>Background</strong>: (In case people are unfamiliar with the WebSocket (WS) protocol and its idiosyncrasies) The WebSocket TLS (WSS) connection is a different connection from the HTTP TLS conne... | <blockquote>
The WebSocket TLS (WSS) connection is a different connection from the HTTP TLS connection.
</blockquote>
A WebSocket connection is created sending a HTTP request containing the wish to upgrade the connection to WebSocket and by receiving a HTTP response granting this wish. From then on the WebSocket pr... | I believe your premise is flawed. Alice doesn't log on to bob.com via normal HTTPS means, because Alice sees the invalid certificate error and smartly decides not to enter in her credentials. If Alice chooses to ignore the warning and proceed anyway, then now she has the same problem that she would have on any financia... | https://security.stackexchange.com |
2,444,797 | [
"https://math.stackexchange.com/questions/2444797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | A fund of 3000\$ is to be accumulated by n annual payments of 65\$ at the end of each year, followed by n annual payments of 135\$ at the end of each year, plus a smaller final payment made one year after the last regular payment. If the effective rate of interest is 6% per year, find n and the amount of the final irre... | If $\lambda$ and $\kappa$ are cardinals, $\lambda^\kappa$ represents the cardinality of the set of functions $f\!:A\to B$ where $A,B$ are fixed sets of cardinality $\kappa,\lambda$ respectively. (One needs to check this is independent of which specific sets $A,B$ we pick, of course.)
At least for finite numbers, this ... | Hint: A function $f:X\rightarrow \{0,1\}$ defines a subset of $X$ and the set of such functions is $2^{\operatorname{card}(X)}$.
| https://math.stackexchange.com |
521,165 | [
"https://physics.stackexchange.com/questions/521165",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/147188/"
] | I am learning about piezoelectric transducers and I want to know why the piezoelectric material is coated with electrodes in top and bottom ?
| Disclaimer: I never asked my self the question before so this answer is something that sounds right to me but I didn't check it out. (not 100% sure)
The answer is to apply a voltage. Piezoelectric materials are most of the time electrically insulating, meaning "rubbing" significant charge on them will be difficult. B... | those electrodes pick up the charge that is generated by flexure of the piezoelectric wafer and convey it as a tiny current to the wires that are soldered onto the electrodes.
| https://physics.stackexchange.com |
1,355,289 | [
"https://math.stackexchange.com/questions/1355289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/253490/"
] | If |z|=max{|z-2|,|z+2|} then -
INFERRENCE - |Re(z)|=1
Is the inferrence incorrect?
My approach is -
|z|=|z-2| when |z-2| {i.e. distance of z from 2 is greater}is greater OR |z+2| when |z+2| is greater.
|z-2|>|z+2| means Re(z)>0....and so on.
| If $\lvert z\rvert=\lvert z-2\rvert,$ then one can show that $\operatorname{Re} z=1,$ and so $\lvert z+2\rvert\gt\lvert z\rvert.$ But then $\lvert z+2\rvert\gt\lvert z-2\rvert$ by assumption, whence $$\lvert z\rvert\lt\max\bigl(\lvert z-2\rvert,\lvert z+2\rvert\bigr).$$
On the other hand, if $\lvert z\rvert=\lvert z+2... | Let me establish that no $z\in\mathbb{C}$ exists such that $|z|=\max\big\{|z-2|,|z+2|\big\}$. Suppose such a $z$ exists, then $|z|\geq|z+2|$ and $|z|\geq|z-2|$. By the Triangle Inequality, $$2|z| \geq |z+2|+|z-2| \geq \big|(z+2)+(z-2)\big|=|2z|=2|z|\,,$$
whence we have an equality, which holds if and only if $z \in ... | https://math.stackexchange.com |
42,366 | [
"https://dba.stackexchange.com/questions/42366",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/23871/"
] | A friend asked me to build a site with a few "static" and "dynamic" tables.
In fact he wants to have a few tables which can't be deleted, and some "dynamic" tables which can be created directly from site users, according to their needs.
I.E. if the user needs some "optional" that in the current db doesn't exist, he c... | Short answer: In general it is no good practice to dynamically create tables and columns. But there can be rare special cases there it is good practice.
Long answer:
You may run (at least) on the following problems with your solution:
<ul>
<li>A user can have only 1 garden, because the garden_id is in the table "us... | Yes, you are correct. Your preferred method matches with the fundamental idea of a relational database. Any app design that allows users to create or delete tables is pretty risky. Think of how much extra effort you will need to have in-place (for security reasons) to make sure that a critical table is not deleted o... | https://dba.stackexchange.com |
64,589 | [
"https://stats.stackexchange.com/questions/64589",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/27738/"
] | I am running an experiment which measured using Likert Scales and I have 6 variables out of 24 which either have significant skewness or kurtosis. These are mixed with some positive and some negative values.
I transformed my data using log transformations, Square root transformations, reciprocal transformations and re... | A few points
<ol>
<li>If your variables are individual Likert items on (say) a 7 point scale, then it is arguable whether they should be treated as continuous at all.</li>
<li>This <em>sounds</em> like you are using these variables as independent variables. If so, why do you want them to be normally distributed? </li>... | <strong>Edited with thanks to @Peter Flom for correction in comment on original answer</strong>
If you want to examine the effects of covariates on Likert scale responses from multiple respondents, use ordinal probit or ordinal logit regression to estimate the effects of covariates on the ordered log odds of a respons... | https://stats.stackexchange.com |
5,281 | [
"https://bioinformatics.stackexchange.com/questions/5281",
"https://bioinformatics.stackexchange.com",
"https://bioinformatics.stackexchange.com/users/1369/"
] | I have RNA-Seq data which is <code>FPKM</code>. In the dataframe <code>df</code> first column is <code>gene_name</code> and the other 100 columns are <code>samples</code>.
Usually if it is <code>counts</code> data I do like following:
<pre><code>df2 <- aggregate(. ~ gene_name, data = df, max)
</code></pre>
I'm no... | I assume you're familiar with the various issues surrounding FPKMs, so I'll not expound upon them.
As a general rule, you should be using gene IDs rather than gene names, since the former are unique while the latter are not. If you only have access to data quantified on gene names, then the appropriate way to merge RP... | The best way to deal with this is to use unique gene IDs, for example ensembl accession numbers. So use the ensemble gtf annotation when quantifying the read counts and not the gene symbols. Just to illustrate, when I look for "5S_rRNA" in ensembl's annotation, i see 18 different "genes" with that gene symbol. But whic... | https://bioinformatics.stackexchange.com |
2,605,739 | [
"https://math.stackexchange.com/questions/2605739",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/309041/"
] | $x^4+1$ is irreducible over $\Bbb Z$ (hence $\Bbb Q$). The proof I saw is to try transforming it into $(x+1)^4+1=x^4+4x^3+6x^2+4x+2$ and use the Eisenstein criterion with prime $2$. I can understand the proof. However, how do we <em>come up with</em> this idea? How do we know we should try to transfer $x$ into $x+1$, r... | This is a trick that one sees over and over again, and perhaps in a year or two, you’ll see it as perfectly natural.
However, let me explain how I see it, from a $p$-adic (in this case, $2$-adic) viewpoint. The roots of $f(X)=X^4+1$ are all close to $1$ in the $2$-adic sense, namely for a root $\rho$ of $f$, $\vert1-\... | Another way: the polynomial $x^4+1$ doesn't have an integral root, so $x^4+1 \ne (x-a)(x^3+bx^2+cx+d)$.
we assume that $x^4+1=(x^2+ax+b)(x^2+cx+d)$, then $a+c=0, ac+b+d=0, ad+bc=0, bd=1$, and so $x^4+1=(x^2-\sqrt2 x+1)(x^2+\sqrt2 x+1)$. i.e. $x^4+1$ is irreducible over $\mathbb Z$.
| https://math.stackexchange.com |
4,881 | [
"https://physics.stackexchange.com/questions/4881",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | Assume two uncharged non-rotating black holes traveling straight at each other with no outside forces acting on the system. What is thought to happen to the kinetic energy of these two masses when they collide? Is the excess energy lost through gravitational radiation? What would the effect of these gravity waves be ... | Some energy is lost to gravitational radiation. Some probably ends up in the final black hole (i.e., $m_{\rm final}$ could be greater than the sum of the two initial masses). Figuring out the proportions of these two is not trivial, I would imagine.
The gravitational waves striking matter would not have any terribly d... | When two black hole collide the horizon area of the resulting black hole must exceed the sum of the areas of the two initial black holes. This places an upper limit on the amount of gravitational radiation which is produced. If the two initial black holes have equal masses $M$ then the finial black hole must obey
$$
... | https://physics.stackexchange.com |
280,571 | [
"https://physics.stackexchange.com/questions/280571",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/130258/"
] | I am working on a constant acceleration problem, and cannot figure out what I am doing wrong as I keep getting the wrong answer.
The situation is:
<blockquote>
During an auto accident, the vehicle's air bags deploy and slow down
the passengers more gently than if they had hit the windshield or
steering wheel. ... | You left out g-- the acceleration is 60g, not 60. Use g=9.8 m/s^2 and make sure your units make sense. Always check units-- quantities are meaningless without the correct units attached to them.
| The equation you are using is basically correct. The more general form, $x(t)= x_0 + v_0 t + \frac{1}{2} a t^2$, gives you the position as a function of time. Now, the acceleration you have to use is $a=-60g$. Since you care about distance travelled, you can take $x_0=0$. But, your initial velocity $v_0$ is not $0$. Yo... | https://physics.stackexchange.com |
701,074 | [
"https://physics.stackexchange.com/questions/701074",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/288846/"
] | I am reading Landau & Lifshitz's The Classical Theory of Fields. There is a derivation about metric tensor and Christoffel symbol I cannot get. On page 261, section 86, first the authors introduce the relation between the differential of the metric tensor and the differential of its determinant: <span class="math-c... | The piece you may be missing is that
<span class="math-container">$$
0 = \frac{\partial \delta^i {}_k}{\partial x^l} = \frac{\partial (g^{im} g_{mk})}{\partial x^l} = g^{im} \frac{\partial g_{mk}}{\partial x^l} + g_{mk}\frac{\partial g^{im} }{\partial x^l}
$$</span>
where I have applied the product rule in the last ste... | Another trick that is often very useful to use in proofs about the determinant of the metric is to leverage the levi-civita symbol:
<span class="math-container">$$g = \frac{1}{d!}\epsilon^{abc...}\epsilon^{ijk...}(g_{ai}g_{bj}g_{ck}...)$$</span>
Then, taking a derivative is trivial:
<span class="math-container">$$\part... | https://physics.stackexchange.com |
122,652 | [
"https://dba.stackexchange.com/questions/122652",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/38076/"
] | I have added <code>/</code> character as statement terminator all in my db2 statements. I can run sql file in data studio client without any issue. But when I run the sql file in db2 command prompt by issuing <code>db2 -tsvf db2.sql</code> command I got
<pre><code>DB21007E End of file reached while reading the comman... | You would need to use the <code>-td<statement terminator></code> syntax. So you would need to format the above as follows:
<pre><code>db2 -td/ -svf db2.sql
</code></pre>
This would tell DB2 that your statement terminator is the <code>/</code> character, otherwise, yes the default is the semicolon <code>;</code>... | You can also set the terminator in the file itself, by adding this comment as the first line like a shebang
<pre><code>--#SET TERMINATOR /
</code></pre>
| https://dba.stackexchange.com |
126,051 | [
"https://math.stackexchange.com/questions/126051",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/10312/"
] | The following question arose while trying to generalize some combinatorial statements from $\mathbb{Z}$ to $\mathbb{R}$.
Suppose I have a multivariate homogenous polynomial $f$ with coefficients in $\mathbb{Z}$, and its integral zeroes lie only on the axes, i.e. $f(\vec x) = 0 \implies$ some coordinate of $\vec x$ is ... | This doesn't work. For example, $x^2-2y^2$.
| Well, the polynomial $Y^2Z = X^3-XZ^2$ is the homogenization of $y^2 = x^3-x$, an elliptic curve which has no rational points other than the trivial ones $(0,0)$ and $(1,0)$ (this isn't hard to show). So the integral (projective) points on $Y^2 = X^3-XZ^2$ are:
<ul>
<li>The "point at infinity" $(0,1,0)$ </li>
<li>The ... | https://math.stackexchange.com |
1,919,346 | [
"https://math.stackexchange.com/questions/1919346",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/186998/"
] | I considered case by case, seeing that in two I win if I choose to change. The problem is I can not explain why the case when I choose the correct door at the beginning must be seen as one, since then the presenter could open either door without the award (they are two events). Then I get two cases in which I win chang... | In order to get probabilities by counting cases, you need to be sure that everthing you count as a "case" is equally likely.
In the Monty Hall case it seems to be reasonable to assume that each of the 9 combinations of which door you choose and which door the prize is behind are equally likely.
If you also take "whic... | There are lots of analyses of the Monty Hall problem on the web, and I won't try to reproduce one here.
I may be able to suggest how you might explain this
<blockquote>
The problem is I can not explain why the case when I choose the
correct door at the beginning must be seen as one
</blockquote>
to your nonprog... | https://math.stackexchange.com |
1,598,338 | [
"https://math.stackexchange.com/questions/1598338",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/283716/"
] | First, circumscribed means inside a circle, right? What does it exactly mean by cut by one side? A regular hexagon has side angles each $120 ^o$ so it has $240^o$ arc measure. But why is the answer $60^o$?
| Clearly
$1) \to$ $$2x=\cos(\theta)+\sqrt{2}\sin(\theta)$$
$2) \to $ $$2y=-\cos(\theta)+\sqrt{2}\sin(\theta)$$
Thus by $1)+2)$ we get ,
$$2x+2y=2\sqrt{2}\sin(\theta) $$
So $$\frac{x+y}{\sqrt{2}}=\sin(\theta)$$
Thus by $1)-2)$ we get ,
$$2x-2y=2\cos(\theta) $$
So $$x-y=\cos(\theta)$$
Now clearly $$ \sin^2(\thet... | Using short-hand $s,c$ for $\sin \theta, \cos \theta$
$$x= s/ \sqrt 2 + c/2; \, y = s/ \sqrt 2 - c/2 $$
Remember as formulas the results/identities:
$$ ( x+y)^2 +( x+y)^2 = 2(x^2 +y^2);\, ( x+y)^2-( x+y)^2 = 4 x y ; $$
$$ 3 (x^2 +y^2) = 3 s^2 + 3 c^2/2$$
$$ -2 x y = c^2/2 - s^2 $$
Add, RHS
$$\rightarrow 2$$
... | https://math.stackexchange.com |
116,322 | [
"https://electronics.stackexchange.com/questions/116322",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/46115/"
] | I got this on an interview question and I still don't know the answer.
<blockquote>
What output will have a nonlinear device if we will give two random frequencies \$f_1\$ and \$f_2\$?
</blockquote>
I answered that it will have two carriers but I really unsure about my answer.
| The correct answer is that you don't know without more information about this non-linear device. Non-linear only rules out linear, but can otherwise mean anything else, including putting out a fixed signal regardless of the inputs.
To show that you understand the concept, you should explain that a linear device can p... | In general, you will get:
<ul>
<li>the two original frequencies f1,f2</li>
<li>The sum and difference of the two frequencies f1 + f2, f1 - f2 (aka intermodulation products)</li>
<li>The harmonics of each of the two frequencies (f1*2, f1*3, f1*n, f2*2, f2*3, f2*n, ...)</li>
<li>Harmonics of the intermodulation products... | https://electronics.stackexchange.com |
467,983 | [
"https://physics.stackexchange.com/questions/467983",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/60183/"
] | How does one properly evaluate something of the form
<span class="math-container">$$
g_{a}^{\, [b} R_{c] b}~?
$$</span>
when I try to expand using the definition of anti-symmetrization brackets the Einstein summation seems to break:
<span class="math-container">$$
g_{a}^{\, [b} R_{c] b} = \frac{1}{2} \bigg[ g_{a}^{... | When contracting <span class="math-container">$b$</span> with <span class="math-container">$d$</span>, you should have raised the index that was not being covariantly antisymmetrized. For example, instead of the term you showed, write it as <span class="math-container">$g_{a[b}{R_{c]}}^b$</span>.
| You cannot (anti) symmetrize indices that belong to different spaces. For example, if you try to symmetrize a mixed tensor like <span class="math-container">$A^\mu_{\ \nu}$</span> you have to swap <span class="math-container">$\mu$</span> and <span class="math-container">$\nu$</span> somehow, but that produces a new te... | https://physics.stackexchange.com |
66,788 | [
"https://security.stackexchange.com/questions/66788",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/42463/"
] | My team at work was recently working on encrypting some hard drives using Microsoft's BitLocker on Windows 7 hosts. The initial encryption for the 2TB drives took several hours to complete. This is all fine and dandy.
What is concerning me however, is that upon changing the password, the process was instantaneous. Thi... | BitLocker uses something called surrogate keys. The data on the disk is encrypted with a random key (surrogate key), and that key is then encrypted with a second key derived from your password (header key). The encrypted surrogate key is then stored in the volume header.
When you type your password in, the system deri... | Just to elaborate a bit on the original answer. There are actually two "surrogate" keys. There is something called the FVEK (Full Volume Encryption Key) keys derived from which are actually used to perform encryption of data on the disk and then there is a MVK (Master Volume Key) which is used to encrypt the FVEK in th... | https://security.stackexchange.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.