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
2,701,416
[ "https://math.stackexchange.com/questions/2701416", "https://math.stackexchange.com", "https://math.stackexchange.com/users/544058/" ]
<blockquote> Let $A ∈ R^{n×n}$ be a nonzero singular matrix with the property that $A^2 = A$. Show that $A − I_n$ is also idempotent. </blockquote> I tried the following: $(A - I_n)^2 = (A-I_n)(A-I_n) = A(A-I_n)-I_n(A-I_n) = A^2 - A - A + I_n = A^2 - 2A +I_n = A - 2A + I_n = I_n - A$ Unfortunately, to the b...
Your computations are O.K. The statement above is wrong. If $A$ is idempotent, then $I_n-A$ is idempotent !
The correct statement is $I-A$ is idempotent. If $$0 = A^2 - A = A(A - I)$$ then the minimal polynomial $\mu_A(x)$ divides $x(x-1)$. If $\mu_A(x) = x$ then $A = 0$ and if $\mu_A(x) = x-1$ then $A = I$, both cases being trivial. Thus assume $\mu_A(x) = x(x-1)$. Recall that for any matrix $B$ and scalar $\lambda$ we ...
https://math.stackexchange.com
142,235
[ "https://physics.stackexchange.com/questions/142235", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/23987/" ]
A current I flows through a solenoid (with n turns). Self inductance is $L$. If the magnetic flux is $\phi$, I am taught that $-n\phi=LI$ I dont understand the part with $n$, why do we have multiply by $n$? $\phi$ itself represents the whole magnetic flux there, if $\phi$ implied the flux only occurred by one coil, th...
I agree that this seems mysterious on first meeting. Multiplication by $n$ is shown to be correct by something called Stokes's Theorem, which you won't have met yet, and which lets us translate the basic equations of electromagnetism (called their Maxwell Equations) between their local and "spread out" forms. But at...
$\Phi$ is the flux of $\vec B$ through <em>one</em> surface $$\Phi = BA$$ where A is the area bounded by <em>a</em> loop (turn). But there are $n$ turns and thus $n$ surfaces that are pierced by $\vec B$ so the the flux <em>linkage</em> $\lambda$ is $$\lambda = n \Phi$$
https://physics.stackexchange.com
705,910
[ "https://physics.stackexchange.com/questions/705910", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/334118/" ]
I am having some doubts regarding operators. In QM, when operators work on a wave function, will it always give a number times the wave function? Suppose I applied it on any normal function of x. Will it always give me a number times the function as a result or it may give another function of x in the place of a number...
An operator <span class="math-container">$A: V \to W$</span> is a linear map between two vector spaces <span class="math-container">$V$</span> and <span class="math-container">$W$</span>, e.g. two function spaces. In quantum mechanics, <span class="math-container">$V$</span> and <span class="math-container">$W$</span> ...
No. In general, an operator acting on a function or a vector gives another, different function or vector. Only for the special case of <em>eigenfunctions</em> or <em>eigenvectors</em> does the action of an operator on an object give a scalar multiple of same object.
https://physics.stackexchange.com
483,859
[ "https://stats.stackexchange.com/questions/483859", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/41028/" ]
Imagine I am trying to fit a multilevel model on products, and want to group by product type. In cases where product types have all the same predictors this is straight-forward. E.g. you might estimate the effect of color on sales or something similar. But what if some predictors only make sense for some of the produc...
There's a pretty sensible way of doing this if you centre all your predictors by subtracting the mean value. Using your example, say you have athletic shorts, shorts, and jeans, and your numeric predictors are a) brightness (defined for all categories), and b) short length (defined for shorts only, <code>NA</code> for ...
Try to create a dummy variable that is 0 when a product does not have the feature (i.e. does not have leg), and 1 when it has this feature. Turn then this dummy variable into a factor. When a dummy does not have a feature, replace the missing value with zero. Then in your model, interact your continuous variable of int...
https://stats.stackexchange.com
148,118
[ "https://electronics.stackexchange.com/questions/148118", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/11636/" ]
I am trying to make a little wireless-connected gizmo to attach to my grandfather's walking cane. The idea is that when it senses the cane has fallen down, it would alert/call one of us so that we can rush to him if we're not nearby. The question is: What sensor or combination of sensors could I use to reliably differ...
I agree with one of the above replies in that you need something (probably two accelerometers) to detect the angle at which the cane stands (calibrated at the factory if you are industrializing this). This way you have a continuum of what angle the cane is at, relative to upright. This gives a distinct advantage over...
A very simple solution is a tilt sensor such as the AT-407 from Sparkfun. It consists of 2 steel balls inside a small tube and 2 leads. When the tube is tilted, the balls separate and continuity is lost between the 2 leads. It costs only $1.95.
https://electronics.stackexchange.com
666,343
[ "https://physics.stackexchange.com/questions/666343", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/314013/" ]
Newton's second law for a body with changing mass given as <span class="math-container">$$F=ma + \frac{dm}{dt}v$$</span> I need the version for rotational motion. By inspection, it seems that it would be <span class="math-container">$$\tau = I\alpha + \frac{dI}{dt}\omega$$</span> I tried to prove this by starting from ...
Torque equals the rate of change of angular momentum. Differentiate the angular momentum to get the answer. And your method is not correct. Don't treat vectors like scalars. That is simply not allowed. <span class="math-container">$$\vec{L} = I\vec{\omega} $$</span> Using your method, you would need to differentiate th...
In general, you have fixed 3x3 mass moment of inertia tensor <span class="math-container">$\mathrm{I}_{\rm body}$</span> riding along the body coordinates and it needs to be rotated into the inertial directions to be used in the equations of motion. Give a 3x3 rotation matrix <span class="math-container">$R(t)$</span> ...
https://physics.stackexchange.com
820,408
[ "https://math.stackexchange.com/questions/820408", "https://math.stackexchange.com", "https://math.stackexchange.com/users/154514/" ]
good evening I want to show that $(1)a;b\in\mathbb {R^*_+}:a^2 b^2 \left( {a^2 + b^2 - 2} \right) \ge \left( {a + b} \right)\left( {ab - 1} \right) $ $ \begin{array}{l} \frac{a}{b} + \frac{b}{a} \ge 2 \\ \frac{a}{b} + \frac{b}{a} = \frac{{a^2 + b^2 }}{{ab}} \Rightarrow a^2 + b^2 = ab\left( {\frac{a}{b} + \frac...
The first statement is the definition of convergence of the sequence $\{a_n\}$ to $a$; no matter how close you want the terms in the sequence to get to $a$ (i.e. within $\varepsilon$), after finitely many terms (i.e. $N$ of them), the sequence will stay that close. The second statement says that after finitely many te...
Note that $N$ is often dependent on the value of $\varepsilon$, $$ N = N(\varepsilon) $$ not "one size (of $N$) fits all ($\varepsilon$ challenges)".
https://math.stackexchange.com
24,849
[ "https://mathoverflow.net/questions/24849", "https://mathoverflow.net", "https://mathoverflow.net/users/3958/" ]
Let $N \in \mathfrak{M}_n(\mathbb{C})$ nilpotent, such that there exists $X \in \mathfrak M_n(\mathbb{C})$ with $X^2=N$ (take for instance $n&gt;2$ and $N(1,n)=1$; $N(i,j)=0$ otherwise). Denote by $\mathcal{S}_N$ the set of $X \in \mathfrak M_n(\mathbb{C})$ such that $X^2=N$. Is $\mathcal{S}_N$ connected or path-conne...
This is a memorial to an incorrect solution that used to be here. Unfortunately, I can't delete it since it was accepted.
Edit: This is just half an answer: I can only show that the sets matrices with $X^2=N$ and fixed Jordan type are path connected. Every nilpotent matrix is conjugate to a nilpotent matrix in Jordan form, which is unique up to permutation of Jordam blocks. So we have a bijection $$\mathrm{Nilp}_n(\mathbb C)/\mathrm{con...
https://mathoverflow.net
195,153
[ "https://mathoverflow.net/questions/195153", "https://mathoverflow.net", "https://mathoverflow.net/users/37537/" ]
Let $Q^{-1}$ be the inverse function of a standard normal CDF. For $0 &lt; \epsilon &lt; p,p' &lt; 1 - \epsilon$, how much does the function $Q^{-1}$ change as a function of $|p - p'|$? Any useful upper bounds would be helpful.
If $F$ is the standard normal CDF, $$(Q^{-1})'(p) = \dfrac{1}{F'(t)} = \sqrt{2\pi} \exp(t^2/2)$$ where $p = F(t)$. The maximum for $\epsilon \le p \le 1-\epsilon$ is at the endpoints. So $$|Q^{-1}(p) - Q^{-1}(p')| \le \sqrt{2\pi} \exp(t^2/2) |p - p'|$$ where $t = Q^{-1}(1-\epsilon)$. Asymptotically as $t \to +\inft...
<blockquote> Let $Q^{-1}$ be the inverse function of a standard normal CDF. For $0 &lt; p,p' &lt; 1$, how much does the function $Q^{-1}$ change as a function of $|p - p'|$? Any useful upper bounds would be helpful. </blockquote> The only upper bound is $\infty$, which is also true for any unbounded random variable ...
https://mathoverflow.net
15,491
[ "https://dsp.stackexchange.com/questions/15491", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/7316/" ]
I read in a paper that a sound signal can be delayed by D degrees. How can such a thing be possible? Isn't sound signals expressed only in terms of the time axis? Thanks in advance
What they mean by a delay of $n$ degrees is simply in reference to the periodicity of the chirps. A period consists of the chirp sound plus an interval of silence. Let the period be $T$. If another chirp starts in the middle of the period of the first chirp, i.e. there is an offset of $T/2$, then the authors refer to t...
If you have a finite window of samples of a reasonably band-limited sound signal, you can also represent this sound data in the frequency domain. In the frequency domain, each frequency point has a phase. For instance, you can try an fftshift of the data, zero-pad the center of the vector, do an FFT, convert the comp...
https://dsp.stackexchange.com
475,018
[ "https://electronics.stackexchange.com/questions/475018", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/160481/" ]
I'm working on a project where, a certain low frequency audio spike should trigger the mono-stable multi-vibrator. If we can trigger a mono-stable multi-vibrator using a mono audio signal, how much is the amplitude needed to trigger this multi-vibrator?
Assuming that your parsing routine is fast (you really should minimize time spend inside an interrupt), I'd consider modifying your code, as follows. <pre><code>struct MeterState { double valueA; double valueB; double valueC; char id[64]; //more.. } MeterState MeterBuffer[2]; MeterState *filled = ...
Use the DMA for the UART to move the data into a memory buffer and parse from there, and check that you don't outrun the DMA while parsing. I would not parse in an interrupt. Then have two copies of the object and three flags: one to indicate most updated copy which the application should read from on its next read, a...
https://electronics.stackexchange.com
117,651
[ "https://softwareengineering.stackexchange.com/questions/117651", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/738/" ]
We are in the middle of a strange situation. We and a partner firm have to put up a web portal. They have a lot of functionality already done on their other portal and we are the managing firm on the project. But there are also some new development needed on their side which is designed by us. Strange thing is, we are ...
The classic method to do this is to use a transactional database (so there's no clashes) and to do a <em>tentative allocation</em> of the seat to you that expires after some length of time (e.g., 10 minutes for kiosks) that gives you enough time to pay. If the (customer-visible) transaction falls through or times out, ...
There are at least 2 business processes involved here. <ul> <li>Process one:</li> </ul> Show available seats. <ul> <li>Process two:</li> </ul> Book a selected seat. Since these processes don't follow one another immoderately, and since 2 people may select the same seat the concurrency issue arises. If your databa...
https://softwareengineering.stackexchange.com
107,426
[ "https://physics.stackexchange.com/questions/107426", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/33926/" ]
Let $B$ be the magnetic field. If $$\nabla \times B = 0$$ and of course $$\nabla \cdot B= 0$$ Can we conclude that $B=0$? For a general field it is wrong because every constant vector will satisfy those conditions. But for the magnetic field is it enough?
No, that is not enough to say that $B=0$. You must also consider that $$\nabla\times E=-\frac{\partial B}{\partial t}$$ which means that for a magnetic field that is constant spatially but not in time, your conditions would be true but your $B$ field would not be $0$ If, however, we had a case where $\nabla\times E=0$...
<blockquote> Can we conclude that B=0? For a general field it is wrong because every constant vector will satisfy those conditions. But for the magnetic field is it enough? </blockquote> It depends on what facts about magnetic field you want to admit into your hypothetical situation. If you assume the Maxwell equati...
https://physics.stackexchange.com
64,955
[ "https://mathoverflow.net/questions/64955", "https://mathoverflow.net", "https://mathoverflow.net/users/10828/" ]
The infinity axiom can be formulated by defining a function $S$ as $$S(N) = \{0\} \cup \{n+1\\ |\\ n \in N\}$$ (FWIW, I'm assuming the von Neumann ordinals.) The axiom is then $$\exists I . I = S(I)$$ which gives us our first infinite set. Then $\omega$ is the intersection of all the subsets of $I$ that are also fi...
Every inaccessible cardinal is a fixed point of the operation $P$ that assigns to every set $X$ of ordinals the set $P(X)=\{2^{|\alpha|}:\alpha\in X\}\cup\bigcup X$. On the other hand, every (nonempty) fixed point of $P$ is a strong limit, the least nonempty fixed point being $\omega$. Now here is the problem: If you...
One can attain something like a positive solution with the observation that the inaccessible cardinals are precisely the <em>regular</em> fixed points of the beth function $\alpha\mapsto\beth_\alpha$, which is monotone and continuous. In particular, the first inaccessible cardinal is the smallest regular beth fixed po...
https://mathoverflow.net
467,386
[ "https://physics.stackexchange.com/questions/467386", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/36746/" ]
Forces arising from magnetic fields do violate Newton's third law of motion under certain circumstances. What other forces violate the third law?
Anytime you hear that a force "violates Newton's Third Law," what that really means is that <strong>the action-reaction pair for that force has been misidentified</strong>. In the case of electromagnetic forces (for example,the case of two moving charges), it is <em>incorrect</em> to say that pairs of charges form acti...
Any force which has a finite speed of propagation "violates Newton's Third Law" in this sense, at least momentarily. Imagine two particles <span class="math-container">$A$</span> and <span class="math-container">$B$</span> some large distance apart along the <span class="math-container">$x$</span>-axis, exerting a cen...
https://physics.stackexchange.com
51,167
[ "https://quant.stackexchange.com/questions/51167", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/44411/" ]
I am learning fundamentals of option market and ran into an example I do not understand : Let's assume I have a portfolio of 3 shares priced \$22, and a European call option to buy a share for \$21 in 3 months. If the stock price turns out to be \$22, the value of the option will be \$1. The text states that the value...
If you are <strong>long</strong> the call option (you purchased it), the value will be as you said <span class="math-container">$22*3+1=67$</span>. If you are <strong>short</strong> the call option (you sold it), the value becomes: <span class="math-container">$22*3-1=65$</span>
As @Valometrics suggests, the only way you portfolio can be worth 65 is indeed that you are short that call. Otherwise it wouldn't make sense for it to be worth only 65 instead of 67
https://quant.stackexchange.com
178,754
[ "https://physics.stackexchange.com/questions/178754", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/27384/" ]
Coupling constants run with the energy scale $\mu$. But what is <em>exactly</em> this energy scale. My question is, if I have a physical process, how do I compute $\mu$?
There are at least two answers possible to give, but both, in the end, amount to the same thing: There is no "right" way to fix the energy scale of a process, but that doesn't matter, except that your perturbation theory will probably break if you choose the scale badly. <strong>The old answer</strong>: The renormaliz...
You go to the center of mass frame to find that $\sum_i \vec{p}=\vec{0}$, and the total momentum four vector is thus $$P_{\text{tot}}^{\mu}=\left(\frac{1}{c}\sum_{i}E_i^{\text{COM}}, \vec{0}\right)$$ then we define the energy scale covariantly as $\mu=\sqrt{-s}$ where $s$ is the mandelstam variable $s\equiv P_{\text{to...
https://physics.stackexchange.com
127,451
[ "https://electronics.stackexchange.com/questions/127451", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/52426/" ]
Does the electrical company generally only supply single-phase in residential areas? i.e.: is 3-phase generally only available in higher use areas? And when 3-phase is supplied, do they have separate lines with single-phase as well?
In most cases, the electrical company, supplies three-phase power voltage. A house is fed from one of these phases and the neutral, moreover, different houses in the same area are connected to different phases, but SHARE NEUTRAL.<br> The number of connected houses are arranged such that each phase has a load similar to...
In my area (Vancouver BC), 3-phase high voltage lines run north along the street at the end of my block. In each lane (running east/west) a single high voltage line connected to one of the 3-phase lines provides power to single phase transformers that step the high voltage down to 120/240 to feed several houses. Succ...
https://electronics.stackexchange.com
492,525
[ "https://physics.stackexchange.com/questions/492525", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/41178/" ]
It has been several years since I looked at General relativity, and I am trying to brush up on it because it was always interesting and I am in need of it for my research. Specifically, I am looking at linearized gravity in "Spacetime and Geometry" by Sean Carrol, page 275. My issue is, I just don't remember tensor m...
As @octonion says, I think the confusion here comes from the fact that Carol re-labels <span class="math-container">$\sigma, \nu$</span> back to <span class="math-container">$\mu, \nu$</span>. First I'll do the computation as Caroll defines it (contracting <span class="math-container">$\mu$</span> and <span class="math...
It is the same form as in the book, you just have some differences in notation. Since you decided to contract <span class="math-container">$\mu,\rho$</span> the free indices you are left over with are <span class="math-container">$\sigma, \nu$</span>. Carrol chose to rename <span class="math-container">$\sigma,\nu$</sp...
https://physics.stackexchange.com
82,067
[ "https://mathoverflow.net/questions/82067", "https://mathoverflow.net", "https://mathoverflow.net/users/19582/" ]
I need an example of a CR submanifold of maximal CR dimension with the shape operator of the distinguished normal equals zero, or a hypersufrace of the shape operator equals zero. Can anyone help me?
Well, there are examples, but it appears that they are all essentially trivial. Take the simplest case of a curve in $\mathbb{C}^n$, which automatically has maximal CR dimension. (Of course, that CR dimension is $0$). Let's say that it is parametrized at constant speed, $\gamma:(a,b)\to \mathbb{C}^n$. Then the condi...
If I'm not misunderstanding your question, this might be the example you're looking for: the standard CR-product of $\Bbb CP^n$ and $\Bbb RP^1$ immersed in $\Bbb CP^{2n+1}$.
https://mathoverflow.net
21,902
[ "https://scicomp.stackexchange.com/questions/21902", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/10403/" ]
It is necessary for me to find the element indicator for poisson equation by linear basis in FEM. Therefore I have to find the following: $$\eta_k=h_k||f+\Delta u_h||_{L^2(k)}+\frac{1}{2}h_k^{1/2}||n.\nabla u_h||,$$ So, I should approximate $\Delta u_h$ numerically, and I need to second order derivative of the shape ...
Generally speaking, adding a single variable to a continuous optimization problem does not drastically decrease algorithm performance. These sorts of manipulations happen routinely to transform apparently "difficult" problems into "easy ones"; examples are things like smooth reformulations of max functions or absolute ...
Depending of your problem, adding more variables can make the problem extremely easy to solve. All will depend of the structure of your problem. For instance, LP problems are solved using a LU decomposition of the constraint matrix. If the decomposition is easy, the problem will be fast to solve. Example for a sum. Y...
https://scicomp.stackexchange.com
134,914
[ "https://physics.stackexchange.com/questions/134914", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/41757/" ]
I don't fully appreciate what the discovery of the decoherence phenomenon adds to the Copenaghen interpretation of QM. I will be more precise: the Copenaghen interpretation, if I am not wrong, is summarized by the following concepts: <ol> <li>QM can, and has to, predict <em>only the probabilities</em> of measurement ...
No, decoherence is <strong>not</strong> a new fundamental feature of quantum physics. It is a phenomenon which occurs when you couple a system with a few degrees of freedom to one with a lot of degrees of freedom and which you can <strong>derive</strong> from the postulates of quantum physics. There really is no measu...
I will give you an easier assignment to start with: explain the origin of Newton's laws, using nothing but statistical mechanics of Newtonian systems. Can you do it? No. Statistical mechanics follows from Newton's laws PLUS a few assumptions about phase space averaging. In the same way decoherence does not lead you b...
https://physics.stackexchange.com
416,756
[ "https://softwareengineering.stackexchange.com/questions/416756", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/373661/" ]
I have two tables <code>products</code> and <code>product_tags</code> in my database having a many-to-many relationship. But I am having a hard time coming up with a practical name. So I was wondering if there is a standard for such a stuff? For <code>orders</code> and <code>products</code> which also have many-to-many...
There is no generally accepted practice here. Here a couple of recommendations: <ul> <li>the preferred approach is to find a name that truly describe what it is from a domain perspective. Your example with <code>order_item</code> clearly belongs to this category. This is extremely clear to everybody and facilitates com...
Why not simply &quot;product_tagging&quot; to cover the N-to-N relation? You've used nouns for objects, you can use verbs for N-to-N relations linking them (and in English as it's not easy to distinghuish nouns and simple forms of verbs you often need a verb variant). You could also use the &quot;<em>and</em>&quot; joi...
https://softwareengineering.stackexchange.com
53,989
[ "https://mathoverflow.net/questions/53989", "https://mathoverflow.net", "https://mathoverflow.net/users/12325/" ]
The broad, generic and badly posed question may be formulated in this way: <blockquote> Let <span class="math-container">$X$</span> be a compact Kälher manifold (or even a projective one). If one considers the Hodge decomposition <span class="math-container">$H^k(X, \mathbb{C}) = \bigoplus_{p+q=k} H^{p,q}(X)$</span> an...
This is really a comment on Donu Arapura's answer, but it seemed large enough to deserve it's own post. Working again in the case of $GL_1$, Simpson considers three spaces: $M_{betti}$: The space of $\mathbb{C}^*$-local systems on $X$. If you like, you can think of this as smooth complex line bundles with an integrabl...
Marco, Since I don't fully understand what you are asking, let me instead discuss what you say is motivating you. If it isn't relevant, you can say so. When $X$ is a compact Kaehler manifold then what Simpson calls the Betti moduli space $M_B(X)$ is the set of semisimple representations in $Hom(\pi_1(X),GL_n(\mathb...
https://mathoverflow.net
79,068
[ "https://softwareengineering.stackexchange.com/questions/79068", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/26147/" ]
Introduction To Software Testing (Ammann &amp; Offutt) mentions on p.32 a 5-level testing maturity model: <strong>Level 0</strong> There’s no difference between testing and debugging. <strong>Level 1</strong> The purpose of testing is to show that the software works. <strong>Level 2</strong> The purpose of testing i...
Testing is meant to find defects in the code, or from a different angle, to prove to a suitable level (it can never be 100%) that the program does what it is supposed to do. It can be manual or automated, and it has many different kinds, like unit, integration, system / acceptance, stress, load, soak etc. testing. Deb...
Debugging is a manual step by step process that is involved, unstructured and unreliable. By testing through debugging you create scenarios that are not repeatable therefore useless for regression testing. All levels other than 0 (in your example) exclude debugging in my view for this exact reason.
https://softwareengineering.stackexchange.com
441,065
[ "https://softwareengineering.stackexchange.com/questions/441065", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/313410/" ]
For instance, if I'm modeling a book collection and I want to be able to represent sets of books that come together (like an encyclopedia series), the sets may share a lot of properties that individual books would also have (author, publication date, title, etc.). In terms of naming the classes in an OOP context, would...
This is a semantical argument, not a technical one. Mathematicians will happily agree that a set can contain one number. Obviously, arrays and lists can have 1 item in them as well. There is no technical limitation here. However, I suspect you are using the wrong name for the concept you're trying to describe. If this ...
Interpreting that in two ways. Assuming that I understood it, <strong>(1)</strong> you want to give the base class a <em>categorical</em> name, like <code>BookSet</code>. As this clashes with with <code>~Set</code> in standard libraries, it should be more like <code>BookCategory</code>. But the convention <code>Abstrac...
https://softwareengineering.stackexchange.com
65,989
[ "https://physics.stackexchange.com/questions/65989", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/23816/" ]
I have a vector potential given by: $\mathbf{A}(x,t) = \mathbf{e}_{y}\frac{1}{2} e^{-(x-ct)^{2}/{4a^{2}}}$ Now, the question is "Determine the <strong>E</strong> and <strong>B</strong> under the condition that the scalar potential vanishes $V = 0$." But I'm not quite sure what it means when $V=0$ ? As far as I can ...
The relation $\mathbf{E} = -\nabla V$ holds only in the absence of vector potential, otherwise the electric field changes to $$ \mathbf{E} = -\nabla V-\frac{\partial\mathbf{A}}{\partial t}. $$ The reason for this is that when you introduce vector potential by $\mathbf{B} = \nabla\times\mathbf{A}$, Faraday's law reads $...
The expression for the electric field includes derivatives of the vector potential with respect to time.
https://physics.stackexchange.com
462,929
[ "https://electronics.stackexchange.com/questions/462929", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/71514/" ]
I made a sensor board that needs to operate at about -55 degrees Celcius. Unfortunately, its key component often malfunctions when the circuit is cooled for days at the temperature and then powered up. The sensor starts to operate normally after it runs (improperly) for several minutes since the power-up time. Thus I w...
You’re trying to heat the sensor, not the PCB. So let’s heat the sensor. Without knowing the footprint of the sensor, it’s hard to give anything more than a general answer, so you’ll need to adapt it to your specific situation. But, the gist is this: <ol> <li>Use a single 0.5W resistor, sized to draw maybe 400mW-...
There are plenty of off the shelf surface mount resistors that can handle the power that is at your disposal. You can even use multiple resistors to spread the heat and derate the parts. For instance, many 1206 resistors are rated for 0.5W. Using two of these to spread the heat would split the power between them, gi...
https://electronics.stackexchange.com
421,557
[ "https://physics.stackexchange.com/questions/421557", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/52332/" ]
I'm not sure what the proper definition of the quadrupole moment tensor is. In the book on gravitational waves by Maggiore, the definition is $$M^{ij}=\int d^3x T^{00}x^ix^j. \tag{3.37}$$ ( Maggiore, <em>Gravitational Waves,</em> Volume 1 eq. 3.37.) Meanwhile, in the books by Wald, Carroll and Weinberg, they say $$M...
The typical analysis of the field far from a source in general relativity is contained entirely within the framework of the <strong>linearised theory</strong>. This means we always assume $$ h_{\mu \nu} \sim T_{\mu \nu} \sim \epsilon $$ and drop $\epsilon^2$ terms wherever they arise. If we lower indices on the $x^i$...
Yes, OP is right. The spatial indices on the LHS. of eq. (7.138) should formally be upper (as opposed to lower). This does not make a difference if we raise and lower with the Minkowski metric in rectangular coordinates $x^{\mu}$ with $\eta_{\mu\nu}={\rm diag(-1,1,1,1)}$, which Carroll presumably assumes.
https://physics.stackexchange.com
226,618
[ "https://physics.stackexchange.com/questions/226618", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/57961/" ]
Recently when I deal with 1D electron system, it occurred to my mind that since these electrons are not able to bypass each other during the scattering processes, we can actually label them as the 1st, 2nd,..., Nth electron. As a result, it seems that these electrons now become distinguishable. so my questions is: do...
One can also label the electrons in an atom by the energy in its Hartree-Fock approximation, and thus makes them distinguishable. This has physical consequences, for example one can speak unambiguously about the outer electron of a Lithium atom. For a 1D quantum system one may have nonstandard statistics related to th...
Your intuition is exactly correct. In 1D, fermions and "hard-core" bosons (i.e. bosons with strong on-site repulsion that prohibits putting two bosons on the same site) are exactly dual to each other and produce the same energy spectrum for any given Hamiltonian. This (nonlocal) duality is easy to construct: a system o...
https://physics.stackexchange.com
159,391
[ "https://electronics.stackexchange.com/questions/159391", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/26864/" ]
Today I had a bit of car trouble where the culprit turned out to be the battery. I had driven my car just 5 minutes earlier without issue, but upon attempting to crank the vehicle it made a final effort at turning over and abruptly stopped, as if the battery leads were suddenly removed and all power was cut-off. After ...
In my boat, I have had a couple of lead-acid batteries fail with a shorted cell. In one case, the shorting may have been caused by the impact of a minor collision, but the batteries were 6 years old, so reaching end-of-life anyway. The shorted cell reduced the battery voltage by 2 volts, and apparently had enough inte...
Open circuit voltage and voltage while connected to the car should not be very different. There are generally 6 cells each with a nominal voltage of 2 volts a piece in SLA 12v, AGM, and other lead driven batteries. If a single cell is dead or internally shorting, expect to see leakage, because like the other answer, ce...
https://electronics.stackexchange.com
213,036
[ "https://dba.stackexchange.com/questions/213036", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/156932/" ]
My database full backup file size is 760 GB and differential would be around 20 GB but the database size is around 2TB. As it is a production database, so to apply only a minimum downtime, i want to run DBCC SHRINKFILE with TRUNCATEONLY before restoring differential backup. Please advise if i can run the command DBCC ...
We ended up renaming the .ss file while the service was down. When it came back up again we could create a new snapshot. It's not ideal that services had to be down for us to resolve this, but it's better than nothing.
this might help: <pre><code>ALTER DATABASE [Your DB Here] SET OFFLINE Drop database [Your DB snapshot here] </code></pre>
https://dba.stackexchange.com
239,656
[ "https://electronics.stackexchange.com/questions/239656", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/82021/" ]
I found audio transformers online having the following specification: 600 : 600 ohms. My question is what does it mean? Does it mean that it is simply an isolation transformer? Or is it in some way used for impedance matching? How can it be used for impedance matching if both the primary and secondary have the same r...
Impedance is just the ratio between voltage and current, like a resistor. A transformer can change the ratio between in- and output voltage (and current as well) for AC signals. So a 600 ohms to 4 ohms transformer lowers the voltage (and increases the current) so that 4 ohms at the output behaves as 600 ohms at the i...
It means this transformer is intended to isolate a audio signal between two different common mode voltages. It otherwise is intended to alter the audio signal as little as possible. This transformer is not intended to have a speaker connected to one side. 600 &Omega; is the official impedance of "line" audio, althou...
https://electronics.stackexchange.com
8,704
[ "https://mechanics.stackexchange.com/questions/8704", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/1201/" ]
I have a Belle MiniMix 150 110V Electric Cement Mixer the documentation says to use a EP90 oil in the gear box, but these days it seems that most outlets only sells EP80/90 oil. What is the difference and does it matter? (I am asking on a mechanics.stackexchange as I need advice for people that understand gear boxes...
80W90 is a multiviscosity version of the single-viscosity 90 gear oil; it's the same concept as 10W30 motor oil being the multiviscosity version of single-viscosity 30-weight motor oil. The "W" is a "winter" rating, meaning that the oil in question is designed to be usable in winter months in cold climates. 80W90 oil ...
much like motor vehicles (depending on age) some makers recommend mineral based oils some synthetic.They do this for a reason as viscosity/additives vary.Use what they specify.Lubricant makers have websites,some of whom allow you to pose questions regarding lubricants and applications
https://mechanics.stackexchange.com
15,134
[ "https://chemistry.stackexchange.com/questions/15134", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/6889/" ]
<blockquote> Find the heat that will be released in kJ per gram when aluminium (<span class="math-container">$\ce{Al}$</span>) reacts with <span class="math-container">$\ce{Fe2O3}$</span> as follows: <span class="math-container">$$\ce{2Al(s) + Fe2O3(s) → Al2O3(s) + 2Fe(l)}$$</span> </blockquote> The information gi...
When you converted the heats to kJ/g, you inadvertently "broke" the Hess's law equation that you plugged them into. Each of the enthalpies of formation in that equation is multiplied by the number of moles of the matching species, and so the units of the enthalpy of formation are kJ/mol. If you assume one mole of pro...
I'm guessing that you're looking for the heat released per gram of <strong>aluminum</strong>. You're correct to here ΔH° = Σ(ν × ΔHf°) (products) - Σ(ν × ΔHf°) (reactants) Since there are 2 moles of aluminum, you need to divide this ΔH° by 2, then you have heat released in kJ/mol of aluminum. To convert this to kJ/...
https://chemistry.stackexchange.com
32,371
[ "https://stats.stackexchange.com/questions/32371", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/5480/" ]
I'm investigating how some weather variables (15) affect electricity demand in a specific area during the last 20 years. I was thinking to perform the following steps: 1. Perform Multiple Linear Regression on each subset of selected variables 2. Save t-statistics (p-values) for each run Then, I would to show the stat...
If X is highly skewed the Z statistic will not be normally distributed (or t if the standard deviation must be estimated. So the percentiles of Z will not be standard normal. So in that sense it does not work.
The R code will work, but the z-score will be about as meaningful as the sentence "Grapes are phoning the fountain pen lightly." It's a valid sentence, but doesn't convey anything meaningful. Judging by your R code, it seems like you think your data is Weibull distributed. In that case, I'd just use the Weibull stat...
https://stats.stackexchange.com
323,618
[ "https://dba.stackexchange.com/questions/323618", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/160280/" ]
I'm trying to execute a different <code>create or replace function</code> signature according to <code>version()</code> - since <code>anyarray</code> &amp; <code>anyelement</code> are removed in postgres 14 and replaced by <code>anycompatiblearray</code> &amp; <code>anycompatibleelement</code>. I can't use <code>prepar...
You can use PL/pgSQL with dynamic SQL: <pre><code>DO $$BEGIN IF current_setting('server_version_num')::integer &lt; 140000 THEN EXECUTE $f$CREATE FUNCTION f(anyarray) ...$f$; ELSE EXECUTE $f$CREATE FUNCTION f(anycompatiblearray) ... $f$; END IF; END;$$; </code></pre>
Ah, if I wrap it inside a function or procedure, then it is possible to use <code>execute</code>: <pre><code>DO $$ BEGIN CREATE OR REPLACE PROCEDURE pg_temp.create_foobar() LANGUAGE PLPGSQL AS $creator$ DECLARE t_arr TEXT; t_el TEXT; cmd TEXT := ' CREATE O...
https://dba.stackexchange.com
323,498
[ "https://softwareengineering.stackexchange.com/questions/323498", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/146020/" ]
C# has made a language feature of the <code>NotImplementedException</code>. It's added to a lot of auto-generated code, such as event handler stubs: <pre><code>// Auto-generated private void TextBox_MouseDown(object sender, MouseEventArgs e) { throw new NotImplementedException(); } </code></pre> What makes this e...
It allows the code to compile for your method stub (regardless of the method's return type), while you get around to putting in an implementation. It also reminds you to put in the implementation, because it will throw the first time you try to MouseDown on that textbox. A thrown exception that says "This method is n...
There is an additional case which wasn't mentioned in the previous answers: mocks for unit tests. A mock can need to implement only a small part of an interface, but to compile, it should declare all of them. The not implemented exception makes then a very clear difference between methods which are actually required b...
https://softwareengineering.stackexchange.com
442,719
[ "https://physics.stackexchange.com/questions/442719", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/146562/" ]
I've been wondering why does this really happen, I mean by intuition if electrons are driven by EMF (ignoring wire's resistance), <span class="math-container">$n$</span> coulombs would pass by a point per second, until they encounter something that slows them down thus the rate of flow would change. Why does current re...
Yes, it is true. Charge cannot disappear. Or appear. This is <strong>Kirchhoff's current law</strong>. For a steady current, all charge that enters any point each second must also leave that point each second: <span class="math-container">$$\sum i_{in}=\sum i_{out}$$</span> Otherwise charge would accumulate at that...
<blockquote> What's the reason behind the current remaining the same after passing by a resistance? </blockquote> Because, due to the redistribution of charges (and voltages), the electric field inside a resistor is stronger than the electric field inside a wire. This redistribution happens automatically. Initial...
https://physics.stackexchange.com
5,839
[ "https://mechanics.stackexchange.com/questions/5839", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/2212/" ]
Recently I discovered that I have a small but a bit deep scratch on a rear door glass ( I have hatchback ). I am not sure how it happened but it is there now and it bugs me quite a bit. Can I fix it myself via some sort of a repair kit? Or do I need to bring my car to repair shop? At this point I can't afford to repla...
Apparently you can try regular buffing/polishing techniques similar to what you would do with paint. However those can only be done on the outside of the rear window because you will damage your defroster element if the scratch is on the inside of the vehicle. Another DIY trick is to use clear nail polish to fill the...
There are various DIY solutions available, which will probably be appropriate for a side or rear window (for a front windscreen regulations are usually quite specific) and they apply a quick setting transparent gel. Your local Halfords or other car maintenance shop should stock this sort of thing. Vendors such as Auto...
https://mechanics.stackexchange.com
94,596
[ "https://softwareengineering.stackexchange.com/questions/94596", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/31418/" ]
Recently a friend of mine bought an inventory application from a vendor, who used an statement like "<strong>built based on 10000 lines of codes</strong>" as a marketing slogan to increase its market share. I've also seen other software claiming to being built with a special language (C#, PHP, Java, etc.), or based on ...
The language matters if the vendor gives the customer the source code to make changes. Otherwise, it might matter for performance (a desktop application written in C means it probably starts up faster than something based on a virtual runtime like JRE or .NET). The lines of code is there to give the customer who is t...
It's marketing-speak. Hopefully your friend knows that LOC (Lines Of Code) has no relation to the quality of the final product. The closes analogy I can think of right now would be to sell cars with marketing info boasting about the number of screws and fasteners in the car. Would the number of screws used to hold a ca...
https://softwareengineering.stackexchange.com
193,936
[ "https://softwareengineering.stackexchange.com/questions/193936", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/82810/" ]
Is it a good idea to use somebody else's library as a base and build your own library over that. I want to make a JavaScript Canvas framework for a animation player on top of KineticJS. Should I do it? Do I need permission from the author of KineticJS? Do I just say to users to donwload KineticJS before my library, or...
I see two perspectives to this: <strong>Legal: Can you do it?</strong> I see no reason you can't. I know there are some laws/rules about bundling other people's libraries, but that would probably only be for proprietary libraries or with licenses that have very specific rules against including them in other projects (...
Sure you can build your library on top of someone else's. People do that all the time! You shouldn't need the permission of the author of the base library to do this (because you're just <em>referencing</em> their code), but you might need their permission if you want <em>redistribute</em> their library with yours. Th...
https://softwareengineering.stackexchange.com
526,219
[ "https://math.stackexchange.com/questions/526219", "https://math.stackexchange.com", "https://math.stackexchange.com/users/63338/" ]
Is there an example of a strictly stationary (zero mean, finite variance) stochastic process $(X_t\mid t\in \mathbb{N})$ that satisfies the conclusion of the ergodic theorem, i.e., the sample mean $\overline{X}_n\rightarrow_{a.s.} 0$, as $n\rightarrow \infty$, such that $X_s$ is uncorrelated with $X_t$, whenever $t\neq...
Let $Z$ be a random variable with $P(Z=1) =P(Z=2)=1/2$. Let $Y_1, Y_2, \dots$ be iid and independent of $Z$ with $P(Y_t = 1) = P(Y_t = -1) = 1/2$. Set $X_t = Z Y_t$. Then $X_t$ is stationary, and by the strong law of large numbers, $\overline{X}_n = Z \overline{Y}_n \to Z E[Y_t] = 0$ almost surely. It is also unc...
Consider the process $X_n = (-1)^n X_0$ where $X_0$ is a random variable with distribution symmetric about $0$ (but $|X|$ not a.s. constant).
https://math.stackexchange.com
64,833
[ "https://mathoverflow.net/questions/64833", "https://mathoverflow.net", "https://mathoverflow.net/users/4685/" ]
Is it true that all continuous finite dimensional $p$-adic representations of $Gal(\bar{K}/K)$ are semisimple, where $K$ is a number field, i.e. if $\rho:Gal(\bar{K}/K) \mapsto GL_n(\bar{\mathbb{Q}}_p)$ is a continuous representation, where $K$ is a number field (even $\mathbb{Q}$ if you want), is it semisimple? Repla...
This can't possibly work. Many p-adic Galois representations are not semisimple. For instance, $\mathbb{Z}_p$ occurs as a quotient of the Galois group of $\mathbb{Q}$ (as the Galois group of the cyclotomic $\mathbb{Z}_p$-extension) and there are non-semisimple $\mathbb{Q}_p$-representations of $\mathbb{Z}_p$, e.g. the ...
A remark on the (lack of) $p$-adic valued Haar measure: there can exist topologically irreducible continuous representations of pro-$p$ groups (e.g. $GL_n(\mathbb Z_p)$ on infinite-dimensional $p$-adic Banach spaces. This is pretty strong evidence that there is no simple analogue of Haar measure in the $p$-adic situat...
https://mathoverflow.net
118,430
[ "https://electronics.stackexchange.com/questions/118430", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/46360/" ]
For a given MCU, all other things being equal, does the memory capacity impact the power consumption ? A 512kB flash memory would consume more than a 128kB ?
No. Flash requires no power to maintain its data. It only uses power when actively reading or writing. The amount of flash has mo direct bearing on the power consumption of the chip. SRAM, however, does require power to maintain the contents, so the amount of SRAM on a chip vastly affects the power consumption of...
Take a look at the datasheets for the micros you are interested in. For example the Atmel XMEGA datasheets show that there are no differences due to the amount of flash memory, only the amount of SRAM.
https://electronics.stackexchange.com
96,020
[ "https://physics.stackexchange.com/questions/96020", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/87745/" ]
I have read that <em>gravitational field intensity</em> and <em>acceleration due to gravity</em> are two different physical quantities that have the same direction, magnitude, and units. So, if all the units, magnitudes, and directions are the same for the two quantities (and also, physically, both essentially mean the...
Gravitational Intensity and Gravitation acceleration , even though have same dimensions are different physical quantities. Gravitational Intensity of a mass body A at a given point is defined as the force on a unit mass body. It is just a physical quantity that is defined to help us find out the force exerted by the m...
The two quantities are on opposite sides of Newton's second law equation <span class="math-container">$\vec F=m\,\vec a$</span> The force on a mass <span class="math-container">$m$</span> in a gravitation field <span class="math-container">$\vec g (= g \,\hat d)$</span> is <span class="math-container">$\vec F = m \,...
https://physics.stackexchange.com
229,714
[ "https://softwareengineering.stackexchange.com/questions/229714", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/120649/" ]
Recently I've been reading and learning quite a lot about scrum and I like it a lot. However, I do have a couple of likely scenarios in my head to which I don't know the solution. So let's say that I might want to organize an agile team of (for instance) four web developers (one of them UI/UX designer). This team would...
I think that your situation its in fact very common, a lot clients don't to be involved with the level of dedication that a PO role needs. Its very usual the approach of the "PO proxy", this is someone of your company that talks with the client and translates the requirements of the client into user histories for the ...
In my experience, if you tell the client they're the 'product owner', they tend to revolt at the extra responsibility. But if you say you're going to show them your progress every couple weeks so they can direct the team, they're cool with it. For the most part, that's what the product owner does anyway.
https://softwareengineering.stackexchange.com
68,309
[ "https://security.stackexchange.com/questions/68309", "https://security.stackexchange.com", "https://security.stackexchange.com/users/56354/" ]
I was just reading about Shellshock and how it works. From what I understood it exploits the fact that the code is being executed even after the export of the function definition which is exported as an env variable. Why isn't the fact that you can set environmental variables on a server a big security issue of its ow...
The attacker isn't setting environment variables on his own. What's happening is that the CGI specification for communication between a web server and CGI executables says that a number of parameters (such as HTTP headers) are to be passed as environment variables. This means that an attacker can't set sensitive va...
Another source of vulnerability are the HTTP headers like <strong><em>Authorization</em></strong> or <strong><em>Referer</em></strong>. This can be maliciously formed to inject some Bash command. Note, all commands will be executed with the privilege of the user the <strong><em>mod_cgi</em></strong> is running.
https://security.stackexchange.com
15,151
[ "https://biology.stackexchange.com/questions/15151", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/625/" ]
Lately, I've become a believer in the limits of reductionist explanations especially in areas like complex systems and biology. So, without wasting any more time, I'll get to my question.. Whenever we think of something like cooperation, the most common explanation that comes up is that of genetic fitness. It is said ...
TCT AAC <em>TGA</em> TTA GC T CTA ACT GAT <em>TAG</em> C TC <em>TAA</em> CTG ATT AGC AGA TTG ACT AAT CG &lt;&lt;&lt; this is the ORF A GAT <em>TGA</em> CTA ATC G AG ATT GAC <em>TAA</em> TCG If the sequence comes from the middle of a gene we assume it should encode an open reading frame. For this sequence only 1/6...
On the sequence alone, you can answer neither of these questions because: <ul> <li>from the sequence alone you don't know anything about the gene or the promoter.</li> <li>the same is true for the orientation</li> <li>and the codons, since you don't know if the code is in frame or not. If one base is cut-off from the...
https://biology.stackexchange.com
73,610
[ "https://softwareengineering.stackexchange.com/questions/73610", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/9901/" ]
I often have to deal with customers or users which are reporting errors in applications. Most of the time their content is something useless as <ul> <li>ERROR!!!</li> <li>x does not work</li> </ul> without much more information. For resolving the issue I have to request every single detail of them, which often is m...
Reward your users for good bug reports, punish them for bad ones (well at least a little). The user needs to understand that a good bug report is essential for you to fix the problem quickly and therefore is good for him as well, because he'll get the solution a lot faster. So the first response could be something li...
One thing that I've seen several open-source projects do is to write up a standard "form" for bug reports, with sections for commonly-needed information. If you have a bug reporting site or application your customers have access to, see if you can make a blank version of it the default text of the bug description fiel...
https://softwareengineering.stackexchange.com
2,673,532
[ "https://math.stackexchange.com/questions/2673532", "https://math.stackexchange.com", "https://math.stackexchange.com/users/415282/" ]
Programming side: Trying to implement a calculation for 3D triangle calculation. Mathematical side: I need a formula for this that does not use cross product. I have found a formula that uses the vectors of the sides and cross products, but the issue is that My triangles are so large, that i get 64bit integer overflow...
The intuitive meaning of $$\lim_{x\to 0}\frac{\sin x}{x} =1$$ is that for $x$ small, $\frac{\sin x}{x} \approx 1.$ Equivalently, $\sin x \approx x$, which of course implies $x \approx \sin x$ and hence $\frac{x}{\sin x} \approx 1$, which is the intuitive meaning of $$\lim_{x\to 0}\frac{x}{\sin x} =1.$$ This isn...
By the Algebraic Limit Theorem $$\lim_{x \rightarrow0}1=1$$ $$\lim_{x \rightarrow0}\dfrac{\sin{x}}{x}=1$$ $$\implies \lim_{x\rightarrow 0}\dfrac{1}{\dfrac{\sin{x}}{x}}=\lim_{x \rightarrow0}\dfrac{x}{\sin{x}}=\frac{1}{1}=1$$ This can be used since $\lim_{x\rightarrow 0}\dfrac{\sin{x}}{x}$ is known and is not $0$
https://math.stackexchange.com
376,447
[ "https://softwareengineering.stackexchange.com/questions/376447", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/277731/" ]
I have a simple project where the controller calls the service, and the service calls the repository in order to get the needed data. Assuming that we have these domain models: <pre><code>// this model has a RepositoryA built for it Class A { public string Name { get; set; } public int B_Id { get; set; } } // ...
<blockquote> And knowing (correct me if I'm wrong) that a repository shouldn't return a DTO </blockquote> Theoretically, every layer (= project in your solution) should have its own DTO objects. In that sense, your repositories should return a DTO, but this is not the same DTO as the "business logic DTO". However, ...
The repository should return a Domain Model. You should have a single repository per database, rather than one per table. In your case if you want both domain models in as single query then you could either <ul> <li>Change your Domain Model so that A has a child object B</li> <li>Have two separate methods still, but...
https://softwareengineering.stackexchange.com
75,457
[ "https://physics.stackexchange.com/questions/75457", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/3416/" ]
As I'm reading about GR a lot lately, I was wondering: how do gravitons (if they exist ofc) impact the general relativity? Since in GR, when we look at particles moving in space-time, we are only looking from geometric point of view so to say. Since gravity is represented with curvature of space-time via Einstein equa...
<blockquote> How do gravitons impact on general relativity? [...] I would guess that this kinda question was asked by some scientists and answered... </blockquote> It's been asked but never answered satisfactorily. The full impact on general relativity would be that it would become a theory of quantum gravity. Nobod...
You would interpret this as gravitational waves being the medium through which changes in matter distributions are communicated to far away places--much in the same way that you see it with retarded potentials in E&amp;M. If you quantize the field, (at this level) all that happens is that this transmission happens in ...
https://physics.stackexchange.com
343,049
[ "https://physics.stackexchange.com/questions/343049", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/82480/" ]
We have that $\Delta U = Q + W$. What I don't see is how this formula relates to the law of conservation of energy. Can someone please clarify? Does this mean that $\frac{dU}{dt}=\frac{dQ}{dt}+\frac{dW}{dt}=0$, so that $\frac{dQ}{dt}=-\frac{dW}{dt}$?
Since your second question has been answered in the comments, I will answer your first question. Let's examine in words what $\Delta U=Q+W$ means: "Any change in internal energy arises from a flow of heat into/out of the system and/or work done by/on the system." Put differently: "The only two ways internal energy can...
The equation of the first law of Thermodynamics does <em>not</em> directly imply the conservation of energy; rather the first law of Thermodynamics is a consequence of the <strong>conservation of energy</strong> when applied to Thermodynamics( systems involving heat, temperature etc.) The conservation of energy was kn...
https://physics.stackexchange.com
172,369
[ "https://math.stackexchange.com/questions/172369", "https://math.stackexchange.com", "https://math.stackexchange.com/users/36060/" ]
In many surveys or introductions, one can see sentences such as "there was a need for this type of cohomology" or "X succeeded in inventing the cohomology of...". My question is: why is there a need to develop cohomology theories ? What does it bring to the studies involved ? (I have a little background in homologica...
I am not an expert, but I think of a cohomology theory as a description of obstructions to solving some sort of equation. For example, if the first simplicial cohomology of a simplicial complex vanishes, there is no obstruction to assigning weights to edges and faces so that some equations relating these weights are sa...
To complement Adam Saltz's nice answer (+1 BTW): cohomology theories give a way of proving that certain sequences are exact---for instance, of proving that certain maps are surjective (i.e., solving certain equations) or injective. More specifically, and towards your question "What does it bring to the studies involved...
https://math.stackexchange.com
45,061
[ "https://mathoverflow.net/questions/45061", "https://mathoverflow.net", "https://mathoverflow.net/users/5115/" ]
Suppose that $n+m$ balls of which $n$ are red and $m$ are blue, are arranged in a linear order, we know there are $(n+m)!$ possible orderings. If all red balls are alike and all blue ball are alike, we know there are $\frac{(n+m)!}{n!m!}$ possible orderings. For example, 2 red and 3 blue balls: R1 R2 B1 B2 B3 R2 R1 ...
Such a color-code ordering starts with either R or B and continues with strictly alternating R and B. The string can be of any length up to the smaller of $n$ or $m$, meaning it can be twice that smaller value, but that can be followed by one more character if there are enough of the other color. Moreover, every such...
Without loss of generality, assume $n \leq m$. Such a colour code ordering is just a sequence of alternating $R$ and $B$ letters. There are four types of such sequences, depending which letter they start and end with. Say a sequence is of type $(X,Y)$ if it begins with $X$ and ends with $Y$. So, there are <ol> <l...
https://mathoverflow.net
82,166
[ "https://dsp.stackexchange.com/questions/82166", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/56371/" ]
Let <span class="math-container">$x[n]=a\cos(\omega_{0}n)$</span>, if we pass it towards an LTI system, we should get as an output: <span class="math-container">$$ y[n]=a|X(e^{j\omega_{0}})|\cos(\omega_{0}n+\phi_{X}(\omega_{0}))+\operatorname{transients} $$</span> My question is why are there transients in the response...
You are mixing your analysis techniques. If <span class="math-container">$x[n]=a\cos(\omega_{0}n)$</span>, then you cannot use the <span class="math-container">$z$</span> transform for your analysis; you need to use Fourier analysis. Because the signal exists for all time <em>there is no transient</em>. If you're usin...
&quot;LTI&quot; means &quot;the output needs to scale with the input&quot;: So if you double <span class="math-container">$a$</span>, <span class="math-container">$y$</span> must also double. Since that needs to work for any <span class="math-container">$a$</span>, especially 0, this means that <span class="math-contai...
https://dsp.stackexchange.com
93,498
[ "https://cs.stackexchange.com/questions/93498", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/86640/" ]
This is the code: <pre><code>j=2 while j&lt;(n*n) j=j*j </code></pre> <hr> At first my approach was to treat this like this loop <pre><code>i=1 while (i&lt;n) i=i*2 </code></pre> Which generates on $i$ various powers of $2$ ($i=2^0, 2^1, 2^2....2^k$). At a certain $k$ iteration, $i$ is equal to or excee...
In this case, $p(|x|)$ denotes any function polynomial in the length of $x$. Asking what $p$ is when $x=ababab$ is like asking "What is the running time on input ababab?" without specifying the algorithm you want to know the running time of (or specifying the problem the algorithm is supposed to solve, for that matter...
A language $L$ is in NP if there exists a polynomial $p$ and a Turing machine $M$ running in polynomial time such that $$ x \in L \text{ iff there exists } u \in \Sigma^* \text{ with } |u| \leq p(|x|) \text{ such that } M(x,u) = 1. $$ Asking what is $p$ is exactly the same as asking what is $M$. When proving that a lan...
https://cs.stackexchange.com
179,233
[ "https://electronics.stackexchange.com/questions/179233", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/72582/" ]
I want to use LM78xx for various applications. What I am concerned about is its failure modes. <img src="https://i.stack.imgur.com/awG8M.gif" alt="enter image description here" /> <strong>1. Failure to Short</strong> Not shorting Vcc to ground!! I mean shorting V_input to V_output. Assume that you have a delicate and e...
<ol> <li>Failure to short- crowbar + fused input (a thyristor and trigger circuit) or at least a TVS. The TVS might be able to limit the voltage to something like 8V which your delicate equipment might have a fighting chance of surviving (newer chips with 5.5V abs max supply may not live). An open GND connection will c...
If you have an application where the failure of the linear regulator causes a higher output voltage then either use a fuse and zener diode (5V6 maybe) or design a small crowbar protection circuit. Crowbars are virtually mandatory on switch mode power supplies to prevent a greater output voltage than what would be allow...
https://electronics.stackexchange.com
220,065
[ "https://softwareengineering.stackexchange.com/questions/220065", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/94336/" ]
This applies to C (and probably to any other similar non-object oriented language). If I have a central data store and potentially concurrent access there are two ways I can see of protecting it. Let's say I have a data store with a few data elements... <pre><code>struct MyStore { int data1, data2, data3, ...., d...
When providing a thread-safe interface (with or with OOP) you need to make sure that your operations are at the level you want to be atomic. If setting or getting a single field is the level of atomic operation you want to support, then option 1 works. (On the other hand, getting and setting int's is atomic anyways) T...
You can do in C everything you'd do in another language to make a clean interface - you just have to do it with less language support. <ol> <li>if you want to avoid boilerplate accessors, store all your simple types in a union: then you have a single access by enumerated field ID (ie, an index into an array of unions)...
https://softwareengineering.stackexchange.com
4,687
[ "https://stats.stackexchange.com/questions/4687", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/1474/" ]
I am trying to get a deeper understanding of the various types of Bayesian networks. Most of the literature/lectures I've come across use discrete random variables exclusively and only mention continuous random variables in passing. It seems if you want to mix discrete and continuous variables in a hybrid network,...
First of all, your usage of the term "prior probability" seems to be wrong. For any node N with discrete values $n_i$ the probability that a certain value of N occurs <em>a priori</em> is $p(N=n_i)$. If a node has no parents, one is interested in calculate this prob. But if a node has parents P, one is interested in ca...
Consider two simple cases, 1) a real valued variable X is the parent of another real valued variable Y<br> 2) a real valued variable X is the parent of a discrete valued variable Y Assume that the Bayes net is a directed graph X -> Y. The Bayes net is fully specified, in both cases, when P(X) and P(Y | X) are speci...
https://stats.stackexchange.com
12,423
[ "https://mathoverflow.net/questions/12423", "https://mathoverflow.net", "https://mathoverflow.net/users/3407/" ]
Is there a univariate probability distribution $p_{\lambda,\alpha}(\beta)$ over the reals, parameterized by $\lambda &gt; 0$ and $1 &gt;= \alpha &gt;= 0$, such that $p_{\lambda,\alpha} \propto \exp(-\lambda(\alpha \beta^{2} + (1 - \alpha)|\beta|)$? If so, is it a proper distribution (integrates to 1 over the real line)...
I don't know if that particular density has a name, but it is a valid exponential family density. The normalisation constant does not have a closed form expression, but with a bit of work you can write as a function of the cumulative Gaussian density, by noting that, since the density is symmetrical around 0: $\int{\ex...
So here's my attempt at the algebra to find the normalizing constant: $Z_{\lambda,\alpha} =\displaystyle\int \exp( -\lambda(\alpha x^2 + (1 - \alpha)|x| ) ) dx$ $ = 2 \displaystyle\int^{0}_{-\infty} \exp( -\lambda(\alpha x^2 + (1 - \alpha)x ) ) dx$ $ = 2 \displaystyle\int^{0}_{-\infty} \exp( -\lambda \alpha x^2 -\...
https://mathoverflow.net
180,432
[ "https://dba.stackexchange.com/questions/180432", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/130073/" ]
I have a problem parsing XML input. I get a string of all Authors while I only want the <em>distinct author</em> or <em>first value</em>. <pre><code>+----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------...
To get the first author of the first book, you can use <pre><code>select ExtractValue(xml_doc, '//book[1]//author[1]'); </code></pre> To get a real distinct list you would have to write a stored function that circles through all books and all authors.
You can try this. <pre><code>SELECT SUBSTRING_INDEX( ExtractValue( REPLACE(artists, '&lt;/author&gt;', '+&lt;/author&gt;'), '//author[1]' ), '+', 1 ) AS Author FROM music.catalogs ORDER BY author; </code></pre>
https://dba.stackexchange.com
214,946
[ "https://dba.stackexchange.com/questions/214946", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/135535/" ]
I need to delete the duplicate records in this table. However, there is no <code>id</code> for each row. <h3>Example Data</h3> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>product</th> <th style="text-align: right;">amount</th> <th style="text-align: right;">quantity</th> </tr> </thead> <tbo...
There is no any field combination which identifies the record uniqually. I see at least 2 different solutions. First solution: move unique records to a copy of table and replace original table. <pre><code>CREATE TABLE temp LIKE products; INSERT INTO temp SELECT DISTINCT * FROM products; DROP TABLE products; REN...
Apart from Akinas answer, You could delete both rows and then insert one. You should also really, really add a primary key to your table even if you don't need to for performance, specifically to avoid situaitons like this.
https://dba.stackexchange.com
642,921
[ "https://electronics.stackexchange.com/questions/642921", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/305610/" ]
I'm a bit confused on using Ohm's law so I'm going to ask about it using an example. I have a simple circuit with power provided by a generic DC power adapter and a 1 kΩ resistor. <img src="https://i.stack.imgur.com/BOhKZ.png" width="250"> <ol> <li>Say the adapter provides 1 A and I need to calculate the voltage afte...
<ol> <li>No. The current through the resistor and the current out of the adapter is one and the same current. </li> <li>Yes, but also no. Your R is 1k, not 1 ohm, so V = IR= 1 x 1k = 1000V. In order for your adapter to be pushing 1A through a 1k resistor it must also be capable of supplying 1000V. </li> <li>No. Just st...
<ol> <li>With a constant voltage supply, the voltage <strong>across</strong> the resistor will be the same as the supply voltage as long as the current is below the current limit threshold. If the current approaches the current limit threshold, the adapter will either go in to constant current mode and supply current a...
https://electronics.stackexchange.com
108,283
[ "https://electronics.stackexchange.com/questions/108283", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/40853/" ]
<img src="https://i.stack.imgur.com/Jy5qE.png" alt="enter image description here"> How does the red (rot) LED at the input to the base provide a constant current to the other two LED's after the collector, via the transistor? (I have been told that the NPN transistor here has a default voltage of 0.6v, and the red LED...
<blockquote> If I short-circuit one of the LED's, the brightness of the green (grun) and the yellow (gelb) LED does not fluctuate. What is happening when I do this? </blockquote> It's a constant current circuit (nearly) so shorting one of the LEDs out doesn't change the current (much) thru the other LED. This me...
The \$V_{BE}\$ of the transistor is about 0.6V, as you said. The rot LED has a \$V_F\$ of about 1.8V, so the voltage across the 470R resistor is about 1.2V. We can ignore the base current, since the BC547 typically has an \$h_{FE}\$ of several hundred. So, the collector current (which equals the LED current) is very cl...
https://electronics.stackexchange.com
1,960,445
[ "https://math.stackexchange.com/questions/1960445", "https://math.stackexchange.com", "https://math.stackexchange.com/users/376624/" ]
I need to integrate $\frac{x}{1+x^2}$ and I tried it like this: $$f(x)=\frac{x}{1+x^2}=\frac{x}{(x+1)(x-1)}=\frac{x+1-1}{(x+1)(x-1)}= \frac{x+1}{(x+1)(x-1)}-\frac{1}{(x+1)(x-1)}=\frac{1}{x-1}-\frac{1}{1+x^2}$$ After I simplified it I integrate it! $$\int{f(x)}=\int{\frac{1}{x-1}}-\int{\frac{1}{1+x^2}}$$ $\int{\frac{dx...
The mistake is at the very beginning: it is <em>not</em> true that $1+x^2 = (1-x)(1+x)$. What you thought about is $1\color{red} - x^2 = (1-x)(1+x)$. (Also, remember that the roots of $1+x^2$ are $\pm \Bbb i$, therefore your factorization is clearly wrong.) The exercise is much simpler if you notice that $x = \frac 1 ...
Hint: Use the substitution $$1+x^2=t \quad \rightarrow \quad 2xdx=dt$$
https://math.stackexchange.com
3,949,646
[ "https://math.stackexchange.com/questions/3949646", "https://math.stackexchange.com", "https://math.stackexchange.com/users/557549/" ]
I believe &quot;assertion&quot; and &quot;judgment&quot; mean the same thing (at least according to Per Martin Lof). I understand that they are meta statements (above that of say formal propositions). How, if at all, do these meanings differ from that of &quot;interpretation&quot;, which is also on top of a proposition...
Here is a counterexample where <span class="math-container">$A$</span> is nonsingular. Let <span class="math-container">$C=\pmatrix{0&amp;-1\\ 1&amp;-1}$</span> be the companion matrix of the characteristic polynomial <span class="math-container">$x^2+x+1=0$</span>. One can verify that <span class="math-container">$C$<...
Note: An upper triangular matrix is normal iff it is diagonal. This suggests <span class="math-container">$$\begin{pmatrix}0&amp;1&amp;0&amp;0\\0&amp;0&amp;1&amp;0\\0&amp;0&amp;0&amp;1\\0&amp;0&amp;0&amp;0\end{pmatrix}. $$</span>
https://math.stackexchange.com
696,111
[ "https://physics.stackexchange.com/questions/696111", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/274352/" ]
Since the norm of a wavefunction in relativistic quantum mechanics is defined as: <span class="math-container">$$|\psi|^2=i\int\left(\psi^*\frac{\partial \psi}{\partial t}-\frac{\partial \psi^*}{\partial t}\psi\right)dx$$</span> How is the expectation value of an operator defined? I tried searching online but didn't fi...
Yes, that is, in fact, the <strong>mathematically well defined</strong> norm of <strong>one-particle quantum states</strong> in relativistic quantum mechanics (and relativistic QFT) for scalar Klein-Gordon particles. However there is a substantial difference with respect to the non-relativistic case concerning the Hil...
Actually a scalar product which is required on a Hilbert space cannot be defined by the expression: <span class="math-container">$$\langle\psi,\phi\rangle = i \int\left(\psi^\ast \frac{\partial \phi}{\partial t} - \phi \frac{\partial \psi^\ast}{\partial t}\right) dx $$</span> since for being a scalar product one requi...
https://physics.stackexchange.com
178,149
[ "https://softwareengineering.stackexchange.com/questions/178149", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30483/" ]
I'm working on a software problem at work that is fairly generic, but I can't find a library I like to solve it, so I'm considering writing one myself (at least a bare-bones version). I'll be writing some if not all of the 1.0 version at work, since I need it for the project. If turns out well I might want to bring th...
It is almost never OK, legally or ethically, to release products that you have created using your employer's resources or while being payed by the employer for your time without permission. However, it depends on your employment contract. If you were paid by the company and/or used company resources to produce the pro...
<blockquote> If turns out well I might want to bring the work home and polish it up just for fun, and maybe release it as an open-source project. </blockquote> You should be crystal clear with your employer about your intentions at the outset. Come to an agreement about how that'll all work before you get started ...
https://softwareengineering.stackexchange.com
25,297
[ "https://electronics.stackexchange.com/questions/25297", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/7611/" ]
I have two Microcontrollers which communicate over a bluetooth link (serial link, like RN-42). So far so good. Unfortunately the device is listed as a class 2 device and I noticed that the distance is indeed very limited. Acoordingly I was wondering if it is somehow possible to mod the chip to act as a class 1 device....
You need a PA (power Amp) before that Antenna. Not an easy hack but possible, it will be illegal though. (you need to get a new FCC license for it) If you have an SMA connector, you can build a tiny board with a PA and give it a shot. PA2423 is an example of such power amplifier. The best way, replace the whole modu...
The only difference between a Class 2 and a Class 1 device is the power output of the antenna when licensed by the FCC. When looking at replacement modules, Bluetooth 4.0 (LE) solutions might provide the extra distance required for your application without the Class 1 designation.
https://electronics.stackexchange.com
53,189
[ "https://security.stackexchange.com/questions/53189", "https://security.stackexchange.com", "https://security.stackexchange.com/users/41838/" ]
I recently registered for a website and received an email that said "Thanks for registering, here's the username and password you used to sign up". The webmaster assures me that plaintext passwords are not stored in the database, but even if the plaintext is only kept long enough to send the email, that's still a bad ...
When a webmaster sends you a plaintext password, that usually implies that they do not hash passwords, which is a bad sign. But when the webmaster assured you that they do so right after they sent the confirmation mail, I would assume good faith and assume that they say the truth. Those few microseconds more during whi...
Sending a permanent password via email is not acceptable if you care about account security. However, if the web site isn't important to you (for example, a discussion forum), then it might not matter. <strong>What is the Password Protecting?</strong> Is the password intended to protect you and your information? ...
https://security.stackexchange.com
443,107
[ "https://stats.stackexchange.com/questions/443107", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/263820/" ]
Once I have derived the variance of <span class="math-container">$\hat{\beta_1}$</span> as: <span class="math-container">$\text{Var}(\hat{\beta_1})= \frac{\sigma^2}{\sum(x_i-\overline{x})^2}$</span> I would like to know how are affecting to this formula: <ul> <li>the size of the dataset <span class="math-container">...
Nick is technically right. But note that if you assume that you have a series of random samples from the underlying population, larger sample sizes (larger <span class="math-container">$n$</span>) cause <span class="math-container">$Var(\hat\beta)$</span> to decrease asymptotically. To see this, note that <span class=...
Just look at the formula. A larger <em>n</em> won't definitely make <span class="math-container">$Var(\hat{\beta}_1)$</span> increase or decrease. The variance only depends how spread out the data is from the mean. You could have a very large <em>n</em>, with data points that are close to <span class="math-container"...
https://stats.stackexchange.com
114,292
[ "https://datascience.stackexchange.com/questions/114292", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/140237/" ]
I have a CSV file (such as <em>test1.csv</em>). There are tabular values like the following. <pre><code>S1 S2 S3 4.6 3.2 2.1 3.2 4.3 5.4 1.4 3.4 6.1 </code></pre> I want to do mathematical operations, such as <code>R1=(S1+S2)/1.5</code> and <code>R2=(S2+S3)/2.5</code>. Then I want to save the ...
You did not define <code>df2</code> before attempting to use it. Try this: <pre><code>import pandas as pd df = pd.read_csv('test1.csv') df2 = pd.DataFrame({}) df2['R1'] = (df['S1'] + df['S2'])/1.5 df2['R2'] = (df['S2'] + df['S3'])/2.5 df2.to_csv('test2.csv') </code></pre>
You can an array to a dataframe and divide a dataframe by a list of values. <pre class="lang-py prettyprint-override"><code>df2 = (df[['S1','S2']] .add(df[['S2','S3']].values) .div([1.5, 2.5]) .set_axis(['R1', 'R2'], axis=1) ) df2.to_csv('test2.csv') </code></pre>
https://datascience.stackexchange.com
308,427
[ "https://softwareengineering.stackexchange.com/questions/308427", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/212809/" ]
I am not so experienced in client-server applications and I could not find exactly answer to my question anywhere in google. I am developing part of application on server side and my collegue who develops frontend suggest me that I should manipulate his payload rather then act as a service. I will explain it in examp...
A drag/drop UI typically encourages users to play around with the interface. You may not want to have every UI operation send data back to the server every time they interact with the interface. Depending on the specific interface it may not be an issue, but it's something to think about. What happens to the UI if the ...
If you value consistency then the service that stores the data should be the definitive 'master' source of what the data looks like. This means that the front end must defer to whatever the service says. Now that doesn't mean it cannot cache results, but it should not make assumptions about logic that may (or may not) ...
https://softwareengineering.stackexchange.com
9,174
[ "https://mechanics.stackexchange.com/questions/9174", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/4767/" ]
I'm having an issue with my 2001 Solara, and I would like to check out a few things myself before I have a mechanic spend lots of time diagnosing the problem. When the engine is under load -- I press hard on the gas pedal, or the car is in cruise and goes uphill -- the engine spikes from cruising power to 4-5000 RPM. ...
99% that your clutch is beginning to give out. If you get spikes like that under load, it basically means that your clutch plates aren't gripping together. Basically what is happening is that the engine can't grip the plate that moves the wheels, so I just slides along. If you get a funky-terrible smell, that is your...
If the RPM rises without a corresponding change in velocity in a vehicle with a manual transmission you've got a slipping clutch.
https://mechanics.stackexchange.com
180,129
[ "https://mathoverflow.net/questions/180129", "https://mathoverflow.net", "https://mathoverflow.net/users/53197/" ]
Let $K$ be a global field and set $O := \prod_{v\nmid \infty} O_v$ where $v$ runs over the finite places of $K$. Equip $\mathrm{GL}_n(O) = \prod_v \mathrm{GL}_n(O_v)$ with the product of the $v$-adic topologies and suppose that $H \le \mathrm{GL}_n(O)$ is a subgroup of finite index. <ol> <li>Is $H$ necessarily open? ...
The answer to 1 is no. For example each $GL_n(O_v)$ has a continuous map to $\{ \pm 1\}$ so your product has a quotient isomorphic to $F_2^{\mathbf{N}}$. Zorn's lemma will give you a non continuous linear form on that, and the pullback of the quotient is a non closed subgroup of index $2$. Edit: the pullback of the k...
In view of Laurent's answer, one may ask more generally for a criterion on a connected reductive $K$-group $G$ to ensure that for all compact open subgroups $U$ of $G(\mathbf{A}_K^S)$ (for a finite set $S$ of places of $K$ containing the arch. places) the finite-index subgroups of $U$ are necessarily open. If $G$ admi...
https://mathoverflow.net
176,328
[ "https://dba.stackexchange.com/questions/176328", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/126801/" ]
I'm searching how to do this and can't find it. Here's my query: <pre><code>SELECT S_Product.Name AS "Name" SUM(S_Item.Quantity) AS "QtySold" FROM s_product INNER JOIN S_Item ON S_Product.ID = S_Item.Product_ID WHERE "QtySold" &gt; 500 --(SUM(S_Item.Quantity)) cannot be used in a WHERE statement since it's a...
The answer is to put any testing of aggregations in to a <code>HAVING</code> clause: <pre><code>SELECT S_Product.Name AS "Name" SUM(S_Item.Quantity) AS "QtySold" FROM s_product INNER JOIN S_Item ON S_Product.ID = S_Item.Product_ID GROUP BY S_Product.Name HAVING SUM(S_Item.Quantity) &gt; 500 ; </code></pre>
Depending on what your SQL server can do, there are other ways to use a query result in a condition of another query, such as. <pre><code>SELECT * FROM Orders WHERE CustomerID IN ( SELECT CustomerID FROM Customers WHERE ExpressDelivery = 1 ) ; SELECT SomeSubQuery.column1 FROM ( SELECT SUM(Quantity) AS colu...
https://dba.stackexchange.com
311,378
[ "https://softwareengineering.stackexchange.com/questions/311378", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/218463/" ]
I have the task to migrate a large silverlight business application in a new living technology. I had choosed asp.net MVC and web api. As we know, silverlight uses MVVM design pattern whereas asp.net mvc is obviously using MVC pattern.It looks like migrating silverlight logic to mvc wouldn't be easy at all. As I kno...
Your basic problem is that the client technologies are fundamentally different - one of the key drivers for the evolution of Silverlight was to put "rich" client capabilities into the browser. What this means in practical terms is that the interactive nature of a rich client app is not available in a simple MVC app gi...
We faced a smimilar problem with our client - while raw MVC.NET is a good tool, it is considerably different from our old silverlight client - especially worrisome was that most of our developers are not really familiar with Javascript, inviting poor performance and compatibillity problems. In the end, we decided to go...
https://softwareengineering.stackexchange.com
89,029
[ "https://physics.stackexchange.com/questions/89029", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/23816/" ]
I'm currently taking a Solid State Physics class, and is currently reading about the quantum mechanical description of solids. I then came across the following figure: <img src="https://i.stack.imgur.com/9ydGp.png" alt="Band structure for Al"> It's supposed to be the band structure for aluminium. My question is basi...
As you have already stated, the polyeder in the upper part of the figure is plotted in 3D k-space and visualizes the first Brillouin zone. The dotted line nicely visualizes a closed (one-dimensional) path in k-space that -- by convention -- runs through the special points you already mentioned. Now, this <strong><em>cl...
To fully present the dispersion relation E(k) needs a 4D space, which cannot be intuitive. Instead, we can use a 2D band diagram to show the most important features (along high-symmetry directions) of the band structure. Another way is to give the constant-E isosurfaces, such as Fermi surface. Many such isosurfaces wil...
https://physics.stackexchange.com
73,096
[ "https://security.stackexchange.com/questions/73096", "https://security.stackexchange.com", "https://security.stackexchange.com/users/39779/" ]
I was wondering if such practice would be safe: <ul> <li>I have a table that stores encrypted notes</li> <li>Every note has a data field and a password field</li> <li>When a password is entered, i want to select all notes, encrypted with that password</li> <li>For this purpose, i need to safely store the password next...
A relatively user-friendly way of mitigating brute-force attacks is delaying the minimum time between attempts. The first time your user enters wrong credentials, you let him wait 1 second before he can try again. The second time, you let him wait 2 seconds. The 3rd time, you make him wait 4 seconds. 4th time, 8 second...
A good compromise between user experience and security would be to have IP-based captchas that trigger after a few failed logins from a particular IP, regardless of username. <ul> <li>This approach isn't vulnerable to DoS attacks against a single user by bruteforcing his account until the backoff time reaches several ...
https://security.stackexchange.com
746,070
[ "https://physics.stackexchange.com/questions/746070", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/105541/" ]
Where <span class="math-container">$\alpha_i= \left( \begin{matrix} 0 &amp; \sigma_i \\ \sigma_i &amp; 0 \end{matrix} \right)$</span>. To me it should just be <span class="math-container">$( \alpha_i r_i) (\alpha_j r_j ) = \alpha_i \alpha_j r_i r_j$</span>, but it is not. Why the difference?
the direction of electron spin is of great significance. For example, to fit two electrons into a electron orbital surrounding an atom, their spins must be pointing in opposite directions. In this sense, electron spin is at least partly responsible for the structure of the periodic table and for the manner in which che...
Electron spin is proportional to the magnetic dipole moment produced by an electron that is not traveling. This acts very much like the dipole moment of a current traveling through a circle of wire. The magnitude of the spin vector is set, but it can be in any direction. When you measure a component, any component, o...
https://physics.stackexchange.com
162,957
[ "https://security.stackexchange.com/questions/162957", "https://security.stackexchange.com", "https://security.stackexchange.com/users/59883/" ]
I'm not sure this is the right place, but figured people would find it useful if they aren't too familiar with security policies and general best practices. There is a lot of information out there, however, we all know that you can't completely lock down a system because people need access to various outside sources....
I think one of the main lessons learned is that the security services shouldn’t be hoarding zero days and tools to exploit them, (especially) if they can’t properly secure them. The thing to remember, however, is that WannaCrypt and Petya both had patches available before they hit and both also took advantage of poor ...
One lesson that came up before is that authorities should not be hoarding vulnerabilities for their own purposes. Through extended non-disclosure they were putting companies and individuals at risk instead of making them more secure. Even if the EternalBlue exploit would not have been leaked and used by WannaCry and Pe...
https://security.stackexchange.com
76,886
[ "https://softwareengineering.stackexchange.com/questions/76886", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/25437/" ]
I just noticed something and I wonder if there is any reason for that. Except for C++ (std::priority_queue is a max heap), I don't know any other language that offers a max heap. <blockquote> Python's heapq module implements a binary min-heap on top of a list. Java's library contains a PriorityQueue class, ...
As others have observed, if the heap accepts a comparator, then it's not too hard to get one behavior or the other. A quick perusal of Google Code, however, suggests that min-heap is by far more prevalent in actual code, because of two applications that come up again and again. <ul> <li>Dijkstra/A*/many other shortest...
It is just a matter of taste. I don't think there will be any specific reason. It's just like some people like to express optimizing problems as minimizing cost, while others like say maximizing profit.
https://softwareengineering.stackexchange.com
507,429
[ "https://electronics.stackexchange.com/questions/507429", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/146461/" ]
If LiPo batteries shouldn't be discharged below 3V, then how are we able to discharge the LIPo phone battery to almost zero, recharge it, and the battery still works?
This depends on the battery of course. Some batteries have protection circuits, some don't, some have short circuit protection, some expect it to be implemented on the device side (or drop it completely altogether). We're talking about common Li-Po in consumer electronics. For clarity. Yes, you can discharge some batte...
<blockquote> How are we able to discharge the LIPo phone battery to almost zero, </blockquote> We are <em>not</em> able to do that. The battery itself, but also the phone, has circuitry and software that shut down the phone before you deep-discharge the battery.
https://electronics.stackexchange.com
135,240
[ "https://dba.stackexchange.com/questions/135240", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/72319/" ]
I am deploy a monodb sharding, I have deploy a replica set in three machines: <pre><code>dev41:27017,dev42:27017,dev193:27017 </code></pre> and <code>configsvr</code> in three machine: <pre><code>dev41:27019,dev42:27019,dev193:27019 </code></pre> and also a mongos in machine: <pre><code>dev41:28000 </code></pre> ...
I faced the same issue then looked into Mongos log file and it was saying <blockquote> can't authenticate to hostname as internal user, error: Authentication failed. </blockquote> Please see here: internal user authentication and happens with SecKey file and auth- Enabled. <h3>Resolution</h3> I opened <em>mongod.conf</...
I had this same issue, and found out that I simply had the name of the replica set wrong in the addShard command.
https://dba.stackexchange.com
490,669
[ "https://physics.stackexchange.com/questions/490669", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/214702/" ]
If a variable Electric field creates a variable magnetic field and VICE VERSA (according to Maxwell's equations), then why don't we enter a loop where E vector and B vector keep creating one another until they reach infinite magnitudes?
The fields are vectors with (signed) direction. In a wave, the <span class="math-container">$\mathbf{B}$</span> field "creates" <span class="math-container">$\mathbf{E}$</span> field components, but they are, at some times at least, opposite to the currently present <span class="math-container">$\mathbf{E}$</span> fie...
Ah, this was actually the great insight of Maxwell. What you are referring to is electromagnetic waves (i.e. light). These waves are just the electric and magnetic field continuously generating each other. Unlike what you may intuit though, looking at the actual mathematical solutions that yield such behavior shows tha...
https://physics.stackexchange.com
150,947
[ "https://physics.stackexchange.com/questions/150947", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/66189/" ]
I was trying to derive $I = F\Delta T$ from $p = mv$. First I converted $v = at$: $$\begin{align} p &amp;= mv \\ p &amp;= m \times at \\ p &amp;= ma \times t \\ p &amp;= Ft \\ \Delta p &amp;= F \times \Delta t \\ I &amp;= F\Delta t \end{align}$$ which seemed to work. Then I tried $v = \text{displacement}/t$: $$\beg...
The first part of your working is fine, though it could be clarified a bit. Impulse is equal to change of momentum, so if the momentum changes from $p_1$ to $p_2$ then: $$ I = p_2 - p_1 = mv_2 - mv_1 = m(v_2 - v_1) $$ If the acceleration $a$ is constant for a time $t$ then we can use the SUVAT equation: $$ v_2 = v_1...
$$I =F t \implies I = mv-mu = m(v-u)$$ where $I$ is the impulse due to force.
https://physics.stackexchange.com
3,576,420
[ "https://math.stackexchange.com/questions/3576420", "https://math.stackexchange.com", "https://math.stackexchange.com/users/719444/" ]
There's this problem I encountered in a math Olympiad for my country. Find the remainder when <span class="math-container">$2^{55}+1$</span> is divided by <span class="math-container">$33$</span>. My approach was to consider <span class="math-container">$2^{55}$</span> as the sum of numbers in the 56th row of Pasca...
Using binomial theorem <span class="math-container">$$2^{55}= 32^{11} = (33-1)^{11} = $$</span><span class="math-container">$${11\choose 0}33^{11}-{11\choose 1}33^{10}+...+{11\choose 10}33-1=$$</span> <span class="math-container">$$ =33\underbrace{(\dots )}_{\in\mathbb{Z}}-1$$</span> So the remainder is <span class=...
I think you will find for example that <span class="math-container">${55 \choose 11}$</span> and <span class="math-container">${55 \choose 22}$</span> are not multiples of <span class="math-container">$33$</span>. Instead <ul> <li><span class="math-container">$2^5=32\equiv -1 \pmod {33}$</span></li> <li><span class="...
https://math.stackexchange.com
280,977
[ "https://physics.stackexchange.com/questions/280977", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/130560/" ]
There are four positive charges of equal magnitude placed at the four vertices of a square. Is there any point where the electric field vanishes (neutral point) within the square and in its plane, other than its center?
I believe there is such a point. Let us assume that unit charges are located in points <span class="math-container">$[\pm 1,\pm 1]$</span> of a plane with coordinates <span class="math-container">$x,y$</span>. Let us consider the field on the abscissa (<span class="math-container">$y=0$</span>). The <span class="math...
There are four extra points within the square where field vanishes. Try to solve for such a point, you may want to solve it numerically.
https://physics.stackexchange.com
168,550
[ "https://dba.stackexchange.com/questions/168550", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/120762/" ]
I have been working on index fragmentation for indexes that are heavily used and causing performance decreases. Our standard job checks fragmentation levels and reorgs if >5% and &lt;30%, and rebuilds if >30%. As far as I have found these don't seem to be functionally different but I'm being asked if a drop/create is m...
From Microsoft SQL Server 2012 Internals, page 366 <blockquote> You can completely rebuild an index in several ways. You can use a simple combinination of DROP INDEX followed by CREATE INDEX, but this method is probably the least preferable. </blockquote> But appeals to authority are boring, so let's test it oursel...
In addition to other points. BTW, how do you find <blockquote> indexes that are heavily used </blockquote> ? One of the ways I know is querying <code>sys.dm_db_index_usage_stats</code>. And regarding this system DMV the following should be mentioned: <ul> <li>when you do <code>DROP INDEX</code> and then <code>CR...
https://dba.stackexchange.com
193,507
[ "https://softwareengineering.stackexchange.com/questions/193507", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/33490/" ]
Is the following guaranteed to return true for all numerical and non-zero values of <code>x</code>? <pre><code>bool IsRoundTrip(double x) { double y = 1 / (1 / x); return x == y; } </code></pre> What conditions would cause a discrepency?
To simplify things by defining a concrete implementation, I will assume (as other answers do) that we're talking about IEEE 754 64-bit floating point. Each floating point number has three parts: a sign, an exponent, and a mantissa. (Technical details about hidden bits are irrelevant to this discussion). Reciprocation...
No. As a counterexample, <code>1/(1/49)</code> works out to 49.00000000000000710542735760100185871124267578125 on my machine. <hr> For a more abstract argument, let N be the number of representable floating-point numbers in the interval [1, 2). (In IEEE 754 double-precision, N happens to be 2^52) There is a trivial...
https://softwareengineering.stackexchange.com
38,425
[ "https://quant.stackexchange.com/questions/38425", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/11723/" ]
From a Barclays primer on dividend swaps: <blockquote> We note that for shorter periods of time, implied dividends can be more volatile than spot as dividends often trade away from fundamental value for technical reasons (as the structured products sellers become longer implied dividend...
The paper is generally correct, but it is not a general statement, as in a general truth of options hedging in a theoretical context, rather a statement regarding how the structured derivs market is typically set up: retail and institutional investors buy a large number of products that at their core entail the dealer ...
To add to the above on a more practical note: In general, SP desks make money on the individual product when the underlying declines. Dividends make the underlying decline, hence they are naturally long dividends. Take an auto-callable product which is exercised if the spot is above a pre-determined strike each yea...
https://quant.stackexchange.com
51,203
[ "https://dba.stackexchange.com/questions/51203", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/16673/" ]
Say that I have a web application that lets users to type in a SQL query (SQL Server 2008+). I want users to be able to run any SELECT query and read whatever is in the database, but I do not want them to be able to insert/update/drop/truncate/exec etc. (in short: only select). Please note that there are no data or eve...
Make sure the application connects to the server using a login that has been given only read permissions (give it the db_datareader role in the database to allow reading all tables), and you should be in good shape. The easiest way to prevent changing data is to ensure the user doesn't have permission to change anythin...
If direct SQL is going to be allowed, you really have to use a separate login for it if the main application connection is read/write. Not only should this login have restricted permissions as @db2 mentioned, but doing this also allows you to do things like better-manage the resources (Resource Governor) being used by...
https://dba.stackexchange.com
504,559
[ "https://physics.stackexchange.com/questions/504559", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/243223/" ]
Suppose the acceleration of a particle is a function of <span class="math-container">$x$</span>, where <span class="math-container">$$a(x) = (2.2 s^{-2})x$$</span> (a) If the velocity is zero when x = 1.0 m, what is the speed when x = 3.4 m? (b) How long does it take the particle to travel from x = 1.0 m to x = 3.4 ...
Substitute <span class="math-container">$a$</span> as <span class="math-container">$v {dv\over dx}$</span>. You can then take <span class="math-container">$dx$</span> to the other side and integrate to get velocity in terms of x. As we know <span class="math-container">$v=0$</span> when <span class="math-container">$x=...
Consider that the work done is converted into kinetic energy <span class="math-container">$$ \frac{1}{2} m v^2 = \int F {\rm d}x $$</span> where <span class="math-container">$F = m a$</span>. <span class="math-container">$$ \frac{1}{2} v^2 = \int a\,{\rm d}x $$</span> You go from there...
https://physics.stackexchange.com
72,819
[ "https://stats.stackexchange.com/questions/72819", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/5829/" ]
<em><strong>TL, DR summary:</strong></em> Is there any theoretical or empirical basis to support the following statement being true as a general rule of thumb? &quot;When estimating a mixed model, typically the estimated variances/standard deviations of random effects associated with 'higher-order' terms (e.g., random ...
I have discovered that the regularity I described in my question has in fact been written about by several authors in the literature on Design of Experiments (DoE). It has been called the "hierarchical ordering principle" and also sometimes the "sparsity-of-effects principle." In the chapter on fractional factorial de...
<blockquote> Blockquote </blockquote> In general, I agree with the original hypotheses that higher-order terms are often associated with smaller variances. But, this also depends on the type of data. In plant breeding, a rule of thumb (Gauch, 1996, page 90) for multi-environment trials is that the variation in the...
https://stats.stackexchange.com
20,167
[ "https://dsp.stackexchange.com/questions/20167", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/7226/" ]
I have a small team project: use Matlab implement a Gui 5-band digital equalizer using FIR and IIR filters (2 cases) - The sample rate of all audio files is standard audio 44.1kHz. Coding is not my concern, however, I have 2 questions (1) What are 5 center frequencies that I should choose ? I saw a homework problems s...
The answer may depend on your application. I suggest you look at some commercial audio equipments with EQs to decide for those band frequencies. For example the old analog philips casette-type stereo system in my room has 5 band graph equalizers with the frequencies: [100-300-1000-4000-10000] Hz respectively. I use it ...
5 bands ain't alot for a graphic equalizer. there are 10 octaves in our hearing range, so they might be spaced apart by two octaves, if their resonant frequencies were fixed. maybe by one octave with the three middle bands as peak/cut EQ and the top and bottom band as shelf EQ, both covering over 3 octaves. it would...
https://dsp.stackexchange.com
184,602
[ "https://stats.stackexchange.com/questions/184602", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/12147/" ]
I start to work with ensembe methods these days focusing on stacking. I am wondering whether to us each models class probability ( real number in $[0,1]$) or the classifcation itself (in the binary case an integer in $\{0,1\}$) as input. In my feeling the probabilites are more natural as it is a difference if I classi...
What you're asking is the difference between <strong>voting</strong> (using classifications) and <strong>averaging</strong> (using probabilities), and as far as things go, it's up to preference and/or performance. Try both and see what works best, and if there is not a significant difference, pick one that you feel bet...
The answer by mttk is quite nice. I will just add that you could also extract the probabilities and use them as input to a meta-classifier such as a simple logistic regression. This will automatically adjust for differences in the way classifiers produce probability estimates (i.e. classifier A almost exclusively produ...
https://stats.stackexchange.com
140,603
[ "https://softwareengineering.stackexchange.com/questions/140603", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/24589/" ]
I'm developing an xbox indie game and as a last-resort I have a <code>try...catch</code> encompassing everything. At this point if an exception is raised I can get the user to send me a message through the xbox however the limit is 250 characters. <strong>How can I get the most value out of my 250 characters?</strong...
You can probably reduce the size a bit more if you consider the difference between framework and user code - when an exception occurs deep in the framework code, you get a long stack trace but all you actually care about is the first line with the actual error, and the line about halfway down where your own code calls ...
In embedded development, the error reports are limited to few integers. The best to do is to report the exact location of the error and the actual value that triggered the error (together with the expected value if it is not hardcoded). It is essential to trigger the error as soon as possible.
https://softwareengineering.stackexchange.com
55,162
[ "https://electronics.stackexchange.com/questions/55162", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/10660/" ]
On a number of projects I'm building, there's a transformer between wall power and device power. In the parts lists, the transformers are usually designated by "12v secondary transformer" or "18v 4a Secondary Transformer". Because the flow goes from wall power through the transformer and then to a rectifier, I assume ...
Others have straightened you out on the "12V secondary" part. As far as substituting a DC adapter (wall wart or laptop PSU) for the transformer; this will generally be safe, but a couple of points to note will help avoid surprises : 1) If the project is driving motors, remember that motors are nasty loads that can gen...
The phrase can also be written as "A transformer with the secondary voltage being 12V" - meaning it's primary is rated for 110V and it will put out 12V. Yes, you can replace the transformer with a wall wart - but keep in mind that safety ratings can be different so intended use must come into play.
https://electronics.stackexchange.com