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
312,768
[ "https://mathoverflow.net/questions/312768", "https://mathoverflow.net", "https://mathoverflow.net/users/101308/" ]
I'm following Gilmore's recipe to compute the abstract Casimir operator of a given algebra (in this example, I refer to algebra su(2)). This recipe bring up a matrix representation of the algebra and my problem is that I obtain different results according to the specific matrix representation that I choose. To be more ...
For infinite (locally finite) graphs it is not true in general that the dimension of the kernel of the Laplacian is the number of connected components. The simplest example to have in mind is the standard graph structure on <span class="math-container">$\mathbb{Z}$</span>, which is connected, where the kernel of the L...
As Uri Bader points out, the infinite tree has an infinitely dimensional space of harmonic functions, so this is an answer to the philosophical part of the question: The way you prove that all harmonic functions on a finite graph are constant is by using a maximum principle (the value of a function at a vertex is the a...
https://mathoverflow.net
713,759
[ "https://physics.stackexchange.com/questions/713759", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/336695/" ]
I tried using spherical coordinates, the wavefunction for the hydrogen atom and the Laplacian in spherical coordinates but I just ended up with a very long integral and I don't know what to do next. I don't know how to write math formulas here to show what I got.
It’s a little weird that your textbook discusses intermolecular and internucleon potential energies, but leaves out electron-nucleus interactions. At ordinary temperatures, the nuclear degrees of freedom are completely frozen out; as temperatures increase, the electronic excitations become accessible long before the nu...
It depends on your point of view. We say that a spring stores potential energy. In microscopic models, part of that is electrostatic, but part is due to &quot;Pauli force&quot; between electrons. However, in quantum field theory, Pauli force isn't a force and doesn't have a potential. Instead, it's associated with incr...
https://physics.stackexchange.com
9,265
[ "https://dba.stackexchange.com/questions/9265", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/5142/" ]
Why do I need to have a primary key on my database for it to function correctly? In every tutorial I read, you need to make the id key the primary key. What does the primary key do differently than the regular cells?
Keys are for identification and data integrity. A key defines how tuples (rows) in a table can be uniquely identified. The integrity of keys is assured because the DBMS prevents users from entering duplicate information into the table. Database users can therefore rely on the keys to identify in the real world the thin...
You allude to tutorials but provide no example. Consider the following two tables that have what I understand to be an "id key" (noting the question has the <code>auto-increment</code> tag) and similar to many found in the wild: <pre><code>CREATE TABLE Books1 ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, isbn C...
https://dba.stackexchange.com
247,247
[ "https://math.stackexchange.com/questions/247247", "https://math.stackexchange.com", "https://math.stackexchange.com/users/23371/" ]
The first thing I was told about the real derivative is that it's "how fast the function is growing" at a given point. This interpretation wasn't addressed in my complex analysis classes. Can the complex derivative also be interpreted as "speed"? And how do we interpret zeros of the complex derivative? With the real d...
The real secret here is that the real derivative is the <em>best linear approximation.</em> If $f:\mathbb{R}\to\mathbb{R}$, here's what the derivative means: if you zoom in really close to a point $x_0$, then $f(x)$ looks very much like the linear function $f(x_0) + f'(x_0)(x-x_0)$. This is why we can think of the re...
Working over $\mathbb{R}$, you can say things like "if the derivative of $f$ is <em>positive</em>, then $f$ is <em>increasing</em>." Note that both the words <em>positive</em> and <em>increasing</em> only make sense because $\mathbb{R}$ is an ordered field. You really need the order to make sense of such things. For th...
https://math.stackexchange.com
318,186
[ "https://physics.stackexchange.com/questions/318186", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/148293/" ]
The question is quite simple. Can diffusion current occur in conductors like they're found PN-junction semiconductors due to concentration gradient? I need to see a rigorous description. Is there any example or any possibility of diffusion taking place in a conductor? Thanks for your time.
Yes, of course diffusion currents (charge moving from higher concentration to lower concentration) can occur in metals. There are also contact potentials (charge redistribution from metals with a high Fermi energy to those with a lower Fermi energy). The balance of these currents is temperature-sensitive, which giv...
I'm just studying semiconductors, from a book by Streetman and Banerjee, the book explains the diffusion process very clearly: "When a bottle of perfume is opened in one corner of a closed room, the scent is soon detected throughout the room. If there's no convection or net motion of air, the scent spreads by diffusi...
https://physics.stackexchange.com
222,184
[ "https://security.stackexchange.com/questions/222184", "https://security.stackexchange.com", "https://security.stackexchange.com/users/31444/" ]
I want to sign webhooks so that client services can verify that a request came from my service. Looking around, it seems that most SaaS use symmetric keys shared by the client and the SaaS. Obviously, there's an overhead of generating and storing a unique secret for each client here. It seems to me like asymmetric cr...
If the only port forwarded to the server is the port used by the game, you are fine. You can protect even Windows 95 with the correct measures. If you block everything but the game server, not use the computer for anything else but host the game (no browsing, no email, no running random programs), it will be reasonabl...
Even with port forwarding, you do not want to expose your filesystem to attackers as it might be possible to use your hacked server as a pivot for lateral privilege escalation through the router into your home server. It depends on your router's configuration/model too. I strongly suggest that you run the game from a...
https://security.stackexchange.com
26,258
[ "https://scicomp.stackexchange.com/questions/26258", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/23387/" ]
Right now I stuck with a problem. It seems to be really trivial one, but still it is hard for me to find an appropriate solution. The problem is: One has two intervals and are to find the intersection of them. For instance: <ul> <li>Intersection of <strong>[0, 3]&amp;[2, 4]</strong> is <em>[2, 3]</em></li> <li>Inters...
We can define a solution to this problem in the following way. Assume the input intervals can be defined as $I_{a} = [a_s, a_e]$ and $I_{b} = [b_s, b_e]$, while the output interval is defined as $I_{o} = [o_s, o_e]$. We can find the intersection $I_{o} = I_{a} \bigcap I_{b}$ doing the following: <strong>if</strong> ( ...
Assume we only have two input intervals. <ol> <li>Make sure the start time of the first interval &lt; the start time of the second interval.</li> <li>Overlap means an interval's end time is after another interval's start time</li> </ol> <pre><code>public int[] overlap(int[] i1, int[] i2) { // Make sure the start ...
https://scicomp.stackexchange.com
538,601
[ "https://electronics.stackexchange.com/questions/538601", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/263514/" ]
Length matching is performed mainly to avoid the skew generated among the parallel data lines/data bus width. All the high speed PCB design guideline suggest performing length matching with the clock trace length as the target length and trace length tolerance of the data, address, command lines has to be maintained wi...
Data is sent in respect to the clock signal. Data has to be stable before the clock edge (setup time) and it has to be stable after the clock edge (hold time). If the clock wiring is too long compared to data, clock will appear too late to be within hold time specs, and if data wiring is too long compared to clock, clo...
Every single signal is observed in relation to the clock; i.e. what matters for the receiver to &quot;sample&quot; all the parallel signals at exactly the right point in time, +- the allowable skew. Example: Say, we have a bus where the allowable skew is +-50 ps, so that the receiver still gets the signals close to the...
https://electronics.stackexchange.com
269,699
[ "https://dba.stackexchange.com/questions/269699", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/210396/" ]
I wanted to create a role called &quot;user_updates&quot; and this role should have the rights &quot;table_note_updates&quot;. The rights called &quot;table_note_updates&quot; is already available in my database. How to grant the rights to role that i create.
A role can be granted to another role. <pre><code>create role user_updates; grant table_note_updates to user_updates; </code></pre>
<pre><code>create role user_updates; grant table_note_updates to user_updates; </code></pre> <em><strong>Grant created role to user.</strong></em><br/> <pre><code>grant user_updates to myuser; </code></pre>
https://dba.stackexchange.com
35,475
[ "https://dsp.stackexchange.com/questions/35475", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/24164/" ]
As I know the Fourier transform of $\delta(t)$ is equal to $1$, on the other hand, shift with $a$ in time domain is equal to multiplying with $e^{-jaw}$ so the Fourier transform of $\delta(t-a)$ is equal to $e^{-jaw}$, but on the other hand the Fourier transform of Dirac comb ($\sum_{n=-\infty}^{+\infty}\delta(t-nT)$wh...
Maybe this way it is simpler to understand: $$1-1.6z^{-1}+0.8z^{-2}=\frac{z^2-1.6z+0.8}{z^2}$$ Hence, $$\frac{2-3z^{-1}}{1-1.6z^{-1}+0.8z^{-2}}=\frac{2-3z^{-1}}{\frac{z^2-1.6z+0.8}{z^2}}=\frac{z^2(2-3z^{-1})}{z^2-1.6z+0.8}$$ whose numerator is $2z^2-3z$.
You cannot multiply nominator and denominator by a different power of z. Instead, you have two treat nominator and demoninator equally. $$ H(z) = \frac{2-3z^{-1}}{1-1.6z^{-1}-0.8z^{-2}}=\frac{z(2z-3)}{z^2-1.6z-0.8} $$ Now, you can see that the nominator has 2 zeros, the denominator also.
https://dsp.stackexchange.com
105,934
[ "https://physics.stackexchange.com/questions/105934", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/43574/" ]
I have measured the spectrum of the LED in my interferometry set-up, and now I want to calculate the coherence length from it. A commonly found formula is $l_{coh} = \frac{c}{\Delta f}$, sometimes with an additional factor for the shape of the spectrum. However, I have only ever found factors for Gaussian and Lorentzia...
Presumably you have measured your spectrum as a function of wavelength, so you have $\mathscr{F}(\lambda)$, which is an power per unit wavelength. You must now convert this power per unit frequency spectrum. So we seek $\mathscr{G}(f)$ where $\mathscr{G}(f)\,|df| = \mathscr{F}(\lambda)\,|d\lambda|$; given $c = f\,\lam...
A detector generally provides values that are proportional to the power spectral density (PSD) of the radiation hitting it. Energy per time interval (collection time), per spectral interval (pass band, slit width, pixel width, ...). The Fourier transform of the PSD is the time-domain autocorrelation function of the r...
https://physics.stackexchange.com
30,001
[ "https://physics.stackexchange.com/questions/30001", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/7993/" ]
The three laws are: First law: The velocity of a body remains constant unless the body is acted upon by an external force. Second law: The acceleration a of a body is parallel[disambiguation needed ] and directly proportional to the net force F and inversely proportional to the mass m, i.e., F = ma. Third law: The m...
The first and second laws are not original to Newton, since we know Hooke deduced that gravity must be an inverse square centripetal force in the 1670s without input from Newton. The calculations of centripetal force were then current, and the first and second law naturally follow from Galileo's work on falling bodies....
Descartes, gave a correct version of the first law (the law of inertia), justified by the constancy of the purposes of God. Galileo (much cited, I believe, as an early proponent of the law of inertia), seems to have been claiming that a body's natural motion is in a circle at constant speed. As far as I know, Newton ...
https://physics.stackexchange.com
14,255
[ "https://security.stackexchange.com/questions/14255", "https://security.stackexchange.com", "https://security.stackexchange.com/users/9402/" ]
I've got virus which tells that all data will be deleted after 12 hours. I cleaned autorun and now scaning my computer with anti-virus, but still is this message just to scary people or is this virus installed something, that will delete data or simply run "format c:" after time passed? This thing looks like message b...
The user part of the registry(<code>HKey_Current_User</code>) is writable by unprivileged applications. <br/> The machine part of the registry (<code>HKey_Local_Machine</code>) is only writable by privileged programs.<br/> <em>Some subkeys might require different permissions, but this is true for most keys</em> To cha...
There are sections of the registry where users can write. This is it related to the ability to launch ResEdit itself. So the virus is writing there.
https://security.stackexchange.com
282,250
[ "https://dba.stackexchange.com/questions/282250", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/218976/" ]
We have a database named WSS_Us_App in our Production SQL Server 2014. In this database all of the indexes need to be rebuilt as most have a fragmentation level greater than 50%. I plan to rebuild these indexes during business hours as I was told that there will not be a problem and would not cause any major issues. I ...
Using the below sql, I managed to give exactly what I am looking for. I used the number 6346 to display the output populating hours, minutes and seconds. Query used: <pre><code>select lpad(floor(6346 / 60 / 60),2,'0') || ':' || lpad(mod(6346/60, 60), 2, '0') || ':' || lpad(mod(6346,60), 2, '0') as run_duration_time fro...
Here: <pre><code>&gt; select (1449.448520410 units second)::interval hour(2) to second; (constant) 0:24:09 1 row(s) retrieved. </code></pre>
https://dba.stackexchange.com
396,767
[ "https://physics.stackexchange.com/questions/396767", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/129433/" ]
Light will travel forever in a vacuum. What about light in a medium? Does it travel forever too, but at a slower rate. Let’s say I run a fiber optic cable across the universe. I know it will travel slower in the cable, but will it eventually stop, or will it continue across the universe?
Even the best optical fiber has some attenuation. The very popular SMF-28 type, for example, has a maximum attenuation of 0.18 dB/km at 1550 nm, which is the optimum wavelength for attenuation. That means that after a mere 1000 km, the power that entered the fiber will be reduced by 180 dB. If you started with 1 W, y...
In a perfect, isotropic homogeneous etc. medium yes it will travel forever. In a real medium, like an actual fiber optic cable there will be imperfections which absorb and refract the light. Eventually all of the photons will have been absorbed and there won't be a light signal any more. The light hasn't "stopped", as ...
https://physics.stackexchange.com
627,548
[ "https://physics.stackexchange.com/questions/627548", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/64793/" ]
I've heard that relativistic mass can influence gravity, but this seems to create a paradox, unless I am missing something. It seems to me that if there were two celestial bodies that are observed to be moving along approximately parallel trajectories at a relativistic speed, wouldn't the gravitational force between th...
The answer is that &quot;relativistic mass&quot; does not produce gravity in the Newtonian sense. Newtonian gravity breaks down in the realm where velocities are relativistic, and you have to use general relativity to determine the answer. In GR gravity (i.e. curvature of spacetime) is produced by the stress-energy ten...
The gravitational effect arising from a particular volume of space is proportional to (among other things) the energy <em>density</em> in that volume of space. In the case of a spinning flywheel the rotational kinetic energy and the stress of having to provide centripetal force is <em>confined</em> to a finite volume o...
https://physics.stackexchange.com
19,547
[ "https://mathoverflow.net/questions/19547", "https://mathoverflow.net", "https://mathoverflow.net/users/2384/" ]
Say we have three infinite sequences $\{a_i\},\{b_i\},\{c_i\}$ of natural numbers, satisfying the equations $$a_1+b_1=c_1,\dots, a_n+b_n=c_n,\dots $$ Assume further that $gcd(a_i,b_i,c_i)=1$ for each $i$ and that $(a_i,b_i,c_i)\neq (a_j,b_j,c_j)$ for all $i,j$. Now let's define $S$ as the set of primes $p$ which divide...
Yes, in fact, you can make $S$ grow as slowly as you like. This follows, for example, from the fact that there exist 3-term arithmetic progressions of primes $(p,q,r)$ with $\min(p,q,r)$ arbitrarily large. For each such arithmetic progression, you can take $(a_i,b_i,c_i)=(p,r,2q)$. Now just choose these arithmetic p...
Alternatively, every prime dividing $2^{2^k}+1$ must be 1 mod $2^k$, hence must be at least $2^k$. So if you take your triples of the form $(1,2^{2^k},2^{2^k}+1)$ with the values of $k$ sufficiently sparse, you get what you want.
https://mathoverflow.net
76,402
[ "https://mathoverflow.net/questions/76402", "https://mathoverflow.net", "https://mathoverflow.net/users/13947/" ]
Observe that we have $Q(\sqrt{2})=Q((\sqrt{2}+1)^n)$. More generally, assume that $K$ is a finite extension of Q. Is there any $\alpha \in K$ such that $K=Q(\alpha^n)$ for every $n \in N$?
In a more general setting, the following is true : let $K$ be an infinite field and $L/K$ be a finite separable extension whose Galois closure $M$ contains only finitely many roots of unity (this assumption is true for number fields). Then there exists $\alpha \in L$ such that $L=K(\alpha^n)$ for every $n \geq 1$. Pro...
$\def\QQ{\mathbb{Q}}$This question seems unmotivated to me, but I might as well answer it: Yes, for any finite extension $K \supset \QQ$, there is some $\alpha \in K$ such that $\QQ(\alpha^n) = K$ for all nonzero integers $n$. $\def\p{\mathfrak{p}}$Let $p$ be a prime which splits completely in $K$, say $p = \p_1 \p_2 ...
https://mathoverflow.net
21,608
[ "https://robotics.stackexchange.com/questions/21608", "https://robotics.stackexchange.com", "https://robotics.stackexchange.com/users/26640/" ]
I have two webcams, which are mounted close together. I plan to use them to find out the true depth of certain pixels of images. Suppose I use a standard multi camera calibration setup and find out the relative orientation of one with respect to the other camera, can it perform as well as a stereo camera setup for dept...
Thank you for your answers and comments. We finally decided to change the pump with a less energy consuming system. We're testing the prototype in the next to weeks we hope we get the estimated autonpmy
Lithium Polymer batteries are, in general, the best you're going to get as far as either energy per weight or energy per volume. Going to a different brand may gain your 10% more capacity per volume, but not much more (if you get to that point, and you're in the US, check out ThunderPower batteries -- I fly model airp...
https://robotics.stackexchange.com
68,734
[ "https://dsp.stackexchange.com/questions/68734", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/44709/" ]
I was writing MATLAB code to compute 1D DCT of sample y. On computing DCT for <code>y=[0,1,2]</code>, code generates coefficient <code>[3.0000 -2.2304 0 -0.1585]</code> which was consistent to coefficient generated by Matlab default <code>dct([0,1,2])</code>. When sample <code>y=[1,2,3]</code> was chosen the same cod...
You have mistyped the formula, replace this line <pre><code>sum = sum + y(i).*(cos((pi.*(2.*y(i)+1).*u(j))/(2*N))); </code></pre> with the one below, and it works fine. <pre><code>sum = sum + y(i).*(cos((pi.*(2.*u(i)+1).*u(j))/(2*N))); </code></pre>
For clarity, I would write this DCT as: <span class="math-container">$$F(u) = \alpha(u)\sum_{i=0}^{N-1}f(i)\cos\left(\frac{\pi u}{2N}(2i+1)\right)$$</span> We note that, with this 1-indexing of Matlab: <span class="math-container">$$y[i+1] = f(i)\,.$$</span> Then I would modify the inner limit (from <span class="math-...
https://dsp.stackexchange.com
277,014
[ "https://mathoverflow.net/questions/277014", "https://mathoverflow.net", "https://mathoverflow.net/users/8628/" ]
Let ${\cal E}$ denote the collection of open sets of $\mathbb{R}$ with respect to the Euclidean topology. It is well known that $|{\cal E}| = 2^{\aleph_0}$. Is there an injective map $f:{\cal E}\setminus \{\emptyset\} \to \mathbb{R}$ such that $f(U)\in U$ for all $U \in {\cal E}\setminus \{\emptyset\}$?
Choose a well-ordering of $\cal{E}\backslash\{\emptyset\}$ with order type the initial ordinal of size $2^{\aleph_0}$. Consider injective functions $f$ from initial segments of $\cal{E}\backslash\{\emptyset\}$ to $\mathbb{R}$ satisfying $f(U)\in U$. The set of such functions is partially ordered by extension, and Zorn'...
Fix an injective map <span class="math-container">$h:\mathcal{E}\to\mathbf{R}/\mathbf{Q}$</span>. Lift it to a map <span class="math-container">$g:\mathcal{E}\to\mathbf{R}$</span>. Then for every <span class="math-container">$U\in\mathcal{E}$</span> there exists <span class="math-container">$r(U)\in\mathbf{Q}$</span> s...
https://mathoverflow.net
873,856
[ "https://math.stackexchange.com/questions/873856", "https://math.stackexchange.com", "https://math.stackexchange.com/users/130642/" ]
I am attempting to derive the result: $$ \int \left(1+x^n\right)^{-1/m}dx= x\,_2F_1\left(\frac 1m,\frac 1n;1+\frac 1n;-x^n\right)$$ First, I start off with the binomial expansion of the integrand to get: $$\int\sum_{k=0}^{\infty}\frac{(1/m)_k}{k!}\left(-x^n\right)^kdx $$ Then, I pull out a $-1$ and interchange sum...
I was in the end able to derive the correct expression as... $$\frac{(1/n)_k}{(1+1/n)_k}=\frac{\frac1n(\frac1n+1)(\frac1n+2)\cdots(\frac1n+k-1)}{(1+\frac1n)(1+\frac1n+1)(1+\frac1n+2)\cdots(\frac1n+1+k-2)(\frac1n+1+k-1)} =\frac{1}{nk+1}$$
Deriving from integral approach is easier: \begin{align} \int(1+x^n)^{-\frac{1}{m}}~dx &amp;=\int_0^x(1+t^n)^{-\frac{1}{m}}~dt+C\\ &amp;=\int_0^{x^n}(1+t)^{-\frac{1}{m}}~d(t^\frac{1}{n})+C\\ &amp;=\dfrac{1}{n}\int_0^{x^n}t^{\frac{1}{n}-1}(1+t)^{-\frac{1}{m}}~dt+C\\ &amp;=\dfrac{1}{n}\int_0^1(x^nt)^{\frac{1}{n}-1}(1+x^n...
https://math.stackexchange.com
503,190
[ "https://stats.stackexchange.com/questions/503190", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/139899/" ]
Consider an outcome <span class="math-container">$Y$</span>, treatment <span class="math-container">$D$</span>, and set of covariates <span class="math-container">$X$</span>. The outcome is real-valued, the treatment has support <span class="math-container">$\{0,1\}$</span>, and the set of covariates is a collection of...
This is a fairly strong assumption and one not likely to be true in practice. That assumption being true justifies the use of a linear regression of <span class="math-container">$Y$</span> on <span class="math-container">$D$</span> and <span class="math-container">$p(X)$</span> for estimating the causal effect of <span...
The expectation of <span class="math-container">$Y$</span> given <span class="math-container">$X$</span> is a function of <span class="math-container">$X.$</span> Hence if <span class="math-container">$X$</span> takes value in <span class="math-container">$\{0,1\}$</span> then there always exists <span class="math-cont...
https://stats.stackexchange.com
126,959
[ "https://cs.stackexchange.com/questions/126959", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/105282/" ]
I know that strong component in a graph means between any 2 vertices there should be bi-directional path. My doubt is cycle is always a strong component. can there be any other subgraph with some property P so that it is strong component ie., P implies strong component.
We can have sets <span class="math-container">$A, B, C$</span> with linear-time computable maps <span class="math-container">$f : A \to C$</span> and <span class="math-container">$g : B \to C$</span> such that there exists a map <span class="math-container">$h : A \to B$</span> with <span class="math-container">$f = g ...
You're asking two questions, one about computability and one about computational complexity. The usual rule is to ask one question per post. I'll answer the second question. No, under standard conjectures, the computational complexity could be quite bad. Suppose <span class="math-container">$f:A \to C$</span> is gi...
https://cs.stackexchange.com
390,988
[ "https://softwareengineering.stackexchange.com/questions/390988", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/334809/" ]
I have a REST API written using ASP.NET Core Web API. There are a few business logic based messages I want to send to the clients from the API. I am in a dilemma on which of the following ways I can use to show the messages: Method 1: Assign a unique code(number) for each message, send that code to the clients and d...
My advice: <strong>do both</strong>. :) The API client can decide to use the messages from your API or read each error code and create his own messages. Like: <pre><code>{ "errorCode": "4005", "message": "Person already registered" } </code></pre> But if you need to choose one, I would choose the error code ...
Variation on the "do both" theme: Return error codes from your API and provide an additional API for error code translations. This service could handle localization, and by keeping business specific messages on the server you avoid having to update the client when new messages are defined to handle new rules.
https://softwareengineering.stackexchange.com
81,170
[ "https://stats.stackexchange.com/questions/81170", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/36844/" ]
I'm using SPSS to perform TwoStep cluster analyses. SPSS shows predictor importance of each variable used in an analysis. Oftentimes, a binary variable like gender (sorry, I'm just keeping it simple!) will be the most important variable to the formation of the clusters, even if you don't want it to be. Is there a way ...
If memory serves, it appears you have forgotten something in your LR statistic. The likelihood function under the null is $$L_{H_0} = \theta^{-n_1-n_2}\cdot \exp\left\{-\theta^{-1}\left(\sum x_i+\sum y_i\right)\right\}$$ and the MLE is $$\hat \theta_0 = \frac {\sum x_i+\sum y_i}{n_1+n_2} = w_1\bar x +w_2 \bar y, ...
The likelihood function given the sample <span class="math-container">$\mathbf x=(x_1,\ldots,x_{n_1},y_1,\ldots,y_{n_2})$</span> is given by <span class="math-container">\begin{align} L(\theta_1,\theta_2)&amp;=\frac{1}{\theta_1^{n_1}\theta_2^{n_2}}\,\exp\left[-\frac{1}{\theta_1}\sum_{i=1}^{n_1} x_i-\frac{1}{\theta_2}\s...
https://stats.stackexchange.com
65,658
[ "https://dba.stackexchange.com/questions/65658", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/38809/" ]
I have the following situation: I have a table that contains entries with language versions (German and English) as part of the key (the other part being a "name" field). However, not always both versions are available - sometimes, e.g. only a German version exists. I want to build a select statement so that I get all ...
<blockquote> Now i'm running them both side by side </blockquote> So, to clarify, you did a side-by-side upgrade. Meaning that you installed a new instance of SQL Server 2014? In that case, if you are ready to rid yourself of the SQL Server 2008 R2 instance then you would need to <em>transfer all of your necessary...
select @@version will give you which version you are actually connecting to.Also check whether your instance names of both in configuration manager to avoid accidentally connecting
https://dba.stackexchange.com
105,687
[ "https://electronics.stackexchange.com/questions/105687", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/13393/" ]
Hopefully a simple one. Should I always control by writing to the GPIO digital output? Or should I always leave it low and then tri-state the output? <h1>LED turns on when MCU pin sinks current:</h1> <img src="https://i.stack.imgur.com/kmSOy.png" alt="enter image description here"> In code, I mean the difference be...
In the case you've shown, it doesn't really matter <strong>too</strong> much. I'd leave the output as an output and control the LED from the LAT bit. If the input is not a Schmitt Trigger input, you could get unnecessary power consumption from having an input floating around, and having inputs floating around is just n...
Effectively, the tri-state solution is giving you the options of "small resistor(on)/big resistor(off)". But it's very un-intuitive to someone else reading your code (and perhaps even to you, after a couple weeks away from it). I would only suggest using the tri-state method if it's the only way, i.e. your battery vo...
https://electronics.stackexchange.com
161,661
[ "https://electronics.stackexchange.com/questions/161661", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/70853/" ]
<img src="https://i.stack.imgur.com/qj5ZM.jpg" alt="Circuits"> So say you a typical setup like in this diagram. <ol> <li>How does current flow while the capacitors charge? To elaborate, what is the mechanic that makes capacitors mimic the functionality of a wire instead of acting like the gap in the wire that they ar...
<ol> <li>The mechanism is electrostatic repulsion -- the Coulomb force. The battery forces extra electrons onto the negative plate of the capacitor. The excess charge pushes an equal number of electrons off of the other plate and into the rest of the circuit. To the rest of the circuit, it looks like there's a current ...
The <em>Master of Analogies</em> is here again... You can think of the capacitor as a balloon. While you're blowing the balloon up air is flowing out of your lungs (battery) and into the balloon (current flowing to charge the capacitor). As the balloon increases in size it displaces the air around it (the repulsed c...
https://electronics.stackexchange.com
381,589
[ "https://softwareengineering.stackexchange.com/questions/381589", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/278325/" ]
Imagine we have a service like the this: <pre><code>class SomeService { // A random pure function that transforms the input // without doing any remote calls or any side effects function somePureFunction(inputNumber) { return inputNumber *2 } } </code></pre> Now we are using it by registering ...
Dependency injection requires a trade-off between decoupling parts of the code at the expense of increasing its complexity through creating abstractions. So as a rule of thumb, that increase in complexity has to offer benefits that outweigh the costs. By injecting dependencies that are mutable or have side effects, we...
Dependency injection makes sense when you want to <em>change</em> that dependency. For example, you may want to mock a dependency for testing. For a pure function, you should ask yourself: <ul> <li>Is this function some utility that holds universally, e.g. <code>Math.Max()</code>? If so, avoiding the complexity of dep...
https://softwareengineering.stackexchange.com
352,554
[ "https://softwareengineering.stackexchange.com/questions/352554", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/112298/" ]
I am accessing a third-party API. It requires a key, which is the same key for all of my users. Currently, my application includes that key in the client-side code, and calls the third party API directly. So any user can decompile my code, and get the key tied to my application. (Bad, right?) I am guessing that I ...
Popular services like Google use API key(s). This key should be protected as this is what is used to track your usage against the service. Many services are volume based and will charge appropriately based on usage. Typically, these services are accessed via a server side component. Client -> Your Service (API Key)...
Well, yes. If you don't want your users to be able to use the 3rd-party API on their own terms, then you have to proxy the access to that API and introduce a different kind of authentication between your users and the proxy. It's always a good idea to reflect whether that is actually what you need to do, though. Why d...
https://softwareengineering.stackexchange.com
91,515
[ "https://mathoverflow.net/questions/91515", "https://mathoverflow.net", "https://mathoverflow.net/users/22223/" ]
I have recently come across some examples of matrices with a special structure. I will describe these matrices here and I hope that somebody will be able to point out a source where I can find more information about them. Consider an <span class="math-container">$n\times n$</span> matrix <span class="math-container">...
A class of matrices with entrywise positive inverses (inverse-positive matrices) appears in a variety of applications and has been studied by many authors. See, for example, <A HREF="https://core.ac.uk/download/pdf/82554224.pdf" rel="nofollow noreferrer">M-Matrices Whose Inverses Are Totally Positive</A> or <A HREF=...
This is straightforward from the adjoint formula for the inverse matrix. Let $A_{ij}$ be the matrix formed by deleting row $i$ and column $j$ from $A$. We must show that $(-1)^{n+1} (-1)^{i-j} \det A_{ij} &gt; 0$. We can reorder the rows and columns of $A$ cyclically to assume without loss of generality that $j=n$. T...
https://mathoverflow.net
286,400
[ "https://softwareengineering.stackexchange.com/questions/286400", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/1512/" ]
We are doing projects, but we reuse a lot of code between the projects and have lots of libraries that contain our common code. As we implement new projects we find more ways to factor out common code and put it into libraries. The libraries depend on each other, and the projects depend on the libraries. Each project, ...
Kind of putting out the obvious here, but maybe worth to mention it. Usually, git repos are tailored per lib/project because they tend to be independent. You update your project, and don't care about the rest. Other projects depending on it will simply update their lib whenever they see fit. However, your case seems ...
The solution you are looking for is a dependency management tool in coordination with git submodules Tools such as: <ul> <li>Maven</li> <li>Ant</li> <li>Composer</li> </ul> You can use those tools to define dependencies of a project. You can require a submodule to be at least version <strong> > 2.x.x </strong> or d...
https://softwareengineering.stackexchange.com
185,940
[ "https://electronics.stackexchange.com/questions/185940", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/81006/" ]
I wan't to know more about how to recognize a damaged component due to excessive impulse or constant current exposure. Particularly resistors, ceramic/electrolyte capacitors, protective diodes, transistors, voltage regulators. Which of them will behave like an open circuit and which of them like a short circuit? Also w...
<h2>Resistors:</h2> <ul> <li>Causes of Failure: Too much power dissipated resulting in high temperature.</li> <li>Physical Changes: They may appear discolored or release some smoke.</li> <li>New State: Open circuit or different resistance value.</li> </ul> <h2>Capacitors:</h2> <ul> <li>Causes of Failure: Too high of...
Some components just degrade. I've read, somewhere on diyaudio.com, that repeated exposure of the base-emitter junction to excessive reverse voltage will eventually increase noise level and generally make the transistor worse.
https://electronics.stackexchange.com
99,960
[ "https://security.stackexchange.com/questions/99960", "https://security.stackexchange.com", "https://security.stackexchange.com/users/84798/" ]
I want to hide the links to my server address in my Android app. When my app is decompiled, the links are clearly showing. Even with the proguard enabled I am not able to hide links. How can I protect these links?
<h2>Short Answer</h2> No matter how well you may obfuscate/hide a URL: <ul> <li>It is a waste of time.</li> </ul> <h2>Why?</h2> <h3>1. DNS Lookups</h3> All software (including your app) has to do a DNS lookup before it can connect to any URL. <strong>Any</strong> computer running Linux can be set up as a local DHCP/DNS...
This is a fool's errand. Even if you you <em>could</em> obfuscate them sufficiently in the source code, it would still be child's play to hook the device up to a proxy like Fiddler or Burp Suite, and see the raw URLs plain as day when the app is running. No need to look at your source code at all, and there is absolut...
https://security.stackexchange.com
810,621
[ "https://math.stackexchange.com/questions/810621", "https://math.stackexchange.com", "https://math.stackexchange.com/users/153539/" ]
Given that $y = \dfrac{x^3 - 5x}{\sqrt{x}}$, show that $\dfrac{dy}{dx}$= $\dfrac{5(x^2 - 1)} {2 \sqrt{x}} $ using standard rules of exponents. I get as far as $\dfrac{dy}{dx}= \dfrac {5}{2}x^\frac {3}{2} - \dfrac {5}{2}x^\frac{-1}{2}$ but struggling with the first fraction to make a common denominator and thus ge...
$\dfrac{5(x^2-1)}{2\sqrt{x}} = \dfrac{5}{2}\cdot \left(\dfrac{x^2}{\sqrt{x}} - \dfrac{1}{\sqrt{x}}\right) = \dfrac{5}{2}\left(x^{\frac{3}{2}} - x^{-\frac{1}{2}}\right)$
$x^{3/2}=x^{1/2}x$ and $x^{-1/2}=x/x^{1/2}$, and so, $$x^{3/2}-x^{1/2}=x(x^{1/2}+\dfrac{1}{x^{1/2}})=x(\dfrac{x+1}{\sqrt{x}})=\sqrt{x}(x+1)$$
https://math.stackexchange.com
8,425
[ "https://electronics.stackexchange.com/questions/8425", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
I am working on a device that uses the Microchip MDDFS library to store data to an SD card. The logger will log data at a maximum rate of 1 entry (56bytes) every minute. The problem is the device may lose power at any time, potentially in the middle of a write sequence. I am wondering what is the best way to protect m...
A few things can happen when you write data to a file. I'm going to describe the sequence that needs to happen for data to be safe, not necessarily library calls. When you're writing, and adding on to the end of the file (normal write mode), you read the last block of the file into memory, modify it with your write da...
I would also suggest using some sort of <strong>checksum</strong> to verify the data on the SD is <em>correct</em> whenever it needs to be read.
https://electronics.stackexchange.com
57,448
[ "https://stats.stackexchange.com/questions/57448", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/7968/" ]
I am running a model (logistic regression) with 20 independent variables in R. Before running the model I calculated the correlation between all the variables and finally selected my variables by also checking "visually" the histograms of each variable in the case of presence and again in the case of absence. In situ...
Since your outcome appears to be dichotomous in nature (absence or presence) and you have numerous predictors of interest, why not calculate unadjusted odds ratios by performing simple logistic regression between each of your potential predictor variables of interest with the outcome (1 = absence; 0 = presence, or vice...
The problem appears odd. Regarding to the "Presence/Absence and each variable", if that variable is simply dropped (or added), other variables may take the responsibility (or lose) to fit the effect of that variable. This may change the model's meaning. If this result/effect is not what you want, the "importance of va...
https://stats.stackexchange.com
165,604
[ "https://electronics.stackexchange.com/questions/165604", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/70363/" ]
I have this piece of code here: <pre><code>library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity first is port( a : in STD_LOGIC_VECTOR(3 downto 0); b : in STD_LOGIC_VECTOR(3 downto 0); result : out STD_LOGIC_VECTOR(3 downto 0); clk : in STD_LOGIC ); end first; architecture behavioral o...
The problem is that you actually have no clock, or to be more precise, no clock is <strong>used</strong>. Check your process: <pre><code>process(clk) begin result &lt;= a + b; end process; </code></pre> This process doesn't use the clock. You probably wanted to do this: <pre><code>process(clk) begin if risin...
Your design has a signal called <code>clk</code>, but it isn't used as clock. You should add <code>if(rising_edge(clk))</code> statements in the process body. Once you modify your desing, Quartus will detect that <code>clk</code> is used as clock and you will be able to proceed with your Fmax analysis.
https://electronics.stackexchange.com
566,174
[ "https://physics.stackexchange.com/questions/566174", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/224576/" ]
Hello im studying special relativity and i was wondering something about length contraction. Let's say someone who is not moving is seeing a rod which has one edge at <span class="math-container">$x=0$</span> and the other at <span class="math-container">$x=a$</span> so its length is <span class="math-container">$a$</s...
The rod is moving in the observer's reference frame and he has to measure each end at the same time in his frame. You are using the same time, t, in the frame of the first observer who is at rest with respect to the rod. What's simultaneous (same t) in the first observer's frame is not simultaneous in the moving observ...
You want to measure the location of both ends at the same time, let us say when <span class="math-container">$t'=0$</span>. Given the Lorentz transformations, the point <span class="math-container">$(x,t)=(0,0)$</span> maps to <span class="math-container">$(x',t')=(0,0)$</span>, and <span class="math-container">$(L,0)$...
https://physics.stackexchange.com
2,728,015
[ "https://math.stackexchange.com/questions/2728015", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I have a random variable $Y \sim \mathsf{N}(2,5)$ and we define $Z = 3Y-4$. I want to find the distribution of $Z$. Intuitively I can see that it is Normal as well due to the nature of the transformation. To show this, my first thought is to scale the variance by 3 and shift the mean by -4, giving $Z \sim \mathsf{N}(...
$$E(3Y-4)=3E(Y)-4=2$$ $$Var(3Y-4)=9Var(Y)=45$$ So $Z$ has the distribution $ N(2,45)$
A random variable $Y\sim N(\mu, \sigma^2)$ if $Y=\mu +\sigma W$ for some $W$ where $W\sim N(0, 1)$. Thus in your case $$ Z=3Y-4=3(2+\sqrt{5}W)-4=2+3\sqrt{5}W $$ where for some $W\sim N(0,1)$. Thus $Z\sim N(2,(3\sqrt{5})^2)$ i.e. $Z\sim N (2,45)$.
https://math.stackexchange.com
348,303
[ "https://physics.stackexchange.com/questions/348303", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/99567/" ]
I remember it being quite hot in the last green house I went inside, and I'm imagining how hot you can make it has something to do with the difference between the temperature inside and outside, because that would determine the conduction of heat through the wall no? So if you construct a smaller green house inside of ...
A greenhouse works by letting in visible light, which are absorbed by plants (and any other absorbing surfaces) inside, while blocking the IR radiation re-emitted by those plants. Suppose you had another smaller greenhouse inside the bigger one. Then what radiation passed through the bigger greenhouse shall also pass t...
The point of having an inner greenhouse may be very valuable as frost protection. It would take longer to cool down. Also it works to keep moisture in just like a lidded seed tray. My greenhouse has an 80L water butt inside to act as a thermal mass during the winter. I believe in Alaska they put a wall of water butts o...
https://physics.stackexchange.com
205,043
[ "https://electronics.stackexchange.com/questions/205043", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/93926/" ]
I am taking a beginning EE course, and it seems like we just use the given peak voltages to find the current and voltage gains of an amplifier. When it comes to finding the power from its source and the power deliver to its load however, we have to use the Vrms and Irms. Why is this necessary to do, instead of just usi...
Back in the stony ages, before AC, the power into a load was simply the voltage across the load times the current through it, so if an incandescent lamp with 120 volts across it had a current of 1 ampere through it, the heat and light it was generating were equal to what it was receiving from the generator: 120 watts. ...
Using the peak voltage and current will give you the peak power, which will only apply for that instant. Using RMS voltage and current will give you the average power over a whole cycle of the AC signal.
https://electronics.stackexchange.com
528,083
[ "https://electronics.stackexchange.com/questions/528083", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/173035/" ]
I am looking for a DC to DC boost converter constant current with very low switching frequency to pass EMC. <ul> <li>Vin- 12V</li> <li>Vout- 36V, 100mA.</li> </ul> Any suitable device for my above application?
Build a Royer oscillator, the voltage step-up is mostly determined by the turns ratio of the transformer so find a 4:1 trasnformer...
Consider that: <ul> <li>a DCDC converter that switches at a low frequency could actually generate <strong>more</strong> EM radiation than another DCDC converter that switches at a higher frequency but where measures have been taken to reduce EM emissions.</li> </ul> The <strong>speed</strong> at which the switching is ...
https://electronics.stackexchange.com
44,181
[ "https://security.stackexchange.com/questions/44181", "https://security.stackexchange.com", "https://security.stackexchange.com/users/31006/" ]
I wanna know that weather a site having XSS vulnerability can lead the hacker to access database? I know that he can get the username and password from the cookie stored but can he completely access the database?
XSS doesn't compromise the server, it compromises the client. Basically, if your site is vulnerable to an XSS attack, then you're serving dodgy code to your users. The attack has control over your users' actions, so has access to anything your users do. So if your users do not normally have complete access to your D...
No, with two caveats: <ol> <li>There isn't really any detail in your question, so it's very hard to be definitive.</li> <li>An attacker may use XSS as part of a broader attack. If she can get the admin to run something on his machine via XSS, who knows where that could lead...</li> </ol>
https://security.stackexchange.com
480,596
[ "https://electronics.stackexchange.com/questions/480596", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/242319/" ]
Ohm's Law gives the relationship of voltage and current as follows: <span class="math-container">$$V = \frac {P}{I}$$</span> <span class="math-container">$$V = I \times R$$</span> In the first equation, voltage and current are inversely proportional. In the second equation, voltage and current are directly proportional...
The key issue here is that you are attempting to draw incorrect conclusions from a mixture of Ohms' law and relationships based on but not a direct part of Ohm's law.<br> Essentially - your question does not make sense as you are mixing items which cannot be directly compared. I can smell apples.<br> I can count app...
You are comparing apples and oranges. Your first equation deals with power and is independent of Ohm's law. Your second equation is one expression of Ohm's law which says that some materials exhibit an electrical resistance whose magnitude is independent of the value of the current. If power is a constant, then, yes, c...
https://electronics.stackexchange.com
1,576,231
[ "https://math.stackexchange.com/questions/1576231", "https://math.stackexchange.com", "https://math.stackexchange.com/users/245557/" ]
Let $G$ be a group s.t. every non-identity element has order 2. If $G$ is finite, prove $|G| = 2^n$ and $G \simeq C_2 \times C_2 \times\cdots\times C_2$ I know G is abelian since $ab = (ab)^{-1} = b^{-1} a^{-1} = ba$ for all non-trivial $a,b \in G$ so I have several questions remaining: <ol> <li>How do I prove $|G| ...
Suppose $G$ is finite, then we have $|G|= \prod_{i=1}p_{i}^{r_{i}}$. By the hypothesis and Cauchy's theorem, $p_{i} = 2$. So that $|G| = 2^{n}$. Let $x, y \in G$, then $xy = 1$ or $(xy)^{2} = 1$ by the hypothesis and so we have $xy = yx$ since $g^{2} = 1 \implies g = g^{-1}$. Hence $G$ is an abelian group. Write $G ...
(1) $G$ is Abelian because $x y=x(x y)^2y=x x y x y y=x^2(y x)y^2=y x.$.. (2) For non-negative integer $n$, let $H_n$ denote a subgroup of $G$ with $|H_n|=2^n. $ It is easily seen that if $H_n\ne G$ and $x\in G\backslash H_n$ then $H_{n+1}=H_n\cup x H_n$ is a subgroup of $G$ with $|H_{n+1}|=2^{n+1}$....(3) Now $H_0=\{1...
https://math.stackexchange.com
147,639
[ "https://physics.stackexchange.com/questions/147639", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/64180/" ]
I get that the sun is producing white light which is scattered threw our atmosphere so that the light of the sun reaching our eyes is yellow. So how come if I look to a piece of white paper under sunlight or a cloud in the sky, I see it white ? I guess that the missing wavelengths may be reflected also by the sky and...
<blockquote> I get that the sun is producing white light which is scattered threw our atmosphere so that the light of the sun reaching our eyes is yellow. </blockquote> Not very much. When the sun is high in the sky, most would describe the light as "white", not "yellow". That would be more true for a sun low to t...
When the sunlight is colored, for example by the atmosphere, the "white" surface has to be slightly colored with the complementary color to looks like white or light gray.
https://physics.stackexchange.com
215,495
[ "https://mathoverflow.net/questions/215495", "https://mathoverflow.net", "https://mathoverflow.net/users/63984/" ]
Is there any known example of fibered knot which is topologically slice but not (expected to be) smoothly slice?
Such a knot would yield a counterexample to one of two important conjectures in the area. A preliminary definition: a slice knot is homotopically ribbon if the inclusion of the knot into the slice disk complement induces a surjection on the fundamental group. It's easy to see that a ribbon knot is homotopically ribbon...
A common source of topologically slice knots are those with Alexander polynomial $1$. However these are not fibered. This follows from a classical result, that $2\mathrm{genus}(K) = \mathrm{deg}(\Delta_K(t))$ for fibered knots, which I learned in a paper of Stefan Friedl and Taehee Kim ("The Thurston Norm, Fibered Mani...
https://mathoverflow.net
102,240
[ "https://chemistry.stackexchange.com/questions/102240", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/66307/" ]
Is a totally eclipsed Newman projection the most stable conformation for a 2 carbon compound, with one carbon bonded to more electronegative atoms (making them partially negative), and the other carbon with something less electronegative (making it partially positive)? For example, let's imagine <span class="math-cont...
For <span class="math-container">$\ce{H3C-CF3}$</span>, the stable conformation is staggered. I would expect this to be case for any similar, freely rotating molecule (the exception being conformations imposed by rings etc.), with the reason being the repulsion between the <span class="math-container">$\ce{C-F}$</span>...
For 1,1,1-trifluoroethane the two extremes are the staggered and the eclipsed conformations. I have done some molecular mechanics calculations which indicate that the staggered conformation has an energy of 5.7 kCal per mole while the eclipsed it is 1.31 kCal per mole. This is the result for the molecular mechanics, i...
https://chemistry.stackexchange.com
246,982
[ "https://physics.stackexchange.com/questions/246982", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/112955/" ]
So, according to Einstein's theory of general relativity, gravity is not a force instead it is a consequence of objects with mass deforming spacetime, right? And so, according to him, there is no difference between standing on a platform accelerating upwards at 9.81 m/s^2 and standing on Earth, right? But, there is a d...
The equivalence principle applies only for a very small size lab, where it is not possible to make the parallel vs radial distinction you mentioned. Small size indicates, it is local. More over, there are other ways to distinguish between the two, if the size of the lab is big enough. One example - gravity changes wit...
If the gravity is caused by an infinite plane of mass, then yes: the equivalence is exact. In this case, Einstein original viewed gravity as a consequence of gravitational time dilation. Enter Earth: now the apples' paths cross--much like 2 nearby people walking on great circles around Earth. Thus, he realized the metr...
https://physics.stackexchange.com
180,015
[ "https://stats.stackexchange.com/questions/180015", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/93893/" ]
I am trying to fit a logistic model to create propensity scores. Looking though the literature, there appears to be some disagreement on which covariates to include when designing such a model. Some say that all covariates that affect both treatment group and outcome should be included. Others advocate including only v...
Ideally, you'd want to select as many covariates as possible to be included in your propensity score (PS) model in order to predict the probability of treatment assignment, but the problem with that approach is that you risk having some of those covariates being influenced by the treatment itself and this violates the ...
Coincidentally, the role of choosing variables for a propensity score is no different than selecting variables for a confounding relationship. Causally, the predictor must be predictive of treatment <em>and</em> causal of the outcome. If a variable is predictive of treatment but independent of the outcome, then addin...
https://stats.stackexchange.com
327,922
[ "https://electronics.stackexchange.com/questions/327922", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/108747/" ]
On a datasheet for a single pole, multiple contact switch, I see that there are a few contact ratings: non-switching (50VDC, 100mA), switching (5VDC, 100mA) and minimum (20mVDC, 1uA). What are these different specs describing? If I anticipate my system to draw 3VDC at around 100mA (300mW), am I good to use this switc...
Non switching: You can apply 50VDC with a load current of 100mA as long as you don't change the state of the switch. Switching: You can switch the load on and off all day with an applied voltage of 5VDC and a load current of 100mA. Minimum: The applied voltage should exceed 20mVDC and the load current should be at ...
Yes none of the specs should violated. They are inclusive. <ul> <li>The max voltage is due small contact separation for non-switching and small reactive loads reduce the operting voltage to 5V.</li> <li>the min current is minor oxidation</li> <li>the max current is to minimize contact heating.</li> </ul> These low sp...
https://electronics.stackexchange.com
2,630,454
[ "https://math.stackexchange.com/questions/2630454", "https://math.stackexchange.com", "https://math.stackexchange.com/users/514429/" ]
If we want to solve the following question: $$\frac{d}{dx}\left(\frac{x}{\sqrt{2x-1}}\right)$$ Then we will have to use this following rule (the power rule), which seems strange to me since using the power rule for other equations doesn't require the same step to be performed when using this equation, which is: $$\left...
Ok, I see the problem. Your problem is with the $'$ notation. Let's use another: $$\frac{du^n(x)}{dx}=n u^{n-1}(x)\frac{du(x)}{dx}$$ Now if instead you were taking an $u$ derivative: $$\frac{du^n}{du}=n u^{n-1}\frac{du}{du}=n u^{n-1}$$ It all depends on the variable you are differentiating with respect to.
In general, $$ f(g(x))'=f'(g(x))g'(x) $$ by the chain rule. You are asking about the case when $f(x)=x^n$.
https://math.stackexchange.com
153,816
[ "https://dba.stackexchange.com/questions/153816", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/104077/" ]
I have two tables: <code>t1</code> and <code>t2</code>. There are three steps: <ol> <li>In <code>t1</code> select a <code>set_of_strings</code> with id = 1 ("1a" and"3c").</li> <li>From <code>t1</code> select strings that correspond to <code>OPTIONID ='A'</code> and that contain substrings from the <code>set_of_string...
I would recommend adding indexes on the columns participating in the <code>JOIN</code> conditions and the <code>WHERE</code> clauses. Indexes are designed to help the query optimizer make better choices. Unless you enforce uniqueness on a column that isn't meant to be unique, your indexes will only help. That said, y...
For only 2GB of RAM, <code>innodb_buffer_pool_size = 1000M</code> is dangerously high; recommend only 400M. The risk is that mysqld will run out of RAM and swapping will ensue. Swapping is deadly for MySQL performance. Also decrease these: <pre><code>join_buffer_size = 16M tmp_table_size = 16M max_h...
https://dba.stackexchange.com
10,849
[ "https://softwareengineering.stackexchange.com/questions/10849", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/101/" ]
I'm working with a new team that has historically not done ANY unit testing. My goal is for the team to <em>eventually</em> employ TDD (Test Driven Development) as their natural process. But since TDD is such a radical mind shift for a non-unit testing team I thought I would just start off with writing unit tests aft...
<strong>Practice on existing bugs/defects.</strong> This is a really tough situation. I've never gone all the way to TDD from nothing before, but in my experience, getting a team to go from no unit tests to proactively writing them has been a very "one step at a time" approach. First, get them comfortable writing un...
I've managed to convince my whole company to switch to TDD. It wasn't easy, but it was well worth the effort: the quality of the code went up after the transition, and now nobody imagines going back to the horrible, cowboy coding times. <ol> <li>Explain, explain, explain. You don't want your team to write tests. You w...
https://softwareengineering.stackexchange.com
309,185
[ "https://stats.stackexchange.com/questions/309185", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/180967/" ]
I've seen this notation pop up in some Bayesian statistics notes but despite my best efforts with Google I've not had any luck discovering the meaning. The only helpful context that I have is that $y$ is the observed data and $\theta$ is some sort of parameter. As for giving an example of this notation in use, I've see...
The notation is overloaded (or abused) so $p$ refers both to the probability density function as well as to the distribution. This seems a lot simpler than to have say capital letters indicate the distribution and lower case letters indicate the pdf/pmf. Alternatively the $\sim$ notation can be thought of as overload...
The notation is very misleading with $p(\cdot)$ being heavily overloaded with multiple meanings and complete disregard for the difference between random variables and the values that they take on. There is a <em>parameter</em> $\theta$ of unknown value which is modeled as a <em>random variable</em> $\Theta$, discrete ...
https://stats.stackexchange.com
229,959
[ "https://stats.stackexchange.com/questions/229959", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/41784/" ]
I'm trying to explain Y (a count variable), in terms of X, Xsquared, and Size, with random effects for Industry/Firm, by year. My hypothesis is that there is a positive relationship between Y and X, and that this relationship has a inverted-U shape (thus the Xsquared term). I normally do this with normal regression mod...
Going through your results a bit at a time: <pre><code>Random effects: Groups Name Variance Std.Dev. Corr Firm:Industry (Intercept) 1.787e+04 1.337e+02 Year 4.434e-03 6.659e-02 -1.00 Industry (Intercept) 7.749e-01 8.803e-01 Year 1.923e-07...
The interpretation of a squared term is a difference in differences comparing groups differing in 1 unit of the outcome. For instance if the model is linear, and we fit $E[Y|X] = \beta_0 + \beta_1 X$ then $\beta_1 = E[Y|X=9] - E[Y|X=8]$ as well as $\beta_1 = E[Y|X=1] - E[Y|X=0]$. But if the true model is quadratic, the...
https://stats.stackexchange.com
179,062
[ "https://electronics.stackexchange.com/questions/179062", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/64856/" ]
I am designing a series of heaters. One of them, actually, is designed for 220V and uses two resistors on series to achieve the power desired. The total current is, on peak, almost 20A. To keep the compatibility with others machines, and based on a lot of other things, the TRIAC which will drive the load will be the BT...
No you should not attempt to parallel triacs as they will not share the load evenly. As temperature increases the hotter one will hog more current so even if they were perfectly matched to begin with they won't play nicely during operation.
<img src="https://i.stack.imgur.com/UbWz4.jpg" alt="enter image description here"> this is BTA24-800 from SSR 100 A.tjey use pararel Triact to increase Current
https://electronics.stackexchange.com
7,449
[ "https://mechanics.stackexchange.com/questions/7449", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/3558/" ]
My car has had an intermittent starting problem with moisture since the beginning of this year. When it rains, it's either very difficult to start or it won't start at all. I was planning on figuring this issue out over the winter (<strong>This isn't the current issue I'm trying to resolve</strong>). One morning, it ...
<img src="https://i.stack.imgur.com/KrVaj.jpg" alt="enter image description here"> What you see here is what remains of my starter. I think it's safe to say that I need a new one.
Doesn't sound like a flex plate or starter issue based on your description. A video would help to identify the sound. Does anything make the sound better or worse? Does it do it all the time? From under the hood where does it sound like the sound is coming from? You can use a mechanical stethoscope or a long screwdrive...
https://mechanics.stackexchange.com
388,563
[ "https://softwareengineering.stackexchange.com/questions/388563", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/-1/" ]
For example, suppose if I had a <code>Character</code> class and an inventory, before taking out a weapon to use it, it's probably a good idea to check if that weapon exists first, so I might have a method called <code>has(GameObject weapon);</code> that returns a boolean. I can then use it in an <code>if</code> statem...
While its nice to be able to make the code write sentences, outside of limited situations it becomes impractical. For a start English is too vague to separate clearly things like <code>character.Has(sword)</code> and <code>character.Has(measles)</code> with single words. Secondly <code>if(character.Has(sword))</code>...
I have seen that unit testing libraries try hard to make code read nicely. I assume this is to help non programmers understand and maybe write tests. For regular code I have not seen much of this and it doesn't seem terribly helpful. I have a feeling that programmers don't actually read code left to right like a book...
https://softwareengineering.stackexchange.com
34,358
[ "https://stats.stackexchange.com/questions/34358", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/13319/" ]
I have the occasion to sit in a Starbuck's almost every day. I have noticed there are rush hours sometimes. It's like hundred of people decided to buy something at Starbucks at the very same time. They rush in, the line becomes longer and longer, and about 15 minutes later they disappear until the next rush hour start...
Queuing theory and time series models have been suggested (and I agree that they are good suggestions). Some other possibilities depending on how you want to approach the question. Decide for each day if it is busy (yes/no) then use logistic regression to model the relationship with predictor variables. Count the nu...
You could construct a time series of the line length over increments of time. Then there are many classes of time series models that one could try to fit to this data. In particular there may be a periodic pattern that could be detected. My thought is that specific times are allotted at workplaces for lunch or coffee...
https://stats.stackexchange.com
242,644
[ "https://security.stackexchange.com/questions/242644", "https://security.stackexchange.com", "https://security.stackexchange.com/users/248089/" ]
It is a laptop shared by my lab. Today I use it, another day one of my student takes it on a field trip. I have 3 hard drives. I wanna leave 2 hard drives for my students and 1 for myself. On my hard drive, I have all my stuff. Students have admin access since they need to install programs, run scripts, etc. Is there a...
There's a concept in threat modelling called <em>spheres of control</em>. A sphere of control is effectively the things in a system that a particular actor has control over. Actors are usually people with different roles, such as unauthenticated users, logged in users, administrators, etc., and each of these has their ...
Yes, you can encrypt the files you want protected. This is often implemented as a transparent layer in the OS, so Applications will work normally without having to decrypt the files first. There's various different solutions depending on the operating system. Windows offers an Encryting File System, and I'm sure the...
https://security.stackexchange.com
410,717
[ "https://softwareengineering.stackexchange.com/questions/410717", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/136084/" ]
Is there a logical reason why the integer is upgraded to 32+ bits? I was trying to make an 8bit mask, and found myself a bit disappointed that the upgrade will corrupt my equations. <pre class="lang-cpp prettyprint-override"><code>sizeof( quint8(0)); // 1 byte sizeof(~quint8(0)); // 4 bytes </code></pre> Usually som...
The rule in C++, which was inherited from C, is that all operands that are smaller than <code>int</code> or <code>unsigned int</code> are first converted to one of those (with <code>int</code> being preferred if it can represent all values of the original type) before the operation is performed. The type <code>int</co...
The C++ Language specification follows the C language specification in being counter-intuitive here. Its defined so that when evaluating integer expressions everything is first converted to an int and then the expression is evaluated. This also applies to unsigned values getting converted to signed values. My guess i...
https://softwareengineering.stackexchange.com
596,446
[ "https://electronics.stackexchange.com/questions/596446", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/252502/" ]
I have zero experience with antennas and little experience with electronics. I need to detect weak radio signals in the range ~100MHz - 1.3GHz and analyze them with an oscilloscope. I bought a large, broad-band log-periodic dipole antenna. I also have an excellent oscilloscope that has more than sufficient bandwidth an...
Antennas are usually connected to <strong>Spectrum Analyzers</strong>. Looking at the RF signal in the time domain may not provide much information about the signal, like signal distortion. Distortion of a signal can be a very slight change in the wave shape which is hard to see without a reference waveform for compari...
The oscilloscope should be grounded through its power cord. It will normally have a three pin plug - hot, neutral, safety ground. It should not be capable of being statically charged. The antenna ground is connected to the oscilloscope ground and from there to the safety ground of the house. The antenna should not b...
https://electronics.stackexchange.com
54,853
[ "https://dsp.stackexchange.com/questions/54853", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/29511/" ]
I have an optimization question. I want to solve the following problem: <span class="math-container">$$ \arg\min_S\frac{1}{2}\|s-c\|_2^2 +\lambda\|\Phi s\|_1 \mbox{ s.t. } As = 0 $$</span> in which <span class="math-container">$\Phi$</span> is the wavelet transform operator. My strategy is to find the close form so...
Indeed you can not solve the problem ignoring the equality constraints and then project the solution onto the set of solution for the constraint. It is easy to build real world example which shows that. Yet, it might be that in most cases it will work reasonably well. You didn't mention how you solve the LASSO Proble...
Why not add an <span class="math-container">$\alpha\|As\|$</span> term to the optimization instead of having it as a constraint?
https://dsp.stackexchange.com
1,439,624
[ "https://math.stackexchange.com/questions/1439624", "https://math.stackexchange.com", "https://math.stackexchange.com/users/260949/" ]
<blockquote> Find Maclaurin expansion of $$y=2^x\text{ to } x^4$$ </blockquote> This is my try. We have $\displaystyle 2^x=e^{x\ln 2} =\left[1+\frac{x^2}2+\frac{x^3}6+\frac{x^4}{24}+o(x^4)\right]^{\ln 2}$ with $o(x^4)$ is infinitesimal larger, but I think that it doesn't meet the problem because $\left(x^4\right)^{...
It is much simpler: by substitution, we get $$2^x=e^{x\ln 2} =1+x\ln 2+\frac{x^2\ln^22}2+\frac{x^3\ln^32}6+\frac{x^4\ln^42}{24}+o(x^4).$$
You didn't apply the taylor series properly. We have $$\displaystyle 2^x=e^{(x\ln 2)} =1+\frac{(x\ln2)}{1!}+\frac{(x\ln2)^2}{2!}+\frac{(x\ln2)^3}{3!}+\frac{(x\ln2)^4}{4!}+O(x^5)$$
https://math.stackexchange.com
123,946
[ "https://electronics.stackexchange.com/questions/123946", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/50648/" ]
My question involves chassis grounding to earth ground. My PCB circuit is a simple signal generator using a microcontroller. It has a separate 'ground' from earth ground, supplied by a floating 5VDC source. (I guess we would call this a digital ground?) The PCB is to be installed inside a metal chassis (aluminum, I b...
After some experimentation, I found out that it is indeed okay to have capacitative coupling between chassis and earth ground. In the question, I wrote, <blockquote> if I connect the earth ground DIRECTLY to the chassis, the circuit is shorted. </blockquote> This is not true, and it was actually caused by me short...
if you are concerned about noise interference, use decoupling capacitors as follows:<br /> Let's discuss an audio amplifier with power supply, assembled in a metal box. The power supply consists of a transformer powered with 120Vrms HOT and NEUTRAL. The metal transformer is bolted to the metal cabinet. Metal of the tr...
https://electronics.stackexchange.com
229,029
[ "https://dba.stackexchange.com/questions/229029", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/171861/" ]
I'm a rookie with postgres, and after I started the postgresql-11.service, I enter in 'su postgres', and try create my db, but appear this message: <pre><code>[root@127 nemo]# systemctl enable postgresql-11.service [root@127 nemo]# systemctl start postgresql-11.service [root@127 nemo]# su postgres bash-4.4$ createdb m...
<code>createdb</code> needs to connect to a database to issue a <code>CREATE DATABASE</code> SQL statement, and by default it will use: <ul> <li>a Unix socket domain connection</li> <li>the current username from the shell as the database user (so <code>postgres</code> in your case)</li> <li><code>template1</code> as t...
<code>su postgres</code> leaves you in a weird state where your are currently in a directory which you have no access to be in. You probably want to do <code>su - postgres</code>, which will leave you in postgres's home directory.
https://dba.stackexchange.com
49,751
[ "https://datascience.stackexchange.com/questions/49751", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/31599/" ]
The csv file is downloadable. I can download the file and use read_csv, But I want to read the file via direct URL in jupyter, I used the following code, but I get the <code>HTTP 403 Forbidden</code> error <pre><code>from io import StringIO import pandas as pd import requests url="https://fineli.fi/fineli/en/elinta...
The problem is that the url you have doesn't accept "non-browser" requests. The default header of Python requests is <pre><code>'User-Agent': 'python-requests/2.13.0' </code></pre> You can pass your own headers as an argument like that <pre><code>from io import StringIO import pandas as pd import requests headers =...
I read the file using the following code <pre><code>from urllib.request import urlopen, Request headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.3"} reg_url = "https://fineli.fi/fineli/en/elintarvikkeet/resultset.csv" req = Request(url=reg_url,...
https://datascience.stackexchange.com
137,210
[ "https://security.stackexchange.com/questions/137210", "https://security.stackexchange.com", "https://security.stackexchange.com/users/113705/" ]
Well this is not a question of a specific problem I have it's more a general question. Yesterday I had a little argument with a friend of mine wehter or not a "high security application" (e-Banking for example) could be implemented in Angular (not specifically angular, client-side SPA's in general). While I was sure ...
There's no reason you can't do a security sensitive website in AngularJS or Angular2 - for the most part, the key points of security happen server side, not JS side. Yes, of course, you need to do some XSS and CSRF protections on the client (in conjunction with the server), but that is very doable in Angular/Angular2....
The browser should be trusted with the user's data in any case. Whether you use a single-page app or a plain HTML page, you are toast if the browser is compromised. Single-page apps do not change anything in this context. Single-page apps can however extend the potential of a server-side vulnerability - since you're n...
https://security.stackexchange.com
296,757
[ "https://softwareengineering.stackexchange.com/questions/296757", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/4049/" ]
I've had a dispute with a colleague about when to run JavaScript unit tests in a CI environment at one of two different times. Let's call the two parties PE (pro-early) and PL (pro-late). <h2>Early (against src)</h2> Running the tests against the source code right out of the version control system. PE says that we...
From a generic testing point of view: "Testing early" is a workflow optimization. It helps you iterate faster by failing quickly. Tests that are close to source code, like unit tests, are useful here. "Testing late" is a requirement for quality assurance. You must test code exactly as it ships, because as you said, t...
Typically you'd run unit tests early - they're developer tests that the bits you've developed work as expected in isolation. Then you'd run wider integration tests late, as these test that the bits you've developed work as expected with the other bits. There's no need to run unit tests both early and late - its redund...
https://softwareengineering.stackexchange.com
1,233,977
[ "https://math.stackexchange.com/questions/1233977", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223228/" ]
The problem is I need to list all elements in the stabilizer of the permutation $\sigma=(123)$ in $S_5$. I know that the stabilizer of a permutation $\sigma$ is the subgroup $$Stab_{{S_n}}(\sigma) = \left\{ x\in S_n : x\sigma x^{-1}=\sigma \right\}$$ So that I need to find a permutation $x$ such that $$x\sigma x^{-1}...
There are definitely more than one element stabilizing $(123)$. Note that you can rewrite $(123) = (312) = (231)$, which should indicate more possible stabilizers using your method. Furthermore, you should check that if $x$ fixes $(123)$ then $x \circ (45)$ also fixes $(123)$.
Hmm. $\text{Stab}(x) = \{g \in G: g \cdot x = x\}$. So we are letting elements in $S_5$ act on $\sigma=(123)$ by regular function composition. Let $\tau \in S_5$ then $\tau \cdot \sigma = \sigma \iff \tau(1)=1,\tau(2)=2$ and $\tau(3)=3$. It would seem as though we could then take any permutation of the form $\tau=(xy)$...
https://math.stackexchange.com
118,052
[ "https://softwareengineering.stackexchange.com/questions/118052", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/1813/" ]
As server-side generated HTML is trivial (and it was the only way to make dynamic webpages before AJAX), <strong>server-side generated CSS</strong> is not. Actually, I've never seen it. There are CSS compilers, but they generate CSS files which can be used as static. Technically, it requires no special libraries, the ...
The big reason why css is seldom generated dynamically (this is also true for javascript) is because they are good candidates for caching. CSS is a very flexible way to style your pages, with the right combination of classes, you can get all of the different parts of all of your different pages styled according to all...
I believe your assumption is wrong: in my last project, the application was using server-generated CSS loaded by ajax (because, depending on the location of the map you were looking at, the page was branded with completely different styles). However, usage cases where retrieving extra CSS by ajax would solve the probl...
https://softwareengineering.stackexchange.com
98,515
[ "https://mathoverflow.net/questions/98515", "https://mathoverflow.net", "https://mathoverflow.net/users/22758/" ]
Let $X$ be a continuous local martingale, and $\langle X \rangle$ be its quadratic variation process. The "standard" proof of Burkholder-Davis-Gundy inequalities found in books yields $(\mathsf{E} |X|^{p})^{1/p} \le O(p) \cdot (\mathsf{E} \langle X \rangle ^{p/2})^{1/p}$ for large $p$. Can the growth rate be improved ...
I know a version which exactly gives the constant $O(p^{1/2})$ for $p\ge 2$. It is contained in a lecture note by D. Khoshnevisan on SPDE.
You are correct that for bounded $&lt;X&gt;_T$ the tails of $X_T$ should be Subgaussian. However, the Burkholder-Davis-Gundy inequality gives an upper bound for the $L^p$-norm of the running supremum $X_T^* = \sup_{t \le T} |X_T|$, of $X$ not just for $X_T$ itself. I do not see a reason why $X_T^*$ should have Subgaus...
https://mathoverflow.net
176,807
[ "https://electronics.stackexchange.com/questions/176807", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/30849/" ]
I've accidentally lost the sync between my schematic and board, with Eagle CAD giving me the following error: <blockquote> Board and schematic are not consistent! No forward-/backannotation will be performed! </blockquote> Is there a method of re-linking the two? I had very little work invested in the board layo...
From schematic run ERC. Consistency errors will be at the top. Fix the errors by removing parts, nets, etc. that causes them then try to switch to layout and back. Repeat until the error message disappears.
Alternatively, some versions of Eagle generate .b#1, .b#2 and .s#1, .s#2 files which are backups. If you rename the extension to .brd and .sch you can go back a few steps and hopefully recover what you lost.
https://electronics.stackexchange.com
2,637,417
[ "https://math.stackexchange.com/questions/2637417", "https://math.stackexchange.com", "https://math.stackexchange.com/users/527390/" ]
<blockquote> Given that $$\begin{aligned} &amp;x=r\cos(\theta),\\ &amp;y=r\sin(\theta),\\ &amp; \qquad \text{and}\\ &amp;x^2+y^2=r^2 \end{aligned}$$ Show that $\partial_y(\theta)=\cos(\theta)/r.$ </blockquote> I tried the following: Since $$\partial_\theta(y)=\partial_\theta(r)\sin(\theta)+r\cos(\theta)$$ then...
$$\theta=\arctan (\frac {y}{x}) +k\pi$$ $$\implies \;\frac {\partial \theta}{\partial y}=\frac {1}{x}\frac {1}{1+(\frac {y}{x})^2} $$ $$=\frac {x}{r^2} $$ $$=\frac {\cos (\theta)}{r}$$
$\begin{bmatrix} \frac {\partial x}{\partial r}&amp;\frac {\partial y}{\partial r}\\ \frac {\partial x}{\partial \theta}&amp;\frac {\partial y}{\partial \theta}\end{bmatrix} = \begin{bmatrix} \cos\theta&amp;\sin\theta\\ -r\sin\theta&amp;r\cos\theta\end{bmatrix}$ $\begin{bmatrix} \frac {\partial r}{\partial x}&amp;\fra...
https://math.stackexchange.com
104,206
[ "https://mathoverflow.net/questions/104206", "https://mathoverflow.net", "https://mathoverflow.net/users/2811/" ]
I'm looking for, or hoping to inspire the creation of, a list of conventional names for categories that come up often. For example, we have <em>the terminal category</em> $\fbox{$\bullet$}$, a nice name. I've heard this category $\fbox{$\bullet\to\bullet$}$ called <em>the free arrow category</em>. That's fine by me. W...
I notice that the categories considered for naming here are all the domains, or shapes, of basic <em>diagrams</em>; an object, an arrow, an endomorphism (n.b., my instinct was just to call that $\mathbb{N}$), a composable sequence, parallel arrows, equalized arrows... Not that diagrams <em>in</em> these categories are...
You're definitely not going to get consensus. I've heard your "free arrow category" also called "the walking arrow" and "the arrow category" and "the interval category" and "the directed interval category" and "the ordinal 2", just off the top of my head. The length-n chain category is, I think, a bit more commonly c...
https://mathoverflow.net
438,304
[ "https://stats.stackexchange.com/questions/438304", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/267053/" ]
I have been getting some bizarre z-score calculations and wanted to confirm whether my concept and/or implementation is correct. I have a <code>pandas</code> DataFrame <code>df</code>: <pre class="lang-py prettyprint-override"><code>count1 count2 countd 127 1 -126 127 1 -126 127 3 -124...
You'd want two separate dataframes in this case for a more efficient computation. Say your dataframe is split into two lists, <code>list1</code> and <code>list2</code>. Then: <pre><code>sd = math.sqrt((np.std(list1) ** 2 + np.std(list2) ** 2)/len(df)) print((np.mean(list1)-np.mean(list2))/sd) </code></pre> You could o...
Calling variables as <span class="math-container">$c_1,c_2,c_d=c_1-c_2$</span>. It's not correct because <span class="math-container">$\sigma$</span> is the standard deviation of <span class="math-container">$c_d$</span>, not <span class="math-container">$x$</span>. In order to test for <span class="math-container">$x$...
https://stats.stackexchange.com
314,993
[ "https://electronics.stackexchange.com/questions/314993", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/148546/" ]
I have an AC motor. It is running for 1 hours and I read the current every one minute and it reads 2A. So how to know how much the energy my motor already consumed? In this case, voltage is steady at 220V and not knowing the power factor(or make an assumptions that it is constant).
For single-phase AC, power is voltage X current X power factor. Power factor is a number between zero and one that indicates how closely the voltage and current waveforms coincide with each other. The power factor for full load may be marked on the motor. A typical motor will have a high power factor, perhaps 0.8 to 0....
I am assuming that there is a steady load on the motor since the current is at 2A every time you check it. You mentioned the voltage is at 220V, so this gives you an operating power of 440W. (Power = Voltage x Current) After the motor has been run for 1 hour, it consumes 440Wh of energy. (Energy = Power x Time)
https://electronics.stackexchange.com
113,495
[ "https://physics.stackexchange.com/questions/113495", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/43847/" ]
The problem of a grounded conducting sphere inside a uniform $E$ field in the $z$ direction can be solved by imagining the field be produced by a pair of charges $Q$ and $-Q$ put on the $z$ axis, taking the limit that the charges are very very far away, $Q\rightarrow\infty$, and using the image method. Under this limit...
you don't need two charges, you can use only one charge and the answer will be the same, you only should note to add a second image charge in the centre of the sphere to make the sphere neutral.<br> in both cases, when you take the limit, you get same electric dipole in the centre of sphere.<br> but because the symmetr...
If we forget about the image charges for a moment, there should be a symmetry between the front part and rear part of the sphere. Because, $e^-$s drawn from the back of the sphere to the frontal part will expose equal amount of +ve ions in the back. A single charge will note restore this symmetry. Also, there will be ...
https://physics.stackexchange.com
155,943
[ "https://security.stackexchange.com/questions/155943", "https://security.stackexchange.com", "https://security.stackexchange.com/users/144229/" ]
I am trying to learn Penetration testing. While learning I was trying to practice on my own as well. I had found a vulnerable image called ICE 120 in internet which is a vulnerable web application and was able to get usernames and hashes for the system after exploiting sql injection. Now while I had logged into that ...
Have you tried any of the other dirtycow variants? If you think the problem lies with the poc you could potentially rule this out by trying other poc's that are exploiting the same vuln. Don't need to spawn a shell to become root, you could always append a new user account to /etc/passwd and /etc/shadow.
The suid binary should be the passwd binary, not your passwd file. Type "which passwd" and set your suid_binary character array to the full path of passwd.
https://security.stackexchange.com
1,666,537
[ "https://math.stackexchange.com/questions/1666537", "https://math.stackexchange.com", "https://math.stackexchange.com/users/210340/" ]
Let $\alpha,\beta \in \mathbb{R}$. I was wondering if there is a systematic way to solve integrals of the following form: \begin{equation} \int^1_{0} x^\alpha(1-x)^\beta dx \end{equation} I have seen similar kind of integrals many times. Any help/hints would be really appreciated. Thanks!
Using the definition of the Beta Function: $$B(x,y)=\int_0^1t^{x-1}(1-t)^{1-y}dt$$ By matching coefficients,we would conclude that: $$\int_0^1x^\alpha(1-x)^\beta dx=B(\alpha+1,1-\beta)$$
Begin with the definition of the Gamma function: $$\Gamma(\alpha+1) = \int_0^{\infty} du\; u^{\alpha} e^{-u} $$ Similarly, $$\Gamma(\beta+1) = \int_0^{\infty} dv\; v^{\beta} e^{-v} $$ Multiply these together... $$\begin{align}\Gamma(\alpha+1) \Gamma(\beta+1) &amp;= \int_0^{\infty} du\; \int_0^{\infty} dv\; u^{\alp...
https://math.stackexchange.com
5,591
[ "https://mechanics.stackexchange.com/questions/5591", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/2221/" ]
I first had this question while playing a racing game - it was a touring race with BMW 320i's, and I noticed that I could rev up to 8,500 RPM before shifting gears. Now my car (an older 320i), certainly can't hit 8,500 RPM - it can do a bit over 6,500 RPM before I need to shift (the rev limiter kicks in shortly after ...
The rev limiter would have to be removed. This would be involved in a <strong>custom</strong> <code>DME</code>. With the limiter removed then you'd be able to blow it up if you wanted to. To support the higher revs, the vehicle would need the engine internals worked on. Stronger camshaft(s), valves, valve springs. <em...
There are 3 key factors to work on when uprating for higher revs: <ul> <li>Moving parts</li> </ul> Spinning a rod, cam or flywheel faster than it is rated for will result in it destroying itself, often spectacularly, as the stresses become too much. Moving linkages and pistons back and forth also takes a lot of energ...
https://mechanics.stackexchange.com
231,681
[ "https://physics.stackexchange.com/questions/231681", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/103605/" ]
In beta minus decay, beta-minus particle and anti-neutrino are ejected, leaving behind daughter nucleus. $\beta^-$ and anti-neutrino both are leptons. <ol> <li>Were the leptons already present in the nucleus in some form?</li> <li>Weak interactions are responsible for various processes here (and transformation of bo...
<ol> <li>No. A pair of neutrinos is pulled from the vacuum. One of them interacts with one of the quarks via the weak force, and they both change identity: the quark to another kind, thus changing the neucleon; the neutrino to an electron, which escapes. (The negative charge unit also moved from the quark to the lept...
Leptons are not present inside the nucleus or in the nucleons(protons and neutrons). Instead what happens is the W- boson is created and this turns the down quark into an up quark. The W- boson then gets converted into an electron and an electron antineutrino. The leptons are created from W- boson and are fundamental...
https://physics.stackexchange.com
6,477
[ "https://cogsci.stackexchange.com/questions/6477", "https://cogsci.stackexchange.com", "https://cogsci.stackexchange.com/users/4322/" ]
One may cause to argue that Fun activities are solely based off psychological and physical identification with certain activities, but surely there is a deeper analysis on why we find things fun. Furthermore, what is the relationship of personal experience to what an individual finds fun. Some argue that what we find...
I would argue that a positive emotional experience is something that evolved for conscious organisms in order for consciousness to function in a way that supports survival and reproduction (thus, sex and eating are pleasurable experiences). Once having this system, an organism can then find other ways to trigger it th...
I think that a person finds something fun if it is challenging (it makes you learn something new, grow, etc.), yet he/she has a talent for it so he/she is doing well at it. Isn't that fun. On the other hand if you do something and it's hard and you're just not getting it, it's not fun and you'll probably consider explo...
https://cogsci.stackexchange.com
47,132
[ "https://stats.stackexchange.com/questions/47132", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/18361/" ]
I have a dataset of about 75K samples with about 20 features per sample (12 of which are probably important) describing various credit profiles - credit score, late payments, income, etc. Some of the input variables are continuous and some are categorical. The output variable is continuous - the ROI associated with eac...
If your categorical data are ordered, and therefore could be transformed to continuous (but integer) variables, then the Random Forest algorithm is likely to be a competitive solution which requires very little tuning compared with other methods (such as neural networks). RF will effectively do feature selection (of so...
The question, as asked, is impossible to answer correctly. It depends on the structure inside your data. Is there a distance measure on your data such that the average of the closest n-points almost always give a good estimate of the values? Is there a global structure to the data such as one that would be reflected...
https://stats.stackexchange.com
245,450
[ "https://electronics.stackexchange.com/questions/245450", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/82348/" ]
i see schematics with values such as .01uF among others... why out of all components are these not labeled using engineering notation
It is a matter of history, sadly. Capacitors where built well before the International System of measurement (SI) was established and some prefixes weren't used so much (e.g. nano). For example, usually capacitors only used <em>microfarad</em> (sometimes written as \$MFD\$) and <em>picofarad</em> as units, this latter...
The history of this is probably bound up in the technology of early capacitors. In the early days, capacitors were <ol> <li>Electrolytic or oil-filled (generally larger than 1uF) </li> <li>Mica or NP0 (and other controlled tempco) ceramic types or air (some pF to hundreds of pF)</li> <li>Paper or film types, general...
https://electronics.stackexchange.com
3,088
[ "https://mechanics.stackexchange.com/questions/3088", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/826/" ]
By mistake, I left the headlights on overnight for my Honda Civic 2008. 24 hours later when I tried to start it, the car would not start and nothing would come on including the internal lights and the dashboard LEDs. Later AAA guy came and jump started the car and I drove it around for around 30 minutes. Today when I...
Depends where you drove, it might simply be an issue with the battery needing more of a charge than your trip could give it. That said, regular car batteries don't take too kindly to deep discharging and if it was fairly old and nearing the end of its life already, it might have just pushed it over the edge. I'd put t...
If you take it to an auto parts store they can test it for you for free.
https://mechanics.stackexchange.com
25,443
[ "https://mathoverflow.net/questions/25443", "https://mathoverflow.net", "https://mathoverflow.net/users/18/" ]
I was told recently that if I take a 2-torus (genus 2) and remove 1 point, then this is homotopy equivalent to a torus with 3 points removed. This may be really easy but I don't see it. Thank you!
A surface minus a finite number of points is homotopy equivalent to a bouquet of circles, and two bouquets of circles are homotopy equivalent iff they have the same number of circles. This two observations and a little picture to see how many circles are involved in your example should do it :)
First observe that the fundamental groups of both spaces are isomorphic (both are free groups with 4 generators). Both universal covers are contractible (they are 2 dimensional non compact spaces). Hence both spaces are homotopy equivalent to the classifying space of the free group with 4 generators.
https://mathoverflow.net
74,480
[ "https://physics.stackexchange.com/questions/74480", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/28380/" ]
An object has an initial velocity of <strong>v</strong> and should stop in <strong>d</strong> meters, in <strong>t</strong> seconds where <strong>v*t >= d</strong>. I can predict that this acceleration won't be constant but it is a function of time and this problem may not have one exact solution for given <strong>v</s...
Assuming $v-t$ graph is quadratic; we can write velocity, acceleration and distance functions as $$ f(x) = ax^2 + bx + c \mbox{ } (\mathrm{velocity})$$ $$f'(x) = 2ax + b \mbox{ } (\mathrm{acceleration}) $$ $$ F(x) = ax^3/3 + bx^2/2 + cx + k \mbox{ } (\m...
I don't think the function is unique. Consider the following velocity-time graph, where the initial velocity is $v$ and time taken to stop is $t$, <img src="https://i.stack.imgur.com/6PH0B.png" alt="velocity-time graph"> Now, the area under the curve represents the distance traveled $d$. I hardly think that there is...
https://physics.stackexchange.com
237,915
[ "https://mathoverflow.net/questions/237915", "https://mathoverflow.net", "https://mathoverflow.net/users/42721/" ]
Suppose that I have an unbounded subset $X \subset \mathbb{R}^n$, definable in the $o$-minimal structure $\mathbb{R}_{an, exp}$. Is it possible to find an unbounded, analytic and definable curve (i.e. real-analytic set of dimension one) contained in $X$?
Clearly you can find an unbounded definable curve $C\subset X$. Any set in $\mathbb{R}_{an, exp}$ admits a <em>finite</em> stratification by real analytic submanifolds. Pick one such stratification of $C$. One of the strata of this stratification is an unbounded real analytic curve contained in $C$ and, a fortio...
This holds in any o-minimal structure. First perform an inversion $i\colon x\mapsto x/\|x\|^2$ so that the origin becomes a limit point of $i(X)$. Then apply the <em>Curve selection lemma</em>: for every definable set $A$ in an o-minimal structure, and any limit point $a\in \overline A$, there exists a definable map $...
https://mathoverflow.net
1,063,898
[ "https://math.stackexchange.com/questions/1063898", "https://math.stackexchange.com", "https://math.stackexchange.com/users/79884/" ]
I would like to solve for $C$ $$7^C \times 2^{n-C-1} \le \frac{2^n}{100}$$ Real questions. The different base is really throwing me off. I got up to $$7^C 2^{-C} \le \frac{1}{50} $$
$$\begin{align*}7^C\cdot 100 \le 2^{n-n+C+1} &amp;\iff 7^C\cdot 100 \le 2^{C+1}\\ &amp;\iff 7^C\cdot100\le 2^C \cdot 2 \\&amp;\iff \left(\frac{7}{2}\right)^C\le \frac{2}{100} \\&amp;\iff \ln\left(\frac{7}{2}\right)^C \le \ln \frac{2}{100} \iff C \ln \frac{7}{2}\le \ln \frac{2}{100}\end{align*}$$ <hr> After editing yo...
Take the $\log$ of both sides, noting that $\log(x)$ is an increasing function for $x &gt; 0$. In particular, we have \begin{equation} C \log{7} + (n-C-1)\log{2} \leq n \log{2} - \log{100}. \end{equation} Now, it's straightforward to get an inequality with $C$ isolated.
https://math.stackexchange.com
231,278
[ "https://softwareengineering.stackexchange.com/questions/231278", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/75667/" ]
We're trying to come up with a way to handle code that builds dynamic SQL for our application, which is very database centric. Things like Linq to SQL and Entity Framework are out of the question, so please no suggestions of that sort, our path has been defined for us. Our main goal is seperation of the SQL from the r...
What you are saying is that you can't use a well supported ORM so you are trying to invent your own limited ORM to compensate. That isn't going to go well. Performance-wise the modern ORMs stand up very well and they are fluent enough to let you do most operations you can do with a database server in raw SQL. That sai...
I see you using enums, however it would appear you'd be passing collections for things like fields/database columns. First you will need to define a collection that makes up the view - [database name]. [schema].[table name].[column name], which is condensed as appropriate into an alias at the column name level. Your ...
https://softwareengineering.stackexchange.com
44,189
[ "https://dsp.stackexchange.com/questions/44189", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/25931/" ]
I am interested in measuring a signal with significant energy content up to 1-2 kHz. However, I am only able to sample the signal after it has passed through a first-order lowpass filter of known bandwidth (which significantly distorts the signal; in this case the bandwidth is 500 Hz). I sample the lowpass-filtered ver...
This very, very much sounds like the classical problem for which you can derive that the <em>matched filter</em> is the optimal receive filter to maximize SNR. You say you know the <em>shape</em> of the signal; I interpret this like your system looks like this TX impulse $p$ -> Pulse shaping filter $g$ -> 500 Hz low ...
Since the filter is first-order, there is probably more than enough energy still there to recover it. So all you have to do is divide the signal (in the frequency domain) by the filter impulse response, and you'll have the original signal. If its an IIR filter, just use the first fraction of a second of the impulse res...
https://dsp.stackexchange.com
91,430
[ "https://physics.stackexchange.com/questions/91430", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/36349/" ]
I am designing a "glider" of sorts, and I have some basic questions about the physics involved to get me started. How much lift is required to overcome the weight of an average person, say 150 pounds? Is the lift required simply 150 pounds?
Yes, lift is nothing but the force in the upward direction. So to keep a 150 pound person aloft, you need a lift of 150 pounds (150 pound-force).
In steady flight, the sum of all the vertical forces has to be zero. This means that the glider has to lift its own weight, in addition to weight of its pilot. So 150 pounds would not be sufficient in this case.
https://physics.stackexchange.com
205,612
[ "https://physics.stackexchange.com/questions/205612", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/59186/" ]
I have a pair of questions about conservation of energy and momentum in a viscous fluid. First, energy. Symon's Mechanics states an equation for conservation of energy in a droplet of a non-viscous fluid as ${d \over dt}({1 \over 2} \rho v^2 \delta V)=\vec{v} \cdot (\vec{f} - \nabla p) \delta V $ (2nd edition, page 32...
<blockquote> Is it correct that from far away, due to time dilation, we can never see the two black holes merging or colliding? </blockquote> Correct. By definition you never see a horizon unless you cross it. <blockquote> Would we perceive the relative motion of the two black holes slow down before the two even...
Luckily black holes emit Hawking radiation, so in some sense we can see them. So first there are two glowing balls approaching each other, after some time there will be one glowing ball that is twice as large as one of the initial glowing balls. (I'm considering black holes of same size) And during the collision the ...
https://physics.stackexchange.com
271,450
[ "https://electronics.stackexchange.com/questions/271450", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/37643/" ]
I have designed a simple PLL with current-starved ring VCO. The minimum frequency of oscillation for this VCO is zero since there is no current fed to ring of inverters when control voltage is zero. As described in Chapter on Digital Phase Locked Loops in Jacob Baker's CMOS Circuit Design, Layout, and Simulation (Sec...
<em>Why is it essential for VCO to continue oscillating when input is zero?</em> I disagree with the statement that it is essential to keep the VCO oscillating for any input signal. You could look at that statement in a broader sense: Is it needed to have the VCO oscillating for <strong>all</strong> possible input si...
<blockquote> "The frequency of the square wave output of the VCO is \$f_{center}\$ when \$V_{in}(= V_{center})\$ is VDD/2 (typically). It is important that the VCO continues to oscillate with no input data." </blockquote> It is important because if the VCO oscillate at the <strong>center</strong> frequency the t...
https://electronics.stackexchange.com
3,834,755
[ "https://math.stackexchange.com/questions/3834755", "https://math.stackexchange.com", "https://math.stackexchange.com/users/688679/" ]
Let <span class="math-container">$f\in L^1(\mathbb{R}^d)$</span>. Show that <span class="math-container">$T_f:g\mapsto f\star g$</span> is of norm <span class="math-container">$\Vert f\Vert_1$</span> as a linear operator from <span class="math-container">$L^1(\mathbb{R}^d)$</span> to <span class="math-container">$L^1(\...
As far as I understand, you are able to prove that the operator <span class="math-container">$T_t: L^{\infty} \to L^{\infty}$</span> has norm <span class="math-container">$\|f\|_{L^1}$</span> if <span class="math-container">$f \in L^1$</span> is uniformly continuous. You can extend the assertion using a density argumen...
Here is a different solution based on the following fact: If <span class="math-container">$\frac1p+\frac1q=1$</span>, <span class="math-container">$f\in L_p(\lambda)$</span> and <span class="math-container">$g\in L_q(\lambda)$</span>, then <span class="math-container">$f*g$</span> is uniformly continuous: Here is a sho...
https://math.stackexchange.com
117,337
[ "https://math.stackexchange.com/questions/117337", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
A colleague popped into my office this afternoon and asked me the following question. He told me there is a clever proof when $n=2$. I couldn't do anything with it, so I thought I'd post it here and see what happens. <em>Prove or find a counterexample</em> For positive, i.i.d. random variables $Z_1,\dots, Z_n$ with...
Yes, the inequality always holds for i.i.d. random variables $Z_1,\ldots,Z_n$. In fact, as suggested by Yuval and joriki, it is enough to suppose that the joint distribution is invariant under permuting the $Z_i$. Rearranging the inequality slightly, we just need to show that the following is nonnegative (here, I am us...
Since the $Z_i$ are i.i.d., the expectation is the same if we rename the variables. Taking all permutations, your inequality is equivalent to $$ \mathbb{E} \left[ \frac{1}{n!} \sum_{\pi \in S_n} \frac{\sum_{i=1}^n a_i^2 Z_{\pi(i)}}{\sum_{i=1}^n a_i Z_{\pi(i)}} \right] \leq \frac{\sum_{i=1}^n a_i^2}{\sum_{i=1}^n a_i}. $...
https://math.stackexchange.com