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
106,457
[ "https://physics.stackexchange.com/questions/106457", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/23583/" ]
<blockquote> Consider a system of particles with wave function <span class="math-container">$\psi$</span>(x) (x can be understood to stand for all degrees of freedom of the system; so, if we have a system of two particles then x should represent {<span class="math-container">$x_1; y_1; z_1; x_2; y_2; z_2$</span>}). The...
They have used the Schrödinger equation: $$i\hbar\frac{\partial \psi}{\partial t} = \hat{H} \psi$$ And hence: $$\frac{\partial \psi}{\partial t} = \frac{1}{i\hbar}\hat{H}\psi$$ And since $1/i = -i$: $$\frac{\partial \psi}{\partial t} = -\frac{i}{\hbar}\hat{H}\psi$$ Similarly for $\psi^*$ we take the complex conjugate...
From the Schroedinger equation, $$i\hbar\frac{\partial\psi}{\partial t}=\hat{H}\psi$$ simply divide by $i\hbar$: $$\frac{\partial\psi}{\partial t}=\frac{1}{i\hbar}\hat{H}\psi=-\frac{i}{\hbar}\hat{H}\psi\\$$ where we used $$ \frac{1}{i}\cdot\frac{i}{i}=\frac{i}{i^2}=\frac{i}{-1}=-i $$ Now note that you've incorrectly a...
https://physics.stackexchange.com
122,756
[ "https://dba.stackexchange.com/questions/122756", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/65798/" ]
I have a table of 1 million record to join another table with 100000 records. However, there are 5 potential keys (lets assume Account Number, email address, membership number, alternative email, and ID number) in table 1 and 60 columns () in table 2 that must be used as joining keys. So, my code would be something lik...
While I think you should consider changing the setup, you could try the UNION approach. Instead of making multiple OR joins, you can make specific queries per case, and then UNION them together. Then you have the chance to make each individual query use indexes. So something like <pre><code>Select * FROM tbl1 t1 joi...
I don't think there is a way to get this query to perform well, but the code will be easier to read if you use the <code>IN</code> predicate: <pre><code>select * from tbl1 t1 join tbl2 t2 on t1.col1 in (t2.col1, t2.col2, ...) or ... or t1.col5 in (t2.col1, ... ) </code></pre>
https://dba.stackexchange.com
177,926
[ "https://electronics.stackexchange.com/questions/177926", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/72586/" ]
Is it a good idea to replace wires that get bent a lot (e.g., around a hinge) with conductive threads? It's a 5V device using up to 1A. Thanks
Conductive thread is simply thread with wire woven through it, so it won't necessarily be any more robust. The critical thing for reducing fatigue in wires that are flexed a lot is to maximize the radius of curvature. Instead of bending it directly around the hinge, use a generous loop of wire, so that the maximum cur...
I wouldn't necessarily use conductive thread for this, because the resistance is actually pretty high -- 10's of ohms per foot. Ohms law says that if you sent 1 amp through 1 ohm (an inch or so of conductive thread) the voltage drop across the thread will be 1 volt. The power through the thread will be 1 Watt. This m...
https://electronics.stackexchange.com
1,788,458
[ "https://math.stackexchange.com/questions/1788458", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I want to prove the integration formula $$ \int \frac {\sqrt {a+bu}}{u} \ du = 2 \sqrt {a+bu}+a \int { \frac {du}{u \sqrt {a+bu}} }. $$ I tried trigonometric substitution (as $u= \frac {a \tan^2 \theta}{b}$), but it didn't seem to work. I am stuck on how to prove the integration formula.
First note that $\int \frac{\sqrt{a+bu}}{u} du=\int \frac{a+bu}{u\sqrt{a+bu}} du=b\int \frac{1}{\sqrt{a+bu}} du+a\int \frac{du}{u\sqrt{a+bu}} $ Now for the first term substitute $x=a+bu$ and it becomes $\int \frac{1}{\sqrt{x}} dx =2\sqrt{x}=2\sqrt{a+bu}$ And we're done.
Let's try another substitution. Let $x=\sqrt{a+bu}\Rightarrow u=\dfrac{x^2-a}{b} \qquad dx=b/2(a+bu)^{-1/2}du=\dfrac{bdu}{2x}\Rightarrow \dfrac{2xdx}{b}=du$ Now we have ${\Large{\int}} \dfrac{2x^2}{b}\cdot\dfrac{b}{x^2-a}dx=2{\Large{\int}} \dfrac{x^2}{x^2-a}dx=2{\Large{\int}} \dfrac{x^2-(x^2-a)}{x^2-a}+\dfrac{x^2-a...
https://math.stackexchange.com
178,282
[ "https://physics.stackexchange.com/questions/178282", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/75502/" ]
Suppose there are two similar particle-like objects attempting to "bump" against each other to create friction, they are prevented from colliding against one another due to either electrostatic repulsion or Pauli exclusion principle. My question is how friction (heat) is produced in the above stated scenario. Am I mis...
You've stumbled on an interesting idea: how do classical systems that dissipate heat or energy via friction arise from quantum systems that perfectly conserve energy in their interactions? Particles in the collision kind of scenario you described don't really exhibit friction. One convenient point is that temperature ...
Whatever you do it produces heat. This has to do with electromagnetic interactions between the two objects which interact. Moving one surface on an other, the surface electrons from both surfaces will be disturbed, they couldn't be at the same place and will be moved slightly. Every displacement has elements of acceler...
https://physics.stackexchange.com
451,046
[ "https://physics.stackexchange.com/questions/451046", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/30715/" ]
The probability of current in quantum mechanics when the is a magnetic potential, <strong>A</strong>, is defined as: <span class="math-container">$$\boldsymbol j=\frac{1}{2m}(\psi^*\hat{\boldsymbol p} \psi-\psi\hat{\boldsymbol p}\psi^* -2q{\boldsymbol A}|\psi|^2) \tag{1}$$</span> However, when dealing with plain waves...
Complex-valued <span class="math-container">$\mathbf E$</span> or <span class="math-container">$\mathbf A$</span> appear often in calculations involving EM waves. It is understood there that such complex-valued quantity represents a real-valued quantity, this practice is because of easier manipulation of complex expone...
When you work with plane waves you always have to take the real part when you want to talk of something physical. For example, if I compute the electric field from your potential, assuming there's no Coulomb potential <span class="math-container">$\phi$</span>, <span class="math-container">$$\vec E = -\frac{1}{c}\fra...
https://physics.stackexchange.com
43,445
[ "https://dsp.stackexchange.com/questions/43445", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/16669/" ]
As far as I can understand, the motivation to OFDM and multi carrier communication in general was alot due to the ISI caused by multi-path which is equivalent to frequency selective channel. Now, by using OFDM, we send our symbols over sub-carriers, thus each symbol in the frequency domain is affected by approximately ...
OFDM (sub)carriers are only exactly orthogonal over a certain IFFT block length (and integer multiples). Multipath echos will mix a subcarrier signal from the end of one symbol block into the beginning of the next, rendering the symbol in that carrier to be ambiguous over the initial one IFFT block length. A Cyclic P...
Well, it is not that simple. CP can be considered as a guard period between successive symbols and therefore interference from one (OFDM) symbol to another (ISI) is avoided. Let's forget about CP and put zeros instead, so that the ISI should still be avoided. That's exactly right, however, there is one more issue. T...
https://dsp.stackexchange.com
28,110
[ "https://biology.stackexchange.com/questions/28110", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/10422/" ]
I got streptavidin for surface reaction. The label says "biotin binding: 16 units/mg". What does <code>units/mg</code> mean? Does it mean "1 mg biotin can bind to 16 units SA"? How much is the <code>unit</code> here?
16 units/mg means 16 units per milligram of protein. Many companies, including Invitrogen, define 1 unit streptavidin as <strong>the amount of streptavidin necessary to bind 1 microgram of biotin</strong>.
Just to add to Chris Stronk's answer: 1 U SAV can bind 1 ug biotin This tells you that in a 16 U/mg SAV sample, every mg of SAV will bind 16 ug of biotin. You can figure out the molar ratio from this: $16\mu g\ BIO\cdot\frac{1mol\ BIO}{244310000ug\ BIO}\cdot\frac{52800000mg\ SAV}{mol\ SAV}$ Which equals: $\frac{3....
https://biology.stackexchange.com
22,621
[ "https://quant.stackexchange.com/questions/22621", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/18880/" ]
I am trying to price a Down-and-Out Call using Monte Carlo simulation. The problem is that I get the right price for the vanilla option (same price as the analytic formula of Black and Scholes) but I do not get the right price for the down-and-out Call. <pre><code>S0 = 105 % Price of underlying sig = 0.28; % vo...
This effect is coming from the supply and demand in the options markets. Many portfolio managers want (or need) to buy out of the money put options, and many are willing to sell out of the money call options (thereby funding the purchase of put options). Now, when the market goes down, dealers find themselves short v...
A large part of this comes from the simple combination of: 1. A downward sloping volatility skew (which corresponds to a skewed risk neutral distribution) 2. Sticky strike behaviour The vol that you plot is not for a fixed strike but ATM, which has a strike that follows the spot. You would observe this pattern even ...
https://quant.stackexchange.com
9,885
[ "https://dba.stackexchange.com/questions/9885", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/5385/" ]
I am working on a sql database and it got corrupted due to power failure while I am doing some data entry on the system. I set my database to emergency mode so that I could get some data out of it before dumping the database but I keep getting the error: <blockquote> Could not continue with NOLOCK due to data move...
I change the mode of the database to emergency, then restore it with 'RESTORE_WITH_DATA_LOSS', it works only very very few records has been lost, moreover rather than contacting Microsoft guys for that, i've tried another tool like Phoenix data recovery, they also worked and costs only $129.
The database is corrupt. Setting it to offline sealed your fate. If it's mission-critical data that you need to recover, contact Microsoft Support. It's going to cost $500, but it's worth a shot if you need that data. Otherwise, restore from backup.
https://dba.stackexchange.com
1,878
[ "https://security.stackexchange.com/questions/1878", "https://security.stackexchange.com", "https://security.stackexchange.com/users/1184/" ]
Is RSA a stream cipher or a block cipher?
It is neither a stream cipher nor a block cipher. Both of these use the same key to encrypt and decrypt (symmetric encryption). RSA is asymmetric meaning you encrypt with a different key than you decrypt with. The advantage is that the encryption key can be made public, since people can only use it to encrypt and no o...
RSA <em>is</em> a block cipher and can use variable-length block sizes. Simply because it is not symmetric does not mean it can not be a block or stream cipher. Further, while it is not intended to be used as a block cipher, it is nonetheless a block cipher. Confused yet? :) RSA is typically meant to only encrypt ...
https://security.stackexchange.com
136,021
[ "https://electronics.stackexchange.com/questions/136021", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/37488/" ]
<img src="https://i.stack.imgur.com/Xs9GN.gif" alt="enter image description here"> Second transistor will turn ON and OFF if input voltage is directly connected to its base terminal. Then why a coupling transistor is used at the input side of a TTL logic gate?
Because with it you don't have to worry about the amount of current being fed in, nor do you have to worry about shorting your positive supply to your negative supply (which also has to do with current).
The Wiki page does a fair job of explaining but perhaps not enough. Previous to TTL logic there was DTL logic which was Diode Transistor Logic, this would use diodes to AND inputs together and then the output transistor to invert it giving a single transistor multi input NAND gate which is the basis for much early log...
https://electronics.stackexchange.com
171,760
[ "https://chemistry.stackexchange.com/questions/171760", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/131682/" ]
From what I understood, we introduced enthalpy to work with reactions that were carried out at constant external pressure. But then I came across this formula (for ideal gas): ∆H=∆U + p∆V where p∆V=∆n(RT). But doesn't the p in the second formula represent the external pressure? So how are we using pv=nRT which is only...
Even if the change occurs irreversibly for the ideal gas mixture, the work is still <span class="math-container">$\int{P_{ext}dV}$</span>. The equation you wrote assumes that the initial and final states of the gas are thermodynamic equilibrium states at pressure p, and that the external pressure is also <span class="...
When a work <span class="math-container">$p$</span>∆<span class="math-container">$V$</span> occurs in thermodynamic calculations, whatever the ± sign of the work, the pressure <span class="math-container">$p$</span> is the pressure of the force doing the work. When a work <span class="math-container">$w$</span> is done...
https://chemistry.stackexchange.com
498,152
[ "https://physics.stackexchange.com/questions/498152", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
<img src="https://i.stack.imgur.com/K5Hkq.jpg" alt="enter image description here"> There are two different directions of horizontal force in two different situations. Why?
The horizontal component of the tension force on the left digram is to the left. Therefore the horizontal component of the reaction of the hinge must be to the right in order for the sum of the horizontal components to be zero. On the other hand, the horizontal component of the tension force on the right diagram is to...
Its simple;since the rod is in equilibrium along horizontal, the reaction at hinge must be opposite to the horizontal component of applied force at the free end. It's rather a simpler case, only one force. But in case of numerous forces acting , you can assume a general situation with a horizontal and vertical componen...
https://physics.stackexchange.com
16,443
[ "https://physics.stackexchange.com/questions/16443", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/4887/" ]
Imagine a mirror house i.e. completely made of mirror with no traces of whatsoever light absorbent. Now, you introduce a light beam into that room and observe somehow through a hole. Would the room be <ol> <li>complete dark - since nothing is actually absorbing it!! or would it be</li> <li>very bright - since lig...
You use the verb "to be," which is rather deceptive in this situation (and in questions of optics generally). The room itself would not "be dark" or "be light," it would be a collection of various particles, some of which would be photons in the visible spectrum. It really only makes sense to ask how the room would a...
If the walls are perfectly reflecting then unless your viewpoint is perfectly normal to a single perfectly flat wall then all rays from your eye will ultimately intersect with the bulb and so the room should appear as bright as the bulb filament. It's just an integrating sphere - used to make a uniform bright field to...
https://physics.stackexchange.com
73,325
[ "https://softwareengineering.stackexchange.com/questions/73325", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/980/" ]
There's a lot of good idioms promoted in modern C++. These include RAII and elegant use of boost or STL or a <code>std::algorithm</code> to solve a given problem. Just like you can write C in any language, you can certainly write C in C++. However you can write really good modern C++ code with the right subset of fe...
I usually call it "modern C++" and most people get what I mean by that.
"Modern C++" as Nemanja Trifunovic already answered is well used, but <strong>the generic adjective for all languages is "idiomatic"</strong>. So for C++ it would be "idiomatic C++". "Pythonic way" is the same as "idiomatic Python".
https://softwareengineering.stackexchange.com
189,194
[ "https://softwareengineering.stackexchange.com/questions/189194", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/83182/" ]
I have this old implementation of the Command pattern. It is kind of passing a Context through all the <em>DIOperation</em> implementation, but I realized later on, in the process of learning and learning (that never stops), that is not optimal. I also think that the "visiting" here doesn't really fit and just confuses...
I am a bit worried about the mutability of your command parameters. Is it really necessary to create a command with constantly changing parameters? <strong>Problems with your approach:</strong> Do you want other threads/commands to change your parameters while <code>perform</code> is going on? Do you want <code>visi...
What is nice about design principles is that sooner or later, they conflict with each other. In the situation described, I think I would prefer to go with some kind of context that each command can take information from and put information to (especially if those are key-value pairs). This is based on a trade off : I ...
https://softwareengineering.stackexchange.com
3,608,339
[ "https://math.stackexchange.com/questions/3608339", "https://math.stackexchange.com", "https://math.stackexchange.com/users/766798/" ]
Calculating the degree of this extension <span class="math-container">$[\mathbb Q(\sqrt[3]{2},\sqrt2):\mathbb Q]=n $</span> With the irreducible polynomials I know: <span class="math-container">$[\mathbb Q(\sqrt[3]{2}):\mathbb Q]=3$</span>, <span class="math-container">$[\mathbb Q(\sqrt2):\mathbb Q]=2.$</span> So <s...
In order to disprove your conjecture that <span class="math-container">$\lim_{(x, y) \to (0, 0)} f(x, y) = +\infty$</span>, take the limit along the curve <span class="math-container">$(x, y) = (t^5, t)$</span> as <span class="math-container">$t \to 0^+$</span>. Then we have: <span class="math-container">$$f(t^5, t) =...
If the limit exists, then it must be equal to the limit along any line, for example, <span class="math-container">$y=x/4$</span>. In that case, <span class="math-container">$$ \lim_{(x,y)\to (0,0)} \frac{x-\sqrt{xy}}{x^2-y^2} =\lim_{x\downarrow 0} \frac{8}{15}\frac{x}{x^2}=\frac{8}{15}\lim_{x\downarrow 0}\frac{1}{x}=...
https://math.stackexchange.com
2,492,541
[ "https://math.stackexchange.com/questions/2492541", "https://math.stackexchange.com", "https://math.stackexchange.com/users/496407/" ]
While keeping one side constant in a right angle triangle, when we change the other side, which would increase more, the side or the hypotenuse? Let the sides be X,Y and Hypotenuse be P. Keeping the length of X same, if we increase Y to (Y+Z), hypotenuse becomes (P+Q). Z and Q are changes in length of the side of len...
We have the equations \begin{align*}(P+Q)^{2}&amp;=X^{2}+(Y+Z)^{2},\\ P^{2}&amp;=X^{2}+Y^{2},\end{align*} by applying the Pythagorean theorem to the original and new triangles. This gives $$2PQ+Q^{2}=2YZ+Z^{2}$$ when we expand the squares in the first equation and subtract the second equation. Now we can solve for $Q$ ...
For any $a&gt;0$ we have that $f(x)=\sqrt{x^2+a^2}$ is a convex function on $\mathbb{R}^+$.<br> In particular $f'(x)$ is increasing from $0$ to $1$ on $\mathbb{R}^+$ and for any $x,h&gt;0$ $$ f(x+h)-f(x) \stackrel{\text{Lagrange}}{=} h\cdot f'(\xi) &lt; h.\qquad \left[\xi\in(x,x+h)\right] $$ In particular, by increasi...
https://math.stackexchange.com
88,833
[ "https://physics.stackexchange.com/questions/88833", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/34304/" ]
Imagine a very tall building. Centre of gravity is defined as the point of application of force of gravity, right? Now, is the centre of gravity the same as centre of mass of this building? I am including the change in g with height, so force of gravity varys with height
You are right to be wary. When the gravitational field is nonuniform, the centre of mass and the centre of gravity are in general different. The centre of gravity is the point around which the nett torque from the gravitational forces is nought. In your problem, where gravity varies with position $\vec{r}$, we seek th...
Center of gravity is the same as center of mass. We usually put mass point (a whole mass of the body in one point) into a center of mass. This is why gravity is acting from the same point.
https://physics.stackexchange.com
21,877
[ "https://quant.stackexchange.com/questions/21877", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/7077/" ]
I've been given some data (it's financial tick data) and I want to predict based on some observed variables whether the next move will be up, down or unchanged. So I have been trying to use multinomial logistic regression, this is my first time doing logistic regression so I want to check that I have done this correct...
I agree with Malick in the sense that an ARMA-GARCH is a better model but I would improve the model by doing a ARFIMA-FIGARCH, the FI stands for Fractional Integrated that are used to deal for long memory processes like HF data. When trying to fit the ARMA the normal approach would be to see the ACF and the PACF which ...
The code you posted is wrong since you do not model the time series behavior of the up/down process (ie if you have 10 up move and consequently 10 down move it is not the same as the opposite ie 10 down and after 10 up..). I would recommend you to use standards Arma Garch models apply on returns instead of modeling th...
https://quant.stackexchange.com
14,185
[ "https://astronomy.stackexchange.com/questions/14185", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/9301/" ]
White dwarfs usually do not collapse, as they have electron degeneracy pressure due to the Pauli exclusion principle. However, if one accretes mass beyond the Chandrasekhar limit, it is energetically favorable for the electrons to combine with protons and form neutrons. This gives us a neutron star. However, neutron s...
The scenario you describe <em>may</em> occur. On the other hand it may actually be that neutronisation in a white dwarf is the trigger for a thermonuclear type Ia supernova. You may be misunderstanding the Pauli Exclusion Principle (PEP).The PEP states that no two fermions can occupy the same quantum state, <strong>no...
In Layman's terms, the Pauli exclusion principal wouldn't need to be overcome to form the black hole. A Neutron star of a certain size will shrink below it's Schwarzschild radius naturally. That's not hard to see. In fact, like white dwarfs, Neutron stars grow smaller in radius as they gain mass. The maximum mass ...
https://astronomy.stackexchange.com
87,274
[ "https://electronics.stackexchange.com/questions/87274", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/16398/" ]
I am trying to build an eagle-cad part for an Arduino Micro. (so I can make a PCB and stick the arduino on it) I was hoping to derive the distance between the two rails of pins from the fact that on a 2.54 mm pitch breadboard, there are 5 holes in between. Pin Empty Empty Empty Empty Empty Pin Of course, it struck m...
The "pitch" is the center-to-center spacing of pins or holes. You may need to make accommodations for any "overhang" beyond the first or last pin/hole.
Like Ignacio said, pitch is the distance between the center of two holes. For a standard breadboard, that distance is 1/10 of an inch, or 100 mils. Look for parts like M08* in the Sparkfun library, for rows of pads designed for 100mil pitch headers, used for creating breadboard compatible parts. Also, a standard DIP's ...
https://electronics.stackexchange.com
186,218
[ "https://softwareengineering.stackexchange.com/questions/186218", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/74735/" ]
I am creating an application which will be testable(unit + integration). In this application I have a FileHelper static class, <pre><code>public static class FileHelper { public static void ExtractZipFile(Stream zipStream, string location) { .................................. } public static v...
To say that they're not testable is inaccurate. They're very testable, but they're not mockable and thus they are not test-friendly. That is, every time you test a unit of code that calls this method, you have to test the method. If the method is ever broken, many tests will fail and it won't be obvious why. With that...
An alternative to pdr's solution is to pass the static function into the class that uses it as a delegate. This allows it to still be mocked out but slightly reduces the amount of boilerplate code <pre><code>//warning! code not tested static public class FileHelper { public static void ExtractZipFile(Stream zipSt...
https://softwareengineering.stackexchange.com
425,732
[ "https://math.stackexchange.com/questions/425732", "https://math.stackexchange.com", "https://math.stackexchange.com/users/83277/" ]
I need to give $n$ apples to three persons $A$, $B$ and $C$. $A$ should get $50\%$, $B$ should get $30\%$, and $C$ should get $20\%$ of however much ever I give. For example, if I have given $10$ apples, $A$ should have $5$, $B$ should have $3$, and $C$ should have $2$. <pre><code>Apple A B C 1st 1 ...
It looks like you want to give the $n^{\text{th}}$ apple to whoever is due most of it. You look at then number you have given out, the number each has received of the first $n-1$, the exact number they are due out of $n$ and give it to whoever it gets closest. In your example, however, it seems the fourth apple shoul...
Here's a greedy algorithm that should work. Ross seems to have a similar idea. Here's some pseudocode: <pre><code>initalize: n = 0 (total number of apples so far) a = 0 (number of apples A has) b = 0 (number of apples B has) c = 0 (number of apples C has) repeat until n == total...
https://math.stackexchange.com
553,378
[ "https://physics.stackexchange.com/questions/553378", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
Why can't we <strong>feel</strong> any <strong>force</strong> unless that force is opposed by other forces ?? E.g. we don't feel our weight unless we stand on rigid bodies or other supports . When we are in air or when we jump from a height we feel weightless because there is no force opposing our weight. So my questio...
You have indeed described Einstein's equivalence principle, but it does not just work for gravitational force. This is true of all inertial (or &quot;fictitious&quot;) forces. Newton's third law (and indeed Newton's formulation of mechanics) describes <em>active</em> forces, which act in the context of Newton's concept...
You cannot feel the force if the force does not push/pull your molecules/cells apart from each other. As @PNS pointed out in his link, this holds for gravitation and free fall of small object. In case of big objects, it no longer works. Like for example Earth is not supported by anything, it is in free fall, yet the m...
https://physics.stackexchange.com
127,616
[ "https://cs.stackexchange.com/questions/127616", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/122809/" ]
Consider the language <span class="math-container">$$L = \{ x \in \{0,1\}^* \mid |x| = 3 \}.$$</span> I think the above language is regular. A DFA can be used to determine the above language. <blockquote> Am I correct? Is the above language regular? </blockquote> If this language <span class="math-container">$L$</span>...
Every finite language is regular. If <span class="math-container">$L$</span> is a finite language and <span class="math-container">$p$</span> is larger than the length of all words in <span class="math-container">$L$</span>, then <span class="math-container">$L$</span> satisfies the pumping lemma with the constant <spa...
Take pumping length = 4. All strings in the language with length greater than the pumping length must meet some condition. Since there are no strings in the language with length &gt; 4, all these strings, all zero of them, meet any condition, and therefore the language is regular. That’s true for any finite language w...
https://cs.stackexchange.com
28,729
[ "https://stats.stackexchange.com/questions/28729", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/11404/" ]
I'm not a statistician, so I hope this question makes sense. I'm an EMT and we have patients known to be "frequent flyers". Example, we have a diabetic that we have seen 100+ times in 3 years. I have looked over his pattern of calls and it looks like they follow an exponential distribution, which makes sense to me. How...
There is a special test of goodness of fit that is designed to have power to detect departures from the exponential. It is called Lillefors test for exponentiality. You should be able to find it through Google. It could be that what you have is not a simple Poisson process but two or more Poisson processes acting ove...
Great question!! If I understood well, for "frequent flyers" (FF) the time interval between visits in your hospital follows a exponential distribution with a short half-life parameter ($\theta$). To me it looks like the visits of the non FF patients also follows an exponential distribution, but with a much larger $\th...
https://stats.stackexchange.com
3,091,238
[ "https://math.stackexchange.com/questions/3091238", "https://math.stackexchange.com", "https://math.stackexchange.com/users/573935/" ]
Find the exact value of the infinite series given by <span class="math-container">$$S = \frac{1}{(3^2+1)} + \frac{1}{(4^2+2)} + \frac{1}{(5^2+3)} + ... $$</span> I found the notation of how it would be written with sigma notation: <span class="math-container">$$\sum_{x=1}^∞ \frac{1}{(x+1)(x+4)}$$</span> I don't know...
Hint: <span class="math-container">$$\frac{1}{(x+1)(x+4)}=\frac{1}{3}\left(\frac{1}{x+1}-\frac{1}{x+4}\right).$$</span> Can you see how to compute the telescopic sum?
You can write your sum as <span class="math-container">$$ \sum_{n=1}^{+\infty}\frac{1}{n+\left(n+2\right)^2} $$</span> and <span class="math-container">$$ \frac{1}{n+\left(n+2\right)^2}=\frac{1}{n^2+5n+4} $$</span> Then you need to write <span class="math-container">$$ \frac{1}{n^2+5n+4}=\frac{a}{n-\alpha_1}+\frac{b}{n...
https://math.stackexchange.com
529,983
[ "https://physics.stackexchange.com/questions/529983", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/135895/" ]
“With” meaning involving, not in. My coffee maker isn’t draining properly anymore, so the drip basket is overflowing. The spring that lets coffee flow out at the right rate seems to have stiffened over time. But how could that happen? Could the repeated heating (the coffee flows out over the spring) and cooling (after ...
Microstructural changes in metals not subject to stresses above yield are thermally activated, meaning that the reaction rate depends exponentially on the absolute temperature. At the temperature of hot coffee, the rate is so low as to be negligible and therefore the mechanical properties of the spring (which is made f...
It is most likely clogged with grinds or some build up, have you taken the plunger assembly apart to clean it? Can you push the plunger up and down? It will work without the plunger, it is only there to stop the flow when you take the pot out from under it. Make sure the pot still pushes the plunger up when it is under...
https://physics.stackexchange.com
39,387
[ "https://electronics.stackexchange.com/questions/39387", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/11976/" ]
I know that electric vehicles have different performances depending on battery and motor, but it's not clear how electrical and mechanical units are related. Will a 100V motor raise against slopes better than a 50V motor?
After 4 years using and studying electrical vehicles I figured out that "gradeability" (ability to raise a slope of specific grade) depends on motor torque, and torque depends on current. Voltage instead "regulates" how fast a motor can run: the maximum speed a motor can reach is the speed at which the motor generate...
The relationship between a motor's electrical characteristics and mechanical performance can be calculated as such (note: this is the analysis for an ideal brushed DC motor, but some of it should still apply to a non-ideal brushless DC motor). A DC motor can be approximated as a circuit with a resistor, and voltage ba...
https://electronics.stackexchange.com
420,932
[ "https://math.stackexchange.com/questions/420932", "https://math.stackexchange.com", "https://math.stackexchange.com/users/82531/" ]
In a class of $63$ students, $22$ study biology, $26$ study chemistry and $25$ study physics. $18$ study both physics and chemistry, $4$ study both biology and chemistry and $3$ study both physics and biology. One studies all three subjects. How many students study: a) biology only b) physics or chemistry c) physi...
Let |$A$| denote the cardinality of $A$, and let $B,P,C$ denote the set of students studying biology,physics and chemistry respectively. Draw the Venn diagram, and you can see that: a) for biology only, we have to delete the students in $B\cap C$ and $B\cap P$, but also have to add the students in $B\cup P\cup C$, sin...
As your title states, you should draw a Venn diagram and insert the relevant information in. From this your can slowly work out the values for each section of the Venn diagram. e.g. if 1 person studies all three and 18 people study both physics and chemistry then 17 people study physics and chemistry but not biology, e...
https://math.stackexchange.com
73,094
[ "https://physics.stackexchange.com/questions/73094", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/26687/" ]
The proof of the No-Cloning Theorem states "By the linearity of quantum mechanics, ..." -- Could someone please give me a rough sketch/outline of what this means? Does it have to do with the Hilbert Space that wave functions live in? I apologize if this question isn't specific enough, I just wanted to fully understan...
The no-cloning theorem states that it is not possible to have a quantum state $|\psi\rangle$ evolve into two separable (non-entangled) copies described by the tensor product state $|\psi\rangle|\psi\rangle$. The proof boils down to the simple observation that when expressing $|\psi\rangle$ in some basis ${|0\rangle, ...
<em>"By the linearity of quantum mechanics"</em> is actually a reference to the linearity of the operators used it quantum mechanics. It means that, for a linear operator $A$ (by the very definition of linearity), $$A\bigl(\alpha\lvert\Psi\rangle +\beta\lvert\Phi\rangle\bigr)=\alpha A\lvert\Psi\rangle + \beta A\lvert\P...
https://physics.stackexchange.com
4,417,978
[ "https://math.stackexchange.com/questions/4417978", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1043488/" ]
I have a problem related to convex optimization. I have a function where <span class="math-container">$h(z)=\min_{x\in{C}}\{f(x)+\frac{1}{2}||x-z||^2\}$</span> for all <span class="math-container">$z\in{\mathbb{R}^n}$</span>. For this function, I want to show <span class="math-container">$\inf_{z\in\mathbb{R}^n}h(z)=\i...
This is to supply some details at the request the OP to my comment to his/her question. <hr /> Suppose <span class="math-container">$\Phi:A\times B\rightarrow\mathbb{R}$</span> and that <span class="math-container">$\Phi$</span> is bounded below. Let <span class="math-container">\begin{align} \alpha&amp;=\inf_{(x,y)\in...
I think the solution is the following: We can prove that a function in the form <span class="math-container">$h(z)=\min\limits_{x\in{C}}\{f(x)+\frac{1}{2}\|x-z\|^{2}\}$</span> for all <span class="math-container">$z\in\mathbb{R}^n$</span> has a unique solution for each <span class="math-container">$x\in{C}$</span>, and...
https://math.stackexchange.com
134,600
[ "https://softwareengineering.stackexchange.com/questions/134600", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/38202/" ]
I am an experienced Java Programmer. 1 year back I started android programming and published 3 Apps into the market. But these all are my personal projects. Now I want get into the android job market. As my android experience is not corporate experience does the companies consider this? How to add these android project...
<strong>Experience gained making those apps are more important.</strong> It would be a waste of space to simply list the applications that you have worked on in the past and simply leave it at that. It doesn't matter if these are personal applications or commercial applications. What is important is the quality of t...
<ol> <li>Come up with a company name (and make a web page for it)</li> <li>Call yourself the owner</li> <li>Add the products to your CV under that company</li> </ol> Because, after all, if you are writing software for the android market (especially if you are selling them), then you <strong>are</strong> your own compa...
https://softwareengineering.stackexchange.com
74,537
[ "https://stats.stackexchange.com/questions/74537", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/23812/" ]
With the below dataset, I have a series which needs transforming. Easy enough. However, how do you decide which of the SQRT or LOG transformations is better? And how do you draw that conclusion? <pre><code>x&lt;-c(75800,54700,85000,74600,103900,82000,77000,103600,62900,60700,58800,134800,81200,47700,76200,81900,95400,...
Transformations are like drugs ! Some are good for you and some aren't !. Haphazard selection of transformations should be studiously avoided. a) One of the requirements in order to perform valid statistical tests of necessity is that the variance of the errors from the proposed model must not be proven to be non-con...
<strong>This question is answered beautifully by means of a <em>spread-versus-level</em> plot:</strong> a cube root transformation will stabilize the spreads of the data, providing a useful basis for further exploration and analysis. <hr> The data show a clear seasonality: <pre><code>plot(y) </code></pre> <img src=...
https://stats.stackexchange.com
425,235
[ "https://physics.stackexchange.com/questions/425235", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/204995/" ]
I'm really confused about Newton's third law which states that "every action has an equal and opposite reaction." Which means if an object A applies a force on object B then object B will apply the same amount of force on object A but in the opposite direction. The problem I have is with the equal statement, the questi...
It is an impossibility. You are imagining a situation that can't happen. Just as if I imagined that I was levitating in the air without touching the ground, and claimed that this violates the idea of gravity being present. The answer could of course be that the idea of gravity may be wrong - or the answer could be tha...
Your scenario is an impossibility to begin with. If $a_{1},m_{1} &lt; a_{2},m_{2}$ respectively, then $a_{1}*m_{1} &lt; a_{2}*m_{2}$ which violates newton's third law. Instead, assuming that $F_{1} = F_{2}$, then we see that if $m_{1} &lt; m_{2}$, then $a_{2} &lt; a_{1}$. Thus, if I push on the wall I will experience ...
https://physics.stackexchange.com
619,004
[ "https://electronics.stackexchange.com/questions/619004", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/312760/" ]
I have about 30 small white LEDs tightly packed in a column to together form a value indicator (imagine &quot;virtual mercury thermometer&quot;). I would like to control them as a group with a microcontroller, but they have to be driven with high-quality PWM and individually addressable. My first idea was to use off-th...
You want led matrix driver or multichannel led pwm driver ics. Most can handle the pwm and dot control themselves as well. You may need a microcontroller locally depending on your setup.
One of many solutions: get a microcontroller with 44 pins – cheapest you can find, and drive the LEDs using an NPN transistor as a buffer. Some microcontrollers may be able to drive all those LEDs without buffers. The microcontroller should cost about $1 for this application. It really can be as basic as you wish, and ...
https://electronics.stackexchange.com
18,518
[ "https://electronics.stackexchange.com/questions/18518", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3966/" ]
I've been given a task to design a wiring harness tester for automobiles. The tester's job is to test wiring harnesses which can contain upto 300 wires. My initial design was quite simple. Feed the wires 5V and connect them to multiplexers. The AVR can address the mux and test each line to see if its high. If its high,...
A few other things to consider. Is this a 12 vdc system (the most common voltage on autos) or 24 or even 48 (commercial and military)? As a general rule of thumb you want to test at two to three times your rated voltage. So 24 to 36 VDC. for a standard 12 volt system. This helps find weak spots in the insulation. Nex...
The obvious solution would be to string together a bunch of IO expanders such as the MCP23S17 which gives you 16 IOs. For bilateral testing of 300 lines you'd need about 40 of them which at about a dollar each shouldn't be a problem.
https://electronics.stackexchange.com
156,179
[ "https://stats.stackexchange.com/questions/156179", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/79352/" ]
In the case of an ordinary least squares GLM with two nearly collinear predictors, how does this shared variance get reflected in the parameter estimates? My understanding is that the parameter estimates will reflect the <em>unique</em> effect of each parameter, i.e., controlling for all other parameters. Consider...
Let's predict income with two highly positively correlated variables: Years of work experience and number of carrots eaten in one's lifetime. Let's ignore omitted variable bias issues. Also, let's say years of work experience has a much greater impact on income than carrots eaten. Your beta parameter estimates would b...
This is one of those situations where what is theoretically true, and what is true in practice can be quite different. I'll try to give an example. Let's suppose we have centered ant standardized both $X$ and $y$ so that: <ul> <li>The predictor covariance is $\Sigma = X^{t} X$.</li> <li>The intercept estimate is $\b...
https://stats.stackexchange.com
348,197
[ "https://softwareengineering.stackexchange.com/questions/348197", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/81278/" ]
Just like the two opposing mirrors are enough for infinity, most of design patterns can be applied repeatedly producing any amount of LOC desired. We can always create a factory for any factory or wrap a delegating layer around any class that already delegates. This is of course somewhat artificial example, but I hop...
You're confused about the purpose of design patterns. It's not that using a design pattern is good because more patterns = better code in any way. Patterns are recurring workable solutions to recurring complex constraints on our solutions. If we use a pattern, it's because it fits <em>our present</em> constraints, not...
Code reviews. If someone can't justify creating another indirection layer to his/her peers, it doesn't need to exist. If they can and the benefit is worth the work, it's probably ok. Some projects will require a lot of indirection, others not so much. Only a human will have a chance at determining if it is justifie...
https://softwareengineering.stackexchange.com
5,404
[ "https://electronics.stackexchange.com/questions/5404", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1225/" ]
What is the input impedance of a typical MCU ADC? In this case I'm working with a PIC24FJ64GA004. I don't need high speed sampling - a maximum of 100 samples per second. I wish to connect a resistive divider with a 100k resistor and a 10k resistor, so the impedance should be higher than 1M or else the impedance will s...
<h3> Input Leakage Current </h3> To determine your resistors voltage drop from the gate you need to use the leakage current from the datasheet. Microchip specifies an "Input Leakage Current" on their datasheets. The [datasheet that I have looked up][1] specifies an input leakage current of 1uA. This could cause a .1V o...
MCU ADC inputs can experience variable input impedance depending on whether the sample-and-hold cap is connected to the pin or not. It might be worth the trouble to use an op amp to buffer the signal. The op amp would have the added benefit of allowing you to filter out frequencies above Nyquist, which is also good p...
https://electronics.stackexchange.com
27,866
[ "https://physics.stackexchange.com/questions/27866", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/7625/" ]
So I know this is a pretty fundamental question, but I'll ask it any way. lets say you have a 12V battery, and the positive is connected to the negative directly by a wire with negligible resistance... is the voltage drop between the positive terminal and the negative terminal still 12V without a resistor? I know this ...
No, quite opposite. For short-cut between both terminals, voltage drop between terminals is exactly 0 V! All of the advertised voltage drop is on the internal resistor of the battery.
As a slightly more elaborate model, the voltage drop between the terminals will not be <em>exactly</em> zero. You can model the situation as a voltage source $V_0$ in series with a big resistor (the battery's internal resistor) $R$ and a small resistor $r$ (the wire). The voltage drop across the wire is then $V_0r/R$, ...
https://physics.stackexchange.com
194,291
[ "https://softwareengineering.stackexchange.com/questions/194291", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/87653/" ]
There is a class method (static method) in which I create and build some object. And for filling that object, I create it as mutable object. My mutable object is a subclass of immutable object. So i can return it as super Class type. That object is just created in class method and returns. It is not a part of obje...
if only your team is using this code in the same process then i would return the same object (mutable object) . keep it simple and fast. Your own team would not change something on the objects unless they needed to, and if they did then they would have to make another copy. If I was making a API too I would not keep i...
Encapsulation doesn't have anything to do with immutability. Well, maybe it does a little. A more accurate term would be "access control." An immutable object restricts access control because you cannot write it; you can only read it. You make objects immutable when you are using them in a multi-threaded context, a...
https://softwareengineering.stackexchange.com
2,124,412
[ "https://math.stackexchange.com/questions/2124412", "https://math.stackexchange.com", "https://math.stackexchange.com/users/270167/" ]
I am wondering if non-square matrices have many applications. It seems in my algebra classes we tend not to use them.
Yes; they're used all the time. An example application: rows are labelled by stores, columns are labeled by items. Entries are the price of the item in the store. If you have a (column) vector $v$ of quantities, and compute $Mv$, you get a (column) vector of the cost for your shopping at each store. Light sources...
Yes, in fact I would say that square matrices are quite rare! For instance a map $\mathbb R^3\to \mathbb R^2$ projecting 3d-space onto a 2d-plane can be given as $$\left(\begin{array}{ccc}1&amp;0&amp;0\\ 0 &amp; 1&amp;0\end{array}\right)$$ by which the vector $(a,b,c)$ is mapped to $(a,b)$. Second example: the scalar...
https://math.stackexchange.com
51,906
[ "https://electronics.stackexchange.com/questions/51906", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/2249/" ]
When using a regular FPGA such as Xilinx Spartan 3 or Virtex 5, how many cycles does a double-precision floating-point 64-bit multiplication or division take to execute? As far as I understand, the FPGA does not have a hard FPU and you need to create one using the standard IEEE libraries or other materials. This means...
I haven't done this for double precision FP, but the same principles apply as for single precision, for which I have implemented division (as multiply by reciprocal). What these FPGAs do have, instead of FPUs, is hardwired DSP/multiplier blocks, capable of implementing a 18*18 or (Virtex-5) 18*25 multiplication in a ...
<blockquote> When using a regular FPGA such as Xilinx Spartan 3 or Virtex 5, how many cycles does a double-precision floating-point 64-bit multiplication or division take to execute? </blockquote> The answer is: Yes! But seriously, it is super hard to come up with a number. When designing any complex logic the...
https://electronics.stackexchange.com
2,384,497
[ "https://math.stackexchange.com/questions/2384497", "https://math.stackexchange.com", "https://math.stackexchange.com/users/292427/" ]
I would like to calculate the sum of the series: \begin{equation} \sum_{m=M+1}^{\infty}\frac{(-1)^{m+1}}{2m+1}\sin((2m+1)\frac{\pi}{2}x) \end{equation} where M is big and finite. <hr> I searched on the books and found this sum: \begin{equation} \sum_{k=1}^{\infty}\frac{(-1)^{k-1}}{2k-1}\sin((2k-1)x)=\frac{1}{2}\ln\t...
The multiplicative groups of $\mathbb{Z}/9 \mathbb{Z}$ and $\mathbb{Z}/ 17\mathbb{Z}$ are indeed cyclic. More generally, the multiplicative group of $\mathbb{Z}/p^k \mathbb{Z}$ is cyclic for any <em>odd</em> prime $p$. If you are supposed to know this result, just invoke it. If you do not know this result, possibly ...
Invertible elements of $\mathbb Z_m$ form a group which is cyclic only in the following cases 1) $m=2,4,8$ 2) $m=p^k, k=1,2, 3,\ldots$ and $p$ is odd prime 3) $m=2p^k, k=1,2, 3,\ldots$ and $p$ is odd prime
https://math.stackexchange.com
7,911
[ "https://mathoverflow.net/questions/7911", "https://mathoverflow.net", "https://mathoverflow.net/users/2330/" ]
I am looking for a counter-example of two functors F : C -> D and G : D->C such that 1) F is left adjoint to G 2) F is right adjoint to G 3) F is not an equivalence (ie F is not a quasi-inverse of G)
The answer of Ben Webster, can be made easier. Consider the functor F : (A-mod) -> (A-mod) which maps any A-module on (0). Then, F is a left adjoint to F ; and so, is a also a right adjoint to F. This is clear because for all A-modules N, M, one has Hom_A(0,N)=Hom_A(M,0). But, F is not an equivalence.
There are lots of examples. Here's what I think is in some sense the minimal one. Let $C$ be the terminal category $\mathbf{1}$ (one object, and only the identity arrow). Then for any category $D$, a left adjoint to the unique functor $G: D \to \mathbf{1}$ is an initial object of $D$, and a right adjoint is a termin...
https://mathoverflow.net
2,122,581
[ "https://math.stackexchange.com/questions/2122581", "https://math.stackexchange.com", "https://math.stackexchange.com/users/411820/" ]
Can someone please show me how to express these two quantities in polar and Cartesian form? $$ \lvert z_1z_2\rvert$$ and $$ arg(z_1z_2)$$ I understand for the Cartesian form of the first, I just get $$(x^2+y^2)^{1/2} + (x^2+y^2)^{1/2} $$ But then how can I do the same for the polar form? Many thanks
Take the following example: $\{1,2\}$. Let the probabilities of picking $1$ or $2$ be $p_1$, $p_2$ respectively. The expected size of the subset we select is $$E=p_1(1-p_2)+p_2(1-p_1)+2p_1p_2=1.$$ The probability that we pick $1$ from the randomly selected subset is $$P(1)=P(1\mid\{1\})p_1(1-p_2)+P(1\mid\{1,2\})p_1...
What I can tell you is that $$\mathbb{P}(x=a)=p_a\sum_{i\in[n-1]}\sum_{Y\in\binom{[n]\setminus \{a\}}{i}}\left(\prod_{z\in Y}p_z\right)\left(\prod_{z\notin Y}(1-p_z)\right)$$ It can or not be the expression you said
https://math.stackexchange.com
14,154
[ "https://dba.stackexchange.com/questions/14154", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/6494/" ]
I'm not sure if I've completely fudged the design of my small hobby database (I'm not a DBA by any means), but I have a table like this (primary key is <code>(staffid, effectivefrom)</code>): <pre><code> staffid | target | effectivefrom --------|--------|--------------- 1 | 6.0 | 2012-01-01 2 | 6.0 ...
That is going to be horribly messy, since you'll need to find the single <code>(staffid, effectivefrom)</code> pair that's the newest prior to the <code>dateParameter</code>. What I'd do is add another field <code>effectiveTo</code> to go with <code>effectiveFrom</code>, and then when you add a new target for a staff m...
You need to select the most recent record that's before or on your date of interest. A query similar to the following would do this. <pre><code>declare @date datetime select @date = '2012-02-01' select t.StaffID ,t.Target from Targets t join (select StaffID ,max (EffectiveFrom) as Effectiv...
https://dba.stackexchange.com
90,331
[ "https://mathoverflow.net/questions/90331", "https://mathoverflow.net", "https://mathoverflow.net/users/10909/" ]
The sequence $\frac{1}{2}, \frac{1}{2\cdot 2}, \frac{1}{3\cdot 4}, \frac{1}{4\cdot 6}, \frac{1}{5\cdot 8}, \frac{1}{6\cdot 10},\ldots$ has a curious property, as follows: a) the series with these terms sums to 1; b) no process of sequentially packing open intervals with these lengths into the unit interval $[0,1]$ c...
This is a rigorous justification of Johan Wästlund's intuition. Namely, I will show that if we tile a round ball $B$ of area $\pi\zeta(\alpha)$ by round balls of area $\pi/n^\alpha$ for some $1&lt;\alpha&lt;1.1716$, then we never get stuck provided we have placed enough balls already. For later use note that the radi...
My guess is that such sets exist in all dimensions. Here's a partial answer that explains why. Let's consider tilings of a rectangular box of area $\zeta(\alpha)$ by axis-parallel rectangular tiles of areas $1/n^\alpha$ for some $\alpha&gt;1$. We allow the tiles to be squeezed and stretched by axis-parallel linear tran...
https://mathoverflow.net
67,480
[ "https://cs.stackexchange.com/questions/67480", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/48520/" ]
My question is the following. Assume that $\Pi$ is an NP-hard problem. Given an arbitrary instance $I$ of $\Pi$ and assume that an adversary knows that this instance is easy to solve, is it possible to find a deterministic polynomial-time algorithm to solve this particular instance $I$? For example: Suppose that $\Pi$...
The problem isn't really well-posed. For any particular instance, there is a single solution, say $S$. Consequently, we can imagine an algorithm that has the answer $S$ hardcoded in: no matter what input you give it, all it does is just print $S$. This answer counts as a deterministic polynomial-time algorithm that ...
In some sense, the answer to your question is affirmative, due to Levin's universal search algorithm. Consider for concreteness graph coloring, and a particular class of easy instances. As a witness that this class is easy, you have an algorithm which, given a graph in this class, produces (in polynomial time) a legal ...
https://cs.stackexchange.com
58,770
[ "https://electronics.stackexchange.com/questions/58770", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/15955/" ]
Are there any differences between a thermal relief in a 'X' shape for a '+' shape? I am using Altium and the software has both styles for selection.
It can make a difference if you have a lot of them packed together in an array, such as in a multipin connector. If the pins are close enough together that the copper "pour" between them disappears, it can leave the legs of the thermal "hanging", not connected to anything. Switching to the other orientation can mitigat...
If I recall correctly, the only difference is the orientation relative to the x-y axis of your PCB design. So the + style will be 0 degrees relative to the y axis, and the x style will be 45 degrees.<br> Electrically there is no difference.
https://electronics.stackexchange.com
27,465
[ "https://dba.stackexchange.com/questions/27465", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/14704/" ]
My problem seems like it should have a much simpler solution than what I have come up with. Starting with this data set: <strong>log_table</strong> <pre><code>+--------+-----------+------------------+---------+ | log_id | entity_id | date | comment | +--------+-----------+------------------+---------+ | ...
Create a Subquery that Gathers Keys from the the <code>log_table</code> with Maximum Date Per Entity. Then, perform an INNER JOIN of that Subquery back to the <code>log_table</code>. <pre><code>SELECT B.entity_id,B.last_log_date,B.last_comment FROM ( SELECT entity_id,MAX(last_log_date) last_log_date FROM l...
The subquery works; here's how you would do it without a subquery: <pre><code>SELECT `entity_id`, SUBSTRING_INDEX(GROUP_CONCAT(`date` ORDER BY `date` DESC), ',', 1) AS last_log_date, SUBSTRING_INDEX(GROUP_CONCAT(`comment` ORDER BY `date` DESC), ',', 1) AS last_comment FROM `log_table` GROUP BY `entity_id` </code...
https://dba.stackexchange.com
255,736
[ "https://mathoverflow.net/questions/255736", "https://mathoverflow.net", "https://mathoverflow.net/users/51223/" ]
The answer to this question might be known, but I don't know of any reference and will appreciate any references. Let $n&gt;0$. By Snaith splitting there is a stable splitting of $\Omega^kS^{n+k}$ into wedge of spaces $D_{k,r}S^n=F(\mathbb{R}^k,r)\ltimes_{\Sigma_r}(S^n)^{\wedge r}$ as $$\Sigma^\infty\Omega^kS^{n+k}\s...
The full story is eluded to in the comments of Arone and Rognes. First of all, $D_{k,r}\Sigma^n X$ is always an $n$-fold suspension. More exciting is that, for all pairs $(k,r)$, there is a natural number $d = d(k,r)$, such that $D_{k,r} \Sigma^dX = \Sigma^{rd}D_{k,r}X$. So what is $d$? It is the order of the canoni...
When $k=2$ and $n$ is even, $$ D_{k,r} S^n \simeq BB_{r+} \wedge S^{rn} $$ is the $rn$-fold unreduced suspension of the classifying space of the braid group $B_r$ on $r$ strings. I once cited Cohen-Mahowald-Milgram ``The stable decomposition for the double loop space of a sphere'' (1978) for this, and if I recall corre...
https://mathoverflow.net
33,553
[ "https://quant.stackexchange.com/questions/33553", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/11597/" ]
This is a commonly asked question and I have not been able to find a satisfactory answer to it. Let me first phrase it here. Suppose that interest rates are $0$ and consider an at the money put and an at the money call (both European) on the same stock (self-financing, hence no dividends) with the same expiry. The payo...
One thing to notice is that indeed $E^Q[S_T]=S_0$, by construction, even though the stock price can only drop down to 0, but it can go up to $2\,S_0, 3\,S_0, 100\,S_0$, ... Thus, implicitly, there are constraints on the distribution of the stock price at time T (otherwise $S_0$ would change): <ul> <li>it could be t...
Let me rewrite what you have a little bit. First, put-call parity does indeed demand that for forward value $F = E^Q[S_T]$, and for $$ \{\hat{C}, \hat{P} \}= \{C, P\} \cdot \int_0^T r(s) ds $$ $$ F = K + \hat{C} - \hat{P} $$ This is true for <em>any</em> strike $K$. Now, when carry costs $c(t)$ and short rate $r...
https://quant.stackexchange.com
303,615
[ "https://electronics.stackexchange.com/questions/303615", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/148296/" ]
I am taking a digital design course and I didn't get something. RTL design includes datapath and controller, that's ok but what's the relation between these and verilog modules. For example, is controller a module in verilog? Generally, how RTL can be coded in verilog?
First of all, Verilog is a Hardware Description Language used to describe a collection of digital hardware, and a <code>module</code> is just a way of hierarchically encapsulating your description. Each <code>module</code> boundary can be physical, like the pins of an FPGA or IC, or printed circuit board, or it can be ...
One of the problems with many courses is that due to time pressure they try to teach concepts with problems that are too small to need those concepts. A design is basically a hierarchy of modules. In synthesis your top level module usually describes &quot;everything on the chip&quot;; submodules then describe parts of ...
https://electronics.stackexchange.com
15,840
[ "https://stats.stackexchange.com/questions/15840", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/253/" ]
This is a bit more "think about it" question - but I see it as an important one to ask. I have been struggling for the past few days with having a more reproducible-research-like workflow. I am confused with the two different strategies for writing a report. The two strategies are: <ol> <li>Sweave or brew. Where th...
<em>New answer based on comment below:</em> As I understand, Method 1 is to mix R code and HTML or LaTeX in the same document, using Sweave or brew for example, to create a final document, while Method 2 is to use R code to generate HTML or LaTeX, using the R2HTML or Hmisc packages for example, and then to just run th...
These are just a few points. <ul> <li>If you want to just write simple reports, then the set of LaTeX commands that you need to learn is a lot smaller than if you want to do complex things.</li> <li>An appealing aspect of LaTeX over some simple markup systems is that if you want features like referencing, automatic nu...
https://stats.stackexchange.com
486,454
[ "https://electronics.stackexchange.com/questions/486454", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/129106/" ]
Today I reviewed the theory behind the Fourier Transform, and I asked myself a question that I couldn't answer to in the process. Theory: A periodic waveform has a Fourier <em>series</em> which can be seen as the sampling of the corresponding aperiodic waveform (i.e. the <em>series</em> of a square wave is the sampli...
The Fourier transform is a linear transform. That means the transform of a long series of pulses is identical to adding the full complex transform of each individual pulse. If you try this, carefully respecting the time offset of each pulse, and the different FT phase result that that implies, you will see something ...
<blockquote> It starts with a single "rectangle", its spectrum is that of the Fourier transform of a rectangle? </blockquote> Yes, tautologically so. <blockquote> Then it continues with many other - infinite - rectangles and you can say that it is indeed a periodic waveform (or at least it's been until that point...
https://electronics.stackexchange.com
505,009
[ "https://math.stackexchange.com/questions/505009", "https://math.stackexchange.com", "https://math.stackexchange.com/users/37244/" ]
How would I integrate the following. $$\int \frac{x^2+1}{x(x^2-1)}$$ I have done the following. $$\frac{x^2}{(x)(x+1)(x-1)}$$ $$\frac{A}{x}+\frac{B}{x+1}+\frac{C}{x-1}$$ I then did $\quad \displaystyle A(x^2-1)+B(x-1)+C(x+1)=x^2+1$ Then $\quad Ax^2-1A+Bx-1B+Cx+C=x^2+1$ Grouping I get $$Ax^2=x^2,\quad A=1, \quad...
$$\frac{x^2}{(x)(x+1)(x-1)} = \frac{A}{x}+\frac{B}{x+1}+\frac{C}{x-1}$$ $$A(x^ - 1) + Bx(x-1) + Cx(x+ 1) = (A + B + C)x^2 + (-B+ C)x + -A = x^2 + 1$$ $$A + B + C = 1$$ $$C - B = 0\iff B = C$$ $$-A = 1\iff A = -1$$ Now, we have $$A = -1,\;B = C, \implies A + B + C = -1 + 2B = 1 \iff 2B = 2 \iff B = C = 1$$ Can you tak...
Indeed, you have $$\int\frac{x^2+1}{x(x^2-1)}dx=\int\frac{x^2}{x(x^2-1)}dx+\int\frac{1}{x(x^2-1)}dx$$ $$=\int\frac{x}{(x^2-1)}dx+\int\frac{1}{x(x^2-1)}dx=\int\frac{x}{(x^2-1)}dx+\int\left(\frac{1/2}{x+1}+\frac{1/2}{x-1}-\frac{1}x\right)dx$$ $$=\int\frac{du}{2u}+\int\left(\frac{1/2}{x+1}+\frac{1/2}{x-1}-\frac{1}x\right)...
https://math.stackexchange.com
198,965
[ "https://dba.stackexchange.com/questions/198965", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/124727/" ]
I am evaluating using Cassandra as a large key-value store over about 500 commodity machines. AFAIK, Cassandra requires manual intervention during permanent machine failures (removing the deadnode, adding new machines). I would think that the machine failure rate is high enough to overload the administrator. So is i...
This is a <code>greatest-n-per-group</code> problem and there are many ways to solve it (<code>CROSS APPLY</code>, window functions, subquery with <code>GROUP BY</code>, etc). Here's a method using window functions and a CTE: <pre><code>WITH ct AS ( SELECT *, rn = RANK() OVER (PARTITION BY PARAMETER_NAME,...
I think the following query is more intuitive to understand: <pre><code>create table SLVs_Flagged (PARAMETER_NAME varchar(30), GW_LOCATION_ID varchar(30), Report_Result int, DETECT_FLAG char(1) ) go insert into dbo.SLVs_Flagged values ('abc', 'cor1', 128, 'N'), ('abc', 'cor1', 12, 'Y') , ('def', 'cor1', 500, 'Y'), ('...
https://dba.stackexchange.com
7,539
[ "https://softwareengineering.stackexchange.com/questions/7539", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/18/" ]
I'm writing a small database-centric application in Java Swing that will be used internally in a small company. I haven't much experience with developing production-level applications. I don't use an ORM, just a few simple methods that run SQL queries with Java JDBC. On every method that access the database I use a <c...
Two main things in production system are: <ol> <li>Don't blow up the logs with information that is not interesting</li> <li>Allow raising the log level for troubleshooting purpose.</li> </ol> Use some kind of a logging infrastructure. If the exception can occur during the <strong>normal</strong> operation, report it ...
IMHO, here is the very minimum you should do. I assume you are using <strong>Log4J</strong>. <pre><code>try { // open connection // begin transaction // my database stuff // commit transaction } catch (SQLException ex) { log.Error("An error occured while ...: " + ex.Message, ex); // do stuff relat...
https://softwareengineering.stackexchange.com
150,611
[ "https://electronics.stackexchange.com/questions/150611", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/65047/" ]
I am currently trying to write code for a 48 channel DMX controlled dimmer using a PIC24FJ32GA002. Using a scope I have confirmed that there is a DMX signal reaching the Rx pin of the UART which has been configured correctly using the PPS function of the pic. Also nested interrupts are disabled. Below is the contents ...
So turns out that that family of PICs has an ADC module that automatically takes priority over any other components and prevents pins from causing interrupts until it is disabled. Added some disable code to the main hardware initialization function to disable the ADC on all pins and it works a treat now.
That PIC has a separate interrupt vector for UART errors.<br> I think that you'll find that your UART is stuck in an unhandled error condition and is refusing to receive any more data.<br> I'd suggest you move your overrun and framing error checking &amp; handling code to a new _U1ErrInterrupt handler.
https://electronics.stackexchange.com
2,012
[ "https://cardano.stackexchange.com/questions/2012", "https://cardano.stackexchange.com", "https://cardano.stackexchange.com/users/1142/" ]
I'm using Yoroi and want to switch to another stake pool. I never withdrew my rewards from the current pool. What happens to my rewards when I switch pools? Do I need to withdraw them before I switch to another pool?
No, you do not need to withdraw rewards before moving stake pools. Cardano wallets use two accounts: one for spending ADA and one for collecting rewards. While this may sound strange, it actually has many benefits (which I won't get into here). In order for earned rewards to be spent, they must be moved from the reward...
Your rewards are not on the pool, they are in an address owned by you. You don't need to withdraw them before redelegating.
https://cardano.stackexchange.com
430,892
[ "https://physics.stackexchange.com/questions/430892", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/194807/" ]
ideal gas Law says that PV/T = nR So does lets say you increase n and you Keep P and V constant should'nt the temperature decrease?
Yes indeed, temperature would decrease. This is because you are keeping the <strong>volume and pressure</strong> constant while the number of molecules increases. For a an intuitive explanation know that temperature is the <strong>average</strong> kinetic energy of the molecules. Also notice that the higher the press...
Exactly. The more intuitive (at least for me) POV would be that you have to decrease the temperature to keep the pressure constant when you increase n. It is comparable to the case of a pressure cooker where the pressure rises when you keep increasing the temperature but keep the volume and n constant.
https://physics.stackexchange.com
1,735,087
[ "https://math.stackexchange.com/questions/1735087", "https://math.stackexchange.com", "https://math.stackexchange.com/users/238738/" ]
I have the following question in my notes. <blockquote> Let $A \in H^*$ and let $F=A^{-1}({0})$ $F$ is a closed linear subspace. Show that for any choice of $u,w \in H$ with $Au$ non zero the vector is $w-\frac{Aw}{Au} u$ is an element of F. </blockquote> The solution is as below. <blockquote> Take $(u_j)...
First, remember that $F = A^{-1}(\{0\}) = \{ v \in H | A(v) = 0 \}$ To show that $v = w- \frac{Aw}{Au}u \in F$, it suffice to show that $A(v) = 0$. By linearity of $A$, you have $$A(v) = A \left( w- \frac{A(w)}{A(u)}u \right) = A(w) - \frac{A(w)}{A(u)}A(u) = A(w) - A(w) = 0$$ Hence the result
It seems more complicated than it has to be. The point is that: $$A \left ( w - \frac{Aw}{Au} u \right ) = Aw - \frac{Aw}{Au} Au = Aw - Aw = 0$$ which is the defining property for a vector to be in $F$. Here all I have used is the fact that $A$ is a linear functional defined on all of $H$. No continuity was required,...
https://math.stackexchange.com
2,162,331
[ "https://math.stackexchange.com/questions/2162331", "https://math.stackexchange.com", "https://math.stackexchange.com/users/397530/" ]
Show that $a_n=\frac{1}{\sqrt n}$ is cauchy directly from definition. My try:I can prove that $a_n$ converges to $0$ but how can we prove directly from definition that $a_n$ is cauchy?Thank you.
What you want to prove is that given $\epsilon &gt;0$ there exist $N$ such that for any $m,n&gt;N$ we have, $$|a_m-a_n|&lt; \epsilon$$ Sketch: $$|\frac{1}{\sqrt{m}}-\frac{1}{\sqrt{n}}|&lt; \epsilon$$ Without loss of generality, let $m \geq n$ so that by the triangle inequality, $$|\frac{1}{\sqrt{n}}|+|\frac{1}{\sq...
It is easy to show that $|x_m-x_n|\leq\frac{1}{\sqrt{\min\{m,n\}}}$. So for any $\epsilon&gt;0$, we can choose $N$ such that $N&gt;\frac{1}{\epsilon^2}$, and then $|x_n-x_m|&lt;\epsilon$ for any $n,m&gt;N$.
https://math.stackexchange.com
19,139
[ "https://cstheory.stackexchange.com/questions/19139", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/14229/" ]
Consider a random undirected graph on a set of $n$ nodes, say $\{1,2,\ldots,n\}$, such that the probability of edge between nodes $i$ and $j$ is $p_{ij}$ (we may assume $p_{ij}=o(1)$ for all $i,j$, i.e., $p_{ij}\rightarrow 0$ as $n\rightarrow \infty$, if it makes things simpler). We define Bernoulli r.v. $X_{ij}$ such ...
In general, it seems that you cannot get the concentration you want without more constraints on the probabilities. Consider the following graph on $n$ vertices. Let vertices $C = \{2,\ldots,n\}$ form a clique such that for all $i,j \in C$, $p_{ij} = 1$. Let vertex $1$ be connected to this clique via only one edge, w...
Here's a heuristic argument to say that, if each vertex has an expected number of edges of at least $\Omega(\log d)$, then you can get such a bound, and furthermore it depends mainly on this expected number of edges per vertex (not much on $n$ or $d$). (<strong>Edit</strong>: As Aaron points out in comments, though, a ...
https://cstheory.stackexchange.com
284,888
[ "https://softwareengineering.stackexchange.com/questions/284888", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/146579/" ]
I've been doing some research on microservices, and one question I've had that is not well addressed is whether there should be multiple instances of a microservice, and if so, how to deal with this? Suppose for example I have a system of two microservices, A and B where A depends on B. Looking at B, is B supposed to ...
Answer mostly depends on your scalability/uptime/failover requirements. If it's necessary to have highly resilient architecture, then yes, you need to have multiple instances (sometimes even distributed across multiple data centers). This is actually one of the benefits of microservices - you can scale different servi...
Why not. If the microservices are stateless or have a shared database backed state then you should be able to have multiple instances of the services behind a network load balancer (F5 big-ip or Microsoft NLB as an example). I am assuming the microservices have a http api (REST). The answer is slightly more complicated...
https://softwareengineering.stackexchange.com
37,628
[ "https://mechanics.stackexchange.com/questions/37628", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/10932/" ]
I've noticed that in a manual transmission vehicle when going uphill I have two options: <ol> <li>Downshift and press the gas more</li> <li>Stay in the same gear and press the gas more</li> </ol> I haven't measured it but typically in the higher gear I end out flooring the throttle, while the lower gear I don't need ...
Bear with me, I'm going to clear up a myth, then answer your question. You will see that they are related. <strong>Higher throttle doesn't mean higher RPM.</strong> Higher throttle just means more fuel entering the combustion chamber. This will tend to accelerate your engine, but if it's under an accelerating load ...
My Volvo V70 (model year 2006) has the digital dashboard fuel consumption meter. I also have a nice, fairly long uphill climb on my way to work, so I've had opportunities to try various methods. This is a manual transmission car. According to the car, the fuel consumption is nearly the same whether I downshift from fi...
https://mechanics.stackexchange.com
8,034
[ "https://mechanics.stackexchange.com/questions/8034", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/4162/" ]
I have recently acquired a 1999 Toyota Sprinter (Japanese domestic import). I realised that the engine "ping" so someone recommend to use 90 Octane petrol. I went through the manual but it only says "Unleaded Gasoline Only" but does not tell what octane rating to use. Does anyone knows this??? The problem is, sometimes...
The Engine System Service Required is a service interval indicator. The <strong>engine check light</strong> coming on will mean you have a fault. You can simply re-set the Engine System Service Required by carrying out a simply re-set. Button A is located at the bottom and to the left of your speedo. Ensure all doors ...
Doesn't the "Engine System Service Required" message just mean it expects an oil change or other routine maintenance? Just as a maintenance reminder?
https://mechanics.stackexchange.com
239,742
[ "https://physics.stackexchange.com/questions/239742", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/109502/" ]
I have a question and am not able to answer it. <ol> <li>Suppose you <em>drop</em> two objects from different heights. They are exactly the same shape, size and weight. Now we know that the gravitational acceleration is constant for all objects. Also, $F = ma$. Since both the values are the same, they ought to exert t...
<blockquote> Since both the values are the same, they ought to exert the same force on Earth on striking which is not true. </blockquote> Actually, the values are <em>not</em> the same. The gravitational acceleration is equal for them both, but the acceleration in $\sum F=ma$ is <em>not</em> this gravitational acce...
The balls, when dropped, have their own inertia, which is resisting the force of gravity. When the balls are released, they accelerate at a rate of 9.81 m/s squared, towards the maximum speed of terminal velocity - but they would need to be dropped from nearly 2,000 feet up to reach this speed. In summary, the ball fa...
https://physics.stackexchange.com
289,461
[ "https://softwareengineering.stackexchange.com/questions/289461", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/136188/" ]
We have a Unit Test Case where we want to assert that after a <strong>login</strong> operation, the <strong>SUT</strong> is able to call a method on one of it's dependencies. This dependency is a <code>NavigationManager</code> and the expectation is that it calls <code>NavigationManager.NavigateTo(string)</code>. Up t...
If the current requirements are that after login, you must always navigate to the screen indicated by the constant <code>NavigableScreens.MyNextScreen</code>, then that most likely isn't a dependency that should be injected. It is just a value that you pass on to another function anyway. However, <code>NavigationManag...
One perspective is that you always need a justification to mock, rather than a justification to use the real dependency. Mocked tests are, simply put, worse than real tests; <ul> <li>they test less</li> <li>require more maintenance</li> <li>are harder to write</li> <li>produce both false positives and false negatives</...
https://softwareengineering.stackexchange.com
11,884
[ "https://dba.stackexchange.com/questions/11884", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/6403/" ]
i need to move the data to a different folder and drive on my cent os db server. i added new hard drive (since we ran low on space), i have a 1tb of hard drive and i have a new 2tb i want to put the data on on the same server (dedicated server hosted in a datacenter) i would like to know what is the easy way to migr...
<strong>Step 1</strong> First setup your drive (assumed it's mounted and setup correctly in the fstab) and create new MySQL directory: <code>sudo mkdir /path/to/new/mysql</code> Make sure this folder has the right permissions: <code>chown -R mysql:mysql /data/mysql</code> Now here you can shutdown the service whil...
If you don't want shutdown during migration, I would setup a master-master replication to chroot environment on 2tb with mysql (same version) in it, then when on sync turn the 1tb off and you got a working chroot environment. If you don't want to use chroot environment, change the my.cnf (not the chroot one) to point ...
https://dba.stackexchange.com
354,810
[ "https://softwareengineering.stackexchange.com/questions/354810", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/189124/" ]
I wrote a class <code>ShaderWrapper</code> in C++, that wraps around OpenGL shaders. In the constructor I generate the actually OpenGL shader object, but this method only returns me a handle/id of type int. The actuall shader object is stored somewhere in global space. So my <code>ShaderWrapper</code> objects only have...
Keep it non-const. I assume that for the users of <code>ShaderWrapper</code> the underlying OpenGL object is an implementation detail they don’t need and want to be concerned with. So from the user’s point of view <code>setFloat()</code> <em>does</em> change the observable state of a <code>ShaderWrapper</code> object....
Logically you're mutating the shader, it doesn't matter that you outsourced actual storage to a global lookup table. So this method should not be callable on a constant view of the shader and the method should not be <code>const</code>. You might want to add a wrapper for <em>location</em> as well, so you can model a ...
https://softwareengineering.stackexchange.com
186,408
[ "https://dba.stackexchange.com/questions/186408", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/112394/" ]
Can any one here please advise how to add a decimal point after first digit while selecting numeric value from database? <blockquote> Example: Output is 8250 should be 8.250 </blockquote> I tried this: <code>convert(decimal(10,3),ti.Rate/1000) AS Amount</code> but the output returns the wrong value of <code>8.000...
<pre><code>DECLARE @value INT = 8250 PRINT convert(DECIMAL(10, 3), @value / 1000.00) </code></pre> <blockquote> 8.250 </blockquote>
Because all the values inside the convert call are integers it is performing integer division to get an integer result before converting to a decimal. <code>ti.Rate/1000</code> is 8250/1000 which with integer division becomes 8. <code>CONVERT</code> then changes the type but the extra precision is already lost. If you...
https://dba.stackexchange.com
155,800
[ "https://dba.stackexchange.com/questions/155800", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/55146/" ]
I have the following database table, that saves all outgoing emails to students: <pre><code> CREATE TABLE [dbo].[tblEmailsSent]( [id] [int] IDENTITY(1,1) NOT NULL, [Sent] [datetime] NULL, [SentByUser] [nvarchar](50) NULL, [ToEmail] [nvarchar](150) NULL, [StudentID] [int] NULL...
You need an outer join for this: <pre><code>select f.rank, count(s.s_id) as assigned from first f left join second s on f.f_id = s.f_id group by f.rank order by f.rank; </code></pre> It's important to count the rows from the outer joined table. A simple <code>count(*)</code> would return the wrong values. <code>cou...
You can achieve that by using a <code>LEFT JOIN</code> between <code>first</code> and <code>second</code> and using <code>COUNT(assigned)</code>. Since assigned could be <code>NULL</code> in the <code>LEFT JOIN</code> your <code>COUNT</code> will return 0 as expected.
https://dba.stackexchange.com
189,320
[ "https://physics.stackexchange.com/questions/189320", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/83447/" ]
I am a biologist developing an interest in physics. I am struggling with the implications of changing reference frames on momentum, mechanical energy and work done calculations. I invented the situation in the diagrams below to try and work stuff out but the outcomes do not fit with what I believe are the correct physi...
I didn't redo your calculations and I assume that they are correct, which actually doesn't play any role in what I'll describe now. Notice that in the second scenario the 2kg ball will inevitably start to move. By keeping it still you change the reference frame one more time, which invalidates the use of conservation l...
Great question. I didn't check all the math, but I see a problem. In the first graphic, you described a collision process in a single reference frame. Your picture is lovely. In the second graphic there is a problem. In the rest frame of the 2kg ball, the 2kg ball sees a 4kg ball approaching it. During the collision,...
https://physics.stackexchange.com
149,421
[ "https://physics.stackexchange.com/questions/149421", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
<strong>Q: Find out the moment of inertia of a uniform circular disc of radius $r$ &amp; mass $M$ &amp; the axis passes through a point on the circumference.</strong> <strong>My attempt:</strong> Let the axis passes through $O$ on the circumference. Then I took a ring at $x$ unit from the axis and width $dx$. Now, are...
with your definition of $dA$ you must integrate between r and 0, because you start at the center, and the rings grow in radius as you go for (r-x) from x=r to x=0
There is a general and simple formula to calculate the moment of inertia with respect to some axis if the moment of inertia with respect to another axis is known. I am pretty sure you'll be able to find it in your textbook. The theorem is parallel axis theorem.
https://physics.stackexchange.com
149,997
[ "https://electronics.stackexchange.com/questions/149997", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/64761/" ]
I was at a placement for the last few weeks, and a lot of people were talking about a strain gauge amplifier. It was a box (the box was about 10cm x 8cm, 3D printed) although I didn't get to open it up. I know that strain gauges are thin wires that create a difference in resistance when a force is applied, so does a st...
By definition, a strain gauge amplifier amplifies the small signal from a strain gauge. A strain gauge is a resistive material that changes resistance when deformed as a result of applied force. This change in resistance is usually measured using a Wheatstone bridge. Note that, depending on the design of the strai...
A strain gauge amp obviously amplifies the strain gauge signal.<br> I'm pretty sure a strain gauge gives some small resistance change signal due to the differential "volume" change in the resistive film as it is bent. I'd start by checking the wikipedia page? You should at least provide a link to the page with your q...
https://electronics.stackexchange.com
2,810,707
[ "https://math.stackexchange.com/questions/2810707", "https://math.stackexchange.com", "https://math.stackexchange.com/users/471125/" ]
The $\eta$-value of an integer partition $\lambda = \big( \lambda_1 \geq \lambda_2 \geq \cdots \geq \lambda_k \geq 0 \big)$ is defined as \begin{equation} \eta \big( \lambda \big) \ := \ \sum_{i=1}^k \, (i-1) \, \lambda_i \end{equation} It makes an appearance in a $q$-version of the <em>hook-length formula</em> for ...
<em>Dear Ines</em>, Let me supplement my first response with a related (possible) answer to your question which makes use of the expansion of power-symmetric functions in terms of Schur functions (an identity which you and I have discussed in other threads of this forum). Given a partition $\mu= \big(\mu_1 \geq \do...
Here's a story that might please you: Let $T$ be the set of all transpositions in $S_n$ and define a corresponding discrete Laplace operator $\Delta$ by \begin{equation} \Delta f ( \sigma ) \ = \ \sum_{\tau \in T} \, f ( \sigma ) - f ( \tau \cdot \sigma ) \end{equation} for any complex-valued function $f: S_n \longr...
https://math.stackexchange.com
719,829
[ "https://physics.stackexchange.com/questions/719829", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/334718/" ]
I am reading Srednicki's QFT and I have met a problem. In its section 5, (5.18) , after deducing the LSZ formula, in order to check whether his supposition &quot;that the creation operators of free field theory would work comparably in the interacting theory&quot; is reasonable, the author considered the number <span c...
A function is Lorentz invariant if <span class="math-container">$f(p) = f(\Lambda p)$</span>. Consider the function <span class="math-container">$$ f(p) = \langle p| \phi(0) | 0 \rangle = \langle p| U(\Lambda)^{-1} U(\Lambda) \phi(0) U(\Lambda)^{-1} U(\Lambda) | 0 \rangle $$</span> where in the last equality, we simpl...
This is why we use the LIPS (Lorentz Invariant Phase Space) normalization <span class="math-container">$$ \langle {\bf p}|{\bf p}'\rangle = (2\pi)^3 2E_{\bf p}\delta^3({\bf p}-{\bf p}') $$</span> for the single particle states. Without the <span class="math-container">$2E_{\bf p}$</span> matrix elements such as <sp...
https://physics.stackexchange.com
115,151
[ "https://physics.stackexchange.com/questions/115151", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/47605/" ]
We believe that time is a dimension and that $x$,$ y$, $z$ are dimensions in space. Is quantity a dimension like these? And if not, how do we have dimensionless numbers (like $e$, $\pi$ etc.)?
A few things I can think of straight away: <ul> <li>Power line pylons are usually the tallest objects in the countryside. They are giant grounded metal objects. As lightning wants to move along the path of least resistance, they are preferred over other objects. Power lines also usually have one or two grounded wires ...
You don't live sufficiently close to the power line pylons. For lightning protection, the lightning rod needs to be pretty much above you; if you use a vertical rod, the apex angle of the cone of protection can be, for example, between 20° and 75° for a high standard of protection (from cone side to the opposite side),...
https://physics.stackexchange.com
334,262
[ "https://physics.stackexchange.com/questions/334262", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/117580/" ]
I'm learning about the Meissner effect, but I can't really grasp an example of Bleaney's book on electricity and magnetism. Let's assume a hollow thick cylinder made of superconductor material, with it's axis in the orientation of an applied field $B_1$. We cool it under it's superconducting transition temperature, so...
The integral form of Faraday's law says that $\oint_C {\bf E} \cdot d{\bf l} = -\frac{d\Phi}{dt}$, where $\Phi$ is the magnetic flux through an open surface bounded by the curve $C$. Let the surface be a cross-section of the cylinder parallel to the end caps. A superconductor is a perfect conductor so it cannot conta...
The cylinder is a perfect conductor. Lenz's law says that when there is a change of flux inside a coil, this will set up an e.m.f. to resist that change. But the moment an e.m.f. is generated, this will create a current in the coil that resists the change in flux. When the resistance is zero, any change in the flux w...
https://physics.stackexchange.com
432,954
[ "https://physics.stackexchange.com/questions/432954", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/208833/" ]
Consider a boltzmann distribution where the total energy of the reservoir and the system is <span class="math-container">$E$</span>. The energy of the system can be <span class="math-container">$\epsilon_i$</span> and the energy of the reservoir is <span class="math-container">$E-\epsilon_i$</span>. Now if the system...
The reservoir is taken to be large enough to provide the system with a very well-defined probability distribution for its energy <span class="math-container">$\epsilon_i$</span>. For the theorists, this means of course that the reservoir is actually infinitely large. A system is said to be in thermal equilibrium with...
Consider a small system in thermal contact with a large system which has coolness <span class="math-container">$\beta$</span>. For simplicity, the small system has just one state per energy level. It could be a harmonic oscillator with a small quantum energy. The large system has a multiplicity <span class="math-contai...
https://physics.stackexchange.com
198,647
[ "https://electronics.stackexchange.com/questions/198647", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/89354/" ]
I know this is probably really basic, but it's very confusing to me.
In order for electrolytic capacitors to perform correctly, they need to be forward-biased. You cannot reverse-bias them and have them perform properly. Even though your input signal has a DC component, your feedback capacitor is still going to spend some of its time with its polarity reversed as the op-amp attempts t...
It's crazy - look at the resistor values - 2k2 - why not use 22k and reduce all your capacitor values by 10 times. Why not use 220k and reduce your cap values by 100 times. Worried if it will work with 220k? You might need an op-amp with lower input bias/offset currents. The LM358 offset current is about 5nA and this ...
https://electronics.stackexchange.com
260,407
[ "https://mathoverflow.net/questions/260407", "https://mathoverflow.net", "https://mathoverflow.net/users/43737/" ]
Let $F$ be a (totally real) number field, and $E$ a (totally imaginary) quadratic extension of $F$. We consider $U$ a unitary group (with respect to a given hermitian form over $E$). The question is: <blockquote> When is $U(F) \backslash U(\mathbf{A}_F)$ compact? </blockquote> I found some interesting reflexions ab...
There are actually several different conditions all of which are equivalent, and one can make various formulations of these conditions depending on whether one sticks to the reductive case and/or global fields of characteristic 0 vs. general global fields. So it may be confusing to sort out exactly what is equivalent t...
This has been answered by @nfdc in great generality. I just wanted to say how Mahler's criterion may be applied. This needs a little bit of work since the group $U(h)$ is "compact at infinity". This should really be an extended comment, but for reasons of space, I write this as an answer. Mahler's criterion says that...
https://mathoverflow.net
103,978
[ "https://dba.stackexchange.com/questions/103978", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/30560/" ]
Okay, this seems funny for a simple script: but I really need this small piece to execute well. <pre><code>DECLARE @dbName NVARCHAR(50) SET @dbName = 'rx_lab' DECLARE @SQL02 NVARCHAR(MAX) SET @SQL02 = 'USE ['+ convert(nvarchar(50),@dbName) +']' exec sp_executesql @SQL02 SELECT DB_NAME() </code></pre> This still retu...
<code>sp_executesql</code> creates a new execution context which ceases to exist when the executed statements return. The USE only has effect within the <code>sp_executesql</code>. Try this <pre><code>SET @SQL02 = 'USE ['+ convert(nvarchar(50),@dbName) +']; SELECT DB_NAME();' </code></pre> and you'll get what you'...
<blockquote> but statements AFTER this will Not be using the new db assignment - which is what I want </blockquote> You can use 3 part naming <code>dbname.schema.objectName</code>. Below is an example to get you started. You can modify as per your needs : <pre><code>SET NOCOUNT ON DECLARE @dbname VARCHAR(max) ...
https://dba.stackexchange.com
22,925
[ "https://stats.stackexchange.com/questions/22925", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/9246/" ]
I have a dataframe with a group variable GRP (ranging from 1-100) and an X and Y for each one. I'd like to get a list of the regression intercepts and slopes for lm(Y~X) within each group. The intercepts and slopes don't need to be in the same dataframe. Any suggestions? R beginner here, so simplicity would be great!
data.table also has great tools for solving problems such as this: <pre><code>library(data.table) set.seed(1) dat &lt;- data.table(x=runif(100), y=runif(100), grp=rep(1:2,50)) dat[,coef(lm(y~x)),by=grp] </code></pre> The first row in each group is the intercept, and the second row is the coefficient: <pre><code> gr...
The responses by @Henry and @Zach both work, but I think the most straight-forward way to do what you want is to use <code>lmList</code> in the <code>nlme</code> package: <pre><code>dat &lt;- data.frame( GRP = sample(c("A","B","C"), 100, replace=TRUE), X = runif(100), Y = runif(100) ) require(nlme) lmList(Y ~ ...
https://stats.stackexchange.com
20,258
[ "https://physics.stackexchange.com/questions/20258", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/5971/" ]
The force on a small element (of length dl) of a current carrying wire, place in a magnetic field <strong>B</strong> can be calculated using the following equation (which is simply an application of the Lorentz force equation): d <strong>F</strong> = i <strong>dl</strong> X <strong>B</strong> My question is, how does...
A bar magnet, current loop, electron etc has a magnetic moment vector associated with it. When placed in a magnetic field, the torque $\tau$ tending to align the magnetic moment $m$ with the applied magnetic field $B$ is given by $\tau = m\times B$
Interaction energy is $U=-\int \vec{m(x)} * \vec{B(x)}d V$. You get the force by taking the negative gradient of this, $\vec{F} = -\nabla U$. The gradient is with respect to rigid displacements of the magnetized object, with the external magnetic field held fixed.
https://physics.stackexchange.com
322,316
[ "https://electronics.stackexchange.com/questions/322316", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/150499/" ]
What electronic components is a constant current LED driver made of? And what are the different components in constant voltage LED driver.
<blockquote> <ol> <li>My question therefore is, why is the LM2904 still in full production?</li> </ol> What is the point of it? Why would someone choose it when the LM358 is a drop-in replacement and is arguably a little better? </blockquote> Generally, cheapness. If the LM2904 is 0.1ct cheaper in 10000 pcs and you don...
They produce lm358 for the suckers and 2904 for the wise shoppers who are unwilling to pay more for the same parts. Buying and using 2904 says to the world that you know what you are talking about.
https://electronics.stackexchange.com
172,716
[ "https://mathoverflow.net/questions/172716", "https://mathoverflow.net", "https://mathoverflow.net/users/38416/" ]
Let $p$ be a prime number, $\mathbb{Q}_p$ the field of $p$-adic numbers, $G_p$ the absolute Galois group of $\mathbb{Q}_p$ and $V$ a finite dimensional vector space over $\mathbb{Q}_p$. Assume we are given a linear representation $\rho : G_p \to GL(V)$. Can we find a closed subgroup of finite index $H$ in $G_{p}$ such...
The answer is no. To prove it, it suffices to show that there exists a representation $\rho: G_p \rightarrow Gl(V)$ of open image. There are several ways to do this, one is to use Chenevier prop. 1.8 in "Quelques courbes de Hecke se plongent dans l'espace de Colmez", which says that for $p=2,3,5,7$ and $\rho: G_{\mathb...
One gets loads of crystalline counterexamples using $p$-divisible groups (and more specifically from any elliptic curve with supersingular reduction). Let $k$ be a perfect field of characteristic $p &gt; 0$ and let $K$ be a complete discretely-valued field of characteristic 0 having residue field $k$. Let $\Gamma_0...
https://mathoverflow.net
424,119
[ "https://physics.stackexchange.com/questions/424119", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/187604/" ]
When an object falls down in a liquid it has two forces working on it one gravity and another is viscous drag . Now when these forces are same the object attains the terminal velocity in liquid. Now if these forces have been neutralized then why shouldn't the viscous drag (which is proportional to instantaneous veloc...
Because gravity is still acting on the object. When the body is moving at terminal velocity, it's not experiencing no forces. It's just not accelerating because the vector sum of all forces on it is zero. In the case of this object, we can say that $F_{gravity}=mg$, and since $F_{total}=0$, we must have $F_{viscous}=F...
When an object has achieved terminal velocity, it experiences no acceleration. From this, we can deduce that $F_{net}=0$. Well, what is $F_{net}$? It is the net force on a object; after all forces have cancelled out, what we are left with is $F_{net}$. In our case, $F_{net}=F_{drag}-F_{weight}=0$.
https://physics.stackexchange.com
92,034
[ "https://softwareengineering.stackexchange.com/questions/92034", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/27666/" ]
I often find myself wondering what programming best practices apply to solo programming, since most of the time, I'm the only programmer on a project. I just started experimenting with C# 4.0 Code Contracts, and I thought I'd ask the community what utility they may have for a solo programmer. Here's where I'm coming f...
The advantage of assertions (or contracts, which are basically a different take on assertions) comes when your codebase grows large enough that you can no longer hold the entire thing in your short-term memory. Especially when you're still developing it and changing things every day. When you first wrote <code>MapEnt...
Mason's answer is excellent, but one other thing to remember is that contracts are a bit more than just a different take on assertions, if you're using the static analysis tool that is included in the Premium Edition of Microsoft's Code Contracts. If your <code>MapEntity()</code> function starts off by requiring that ...
https://softwareengineering.stackexchange.com
53,078
[ "https://electronics.stackexchange.com/questions/53078", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/17605/" ]
I have some relative experience on AVR but just minimum with PICs. In order to start a project I've just wanted to verify that I was able to get the internal oscillator working at the right frequency. So, my first test was to toggle a pin and see the frequency I've got. The first test code was <pre><code>#include &...
What you are doing wrong is making instruction-level assumptions about compiled code. If you want to test the execution speed of instructions, you need to write a known loop in assembler. For example: <pre> loop: btg LATA, #6 bra loop </pre> Next you carefully count how many cycles in one ...
Add a known delay to your code; eg. 1 ms delay. The compiled code will be optimized for the frequency the compiler is aware of and if that is the same as the set RC-clock, then you will measure a 500Hz block at the output. Without a known delay you are can only verify timing by analyzing the compiled machine code. The...
https://electronics.stackexchange.com
378,417
[ "https://softwareengineering.stackexchange.com/questions/378417", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/315261/" ]
I've noticed that some methods like the String's substring(int beginIndex, int endIndex) and StringBuilder's delete(int beginIndex, int endIndex), use the second parameter to signify that the substring or deletion should go to endIndex-1 and not endIndex. Is there a reason for this? It doesn't seem, at least to me, to ...
A practical reason is that it makes things easier in some common situations: <ul> <li>If you want the operation to include everything until the end of the string, you can directly use the length as <code>endIndex</code></li> <li>If you have "separation characters", like the dot between base name and filetype suffix, y...
I agree with Micheal Borgwardt's answer but there is an opportunity for elaboration. The approach you see here is not only useful but also consistent with most the APIs you will find in Java and many other languages. The association with 0-based indexing is more clear if you think about the standard old-style for-loo...
https://softwareengineering.stackexchange.com
181,140
[ "https://softwareengineering.stackexchange.com/questions/181140", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/37265/" ]
I was using a popular music package (Ableton Live) when I opened the legal section of the helpfile and saw that the program contained code licenses that appeared to be both free as in freedom and free as in beer. I cannot find an online copy, alas, but if necessary I can list the licensed packages. As far as I can see...
It depends on which license. There are some free software licenses that are specifically designed to prevent people from doing stuff like that, such as the GNU GPL. They're known as "viral" licenses, because their licensing terms spread to any code you use them with, which keeps you from using a GPL library in a non-...
<strong>Disclaimer</strong>: I am not a lawyer. From working with lawyers in the past, software developers tend to guess the intent of legal documents and work of that whereas lawyers (1) read what is written and (2) use the legal rather than common definitions of words. Be careful. As Mason said, it depends on the li...
https://softwareengineering.stackexchange.com
119,824
[ "https://dba.stackexchange.com/questions/119824", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/77485/" ]
I try to purge some files in oracle. I use adrci. I want to purge trace files in listener file. But it's not work. I don't know why. <pre><code>[grid@orcl1 app]$ adrci adrci&gt; set homepath diag/tnslsnr/orcl1/listener adrci&gt; purge -age 360 -type alert adrci&gt; purge -age 60 -type trace adrci&gt; purge -age 1 -ty...
ADRCI deletes the XML files, but not the plain text logs, which is a nuisance. An easy but dirty solution would be overwriting the file with empty content, e.g: <pre><code>$ cat /dev/null &gt; listener.log </code></pre> Deleting the file while the listener is running and logging is enabled may not lead to the expect...
adrci purge will remove files according to your commands but not the contents of trace or log files. Even though your listener.log has contents going back weeks/months/years it was modified today if the listener is up and accepting connections. The same for an alert log purge, if the db is online and the file was upda...
https://dba.stackexchange.com
303,783
[ "https://softwareengineering.stackexchange.com/questions/303783", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/205676/" ]
I am trying to understand static vs dynamic typing, but am really struggling to see how everything fits together. It all starts with data types. As far as I understand, data types are quite abstract notions, which exist 'in' compilers in order to categorise data so that the operations on various types of data can be v...
Your assertion that "datatypes exist only in the compiler" is not true for dynamic languages (and not a few static ones). Once that doesn't hold, it becomes a simple runtime check.
<blockquote> How can any type-checking be done at runtime? Surely there is no concept of data types at run time? </blockquote> Sometimes there <em>are</em> data types at runtime. Other times, the type checking can be done entirely at compile-time. In principle, it's up to the implementation whether it chooses to imp...
https://softwareengineering.stackexchange.com
183,357
[ "https://dba.stackexchange.com/questions/183357", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/118143/" ]
I'm trying to acquire a serializable lock on a <code>JSONB</code> column, but it looks like by default <code>JSONB</code> supports only row level lock on transactions. Basically I want to store JSON like: <pre class="lang-json prettyprint-override"><code>{a:"v1", b:"v2"} </code></pre> Here I want to acquire lock on ...
You can't do this with <code>JSONB</code>. To get this level of separation, you would have to have a parent and child table, where the child table would be something like: <pre><code>(parent_id whatever, key text, value text, primary key (parent_id, key)) </code></pre> If your JSON can be nested and not just a flat...
I would never do something like this but you can certainly stop a single user from editing two keys. <pre><code>CREATE TABLE foo(frekinJSON) AS VALUES ('{"a":1, "b":2}'::jsonb); CREATE FUNCTION halt() RETURNS trigger AS $$ BEGIN RAISE EXCEPTION 'NOAP!'; END; $$ LANGUAGE plpgsql; CREATE TRIGGER halt_in_the_...
https://dba.stackexchange.com