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
405,318
[ "https://softwareengineering.stackexchange.com/questions/405318", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/180461/" ]
We were discussing how to design a API response, for simplicity, think of having to give information of all the different types of facilities available in a city: <pre><code>{ "city": { "cityName": "Gotham", "population": "8620000", "facilities": { "airport": { "...
In your case where there simply isnt a building of that type I would go for an array of Building <pre><code>{ "city" : { "buildings" : [ { "type": "airport", "name": "Batman International Airport", "numRunways": 7, "dailyCommuters"...
Why do you think you need to specify keys for <code>facilities</code> that are not present? Why not just omit them entirely. <pre><code>{ "city": { "cityName": "Gotham", "population": "8620000", "facilities": { "airport": { "name": "Batman International Airport"...
https://softwareengineering.stackexchange.com
13,323
[ "https://stats.stackexchange.com/questions/13323", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/2251/" ]
I'm trying to finish a proof for a review exercise and I'm asked to show that $E\left[(y-E(y|x))(E(y|x)-f(x))\right]=0$ where $y$ is the dependent variable and $f(x)$ is a linear predictor of $y$. I'm almost finished, but I just want to check whether or not $E\left[ E \left[ y E(y|x)\,|\,x \right] \right]=E\left[ ...
You answer your own question. There is nothing different than backing out function of $x$ from the conditional expectation conditioned on $x$. Introduce definition $$g(x)=E(y|x)$$ Then $$Eyg(x)=E[E[yg(x)|x]]=E[g(x)E[y|x]]=E[(E[y|x])^2]$$ And we get your result. However your last statement is false. $E(y|X)$ is a...
By definition, $\newcommand{\E}{\mathrm{E}}\E[Y\mid X]$ is a measurable function of $X$ a.s. But then, $\E[Y\mid X]-f(X)$ is also a measurable function, say $g$, of $X$ a.s. Using the properties of the conditional expectation, you get what you need. $$ \E[(Y-\E[Y\mid X])(\E[Y\mid X]-f(X))] = \E[(Y-\E[Y\mid X])g(X)] $...
https://stats.stackexchange.com
119,050
[ "https://mathoverflow.net/questions/119050", "https://mathoverflow.net", "https://mathoverflow.net/users/12310/" ]
<strong>Fact:</strong> For any (continuous) $S^1$-action on the closed unit disk $\mathbb{D}^n$, there is a fixed point $x_0\in\mathbb{D}^n$.<br> I have thought of a possible argument that re-proves this, but am not sure how to complete it: Let $U_p\subset S^1$ be the subgroup of $p^\text{th}$-roots of unity ($p$ prim...
You might have a look at Chapter VI of Borel's "Seminar on transformation groups". This is the chapter on "Isotropy groups of toral actions" by E. E. Floyd. In particular Theorem VI.1.2 seems to be saying that the fixed point sets eventually stabilize. (I can give more details if you don't have the reference to hand.)...
Not quite your question, but I'll say it anyway. The "fixed-points of actions on a $p$-acyclic space are $p$-acyclic" part of Smith theory easily extends to arbitrary $p$-groups. By induction on the order of the group: if $P$ acts on a $p$-acyclic $X$, choose a non-trivial proper normal subgroup $Z \leq P$ (these alw...
https://mathoverflow.net
106,013
[ "https://softwareengineering.stackexchange.com/questions/106013", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/-1/" ]
I'm working on a C++ wrapper for libpcap and I'd like to get more into version control as I'm not experienced with this (the only reason I used it was to put code on GitHub :)). Does it make sense to schedule nightly builds for a one-man project? What advantages are there in doing this?
You've got it a little bit from the wrong angle. The important idea is that you need <em>reproducible builds</em>! Given any deployment you need to be able to later reproduce the exact build process that generated that deployment, so you can debug it and fix it. Here it is important to use source control so you can ...
Probably not. The advantages of automated nightly builds only start to play when the team becomes so large that no individual team member can keep the entire project in their head anymore. When this happens, nightly builds ensure you always know whether you'd be able to ship if you had to, at any given time - but if ...
https://softwareengineering.stackexchange.com
84,794
[ "https://electronics.stackexchange.com/questions/84794", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/28144/" ]
In theory, for an op-amp in inverting design, the voltage gain is \$\dfrac{R_{f}}{R_{in}}\$. For example: for a \$gain=10\$ we can use \$R_{f}=100\ \mathrm{k\Omega}\$ and \$R_{in} =10\ \mathrm{k\Omega}\$. The same gain can be obtained from \$R_{f}=1\ \mathrm{k\Omega}\$ and \$R_{in}=100\ \mathrm{\Omega}\$. What is the...
If you want your op-amp to perform better at high frequencies you'll use lower value resistors to set the gain. Leakage capacitance around the feedback area might be in the order of 1pF due to circuit tracks and pads for components and this has an effect when resistor values are high. If your feedback resistor were 100...
This is a good general question and the general answer is: it depends. Specifically, since you have two resistor values to find but only one specification, the gain, all you can constrain is the resistor value ratio; you need another constraint to fix individual values (or a bound on the them). The most likely speci...
https://electronics.stackexchange.com
907
[ "https://robotics.stackexchange.com/questions/907", "https://robotics.stackexchange.com", "https://robotics.stackexchange.com/users/362/" ]
A 2d laser scanner is mounted on a rotary axis. I wish to determine the transformation matrix from the center of the axis to the center of the scanner, using only the input from the scanner and the angle of rotation. <img src="https://i.stack.imgur.com/bygWj.png" alt="enter image description here"> The 2d scanner its...
Your hardware configuration sounds wrong... your trying to provide all the drive current from the arduino Given your description, your using a bipolar (NPN or PNP) transistor, I'd wire up as: <ul> <li>Base: To arduino</li> <li>Collector: Motor -ve (motor +ve to Vcc)</li> <li>Emmitter: Ground</li> </ul> Alternativel...
It's possible that this isn't working because you have blown your transistor. There are a couple of things which could have blown it: <ul> <li>No resistor to limit the base current</li> <li>No diode to protect against back EMF from the motor</li> </ul> So you should add a base resistor, and a flyback diode. <img src...
https://robotics.stackexchange.com
1,043,225
[ "https://math.stackexchange.com/questions/1043225", "https://math.stackexchange.com", "https://math.stackexchange.com/users/189188/" ]
I have encountered the following interesting technical relation. $$ \pi^2 = \inf_{x \in \mathcal{D}(0,1) \setminus\{0\}} \frac{\int_0^1 |x'(s)|^2 \, \text{d}s}{\int_0^1 |x(s)|^2 \, \text{d}s}$$ where $\mathcal{D}(0,1)$ is the set of all smooth functions in $(0,1)$ with a compact support. Amazing. Can anyone please g...
First of all, we write down the fourier expansion of $x(t)$: $$x(t) = \sum_{n=1}^\infty a_n \sin(n\pi t) + \sum_{n=1}^\infty b_n \cos (n\pi t)$$ (the main point is that $x(t)$ has no constant term, do you know why?). Thus $$\int_0^1 |x(t)|^2 dt = \sum_{n=1}^\infty a_n^2 + b_n^2$$ and $$\int_0^1 |x'(t)|^2 dt = \p...
I can prove that if $\pi^2$ is a lower bound then it must be the greatest one. Simply consider uniform approximations of $x(s)=\sin(\pi s)$ by functions with compact support. Then $x'$ will be approximated in the sense of $L^2$ and so you recover the result. I am not sure why $\pi^2$ is a lower bound, however.
https://math.stackexchange.com
98,783
[ "https://math.stackexchange.com/questions/98783", "https://math.stackexchange.com", "https://math.stackexchange.com/users/11351/" ]
I have a homework question to which is <blockquote> If $f(x)$ is diferentiable in $(0,\infty)$ and $f&#39;(x)&gt;\frac{1}{x}$ for every $x&gt;0$ then $f$ is not uniformly continuous in $(0,\infty)$. </blockquote> The question has a clue which asks me to prove that for $0&lt;a&lt;b$ then $f(b)-f(a)&gt;\frac{b-a}...
Very informally: Noting $\bigl(\cos x \bigr)^{\sin x } =\exp\bigl ( \sin (x) \ln (\cos x) \bigr)$. Start with $\cos x = 1-{x^2\over 2!}+{x^4\over 4!}-\cdots$. Then use the Taylor series $$\ln(1+z)=z-{z^2\over2}+{z^3\over3}-\cdots$$ with $z=-{x^2\over 2!}+{x^4\over 4!}-\cdots$ to obtain the first few terms of the ex...
Your formula ($\cos(x)^{\sin(x)}=1-\frac{x^3}{2}+\frac{x^6}{8}+o(x^6).$) has been achieved from the definition of The Taylor Series: $$f(x) = \sum_{i=0}^{\infty}\frac{f^{(n)}(x_0)}{n!}(x-x_0)^n$$ Where $f^{(n)}(x)$ is $n$th derivative of $f(x)$ with respect to $x$. (Notice that $f\in c^{\infty}$) put $x_0=0$ and calc...
https://math.stackexchange.com
478,600
[ "https://physics.stackexchange.com/questions/478600", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/136800/" ]
The usual answer to the twin paradox is that the twin who undergoes acceleration is the one who finds the other has aged more, because the trajectory of the 'travelling twin' does not amount to a single inertial frame - the travelling twin has accelerated while the stationary twin has not. But isn't acceleration a rela...
This is actually an excellent question and it bothered me for an incredibly long time because I thought exactly what you did: acceleration is relative, is it not? One twin will see the other's speed is changing, and vice-vera. So how does the universe know which once is <em>actually</em> accelerating? The answer is tha...
It's easy To spot you're accelerating without any other reference points. For example a twin in an accelerating ship would see he couldn't apply Newton's laws inside the ship since positions of objects within the ship would change their positions at an increasing rate without any forces present. He would realise he had...
https://physics.stackexchange.com
58,622
[ "https://mathoverflow.net/questions/58622", "https://mathoverflow.net", "https://mathoverflow.net/users/4096/" ]
Let $X$ be the intersection of two quadrics in $P^5$. It is well known that the intermediate Jacobian $J(X)$ is isomorphic to $J(C)$ for a genus 2 curve, related to the pencil of quadrics whose base locus is $X$. It seemed then natural to me to ask the following question: Is there an explicit construction where $X$ i...
The projection from a line $L_0$ is a birational isomorphism of $X$ onto $P^3$. It decomposes as the blow-up of the line $L_0$ followed by the contraction of a surface swept by lines intersecting $L_0$ onto a curve of genus 2 in $P^3$.
The answer is 'no'. By the Lefschetz hyperplane theorem, the second betti number $b_2$ of $X$ is 1, so in particular the Picard group of $X$ is isomorphic to $\mathbb{Z}$. Since blow-ups and $\mathbb{P}^k$-bundles have Picard number $\ge 2$, it follows that no such description exists.
https://mathoverflow.net
57,881
[ "https://dba.stackexchange.com/questions/57881", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/25339/" ]
For a monitoring script I need to count the number of open connections to a postgres database. This is done easily enough by opening up a client connection and running a count on the pg_stat_activity table. However, if the maximum number of connections has already been reached, the connection, and check script, will ...
A safe and reliable way is to use netstat. I would start with <code>netstat --numeric-ports | grep 5432</code> as this will show you active connections. The problem of course is that there may be some false positives. The following should work for most cases though: <pre><code>netstat --numeric-ports | awk '/(local...
Look at what puts your count out. With <code>ps aux | grep postgres | grep -v grep</code> I see 7 server processes plus one for every open client connection. <pre><code>USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND pgsql 11755 0.0 0.1 73420 11568 ?? Is 8:16pm 0:0...
https://dba.stackexchange.com
318,991
[ "https://softwareengineering.stackexchange.com/questions/318991", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/229105/" ]
I'm working on website and java application for my project and I'm writing report and there is question that say "What is the architecture of the project" I don't know what should I write because I don't understand what does it mean
If they were asking for the architecture of some code or files, they might be asking about what classes there are and how they interact. However, in a project, we group classes into larger components, and these components interact. Given that they're asking about the project, they're asking for the big picture of top...
It's, probably, asking you for to describe your strategy at the time of conceptualizing the project. <strong>An overview</strong> of your solution. For example: <em>What kind of software are you proposing? Server-client? Desktop? Movile? And why?</em> <em>What requirements are you meeting with your choice?</em> Thi...
https://softwareengineering.stackexchange.com
66,926
[ "https://physics.stackexchange.com/questions/66926", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/25357/" ]
I'm not a physicist, but I'm still very interested in the relativity theory, especially in how the twin paradox is explained. Actually, it does not make sense to me and I hope you can answer my following question to help me understand how it works: Does it matter in which direction i travel in the relativity theory? W...
<blockquote> If this is actually true, then my previous assumption is wrong and it does matter if A moves away from B or the other way round, </blockquote> In the context of the Twin "Paradox", it doesn't matter. It isn't the direction that makes the difference, it is the path through spacetime. The key to under...
With respect, OP, I think you've missed the point of Alfred Centauri's answer. As has been referenced in our other question, there is an unambiguous notion of acceleration in special relativity, which all inertial observers will agree upon. In the twin paradox problem, it is <em>taken for granted</em> that the Earth ...
https://physics.stackexchange.com
56,066
[ "https://electronics.stackexchange.com/questions/56066", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/18110/" ]
Even though the electronic device is powered off, isn't there a risk of doing a continuity test on connections in the middle of the circuitry ? I mean, you do apply voltage doing so - couldn't that harm the components? Or is the voltage too low?
Continuity testing of an in-circuit component is not a reliable procedure, independent of signal injection and its associated risks. The component leads may be interconnected via other circuit elements, thus giving a false continuity result, where the component itself is actually not a conductive route. Regarding th...
Damages thru Electrostatic Charge is different, DMM can not cause damage on component under test, Specially continuity. I am in this industry for last 25 year , never come across such case.
https://electronics.stackexchange.com
549,517
[ "https://physics.stackexchange.com/questions/549517", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/257313/" ]
I read that a tensor <span class="math-container">$U_{\mu\nu}$</span> is symmetric if <span class="math-container">$U_{\mu\nu} = U_{\nu\mu}$</span>, and that if a tensor is symmetric in one inertial frame, it is symmetric in all inertial frames. How can this be proven?
Consider the tensor <span class="math-container">$$V_{\mu\nu} = U_{\mu\nu} - U_{\nu \mu}.$$</span> If <span class="math-container">$V_{\mu\nu}$</span> vanishes, then <span class="math-container">$U_{\mu\nu}$</span> is symmetric, and vice versa. If <span class="math-container">$U_{\mu\nu}$</span> is symmetric in one f...
You can explicitly compute <span class="math-container">$$T'_{\alpha\beta}\pm T'_{\beta\alpha}=\frac{\partial x^\mu}{\partial x'^\alpha}\frac{\partial x^\nu}{\partial x'^\beta}T_{\mu\nu}\pm \frac{\partial x^\mu}{\partial x'^\beta}\frac{\partial x^\nu}{\partial x'^\alpha}T_{\mu\nu}$$</span> Or, renaming the dummy indi...
https://physics.stackexchange.com
576,698
[ "https://physics.stackexchange.com/questions/576698", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/272285/" ]
A rotating frame rotating at <em>constant</em> angular velocity with reference to a stationary one is considered non-inertial. This makes sense if one considers that the velocity vector of any point in the rotating frame is changing direction with respect to the stationary one, and is hence accelerating. However, if on...
<blockquote> A rotating frame rotating at constant angular velocity with reference to a stationary one is considered non-inertial </blockquote> It is not true, it depends on the nature of what you named &quot;stationary&quot; reference frame. If it is inertial, then the &quot;rotating&quot; frame is not inertial. If t...
It is a matter of logic and the definition of the term &quot;inertial&quot;. Suppose we define the term &quot;elephant&quot; to mean a member of a certain species of animal, a large mammal with a trunk and large ears. Someone may then point out that there are common features with a member of some other species such as ...
https://physics.stackexchange.com
226,679
[ "https://electronics.stackexchange.com/questions/226679", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/43263/" ]
I need to amplify a 5 to 50 mV signal to 0.3 to 2 Volts over 20hz to 40k. Or at least that's the range I'm concerned with. What about an op-amp spec tells me if it can do this? Can you please provide an example of a suitable and unsuitable spec sheet What are the equations used to calculate my needed gain?
For voltage op amps (the usual kind) you need to do 3 things. First, find the maximum gain you need. Second, multiply this times the greatest frequency you need, and then multiply this by at least 10. This is called the gain-bandwidth product. Finally, multiply peak voltage times the highest frequency times 2 pi. This ...
the gain required is about 2000/50= 40. try using an op amp such as LF353 with gain bandwidth product of more than 40*40khz= 1.6 MHz. LF 353 has a gain bandwidth product of 4 MHz.
https://electronics.stackexchange.com
231,881
[ "https://electronics.stackexchange.com/questions/231881", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/57571/" ]
I currently have an application that uses a DB25 switch to switch signals between two devices (it's not actually a parallel port - there are analog and digital signals as well as DC power on the DB25). The manual switch box uses a big rotary switch and I would like to miniaturize this on a PCB. However, short of using ...
<blockquote> Does the stamped “8 ohm” refer to the total impedance at some standard sine wave frequency, e.g., 1 kHz? </blockquote> Only approximately. It's a "nominal" value, but the actual value can vary over a rather large range. <blockquote> If so, does that mean that when driven at 1 kHz that the total imped...
Just using this as an opportunity to reflect on why those impedances might be "nominal". The speaker is an electro-mechanical-acoustical device and as such all those characteristics are seen across the two terminals on the back of the speaker. Electrically there is the obvious resistance of the coils, the magnetic ma...
https://electronics.stackexchange.com
5,283
[ "https://physics.stackexchange.com/questions/5283", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/955/" ]
It has been said that our universe is going to eventually become a de Sitter universe. Expansion will accelerate until their relative speed become higher than the speed of light. So i want to understand what happens after this point: so from our point of view, we see a progressively shrinking event horizon (each gala...
We are <em>already</em> living in a nearly empty de Sitter space - the cosmological constant already represents 73% of the energy density in the Universe - and the Universe won't experience any qualitative change in the future: the percentage will just approach 100%. However, once the space may be approximated as an e...
The Hawking radiation of a deSitter space is given, as always, from the near-horizon metric, consistently redshifted to fill all space. Normalizing the cosmological constant appropriately: $$ ds^2 = - (1- {\Lambda\over 3} r^2) dt^2 + {dr^2 \over (1 - {\Lambda\over 3} r^2)} + r^2 d\Omega^2 $$ If you flip the sign of $...
https://physics.stackexchange.com
329,056
[ "https://electronics.stackexchange.com/questions/329056", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/161121/" ]
I am new to PCB design. I am creating a 4 layer PCB with the following layer stack: <blockquote> Signal (1) - GND (2) - Vcc (3) - Signal (4) </blockquote> Now, I'll need Vcc and GND on both the signal planes. This means I'll need blind vias from 1-2, 1-3, 2-4, 3-4 but the PCB manufacturer I chose said that they can...
The IRF820 is poorly suited for this application- choose a logic-level MOSFET with a low Rds(on). Your output current will depend on the value of Rds(on) + R1 so if you stay with this circuit you would probably want Rds(on) to be extremely low compared to 10 ohms. Since the IRF820 may not turn on fully it may get hot...
1) The power amp is prone to high frequency oscillations which can be improved with the 4.7 ohm 0.1 uF snubber load as they show on most audio power amps including this. (which you neglected) 2) The MOSFET is a miss-fit for this application. It is rated for low current and 3 Ohms RdsOn at Vgs=10 but if you only supply...
https://electronics.stackexchange.com
54,239
[ "https://cs.stackexchange.com/questions/54239", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/47674/" ]
During an interview I was asked to calculate the big theta complexity for the following algorithm that receives 3 sorted arrays of variable size and returns a new array which has the elements of the original 3 arrays. The algorithm is pretty basic: we set indexes at the beginning of each array and use such indexes for...
Assuming that you're using some random-access model of computation (i.e., not an ordinary Turing machine) and that comparisons can be done in constant time, the algorithm you describe is linear. Each element of the final array is produced by comparing at most three elements of the original arrays, so each element of th...
What you are describing is merging $K$ sorted arrays, each array of length $N$. In this case, from the algorithm you describe you are making $K$ comparisons and there is a total of $N \cdot K$ elements, your complexity is $O(N \cdot K^2)$. If $K=N$ then it is $O(N^3)$.
https://cs.stackexchange.com
106,162
[ "https://mathoverflow.net/questions/106162", "https://mathoverflow.net", "https://mathoverflow.net/users/26147/" ]
<h2>Context</h2> According to the FAQ, questions of the form "the sorts of questions you come across when you're writing or reading articles or graduate level books" are acceptable. This falls into the "reading graduate level books." <h2>Problem Statement</h2> Let $N$ be the natural numbers. $B \subseteq N$ is a ba...
If $B$ is a basis of order $k$ such that every integer $n$ can be written as a sum of $k$ elements from $B$ in $\asymp n^{o(1)}$ ways, then a simple counting argument yields $|B \cap [1 , X]| \asymp X^{\frac{1}{k}+o(1)}$. Thus a stronger estimate $|B \cap [1 , X]| \asymp (X \log X)^{\frac{1}{k}}$ in your problem is cer...
To elaborate on the above comment, the problem with order $k$ bases is precisely that Chernoff's inequality does not work. The joint independence assumption for Chernoff's inequality is essential; as seen by the following example taken from Tao and Vus' Additive Combinatorics: Color the elements of $[1, N]$ either bla...
https://mathoverflow.net
390,975
[ "https://softwareengineering.stackexchange.com/questions/390975", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/304203/" ]
Let <code>F(x)</code> be a function that calls <code>G(x)</code>, in which <code>x</code> must be greater than 0. If <code>G</code> already does <code>assert(x &gt; 0)</code>, should <code>F</code> do it as well?
If <code>F</code> and <code>G</code> are functions of a class, then you can put validations on public method which can be called from outside. If <code>G</code> is a function which performs its business standalone and <code>F</code> doesn't care whether x > 0 or x &lt;= 0, then you can put this assertion on <code>G</c...
Probably. The details depend on your programming language and performance constraints, but in general the caller may not know that G exists, so it's better to receive the error from F, and as soon as possible. If this is Java, however, you shouldn't check a pre-condition with an assert (which is disabled by default), ...
https://softwareengineering.stackexchange.com
354,781
[ "https://physics.stackexchange.com/questions/354781", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/77147/" ]
Imagine that I'm exactly in the middle of two identical masses. So that each of them exerts an identical acceleration on me and in the exact opposite direction. My question is Will these opposite accelerations cancel, or will they split me in half?
They will cancel in the middle of you, but one will be a bit stronger than the other on your left and vice versa. So your arms may get stretched. This is exactly the force that creates the sea tide due to the moon gravity. If the objects are normal planets, you wouldn't feel the tide forces, but if you get to be betwe...
It sounds like you're referring to being in between two planet-sized masses. If that were the case and they weren't catastrophically close to each other, I think it's safe to say you would just float in limbo right in the middle as long as you never moved from the exact center. If you're talking about something as mas...
https://physics.stackexchange.com
329,983
[ "https://electronics.stackexchange.com/questions/329983", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/163338/" ]
I only know the code in which accumulator contents are affected. It is not a duplicate as I have asked for a solution which doesn't affect accumulator.
You can reset the all the flags by executing instructions which affect them appropriately. Here's a method that only uses one register and no stack (this example uses B):- <pre><code> MVI B,0 ; B = 0 INR B ; B = 1 (resets Sign, Zero, Parity and Auxiliary Carry flags) STC ; set Carry flag CMC ; comple...
You could leverage the <code>POP PSW</code> instruction. <ol> <li>Move the current contents of the accumulator into the corresponding part of a register pair, for example A -> C</li> <li>Zero the other half of that register pair</li> <li>Push that register pair onto the stack</li> <li>Pop the accumulator and PSW off t...
https://electronics.stackexchange.com
53,451
[ "https://electronics.stackexchange.com/questions/53451", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8984/" ]
hi I didn't studies all the circuit configurations and also I'm a newbie to EE. My question is I need to design something like a voltage holder. The idea is two emitter followers. One is NPN one and other is PNP one and it will balance the threshold voltage across junctions. Circuit diagram looks like this. <img sr...
What you're talking about is called sample-and-hold. To do this, you need a storage element - a circuit without one like yours will rapidly drift. The most common way to do this is to use an Op-amp: <img src="https://i.stack.imgur.com/nWrO5.png" alt="enter image description here"> The two triangles represent op-amps ...
<ol> <li>As Nick said, a <i>sample and hold</i> circuit inherently needs some kind of storage or memory. You have none. For starters, put a large cap to ground on the base of Q1. That will hold the voltage for some time for some level of close enough. You said nothing about how long the desired voltage needs to be...
https://electronics.stackexchange.com
87,027
[ "https://dba.stackexchange.com/questions/87027", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/47675/" ]
I have a shard, using mongo v2.4.11. It has to mongos, 3 config, and 8 replica set (2 replica for each set, means 16 node for shard) It is keep having exception as per below. Caused by: com.mongodb.MongoException: can't connect to new replica set master [shardA01:27017], err: couldn't connect to server shardA01:27017...
the problem seems to be the version of mongodb. Somehow for mongodb &lt; 2.6 socket problem will intermittently occurs. When it occurs, you have to restart your mongos node.
Unfortunately this appears to be, per your description, a network issue. I believe it to be so whereas you imply the error goes away and the replica set effectively believes it does have a master. As requested, some things to investigate would be to check the mongo logs for connectivity errors. I have experienced, in ...
https://dba.stackexchange.com
24,771
[ "https://dba.stackexchange.com/questions/24771", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/9171/" ]
I'm using SQL Server (2008 R2 in this case) and I am backing up my databases into backup devices (one per database). Every Sunday the device is overwritten with a new full backup, every night a differential backup is added and every hour a transaction log backup is added to the backup device. When restoring this onto ...
I ended up writing my own solution, I have just started testing it, but it looks good. All I need is the backup device file and I can go: <pre><code>EXEC [dbo].[dba_RestoreFromBackupDevice] @DBName = 'test', @File = 'C:\test.bak', @WhatIf = 1 </code></pre> It will create the database, then read the content of the bac...
This procedure should do what you want: <pre><code> create procedure dbo.dbrestore @dbname nvarchar(50) as declare @fileno integer declare @dumpdevice nvarchar(50) declare @mediasetid integer declare @position integer select top(1) @dumpdevice=a.logical_device_name, @mediasetid=b.media_set_id, @position=b.position fr...
https://dba.stackexchange.com
10,729
[ "https://security.stackexchange.com/questions/10729", "https://security.stackexchange.com", "https://security.stackexchange.com/users/6004/" ]
It is widespread knowledge, and therefore a common practice, to close open ports on any machines connected to the internet. If for example, a typical program uses port xyz as it's communication channel, and there is a vulnerability in that program, which could be exploited through that port, why won't the same attack ...
Services listen to ports. Web servers (a service) listen to port 80, but that's just a standard, not a hard rule. You could configure any service to listen on any port. It's not about 'special packets' it's about 'dialing the right port number' to get the service you want. If your pseudo program has a vulnerability, t...
"Blocking ports" is just an approximate way of stating what we really want to do, which is blocking access to some <em>services</em>. A freshly-installed operating system often has a number of things running automatically, some of which being services which have a network part. Any network-exploitable vulnerability in...
https://security.stackexchange.com
150,743
[ "https://physics.stackexchange.com/questions/150743", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/47282/" ]
We know that we can obtain stress from strain energy density and deformation gradient, for example: $$\mathbf P=\frac{\partial W}{\partial \mathbf F}$$ However, is there a way to calculate $W$ from $\mathbf F$ and $\mathbf P$? (Of course, we could also use other stress/deformation measures such as Cauchy stress, 2nd ...
If you write your equation in component form, you get \begin{equation} P_{ij} = \frac{\partial W}{\partial F_{ij}}, \end{equation} which is equivalent to \begin{equation} W = \int P_{ij}dF_{ij} = \int \tilde{P} \colon d\tilde{F}, \end{equation} where $\tilde{P}$ and $\tilde{F}$ are the stress and strain tensors in Gibb...
As $W$ is a potential for the stresses in $F_{ij}$, a Legendre-Fenchel-transformation to change the independent variable from strain to stress gives you the dual potential $W^*(P_{ij})$, where $ P_{ij}$ are the first Piola Kirchhoff stresses. It is given by $$ W^\ast(\mathbf{P})=\sup[{\mathbf{P}\cdot\mathbf{F}-W(\mat...
https://physics.stackexchange.com
3,308,374
[ "https://math.stackexchange.com/questions/3308374", "https://math.stackexchange.com", "https://math.stackexchange.com/users/678074/" ]
<blockquote> Suppose <span class="math-container">$\{A_{i} | i \in I\}$</span> is an indexed family of sets. Prove that <span class="math-container">$\bigcup_{i\in I} \mathscr P(A_{i}) \subseteq \mathscr P (\bigcup_{i \in I}A_{i})$</span> </blockquote> My attempt: Let's denote <span class="math-container">$\{A_{...
Yes, that is correct. You could also prove on forehand that: <span class="math-container">$$A\subseteq B\implies\wp(A)\subseteq\wp(B)$$</span> Then based on <span class="math-container">$A_j\subseteq\bigcup_{i\in I}A_i$</span> for every <span class="math-container">$j\in I$</span> it can be concluded that <span class...
This seems correct. In general, <blockquote> <strong>Proposition.</strong> If <span class="math-container">$(A_i)_{i \in I}$</span> is a family of sets such that <span class="math-container">$A_i \subset B$</span> for all <span class="math-container">$i$</span>, then <span class="math-container">$\bigcup_i A_i \subs...
https://math.stackexchange.com
423,382
[ "https://physics.stackexchange.com/questions/423382", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/204296/" ]
Electromagnetism;Ampere's Law Application for finding magnetic field strength(B) inside a current carrying solenoid Question is that why we multiply the current in one loop to the number of turns(enclosed in amperian rectangular loop) ALTHOUGH the current flowing(charges flowing per unit time) is SAME through all the ...
Firstly, the first scenario works because the reaction force directly cuts through the centre of mass of a ball, and that the wall being a rigid body will not move. On the other hand, frictional force doesn’t do that, and merely acts on the side of the box, at most generating a torque. For instance, if we slide a box...
The real problem is not only in the direction of the friction force, but also in its dissipative nature. It removes kinetic energy from a moving body irreversibly, so when the body stops, it has no energy to move anywhere.
https://physics.stackexchange.com
54,093
[ "https://biology.stackexchange.com/questions/54093", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/27653/" ]
I have thawed Hl-60 cells from liquid nitrogen chamber two times in RPMI 1640 media (containing 10% FBS, L glutamin, penicillin/streptomycin). In the first day the cells remain okay. But when subcultured from the first flask to new flasks (cell solution : media= 1:3) all the flasks became contaminated on the 2nd day of...
The single most likely reason for the contamination is that your frozen stock is contaminated. Assuming you've been properly trained in cell culture, you're working in a correctly-maintained biosafety cabinet, your reagents are all sterile (has your media been sterile-filtered after adding FBS, etc.?), and the incubato...
Avoid passing your hands through the openings of the flasks/tubes since skin originated bacteria are the major source of contamination. It's safe to briefly burn the caps and the opening of the tubes before opening or capping. If you maintained good aseptic techniques through thawing and subcultures, it's possible that...
https://biology.stackexchange.com
102,059
[ "https://electronics.stackexchange.com/questions/102059", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/37138/" ]
I am trying to understand the relationship between these. I have 24AWG 300V copper PVC insulated wire. From what I have learned, this wire can be used to connect a Panel LED that draws &lt;20 mA @ 110V to a 110V main power terminal strip. I have read that voltage drop would be a problem with increasing lengths of wire...
Voltage drop is one consideration, there are others. Think about the potential fault current and fusing for that circuit. You want the wire to be sufficiently large gauge to be able to blow the fuse or trip the breaker without causing a hazardous situation (such as the wire going incandescent). In many cases that m...
According to my copper wire table, #24 wire has close to 26 ohms per thousand feet. So about a millivolt drop is about right. Sometimes wire larger than necessary is used because it is less fragile than the smaller wire that meets the electrical requirements.
https://electronics.stackexchange.com
125,522
[ "https://chemistry.stackexchange.com/questions/125522", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/87241/" ]
I've got the following question in a workbook which I need to solve: <blockquote> A <span class="math-container">$\pu{50 g}$</span> sample of an experimental catalyst used in the polymerisation of butadiene is made up of <span class="math-container">$\pu{11.65 g}$</span> of <span class="math-container">$\ce{Co}$</sp...
Despite the absurd lack of data, this problem attracted my attention, probably because it closer resembles a real-life challenge rather than a textbook problem. It looks like it's an adaptation of the problem from <em>Schaum’s Outline of Theory and Problems of College Chemistry</em> [1, p. 39]: <blockquote> <strong>3.3...
It is no use to calculate the mass ratio of the atoms in the catalyst, as Doofilator did. What is important is the number of moles. The trouble is that the data are wrong. As MaxW said it previously, the following data is wrong : "11.65 g of Co and 25.7 g of Co". Cobalt cannot be mixed with Cobalt. And worse ! There is...
https://chemistry.stackexchange.com
228,283
[ "https://mathoverflow.net/questions/228283", "https://mathoverflow.net", "https://mathoverflow.net/users/19593/" ]
Could someone give a reference or construct an example of closed subspace of $Y\subset L_1[0,1]$ such that $\operatorname{dist}(x,Y)$ is not attained of for any $x\notin Y$. I read somewhere that $Y$ is necessarily of infinite dimension and codimension.
The $Y$ in Mikhail's answer has codimension one. Obviously $Y$ cannot be reflexive, but $Y$ can be of any non zero finite codimension or of infinite codimension. (Let $Z$ be any separable Banach space and let $Q$ be an operator from $L_1$ to $Z$ that maps the closed unit ball of $L_1$ onto the open unit ball of $Z$. Th...
Consider any functional $f$ which does not attain its norm on $L_1[0,1]$ (such $f$ exists by James's theorem, but in this case one can find it without, as an $L_\infty$-function with essential supremum equal to $1$, which is not attained on a set of non-zero measure) and let $Y$ be the kernel of $f$. Let $x\notin Y$, i...
https://mathoverflow.net
486,038
[ "https://physics.stackexchange.com/questions/486038", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/234594/" ]
Does relativistic mass phenomena only appear while accelerating or even when the object is travelling at constant velocity (say 90% speed of light)?
The formula for relativistic mass is <span class="math-container">$$ M_r = \frac{M_0}{\sqrt{(1 - v^2 / c^2)}}. $$</span> where <span class="math-container">$$ \begin{align} M_r &amp;= \text{relativistic mass}\\ M_0 &amp;= \text{rest mass}\\ v &amp;= \text{velocity}\\ c &amp;= \text{speed of light} \end{align} $$</span...
There is no relativistic mass effect, it came into existence because of inability of an object to gain unlimited speed on applying constant force for unlimited time. If a constant force <span class="math-container">$F$</span> is applied on an object then it causes change in state of motion, momentum. This is good for v...
https://physics.stackexchange.com
3,883,020
[ "https://math.stackexchange.com/questions/3883020", "https://math.stackexchange.com", "https://math.stackexchange.com/users/841684/" ]
To be honest, I have to solve the following exercise, but I don't know what trigonometric formulas should I use (if I should), to get to a form where I can use the Taylor series. <span class="math-container">$$\lim_{x\rightarrow 0} \frac{\sqrt{1+ x\sin(x)} - \sqrt{\cos(2x)}}{ \tan^2(x/2)}$$</span> I have tried to conve...
As noticed we don't need Taylor's series in this case but if we want to proceed by this way we have that <ul> <li><span class="math-container">$x\sin x=x^2+O(x^3) \implies \sqrt{1+ x\sin(x)}=1+\frac12 x^2+O(x^3)$</span></li> <li><span class="math-container">$\cos(2x)=1-2x^2 +O(x^3) \implies \sqrt{\cos(2x)}=1-x^2+O(x^3)...
<span class="math-container">$$L=\lim_{x\rightarrow 0} \frac{{\sqrt{1+ x\sin(x)}} - \sqrt{\cos(2x)}}{\tan^2(x/2)}$$</span> <span class="math-container">$$L=\lim_{x\rightarrow 0} \frac{{1+ x\sin(x)} - \cos(2x)}{\tan^2(x/2)\Bigg({\sqrt{1+ x\sin(x)}} + \sqrt{\cos(2x)}\Bigg)}$$</span> <span class="math-container">$$L=\lim_...
https://math.stackexchange.com
659
[ "https://dba.stackexchange.com/questions/659", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/136/" ]
I have a user getting an ORA-28002 indicating that the password will expire within six days. I ran the following: <pre><code>ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; </code></pre> But when I try to log in as the user, the message is still there. Executing this: <pre><code>select * from dba_profile...
The password has been marked as 'EXPIRED' or marked with an 'EXPIRY_DATE' in dba_users. You will have to change it. You can set it back to the same password. The easy way would be setting the password "by values". This usually bypasses history checking. <pre><code>12:28:33 SQL&gt; select * from dba_users where usernam...
Please find the below three queries and run these queries from system database. <pre><code>// For seeing full user details SELECT profile FROM dba_users WHERE username = 'SYSTEM'; // This query is used to change the password life time to unlimited ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; // This que...
https://dba.stackexchange.com
32,759
[ "https://astronomy.stackexchange.com/questions/32759", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/-1/" ]
We know that our universe is expanding i.e. volume of the universe is getting larger with time with total energy being conserved. My question is whether the energy density is getting smaller with time. If this is true then what is the effect of this phenomenon on all the celestial bodies?
I am no expert and I am sure there will be a more rigorous answer later, but here my 2 cents: It appears to me that the term "energy" and energy conservation becomes a bit more complicated in general relativity and cosmology, taking into account more abstract forms as the energy of the gravitational field or space cur...
The experts say that as fast as the universe expands the increased space fills instantly with countless trillions of virtual particles which arrive from nowhere. Not only does this contravene the 1st Law of Thermodynamics (mass/energy can neither be created nor destroyed),but there is a discrepancy of 40 orders of magn...
https://astronomy.stackexchange.com
73,271
[ "https://dba.stackexchange.com/questions/73271", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/43661/" ]
I am trying to import data from falt files (.CSV) into SQL table. I am able to import them no problem but the data is coming with double quotes. What is the best way of resolving this problem? Regards,
Set the text delimiter in the flat file reader properties to the double quote.
If you have mixed data, where some are double quoted and others are single, another option would be to load the complete data into a column and have a computed column in the same table that is running a function to strip out the unwanted characters from the source column. something like this: create table [xxxx] ( or...
https://dba.stackexchange.com
372,064
[ "https://softwareengineering.stackexchange.com/questions/372064", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/307401/" ]
Currently we have the following branches: <ul> <li>Develop </li> <li>Release 1 </li> <li>Release 2 </li> <li>etc..</li> <li>Master</li> </ul> When we want to cut off new features for a release, we create a new release branch (say release 3). We then only apply bug fixes etc. to the release branch and no more major ch...
<blockquote> Do we really need a master branch? </blockquote> I think this is a structural/naming thing. It seems that upon release your release and master branches are identical. This would imply it's not necessary for releases. It seems your project uses branches slightly differently than the canonical way. Nomin...
It depends WHY you have a master branch. I would run a <code>git diff</code> to see what the differences are between master and the latest release. Understand that, and you can understand what would have to change to get rid of it. For example it may be that the difference between master and release branches is that...
https://softwareengineering.stackexchange.com
351,472
[ "https://softwareengineering.stackexchange.com/questions/351472", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/223143/" ]
I have a bunch of classes inheriting from <code>Violation</code>. These subclasses model violations to different rules: <code>UsedTimeslot</code>, <code>TeamConstraint</code>, etc... I need to check what kind of violation happened in order to respond to it: <pre><code>if team_constraint_violation_ocurred: corresp...
If you really need to check the type of objects, sure, use <code>isinstance</code> - that's what it was invented for. However, if your <em>real</em> requirement is <em>do something different depending on the subtype of an object</em>, then usually it's a better idea to implement this code as a method in each subclass...
What you need is not to know what type of violation is thrown, but rather what action to invoke. There are various ways to do this. @KilianFoth suggested a very reasonable way to do this. However, if you do not want to make ExecuteAction a method of Violation class, you could use a Visitor pattern, which would look li...
https://softwareengineering.stackexchange.com
243,051
[ "https://dba.stackexchange.com/questions/243051", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/183537/" ]
Once you restore the backup, how do you verify that the source and destination are in sync (schema, datatypes, number of records etc)? assuming that the source has not change. Appreciate your insights.
You can use connection pooling on any level, but I believe that it is best done with a connection pool inside the application server code for these reasons: <ul> <li>You don't need an extra process like pgBouncer that you have start and monitor.</li> <li>You don't have any more TCP connections than necessary, thus con...
Connection Pooling serves two particular purposes and both of them are client related. First, pooling helps reduce the overhead of establishing connections. Second, pooling helps conserve the TCP Port pool on the Client. Most providers (e.g. SQLNCLI, ODBC) implement pooling on the client side and implement at least som...
https://dba.stackexchange.com
227,539
[ "https://electronics.stackexchange.com/questions/227539", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/20285/" ]
We needed a noise immune, low cost, multidrop, multi master (realtime and distributed) protocol and there is only CAN bus seems to meet with these requirements. Since there are no can controllers (data link layer hardware) for very low cost MCU's (such as STM32F0) and no easy-to-use API we could find to get started w...
<ol> <li>Many small and cheap microcontroller have CAN built in. Look at some of the PIC 18 with "8" in their part number. You only need to add the physical CAN transceiver, like a MCP2551. <li>If you just want a differential signal, then you can use a number of differential line drivers/receivers. There is nothin...
There are discrete controllers (MCP2515) that require SPI and few other GPIOs.
https://electronics.stackexchange.com
3,987,102
[ "https://math.stackexchange.com/questions/3987102", "https://math.stackexchange.com", "https://math.stackexchange.com/users/727735/" ]
<blockquote> Let <span class="math-container">$ \rho\left(X,Y\right)=\dfrac{\text{Cov}\left(X,Y\right)}{\sqrt{\text{Var}[X]\text{Var[Y]}}}$</span>. Prove that <span class="math-container">$$ |\rho\left(X,Y\right)|=1\iff\exists a,b\in\mathbb{R}:(\mathbb{P}[Y=aX+b]=1). $$</span> </blockquote> I prove the <span class="mat...
In the special case where <span class="math-container">$X$</span> and <span class="math-container">$Y$</span> each have variance <span class="math-container">$1$</span>, the fact that their correlation is <span class="math-container">$1$</span> would imply <span class="math-container">$\operatorname{Cov}(X,Y)=1$</span>...
Hint: We may standardize the variables <span class="math-container">$X,Y$</span> via the substitutions <span class="math-container">$$\hat{X}:=\frac{X-\mathbb{E}[X]}{\sqrt{\text{Var}(X)}},\quad \hat{Y}:=\frac{Y-\mathbb{E}[Y]}{\sqrt{\text{Var}(Y)}}.$$</span> What are the mean and variance of these new variables? What is...
https://math.stackexchange.com
502,420
[ "https://electronics.stackexchange.com/questions/502420", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/253773/" ]
I have a diode where forward voltage is 3.5V and forward current is 25 mA. I supply it with 5V so I calculate a value of resistor in the following way: R = (5V - 3.5V)/25mA = 60 Ohm However I see that most times bigger resistors are used, like 220 Ohm or 330 Ohm. Why is it better to use bigger resistors then to stick...
Because your LED has an unusually high forward voltage. It is a blue or white LED, while a "normal" LED is red or green. A red or green LED has a forward voltage of roughly 2 volts and a standard forward current of about 10 mA. Another reason is that you simply don't want to run the LED at the maximum brightness. Mayb...
Several reasons. <ol> <li>In most cases you don't actually need the maximum power of the LED.</li> <li>The LED may be able to take 25mA, but LEDs are often driven directly off logic outputs which can't supply that kind of current.</li> <li>Your LED has a high forward voltage, probablly because it's a blue or white LED....
https://electronics.stackexchange.com
287,959
[ "https://softwareengineering.stackexchange.com/questions/287959", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/184985/" ]
I have quite a few Helper classes in my project. I have read that this is a bad thing, but I suspect that "Helper" is the wrong suffix for them. I'll give an example. First, I have a <code>User</code> class. I need a method <code>GetSuggestedFriends()</code> for a user. I want to keep the logic for determining the lis...
<blockquote> How to avoid …Helper or …Manager classes« </blockquote> In general: by <em>good Design</em> <blockquote> First, I have a User class. I need a method GetSuggestedFriends() for a user. </blockquote> Yes. A <code>user</code> <em>has a relationship</em> to other <code>users</code>. And the relationship ...
I would suggest that you have a <code>FriendshipService</code> class that has a (non-static) <code>GetSuggestedFriends(User)</code> method. Avoid static methods since you cannot implement an interface which makes it more difficult to test. Avoid adding the user object to the constructor since you might want to extend y...
https://softwareengineering.stackexchange.com
3,471,666
[ "https://math.stackexchange.com/questions/3471666", "https://math.stackexchange.com", "https://math.stackexchange.com/users/484346/" ]
I'm working on a physics problem and I got to the integral: <span class="math-container">$$\int_0^\infty (a+b+x^2)^{-\frac{3}2} dx = \frac{1}{(a+b)}$$</span> I am just trying to understand how this is achieved. Because the indefinite integral yields <span class="math-container">$$x*(a+b)^{-1}*(a+b+x^2)^{-\frac{1}2}$...
Let <span class="math-container">$t = \frac x{\sqrt{a+b}}$</span> to reexpress the integral as, <span class="math-container">$$I=\int_0^\infty (a+b+x^2)^{-\frac{3}2} dx = \frac{1}{a+b} \int_0^\infty \frac{dt}{(1+t^2)^{3/2}}$$</span> Then, let <span class="math-container">$t=\sinh u$</span> <span class="math-containe...
The indefinite integral of <span class="math-container">$(C+x^2)^{-\frac{3}{2}}$</span> actually equals <span class="math-container">$\frac{x}{C\sqrt{C+x^2}}$</span>. If we set <span class="math-container">$C=a+b$</span>, the answer will coincide with yours. I guess that in your approach you missed <span class="math-c...
https://math.stackexchange.com
228,235
[ "https://dba.stackexchange.com/questions/228235", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/171103/" ]
I'm trying to match a string pattern to any string in an array: <pre><code>SELECT 'abc' LIKE ANY('{"abc","def"}') -- TRUE -- BUT SELECT 'ab%' LIKE ANY('{"abc","def"}') -- FALSE, I expect TRUE </code></pre> What is wrong with the second query?
% could be used in LIKE part, but not in string <pre><code>SELECT 'abc' LIKE ANY('{"ab%","def"}') </code></pre> would be correct form for your 2nd example
It would be nice if PostgreSQL allowed ANY on the left hand operand, but sadly it doesn't. So you need the commutator of LIKE. PostgreSQL doesn't come with one, but you can create your own. You need a function that reverses the order of arguments to LIKE, and then use that to create an operator that can be used in c...
https://dba.stackexchange.com
201,442
[ "https://softwareengineering.stackexchange.com/questions/201442", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/75595/" ]
I have this GPL project, it got stuck for like a year, I really like the idea, then somebody fork it and changed the whole thing but used the same name, I don't mind for the code (it was GPL after all) but I like the name. What's the etiquette for this kind of situation? The project will benefit myself, and I like it...
The most effective way of protecting the name of your project is to register it as a trademark (and make clear in all documentation that the project name <em>is</em> a registered trademark), because then people are required to get your permission before re-using the name. If you license your project under GPLv3, then ...
This is exactly the reason why many large open source projects register their project name as a trademark. This still allows anyone to use their code for an own project, but not under the same name. The Mozilla foundation, for example, has a trademark on "Firefox". That's why Debian ships with a browser called "Icewea...
https://softwareengineering.stackexchange.com
146,614
[ "https://security.stackexchange.com/questions/146614", "https://security.stackexchange.com", "https://security.stackexchange.com/users/134612/" ]
Let's say I have two databases on the same server (e.g. AWS RDS), <code>DB1</code> and <code>DB2</code>. There are two users with some restrictions, and each user is assigned to a different database. <code>US1</code> have access to <code>DB1</code>, and <code>US2</code> have access to <code>DB2</code>. The users and t...
If you set the permissions correctly, yes, you can be sure. To grant user <code>US1</code> select, insert, delete permissions to database <code>DB1</code> use this query: <code>GRANT SELECT, INSERT, DELETE ON DB1.* TO 'US1'@'host';</code> or for all privileges <code>GRANT ALL ON DB1.* TO 'US1'@'host';</code> This ...
If you access the <code>DB2</code> server that stores encryption keys, bruteforcing becomes easier, but it does not mean instant access to the other database. In the other case, accessing ciphertext should not be a problem if the encryption algorithm is strong enough.
https://security.stackexchange.com
166,852
[ "https://softwareengineering.stackexchange.com/questions/166852", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/57968/" ]
I have a client who wants a tool for him to be able to upload his products, enter orders, and keep track of customer details. There are quite a few highly customised requests, which is why he wants the tool custum made. He does not care much about the interface design - it just has to be usable and provide access to ...
Design a web application, and deploy it on his desktop by running apache and mysql locally. It's actually a feature that this "local" web application will be accessible to his LAN too.
I say C#. It's a perfectly good programming language, has a nice and easy RAD interface for form design, and is gonna be WAY more responsive then even a locally hosted web application. You also get the benefit for learning C#, which isn't gonna hurt you.
https://softwareengineering.stackexchange.com
444,812
[ "https://electronics.stackexchange.com/questions/444812", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/224934/" ]
I have ILI9486 based tft display to initiate via 16bit FSMC. I did gpio, fsmc, and lcd initialization. <pre><code> // Interface Mode Control LCD_WRITE_CMD(0xb0); LCD_WRITE_DATA(0x00); // Interface Pixel Format, 16 bits / pixel LCD_WRITE_CMD(0x3A); LCD_WRITE_DATA(0x55); // PGAMCTRL(Positive G...
The problem was found in memory addressing. Correct memory addresses are: <pre><code>CMD: 0x60000000 DATA: 0x60020000 </code></pre>
I'm trying to get my 3.5" lcd working. I've used your code as a starting point and I get a static snowstorm background. One error I spotted is that the below should be commands, not data <pre><code>// # Sleep OUT LCD_WRITE_DATA(0x11); DELAY(500); // ms // Display ON LCD_WRITE_DATA(0x29); </code></pre>
https://electronics.stackexchange.com
352,534
[ "https://softwareengineering.stackexchange.com/questions/352534", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/277611/" ]
I have a web application (ASP.NET Core / C#) with 3 layers (web/presentation, business logic and data access). I'm using Entity Framework to retrieve a record from an SQL Server database which is subsequently mapped to my model object. One of the retrieved columns contains an XML string where I need to extract some va...
Definitely Data Access Layer.<br> The reason why, have nothing to do with how often structure of xml will change. The fact that one of the columns contains data serialized as xml is implementation details of data access layer.<br> Business layer doesn't need to care about how data is saved to the database. Your bu...
You ask: <blockquote> but would you place the parsing from the XML string in the data access layer too (since it's a matter of extracting data) or would you rather place it into the business logic layer (since the data access layer should only deal with the database)? </blockquote> Now ask yourself an other q...
https://softwareengineering.stackexchange.com
368,379
[ "https://physics.stackexchange.com/questions/368379", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/174239/" ]
<blockquote> If one of the forces acting on a particle is conservative, will its work equals the change in Kinetic Energy? True or False </blockquote> Well, according to the formula $\text{W} = \Delta\text{K.E}$ the statement must be true. Any force acting on the particle which produces a change in its kinetic energ...
There's a surprising lack of clarity from the answers here. According to the work-energy theorem, the total work done on an object is equal to its change in kinetic energy. Additionally, if one of the forces acting on the object is conservative, then the work done by that force is equal to minus the change in the a...
Concervative force means the work done against it is independand of path. For example gravitational force is concervative ,and you can put a body on the ground to a height h through many paths. But the net gain in energy is mgh. Here kinetic energy is not ever mentioned. so concervative force is not to be sticked with ...
https://physics.stackexchange.com
269,880
[ "https://mathoverflow.net/questions/269880", "https://mathoverflow.net", "https://mathoverflow.net/users/38145/" ]
Let $G$ be a connected, reductive group over a field $k$. Let $\Gamma = \textrm{Gal}(k_s/k)$. I think my question is better suited using the classical language: think of $G$ as an affine $\overline{k}$-variety with $k$-structure. This gives a continuous action of $\Gamma$ on $G$. A <em>$1$-cocyle</em> is a continuou...
Nothing is "better-suited to using the classical language"; if you cannot express things clearly via schemes then think harder about it until you can. Also, any connected reductive group over a field has a <em>unique</em> quasi-split inner form. (See Proposition 7.2.12 in the article <em>Reductive Group Schemes</em> in...
The privileged element in <span class="math-container">$H^1(k, \mathrm{Aut}(G, B, T, (u_\alpha: \alpha \in \Delta) )$</span> corresponds to the rational form of <span class="math-container">$G$</span> which possess a Borel subgroup <span class="math-container">$B$</span> defined over <span class="math-container">$k$</s...
https://mathoverflow.net
19,360
[ "https://electronics.stackexchange.com/questions/19360", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/2050/" ]
I am starting out with programmable logic, and I am mostly using schematic entry. (Hey, I like to see the schematic instead of VHDL/VERILOG :P) I have been using a Xilinx CPLD originally that had 128 macrocells, and the design has a data bus and used tri state buffers extensively. Turns out it did not fit into the CPL...
Usually it is a system trade-off. How many voltage rails are needed, how many discrete ICs are required, how much power, amount of logic. CPLDs, usually, are smaller (less programmable resources), usually require a single voltage rail, do not require an external PROM. As mentioned, usually used for glue logic, in pl...
CPLDs are mostly used for random logic that used to be implemented using individual TTL and CMOS chips. FPGAs tend to be used for complete systems or complex sub-systems. There will obviously be some overlap, and Altera CPLDs are actually small FPGAs with on-chip configuration memory. FPGA I/Os can usually be tri-stat...
https://electronics.stackexchange.com
334,143
[ "https://mathoverflow.net/questions/334143", "https://mathoverflow.net", "https://mathoverflow.net/users/56328/" ]
<h2> Question:</h2> Let's suppose that <span class="math-container">$S \subset \mathbb{R}^n$</span> is convex and symmetric so: <span class="math-container">\begin{equation} x \in S \iff -x \in S \tag{1} \end{equation}</span> Now, if we define the radius of <span class="math-container">$S$</span> as <span class="math-c...
Consider the set <span class="math-container">$$S:= \{ (x,y) \in \mathbb R^2 : x^2+4y^2 \leq 4 \}$$</span> This is convex and symmetric, and <span class="math-container">$R=2$</span>. But <span class="math-container">$V= \{ (2,0), (-2,0) \}$</span> and <span class="math-container">$\mbox{conv}(V)= \{ (x, 0) : -2 \le...
Take any convex, symmetric, bounded set <span class="math-container">$T$</span> in <span class="math-container">$\mathbb{R}^n$</span>. Choose any point <span class="math-container">$p\in \mathbb{R}^n$</span> such that <span class="math-container">$\|p\|&gt;\sup_{x\in T}\|x\|$</span> and let <span class="math-container"...
https://mathoverflow.net
37
[ "https://mathoverflow.net/questions/37", "https://mathoverflow.net", "https://mathoverflow.net/users/28/" ]
What are some examples of morphisms of schemes which are not quasi separated?
Suppose $U\hookrightarrow X$ is a non-quasi-compact open immersion. Then you can glue two copies of $X$ together along $U$ (effectively doubling up the complement of $U$) to get a non-quasi-separated scheme $Y$. By the assumption that $U\hookrightarrow X$ is not quasi-compact, there is some open affine $W$ of $X$ such...
Here is some intuitive propaganda for Anton's answer... We know that a qsep (quasi-separated) scheme (over $\mathbb{Z}$) is precisely one where the intersection U&#8745;V of any two open affines, U=Spec(A) and V=Spec(B), is quasi-compact. Looking at compliments gives a different perspective: that their differences U...
https://mathoverflow.net
2,521
[ "https://mathoverflow.net/questions/2521", "https://mathoverflow.net", "https://mathoverflow.net/users/774/" ]
Consider a random walk on a two-dimensional surface with circular reflecting boundary conditions (say, of radius 'R'). Here, for a fixed-size area, one finds a larger fraction of the probability density (for the position of the walker) near the midpoint of the circle than near its contour. Given this example, my ...
Hmm, you're asking for concentration for heat kernels. Over long periods of time, these kernels are dominated by the low-energy eigenfunctions, so basically one needs to construct domains which have concentrated low-energy eigenfunctions. Generally one expects in fact that heat kernels become smoother and disperse ...
I have no idea about the continuous case, which is presumably subtle, but the discrete case has an easy answer ('not very well'). In particular, if the random walk is simple random walk on a finite collection of vertices in the integer lattice in R^{d} (possibly with many self-loops on the boundary to simulate reflecti...
https://mathoverflow.net
20,332
[ "https://dsp.stackexchange.com/questions/20332", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/13457/" ]
I've recently been studying wavelet analysis with a view to differentiating certain areas of texture images where the texture differs from the background pattern (which is quite random); for example a small ink smudge on a photo of sand or similar. I've seen a lot of applications of Gabor wavelets used to pick out tex...
The concept of reconstruction has nothing to do with the application, rather it has to do with the question: did I get the same signal that is really there. If you cannot recreate the signal back, that means the conversion process is loosing/modifying underlying information, which in most cases you do not want to happe...
You may not need to explicitly reconstruct. But if you did reconstruct a waveform using the samples that you have, and end up with something different from the actual input, your controller is controlling as if that new different reconstructed waveform was really the input. Depending on what your controller is doing,...
https://dsp.stackexchange.com
492,115
[ "https://physics.stackexchange.com/questions/492115", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/237064/" ]
I’ve recently started reading up on electricity and slightly confused about this. I live in Europe and our electricity is 230 volts 50HZ. I understand the two conductor wires being phase/live and neutral and how on our alternating current the electrons move back and forward slightly depending on what the voltage is doi...
This is one of those slightly ambiguous things that people may start arguing about without reaching any definite conclusions, so I may be opening a Pandora’s box here. But for what it’s worth: <strong>no, the Euler-Lagrange equation is not a physical law</strong>. I have never seen it referred to as a physical law (exp...
Yes, Lagrangian equations are physical laws. The Lagrangian formulation is the same mathematically as the Hamiltonian formulation (the kind most people are more familiar with), there's just been a few tricks (the calculus of variations) to shift the work of finding solutions from a zero of change of energy to minimizin...
https://physics.stackexchange.com
300,063
[ "https://mathoverflow.net/questions/300063", "https://mathoverflow.net", "https://mathoverflow.net/users/103866/" ]
For a group $(G,\star)$, an element $x\in G$ is said to be <em>square</em> if there is $y\in G$ such that $x=y\star y$. My question is: For which kinds of group $G$, can we decide whether $x\in G$ is a square or not? As for the multiplicative group $(\mathbb Z/n\mathbb Z)^*$ (where $n$ is a prime or the production o...
For a finite group $G$, there is a long-standing answer to this question using character theory. If $\chi$ is an irreducible complex character of $G$, then its Frobenius-Schur indicator $\nu(\chi)$ is defined by $\nu(\chi) = \frac{1}{|G|} \sum_{g \in G} \chi(g^{2}).$ It is known that $\nu(\chi) \in \{0,1,-1\},$ and tha...
To complete the picture, for an infinite finitely presented group, the answer can be "it is undecidable". That is, there exists a group $G$ given by a finite set of generators $X$ and a finite set of relations $R$ for which there is no algorithm to decide, given an element $g\in G$, if $g$ is a square in $G$. One examp...
https://mathoverflow.net
219,567
[ "https://stats.stackexchange.com/questions/219567", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/120466/" ]
I'm working through some parts of Russel &amp; Norvig's Artificial Intelligence, and this is the cost function they give: Cost(h) = EmpericalLoss(h) + λComplexity(h) How does choosing a value for lambda affect how a hypothesis is selected, if lambda is not present in the hypothesis? Or am I thinking about this in the...
Framed in this way, $\lambda$ isn't a parameter that appears in the hypothesis itself, but a hyperparameter that affects what hypothesis is chosen (i.e. how the other parameters are selected). You wrote a cost function that takes a hypothesis as input and returns the associated cost, which is a scalar value that reflec...
I'm not well versed in that book, but a factor added to a cost function which is proportional to complexity is generally used to prevent model overfitting. Fairly obviously, if you could increase the complexity effectively to infinity, then you could make the loss as small as you like (on your training data), but the ...
https://stats.stackexchange.com
240,378
[ "https://mathoverflow.net/questions/240378", "https://mathoverflow.net", "https://mathoverflow.net/users/91935/" ]
Let $G=G(k, V)$ be the Grassmanian of $k$-dimensional subspaces of the $n$th dimensional vector space $V$, regarded as a smooth algebraic variety over $\mathbb{C}$. Denote with $S$ the tautological (universal) bundle over $G$. On Kapranov's "Coherent sheaves on Grasmann manifold" the following result are stated: $H^0...
These are simple instances of the Bott-Borel-Weil theorem. For a complex semsimple group $G$ and a parabolic subgroup $P$ and a complex irreducible representation $W$ of $P$ consider the homogeneous vector bundle $G\times_P W\to G/P$. In this situation the BBW theorem computes the cohomology of the shaef of local holom...
I don't know a reference either but one can argue as follows: Let $U\subseteq V$ be of dimension $k$ and let $P$ be its stabilizer in $GL(V)$. Then the morphism $\pi:S=GL(V)\times^PU\to V$ is proper and surjective. Moreover one checks that all of its fibers are irreducible. The normality of $V$ implies $\pi_*\mathcal ...
https://mathoverflow.net
524,622
[ "https://math.stackexchange.com/questions/524622", "https://math.stackexchange.com", "https://math.stackexchange.com/users/100567/" ]
How would I evaluate the following limit by hand? $\lim_{x\to 3+} \frac{x-3}{\sqrt{x^2-9}}$ Thanks in advance.
$$\begin{align} \lim_{x\to 3+} \frac{x-3}{\sqrt{x^2-9}} &amp; = \lim_{x \to 3+}\; \frac{\left(\sqrt{x - 3}\;\right)^2}{\sqrt{(x - 3)(x+3)}}\\ \\ &amp; = \lim_{x \to 3+}\;\frac{\left(\sqrt{x-3}\;\right)^2}{(\sqrt{x-3}\;)(\sqrt{x+3}\;)}\\ \\ &amp; = \lim_{x \to 3+}\;\frac{\sqrt{x - 3}}{\sqrt{x+3}}\\ \\ &amp; = \frac 06\...
Hint: $$ \lim_{(x\to 3^+)}{\frac{(x-3)}{\sqrt{(x^2-9)}}} = \lim_{(x\to 3^+)}{\sqrt \frac{(x-3)^2}{(x-3)(x+3)}} $$ $$ \lim_{(x\to 3^+)}{\sqrt\frac{(x-3)}{(x+3)}} = \frac {3-3}{3+3} = \frac{0}{6} = 0 $$
https://math.stackexchange.com
3,090,926
[ "https://math.stackexchange.com/questions/3090926", "https://math.stackexchange.com", "https://math.stackexchange.com/users/536020/" ]
<blockquote> Let <span class="math-container">$f$</span> be a continuous function on <span class="math-container">$X$</span>. Let <span class="math-container">$E$</span> be any dense subset of <span class="math-container">$X$</span>. Show that <span class="math-container">$f(E)$</span> is dense in <span class="math-con...
The first sentence of the solution makes no sense, since it ends with <span class="math-container">$\delta$</span>, but you don't say what <span class="math-container">$\delta$</span> is. Let <span class="math-container">$x\in X$</span> and ket <span class="math-container">$\varepsilon&gt;0$</span>. Since <span class=...
Proofs generally ought to be structured by what they want to show. The definition of "<span class="math-container">$D$</span> is dense in <span class="math-container">$Y$</span>" is <blockquote> For any <span class="math-container">$y\in Y$</span> and any <span class="math-container">$\varepsilon&gt;0$</span>, there...
https://math.stackexchange.com
191,727
[ "https://security.stackexchange.com/questions/191727", "https://security.stackexchange.com", "https://security.stackexchange.com/users/151266/" ]
I'm working on a php application that is handling file upload. I'm trying to inject a path transversal payload in the filename such as <code>/../../../../etc/</code>. The thing is that the vulnerable line of code is using the filename through the <code>$_FILES["name"]</code> array. This built-in php array is doing an ...
The amount of time before expiration that someone decides to renew the certificate has to do with <em>continuity</em> rather than <em>security</em>. In short, <strong>you should leave yourself enough time to rotate, based on "normal" turnaround time and then adding some more time for padding.</strong> The people rota...
Although the answer above is marked as correct, I think the spirit of the question is &quot;what rotation period provides adequate security&quot;. The lack of real answers to security questions on the internet continues unabated.. Although I appreciate the answer above related to avoiding expiration because it prevents...
https://security.stackexchange.com
701,523
[ "https://physics.stackexchange.com/questions/701523", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/331810/" ]
Based on my understanding, frequency is dependent on the number of times that the wave passes through the resting point, and therefore the frequency is the speed of the wave. That makes sense to me. The thing that's tripping me up is that frequency is inversely proportional to wavelength, and the color of, for example,...
Wave speed is <span class="math-container">$f\lambda$</span> <span class="math-container">$c=f\lambda$</span> If the frequency increases, the wavelength decreases Frequency is how frequent a peak travels across a certain point ( or freq of osscilations), if the frequency is increased, with a constant wavelength, then t...
A wave is characterized by its amplitude <span class="math-container">$A$</span>, frequency <span class="math-container">$\nu$</span>, wavelength <span class="math-container">$\lambda$</span>, and speed <span class="math-container">$v$</span>. Stand at a certain point and allow the wave to travel past you. The amplitud...
https://physics.stackexchange.com
667,139
[ "https://physics.stackexchange.com/questions/667139", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/298106/" ]
I have to find electric field at any inside point due to a uniformly charged solid sphere I do it in following steps <span class="math-container">$\to$</span> First I choose a spherical gaussian surface passing through required point concentric with the charged sphere. <span class="math-container">$\to$</span> Next by ...
Your arguments are not in the right order: First, you prove by symmetry, that the field is radial and depends only on the distance to the center O : <span class="math-container">$\vec{E}=E(r)\vec{e_r}$</span>. Note that <span class="math-container">$E(r)$</span> is an algebraic quantity: you don't need to know its sign...
The direction of the field is given by the sign of the charge. It can be either outward or inward .
https://physics.stackexchange.com
771,605
[ "https://math.stackexchange.com/questions/771605", "https://math.stackexchange.com", "https://math.stackexchange.com/users/109299/" ]
Let $f \in \textrm{O}(n, \mathbb R)$. (O is the orthogonal group) Show: i) If $f(W) \subset W$ for a subspace $W \subset \mathbb R^n$, then $f(W^\perp) \subset W^\perp$. ii) If $f(\langle v \rangle ) \subset \langle v \rangle$ for a vector $0 \neq v \in \mathbb R$, then $v$ is an eigenvector of $f$ with value $1$ or ...
(i) Let $x\in W^\perp$ and $y\in W$ then $$\langle {f(x)},f(y)\rangle=\langle x,y\rangle=0$$ and since $f(y)\in W$ hence we conclude that $f(x)\in W^\perp$. (ii) By the hypothesis there's $\lambda$ such that $f(v)=\lambda v$ and then \begin{align}\langle f(v),f(v)\rangle&amp;=\langle \lambda v,\lambda v\rangle=|\lamb...
Note that since $f \in O(n, \Bbb R)$, that is, $f$ is an orthogonal linear map, we have $f^Tf = ff^T = I$, where $I$ is the $n \times n$ identity map. Suppose $\dim W = m$. Then, since $f$, being orthogonal, is nonsingular, we have $\dim f(W) = \dim W = m$ as well; this shows that in fact $f(W) = W$, so that for any ...
https://math.stackexchange.com
26,394
[ "https://quantumcomputing.stackexchange.com/questions/26394", "https://quantumcomputing.stackexchange.com", "https://quantumcomputing.stackexchange.com/users/20481/" ]
Hi I'm a newbie in quantum computing recently I had a look at the AWS braket and I've seen they had a machine called D-Wave - Advantage_system6.1 that has 5760 qubits but when I googled the highest qubits quantum computer so far it showed me IBM's 127-qubit Eagle processor is the most potent Quantum computer so far! Ho...
They are different kinds of quantum computers: The D-Wave is a quantum Annealer. A rather specific (non-general purpose) device that can solve QUBO-type problems. IBM offers universal gate-based quantum computers. They can in principle solve everything the D-Wave can. But with this generality comes the downside of cont...
As the other answers have stated, they're two substantially different systems that are unfortunately both marketed as quantum computers. D-Wave is more specifically a quantum annealer. At a high level, it works by encoding a function you'd like to optimize and the system will tend to the lowest possible energy state, w...
https://quantumcomputing.stackexchange.com
11,905
[ "https://physics.stackexchange.com/questions/11905", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/4208/" ]
I thought the Hamiltonian was always equal to the total energy of a system but have read that this isn't always true. Is there an example of this and does the Hamiltonian have a physical interpretation in such a case?
In an ideal, holonomic and monogenic system (the usual one in classical mechanics), Hamiltonian equals total energy when and only when both the constraint and Lagrangian are time-independent and generalized potential is absent. So the condition for Hamiltonian equaling energy is quite stringent. Dan's example is one i...
Goldstein's Classical Mechanics (2nd Ed.) pg. 349, section 8.2 on cyclic coordinates and conservation theorems' has a good discussion on this. In his words: <pre><code>The identification of H as a constant of the motion and as the total energy are two separate matters. The conditions sufficient for one are not e...
https://physics.stackexchange.com
1,340,770
[ "https://math.stackexchange.com/questions/1340770", "https://math.stackexchange.com", "https://math.stackexchange.com/users/33817/" ]
Let $a &lt; b$ and $0 &lt; \varepsilon &lt; (b - a)$ and let $x, y \in \mathbb R$ be such that $$ | x - a | &lt; \frac{(b - a) - \varepsilon}{2}, \qquad | y - b | &lt; \frac{(b - a) - \varepsilon}{2} $$ then $|x - y| &gt; \varepsilon$. How to prove this?
After two applications of the reverse triangle inequality you get: $$|x - y| = |(x - a) - (y - b) - (b - a)| \geq (b - a) - |x - a| - |y - b|.$$ Using your assumption on $|x - a|$ and $|x - b|$, you get: $$|x - a| + |y - b| &lt; (b - a) - \epsilon.$$ So, $$|x - y| &gt; (b - a) - (b - a) + \epsilon.$$
Your statement (as written at first) is not true. Let $$a=0,b=1,\varepsilon=\frac 14,x=y=\frac 12$$ Then $$0&lt;1$$ $$0&lt;\frac 14&lt;(1-0)$$ $$\left|\frac 12-0\right|&lt;(1-0)-\frac 14$$ $$\left|\frac 12-1\right|&lt;(1-0)-\frac 14$$ But $$\left|\frac 12-\frac 12\right| \not\gt \frac 14$$
https://math.stackexchange.com
12,292
[ "https://dba.stackexchange.com/questions/12292", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/-1/" ]
Consider the following situation: we have T1, T2, &amp; T3 tables in which saved <code>id</code> and <code>price</code> of products. Now we need to find the <code>id</code> of products which have maximum <code>price</code> of all 3 tables. I have this solution: <pre><code>select id from T1 where price in( select ma...
I'm assuming that you mean you want the <code>id</code> of the item which is the most expensive based on the data from all three tables. For each table, you need the <code>id</code> and the price of the item(s) with the maximum price in that table. For one table, that is: <pre><code>SELECT id, price FROM Tn WHERE pr...
<pre><code>create temporary table allthree as select * from t1 union select * from t2 union select * from t3; select id, max(price) from allthree; </code></pre> If you need to get all of the IDs that have the same price in the event of a tie (or you need to be more strict for other reasons), use the following <pre><...
https://dba.stackexchange.com
174,584
[ "https://electronics.stackexchange.com/questions/174584", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/72586/" ]
I wonder if it's a good idea to put LEDs in parallel, as below: <img src="https://i.stack.imgur.com/X4Vdb.jpg" alt="enter image description here"> I've heard that it might not be because the voltage threshold won't be exactly the same for each LED, so they'll shine all with very different brightness and you don't hav...
It's not a good idea. Look how a (generic red) LED conducts current when you apply a voltage to it: - <img src="https://i.stack.imgur.com/q53DQ.png" alt="enter image description here"> At 2 volts, the LED is taking 20 mA. If the LED was manufactured slightly differently it might require 2.1 volts or maybe 1.9 volts t...
Not a good idea. Not only will you have inconsistent brightness (which you may not care about) you will have a cascade failure mode. You've got 8 LEDs in your circuit with one resistor. 8 x 20mA is 160mA. As long as each LED takes roughly the same current we are fine. Now lets say one of them gets a bit warm, and it...
https://electronics.stackexchange.com
13,743
[ "https://electronics.stackexchange.com/questions/13743", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1319/" ]
I would like to play around with this servo motor but I'm not sure what the feedback mechanism on it is or what the interface is. The mechanism has 3 wires leading to it (yellow, orange, brown). It consists of a hard black disc (I think the disc is metal or possibly a ceramic?), a PCB behind it that has a square wave ...
With just three wires, I don't see how it can supply a quadrature output. For that, a supply for the IC, ground, and two wires for the quadrature outputs would be required. It's probably just a tacho.
In fact that is a single channel encoder. Maybe optical or magnetic (hall sensored). 3 wires encoders are always: 5vdc input, gnd input and pulse output.-
https://electronics.stackexchange.com
98,717
[ "https://softwareengineering.stackexchange.com/questions/98717", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/8622/" ]
What methods (in programming/web dev terms) were used to take payments online before such things as Paypal, Google Checkout and various gateways and API's. How were such transactions carried out?
CC Info was downloaded and then Processed locally (securely). Sometimes Manually, Sometimes Batch, via a dial up line (securely). This is often the case today as well.
Actually, not that much differently if you take all the middleware out of context. Payment gateways typically provide a secure, offshore way to store CC data and provide advanced validation, invoicing etc. But besides all that great funk behind the scenes, they're still saving it into a database and handing the infor...
https://softwareengineering.stackexchange.com
634,866
[ "https://physics.stackexchange.com/questions/634866", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/270568/" ]
Einstein's theory of special relativity says that time slows down or speeds up depending on how fast you move relative to something else. Does that mean, that time dilation can occur within the same medium? Example: A person moving for 10x speed of light for a few centuries VS a static person. Do they age differently? ...
These are the key points you should try to understand. Time-dilation is an effect caused by motion- it is nothing to do with media. The magnitude of the effect increases with relative speed. At the sorts of speeds at which we move relative to each other on Earth, the effects are so tiny we never notice them. The effect...
In short, yes. If one of the twins stays on Earth and another twin orbits the planet, they will find themselves younger when they arrive back.
https://physics.stackexchange.com
21,759
[ "https://physics.stackexchange.com/questions/21759", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/7751/" ]
I am testing the material properties of some very low stiffness materials. I'm using a force probe connected to software, sensing at about a hundredth of a gram of force. Now, what's interesting is when my sample rate is 1/sec I get a smooth line, as expected. If I increase the sample rate the line get a more jagged...
From your description of the experiment (please correct me if my assumptions are wrong), it sounds like your apparatus consists of the application of a controlled stress to the sample (and the sensor), and the resulting strain in the sensor is measured. Whenever the stress applied by your apparatus changes, it will tak...
Only thing I can think of is Nyquist 's theorem, sampling must be at least twice of the highest frequency component, maybe you need Aliasing filter or averaging filter?
https://physics.stackexchange.com
650,201
[ "https://electronics.stackexchange.com/questions/650201", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/330655/" ]
Just a quick question: <em>(If you need the photo of the exercise text to understand this question, let me know, I've tried to make it simple without the photo.)</em> I was solving an electric circuit problem just turning off and on independent generators, and that's okay. This is the formula when I turn off V1: <span ...
This is a question of notation. R1||R3 is shorthand notation of 1/((1/R1)+(1/R3)) It is simply just the parallel resistor formula. R1||R3 = 1/((1/R1)+(1/R3))
In general, to answer your title question: R1 || R2 || ... || Rn = 1/(1/R1 + 1/R2 + ... + 1/Rn) In the specific case of only two resistors, R1 || R2 = 1/(1/R1 + 1/R2) = <span class="math-container">\$\frac {1}{(R1 + R2)/(R1\cdot R2)}\$</span> = <span class="math-container">\$\frac {R1\cdot R2}{R1 + R2}\$</span> If th...
https://electronics.stackexchange.com
9,323
[ "https://math.stackexchange.com/questions/9323", "https://math.stackexchange.com", "https://math.stackexchange.com/users/400/" ]
Suppose that $S_1$ and $S_2$ are the vanishing sets of a system of polynomial equations in n variables over a field $\mathbb{k}$ (ideal in $\mathbb{k}[X_1,\dots,X_n]$) and a system of polynomial equations in m variables over a field $\mathbb{k}$ (ideal in $\mathbb{k}[Y_1,\dots,Y_m]$). We can give $S_1$ and $S_2$ the Za...
If I understand your question correctly, then (1) yes, there are going to be lots of Zariski continuous maps that are not polynomial (although, if one asks that all higher products of the map preserve the Zariski topology on the corresponding sources and targets, this is a much stronger restriction, I think --- does an...
The complex conjugation $\bar \cdot : \Bbb C \to \Bbb C$ is a concrete example of a Zariski-continuous function that is not a polynomial function. It is not a polynomial function because if it were, since this property is independent of the underlying topology, $\bar \cdot$ would also be a polynomial function in the t...
https://math.stackexchange.com
49,990
[ "https://quant.stackexchange.com/questions/49990", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/11723/" ]
What is the intuitive reason for the smile in FX? For equities this usually down to crash risk.
The general explanations quoted by @AK88 are the economic reasons why one observes skew in FX option markets (along with most others). The reason FX has symmetric smiles rather than a consistent pattern of one-sided "smirks" is because any FX price is really a ratio. To expand on that, note first that (vanilla optio...
I think Hull does a pretty good job explaining the smile in FX options: <blockquote> In the mid-1980s, a few traders knew about the heavy tails of foreign exchange probability distributions. Everyone else thought that the lognormal assumption of Black–Scholes–Merton was reasonable. The few traders who were wel...
https://quant.stackexchange.com
236,003
[ "https://electronics.stackexchange.com/questions/236003", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/98497/" ]
Let's imagine a wheel spinning clockwise. There's an electric motor on the axle, and we want to spin the wheel counterclockwise. Can we just switch on the motor and it will work? I want it to slow down, stop, then start spinning counterclockwise. In other words, create torque that's initially in the opposite direction...
If this is a brushed DC permanent magnet (PM) motor, then yes it will work, but could work too well. If you switch a high capacity battery in reverse across it, it will draw a huge current which would have the capability to damage the motor, by demagnetisation, the vehicle, and the battery. If you are using a motor co...
sure. but then we call the motor a "generator". i know with DC motors, that if you increase the current of the field, so that at the present speed of the motor the "back e.m.f." (i don't remember the current term for that, it's what we used in my college days) of the DC motor exceeds the applied voltage, then power w...
https://electronics.stackexchange.com
423,967
[ "https://mathoverflow.net/questions/423967", "https://mathoverflow.net", "https://mathoverflow.net/users/131975/" ]
Let <span class="math-container">$X$</span> be an integral scheme with function field <span class="math-container">$K$</span>. If <span class="math-container">$U\subset X$</span> is an open subscheme, we may consider the restriction functor <span class="math-container">$$\textsf{QCoh}(X) \to \textsf{QCoh}(U).$$</span> ...
Let <span class="math-container">$x$</span> be a point in a scheme <span class="math-container">$X$</span>. There are two posets, namely the poset of affine opens containing <span class="math-container">$x$</span>, <span class="math-container">$A(x)$</span>, and the poset of opens containing <span class="math-container...
I don't understand what kind of higher category magic went on in the other answer. For me, the answer should be &quot;no&quot;, as taking direct limits of rings is only compatible in passing to categories of <strong>finitely presented</strong> modules. Note that any vector space over the field of rational functions <sp...
https://mathoverflow.net
54,953
[ "https://dba.stackexchange.com/questions/54953", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/31211/" ]
When we execute <code>SHOW global status;</code> or <code>SHOW variables;</code> we get list of 291 and 278 records in the resultset. For performance perspective, only few of them are much important. I have to fetch these variables many times during performance hit. For example, can we write below multiple statement i...
<pre><code>select * from information_schema.GLOBAL_STATUS where VARIABLE_NAME like 'Threads_cached' or VARIABLE_NAME like 'Threads_connected' or VARIABLE_NAME like 'Threads_created' or VARIABLE_NAME like 'Threads_running' or VARIABLE_NAME like 'Select_scan'; </code></pre>
Remember that in MySQL 8 the global_status table has been moved to the performance_schema, therefore you should query: <pre><code>SELECT * FROM performance_schema.global_status WHERE VARIABLE_NAME like 'Open_files' OR VARIABLE_NAME like 'Uptime'; </code></pre>
https://dba.stackexchange.com
162,991
[ "https://softwareengineering.stackexchange.com/questions/162991", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/63071/" ]
I have to refactor a complex C# app (many dialogs, mixed logic and so on). There is a part managing the communication with special hardware equipments (sending commands and receive data via asynchronous c# callbacks). The code is "spaghetti" with mixed UI/Logic/Communication/etc and my task is to split the layers in ...
Yes, portscans are considered a form of hacking, but a relatively low threat level (and pretty common), so it's unlikely to have any consequences except possibly getting your IP blocked. <blockquote> How else can one find out on which port the desired application is running (without the user input)? </blockquote> A...
It is not a good idea to scan for ports. Port scanning probably will be against network policies. You should make it configurable which port to connect, and use a default if not configured specifically.
https://softwareengineering.stackexchange.com
404,464
[ "https://softwareengineering.stackexchange.com/questions/404464", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/329035/" ]
Under the context of dependency injection - that is, an interface has mostly one implementation - I took the habit of exposing via the Interface a bunch of fields which are never called by the consumer classes. These fields reflect a high-level implementation strategy; I decided to expose them via my interfaces because...
I like that you are thinking about knowledge management, which to me is very important, and I'm not completely against small compromises in architectural elegance if they improve the productivity of your development team. That being said, I believe your readonly fields connote something very different about the class....
Yes remove it. You prevent someone implementing an encryptor without implementing an Algo effectively tightly coupling your classes. You don't need an interface to do unit testing or dependency injection. DI and unit testing require abstraction. Addendum for full code Neither the service factory or the consuming co...
https://softwareengineering.stackexchange.com
369,167
[ "https://softwareengineering.stackexchange.com/questions/369167", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/302620/" ]
There is a kind of rule in dependency injection literature, stating that we should declare all arguments in the constructor, in order to have a constructor injection, which is better than other approaches. At first, there is nothing wrong with that. But I’ve come to realize that this “rule” applies only to the realm...
As @Mark noticed there no such rule that all arguments should be instantiated in the constructor. <blockquote> Given various applications, my estimate is that it has to be way lower than 80% </blockquote> I think it is not right to make design decision based on the percentage values. You can use the way to inje...
<blockquote> There is a kind of rule in dependency injection literature, stating that we should declare all arguments in the constructor </blockquote> Where? In which literature? Given your examples, if <code>_input</code> is, in fact, run-time input, why don't you just write the class like the following? <pre cla...
https://softwareengineering.stackexchange.com
1,929,245
[ "https://math.stackexchange.com/questions/1929245", "https://math.stackexchange.com", "https://math.stackexchange.com/users/309360/" ]
Let $a,b,c -$ triangle side and $a+b+c=1$. Prove the inequality $$\sqrt{a^2+b^2}+\sqrt{c^2+b^2}+\sqrt{a^2+c^2}&lt;1+\frac{\sqrt2}{2}$$ <h3>My work so far:</h3> 1) $a^2+b^2=c^2-2ab\cos \gamma \ge c^2-2ab$ 2) $$\sqrt{a^2+b^2}+\sqrt{c^2+b^2}+\sqrt{a^2+c^2}\le3\sqrt{\frac{2(a^2+b^2+c^2)}3}$$
Let $a=y+z$, $b=x+z$ and $c=x+y$. Hence, $x$, $y$ and $z$ are positives and we need to prove that: $$\sum\limits_{cyc}\sqrt{2x^2+y^2+z^2+2xy+2xz}\leq(2+\sqrt2)(x+y+z)$$ By C-S $$\left(\sum\limits_{cyc}\sqrt{2x^2+y^2+z^2+2xy+2xz}\right)^2\leq\sum\limits_{cyc}\frac{2x^2+y^2+z^2+2xy+2xz}{\sqrt2x+y+z}\sum\limits_{cyc}(\sq...
Just a sketch of a possible proof (a variational, mixing variables approach). Assume that $a\leq b\leq c$ and show that if you replace $a$ with $a-\varepsilon$ and $b$ with $b+\varepsilon$, the convexity of $f(x)=\sqrt{1+x^2}$ grants that the LHS increases (after such substitution, the order of $b$ and $c$ may change. ...
https://math.stackexchange.com
7,655
[ "https://chemistry.stackexchange.com/questions/7655", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/3747/" ]
<blockquote> Which of the following must be true for adiabatic processes? <ul> <li><span class="math-container">$C_V = C_p$</span></li> <li><span class="math-container">$\Delta H = 0$</span></li> <li><span class="math-container">$\Delta U = 0$</span></li> <li><span class="math-container">$\Delta S = 0$</...
The Enthalpy $H$ is defined as $H=U+PV$. Therefore, $$\Delta H=\Delta U + P\Delta V +V\Delta P$$ For an adiabatic process, $q=0$. therefore from the first law of thermodynamics, $$\Delta U = q +w =q-P\Delta V$$ $$\Delta U=w=-P\Delta V$$ Substituting this in the first equation you get, $$\Delta H=V\Delta P$$ If $\D...
If you have an ideal gas in a constant volume adiabatic chamber, with the gas initially occupying only half the chamber, and vacuum in the other half, with a barrier in between, and you remove the barrier and then let the system re-equilibrate (i.e., free expansion), the work done on the system will be zero (rigid cont...
https://chemistry.stackexchange.com
2,129,830
[ "https://math.stackexchange.com/questions/2129830", "https://math.stackexchange.com", "https://math.stackexchange.com/users/160110/" ]
I am wondering if this is generally true for any topology. I think there might be counter examples, but I am having trouble generating them.
The set $(0,1) \cup (1,2)$ is a counterexample.
No. A quick way to verify counterexamples is the following observation: if $U$ is the interior of a closed set $C$, then $U$ is also the interior of $\overline{U}$. Indeed, since $C$ is closed and $U\subseteq C$, $\overline{U}\subseteq C$, so the interior of $\overline{U}$ is contained in the interior of $C$. But $U...
https://math.stackexchange.com
3,380,372
[ "https://math.stackexchange.com/questions/3380372", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Find all the possible four digit numbers <span class="math-container">$\overline{abcd}$</span> such that <span class="math-container">$$\overline{abcd} = a^x+b^x+c^x+d^x$$</span> for a positive integral value of <span class="math-container">$x$</span> <span class="math-container">$(x&gt;0)$</span>. <strong>My Take :<...
4) is false: take <span class="math-container">$f=1$</span>. 3) is false because <span class="math-container">$f=0$</span> satisfies the hypothesis. 2) is false: take <span class="math-container">$f=1$</span>. 1) is true by continuity. Hence 1) is true and others are all false.
An example will not show an option to be correct. For an option to be correct, it must be correct for <em>all</em> possible <span class="math-container">$f$</span>, and you can't possibly check the functions one by one like that. However, an example can show an option to be <em>incorrect</em>. So you haven't shown 1, ...
https://math.stackexchange.com
3,684,126
[ "https://math.stackexchange.com/questions/3684126", "https://math.stackexchange.com", "https://math.stackexchange.com/users/464054/" ]
Let (x,y) be a pair of real number satisfying <span class="math-container">$56x+33y=-\frac{y}{x^2+y^2}$</span> and <span class="math-container">$33x+56y=\frac{x}{x^2+y^2}$</span>. If <span class="math-container">$|x|+|y|=\frac{p}{q}$</span> (where p and q are relatively prime), then find the value (6p – q). I used th...
Both of the existing answers posted here are incorrect, so here I will start with @Aditya Dwivedi's solution and go from there. <br /> Let <span class="math-container">$ z = x - yi $</span> <br /> Then, subtract the first equation times <span class="math-container">$i$</span> from the second equation. <span class="math...
Let <span class="math-container">$z =x +iy \\ \bar{z}=x-iy \\ now \ subtract \ 2 \ equations \ by multiplying \ first \ with \ i $</span> <span class="math-container">$$\bar{z}(33-56i) = \frac{1}{z}$$</span> Now you can proceed
https://math.stackexchange.com
2,260
[ "https://ai.stackexchange.com/questions/2260", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/3448/" ]
In theory, could an AI become sentient, as in learning and becoming self-aware, all from its source code?
In theory, if one could build a computing device that matched or exceeded the cognitive capabilities of a sentient being, it should be possible. (Singlarity adherents believe we will one day be able to transfer the human mind into an artificial computing platform, and it logically follows that one could "hack" such a...
<strong><em>Yes</em></strong>, an AI program can become sentient. Ray Kurzweil while giving a lecture at Singularity University on <strong>The Accelerating Future</strong> stated that human body is basically composed of approximately 23,000 little software programs called <strong>GENES</strong>. If you think about it, ...
https://ai.stackexchange.com
2,769
[ "https://chemistry.stackexchange.com/questions/2769", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/982/" ]
So I understand molecular orbitals and how to do VSEPR models, but I seem to be struggling with understanding localized bonding theory and how to do hybridizations. After drawing the initial lewis structure then molecular orbital, I do not know where to go in terms of whether something has a $\pi$ or $\sigma$ bond.<br...
First of all, 'hybridisation' is a hypothetical concept, i.e. orbitals don't really mix to form new orbitals, but 'hybridisations' are very successful in explaining structures of molecules and their physical properties. So knowing that a compound has $\text{sp}^2$ hybridisation will just help you arrange the constituen...
I'm not very fond of VBT, but I'll try my best: In the 20th Century, Chemist Linus Pauling decided to try and "hybridise" atomic orbitals to explain molecular geometry. We you probably know, the s orbital is spherical and the 3 p orbitals are dumbbell-shaped, meaning that the "unhybridised" orbitals <em>SHOULD</em> fo...
https://chemistry.stackexchange.com
372,906
[ "https://physics.stackexchange.com/questions/372906", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/177761/" ]
I'm a freshmen student, I got this question in my mind why we consider acceleration based on velocity not speed. as far as I know, velocity will be zero if we go and back from A to B although speed won't be zero or negative I understand why acceleration can be negative (when speed decreases ) but through A to B and bac...
<blockquote> it doesn't make sense to me why acceleration can be 0 because particle had acceleration in whole moving path. </blockquote> I suspect that your confusion is rooted in the difference between <em>average</em> acceleration $$\bar{\mathbf{a}} \equiv \frac{\Delta \mathbf{v}}{\Delta t}$$ and <em>instantan...
The acceleration for the whole journey is zero, and here is why. Acceleration is the change in speed over time. You went from 0m/s to 0m/s in the span of some time, so (0-0)/any amount of time will result in 0 acceleration. It might be weird for you since the particle kept changing speed over it's journey, but the ave...
https://physics.stackexchange.com
29,832
[ "https://electronics.stackexchange.com/questions/29832", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8215/" ]
What is "discrete diode" and when it should be used? Google doesn't help to find the answer. What is the difference between discrete diodes and others?
'discrete' just means 'in a package by itself' - as opposed to 'integrated' into a package with other components.
I've always understood it to mean a single diode, such as a 1N4148, as opposed to multiple diodes in the same package (a diode array or bridge), or a diode that is included on an IC.
https://electronics.stackexchange.com
35,183
[ "https://stats.stackexchange.com/questions/35183", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/5339/" ]
Suppose I have a posterior $p(z, \theta | y, \eta)$ with $y$ observed data, $z$ are hidden variables and $\theta$ are parameters, and $\eta$ is a vector of hyperparameters. I construct a mean field approximation to the posterior using coordinate ascent, i.e. $$ q(z) \gets \exp\left\{E_q(\log p(z, \theta | y, \eta) | z...
One way of deciding how to run variational MLE is to look at how the experts do it. In Blei's LDA code (http://www.cs.princeton.edu/~blei/lda-c/lda-c-dist.tgz), within the "run_em" function, the "lda_inference" function (inside "doc_e_step") repeatedly maximizes with respect to each $q$ distribution until convergence....
Generally, in empirical Bayes, you maximise the marginal likelihood (also called model evidence, or the normalising constant of the posterior) with respect to the hyperparameters and plug this estimate of the hyperparameters into the posterior. In Casella (2001) there is a derivation of an EM for empirical Bayes. Case...
https://stats.stackexchange.com