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 |
|---|---|---|---|---|---|
109,298 | [
"https://electronics.stackexchange.com/questions/109298",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/41306/"
] | I know this question might sound obvious, but still I cannot find an answer.
What is the purpose and best-fit applications for field effect transistors?
I mean, we have bipolar junction NPN transistors. It can be used to control a high-current circuit with a low-current signal, for example enabling relay through a mi... | If you wish to avoid holy wars you'll need to avoid making simplistic and incomplete statements :-).
Bipolar transistors are current driven.
MOSFETs are voltage driven.
In both cases the spread of parameters during manufacturing is such that a circuit will almost always rely on feedback to produce a given voltag... | The most obvious answer that springs to mind is when trying to switch a medium load. A BJT collector-emitter will saturate at possibly as low as 200mV whilst switching (say) 10 amps - power dissipation is 2 watt.
A decent MOSFET might have an on resistance of 5 milliohms and the volt drop will be 50mV at 10 amps - pow... | https://electronics.stackexchange.com |
126,856 | [
"https://stats.stackexchange.com/questions/126856",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/253/"
] | I am playing with the following trinomial (multinomial) distribution which can get values (a,b,c) with the probabilities: $(\theta^2, 2\theta(1-\theta), (1-\theta)^2)$.
Say I have n observations from this distribution, then it is easy to show that the MLE for estimating $\theta$ is: $\hat \theta_{MLE} = {2\#a+ \#b \ov... | Edit: I believe this is now correct
Let $X_a$ and $X_b$ be the counts in categories $a$ and $b$. Consider first the case for a single observation ($n=1$):
<ul>
<li>$\text{Var}(X_a) = \theta^2(1-\theta^2)$</li>
<li>$\text{Var}(X_b) = 2\theta(1-\theta)(1-2\theta(1-\theta))$</li>
<li>Since the categories are mutually e... | Thanks to the discussion with Glen, I realized that (assume ${X_a}$ is the number of a's and ${X_b}$ is the count of b's):
$${X_a}|{X_b} \sim B\left( {n - {X_b},{p_L} = \frac{{{\theta ^2}}}{{{\theta ^2} + {{\left( {1 - \theta } \right)}^2}}}} \right)$$
Hence:
$$E\left( {{X_a}|{X_b}} \right) = \left( {n - {X_b}} \rig... | https://stats.stackexchange.com |
45,818 | [
"https://cs.stackexchange.com/questions/45818",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/38181/"
] | I'm guessing I could replace the words "hard drive" with "random access medium" but let's be more specific here. Also for the sake of this question, let's not consider SSDs. Just plain old hard-drives with heads and magnetic discs.
I'd guess that the hard drive doesn't care about things as bytes and receives instruct... | Simplified, the operating system sees disk storage as a randomly accessible set of sectors, each sector containing some fixed number of bytes. The OS asks the disk controller for a sector using some standard protocol and it is the responsibility of the disk controller to retrieve the sector with the bits and bytes in ... | Prior to the 1990s, disk drives were somewhat like a tape recorder with a short loop of tape, and an ability to move the drive head to select a track. Information is written to disks using sequences of magnetic pulses with varying amounts of time between them. Depending upon the physical properties of the media, ther... | https://cs.stackexchange.com |
577,108 | [
"https://physics.stackexchange.com/questions/577108",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/273053/"
] | What happens when one connect a 110V appliance to a 220V supply, and vice
versa? Please explain in detail.
<strong>Is there any way to safely connect such an appliance to a
220V supply without causing any damage?</strong>
| If you double the supply voltage, you double the current which flows through the device. Any component of the appliance that is rated to carry a certain amount of current now has to carry twice that rating and it will dissipate four times as much power as it ordinarily would, and its insulation will scorch or catch fir... | What happens will depend on the type of appliance and its components. That includes damage to the appliance as well as an increased risk of fire, electric shock, and personal injury.
Bottom line: Always connect an appliance to a voltage source as per the rating of the appliance by the manufacturer.
ps. My comments are ... | https://physics.stackexchange.com |
138,822 | [
"https://softwareengineering.stackexchange.com/questions/138822",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/1918/"
] | We have "priority" and "severity" fields in our bug tracking system. We define severity as "how it impacts the user" and priority as "how it impacts the product".
My question is about how to categorize a "code improvement" task in severity and priority. Suppose the improvement does not change any behavior but makes i... | Typically I do not like to view "code improvement" activities as a seperate assignable task because code improvement itself never directly brings you closer to completing user stories or requirements. This is why code improvement tasks will always be such low priority that they never get assigned.
I see code improvem... | If you want to refactor your code, set the priority of the task according to your definition (i.e. "how it impacts the product"). Some refactoring will not impact the product much and some will, depending on the scope of the work required. Setting a higher priority will indicate that more testing will need to be done a... | https://softwareengineering.stackexchange.com |
246,427 | [
"https://softwareengineering.stackexchange.com/questions/246427",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/139096/"
] | I came across some code recently where in many, many places, expression evaluations were being assigned to different arrays one index at a time. A psuedo-code example:
<pre><code>array[0] = item1[0] + item2[0];
array[1] = item1[1] + item2[1];
array[2] = item1[2] + item2[2];
</code></pre>
or
<pre><code>array[0] /= v... | Yes of course it is :)
You are quite correct in that creating a loop already simplifies things, so let me address your more detailed concerns about it:
<ul>
<li>Arbitrary expressions: while the expressions themselves may be arbitrary, they may still be representable as a function. When you are thinking in a more func... | In addition to what 'Frank' wrote, you build something like strategy , an <code>abstract Operator class</code> that its constructor takes two arguments and has a method of <code>myCalc</code> which returns the value.
Then have for each arithmetic or mathematical operation and derived class.
Using generics you can even ... | https://softwareengineering.stackexchange.com |
222,604 | [
"https://softwareengineering.stackexchange.com/questions/222604",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/101645/"
] | It seems to me that this is often encountered in practice and I was wondering if there is a design pattern for the following:
Suppose I have a class that represents a card:
<pre><code>public class Hand {
private static Random rng;
private Rank rank;
private Suit suit;
public Hand() {
if (prng ... | A constructor should be deterministic if possible, otherwise your code will be untestable. Have at least one overloaded constructor that can accept an RNG:
<pre><code>public Hand(Random prng) {
// more stuff
}
</code></pre>
An argument-less constructor could give a default RNG, as in your design sketch. While a <co... | <blockquote>
If I create a static field and allocate it in the deceleration:
<pre><code>private static Random rng = new Random();
</code></pre>
a new Random object gets instantiated every time - also not very efficient.
</blockquote>
This is simply not true - it will create a single <code>Random</code> when the class i... | https://softwareengineering.stackexchange.com |
144,333 | [
"https://security.stackexchange.com/questions/144333",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/131613/"
] | In card games like poker it is critical that players do not know the hands of the other players until they simultaneously show their cards to see who has won.
Is there a cryptographic technique to achieve a similar result on the internet that does not require trusted infrastructure and could be achieved in a distribut... | Yes: an encrypted blockchain. The decryption key is sent at the end of the hand.
I'm not sure how much more to expand this without explaining how blockchain works (but I see you are already familiar with the concept).
| <blockquote>
Is there a cryptographic technique to achieve a similar result on the internet that does not require trusted infrastructure and could be achieved in a distributed way?
</blockquote>
Sort of. Let's consider a poker variant in which each player receives cards from a separate deck of cards. Thus no player ... | https://security.stackexchange.com |
280,588 | [
"https://physics.stackexchange.com/questions/280588",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/77318/"
] | Two objects are stacked on each other with a nonzero coefficient of static friction between them, and the bottom block sits on a frictionless table. A force is applied rightward to the bottom block, and the right block moves along with it due to the static friction they exert on each other. My question is how do you kn... | Remember that the flux that enters into Lenz's Law is the flux <em>enclosed by the path for which you are calculating the EMF</em>. The field between the two loops is <em>outside</em> of that path, and so is not considered.
| Lenz never wins because if he did then the opposition to the change producing the induced current would be total and so there would be no net change and hence no induced current.
Even without the inner loop there is opposition to the increasing current in the outer loop (self inductance) and the presence of the inner ... | https://physics.stackexchange.com |
153,094 | [
"https://softwareengineering.stackexchange.com/questions/153094",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/1411/"
] | I'm now learning Gerrit (which is the first code review tool I use). Gerrit requires a reviewed change to consist of a single commit. My feature branch has about 10 commits.
The gerrit-prefered way is to squash those 10 commits into a single one. However this way if the commit will be merged into the target branch, th... | Code review has the best impact when it is a pre-commit (pre-push in case of git) hook. If an error in encountered in 5th of your ten commits, how would you fix it (preserving history)? Sure, you can create another topic branch, fix that commit, cherry-pick the remaining 5 commits and resend the diffs for review, but t... | What about Continues Integration? you made 10 commits on a feature branch and it will be "published" at once - that would be a huge impact on others who should review those commits/changes.
However it is worth to push 10 commits, if the commits contain separate code modifications. But in case the commits contain conti... | https://softwareengineering.stackexchange.com |
117,481 | [
"https://softwareengineering.stackexchange.com/questions/117481",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/39821/"
] | I think most people would agree that pointers are a major source of bugs in C programs (if not the greatest source of bugs). Other languages drop pointers entirely for this reason. When working in C, then, would it be best to avoid using pointers whenever practicable? For example, I recently wrote a function like this:... | Other languages don't "drop pointers entirely," they just restrict what you can do with them, give them a syntax that looks like non-pointer variables, handle some operations on them behind the scenes, and call them something else, like a reference or object. If you ever have to make a distinction between assigning a ... | In my opinion, it doesn't make any sense to use C and want to avoid pointers. If you do so, then you'd better use another language.
Pointers are unavoidable in C. This is what make C so powerfull and also what make C a pain in the ass sometime. C is meant to be used with pointers.
Arrays are pointers, functions are p... | https://softwareengineering.stackexchange.com |
13,866 | [
"https://dba.stackexchange.com/questions/13866",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/3046/"
] | I need to have a way to insert to a table, fast, synchronous, with minimal duration. What I've tried ("blind") is :
<ul>
<li>Have no index on the table whatsoever</li>
<li>Switch to simple logging (from full logging)</li>
</ul>
The test scenario that I use consists of 100 connections that each run an INSERT and then ... | A lot of folks added a lot of good points in the comments.
1) Separate your transaction logs onto a different drive. That's going to be tough with a laptop. If you can't do that, get yourself an SSD for the laptop, and that should make your life considerably better.
2) Pre-grow your data and log files to a target a... | My advice is to get off a laptop. Put this on a real machine, with fast drives and lots of ram.
| https://dba.stackexchange.com |
515,460 | [
"https://electronics.stackexchange.com/questions/515460",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/253999/"
] | In control system, the error is the difference between input and output. But why are we expecting to get the output same as the input. To get the exact input as output there is no necessary for the system since we have the output available i.e input.
I am not sure I have detailed it correctly but please respond if you ... | The valve works by attracting an iron armature into a solenoid. This means that when un-energised, there's a large airgap in the magnetic circuit. When it's energised, the airgap is much smaller.
The large initial airgap means that a large current is required to develop enough force to move the armature. When the airga... | Just so the poor guy knows what a buck converter is. A buck converter reduces the power by switching the transistor on & off rapidly instead of using a resistor. The inductance of the coil resists changes in the current by generating a reverse voltage which keeps the current flowing through the diode (known as a fr... | https://electronics.stackexchange.com |
219,096 | [
"https://mathoverflow.net/questions/219096",
"https://mathoverflow.net",
"https://mathoverflow.net/users/15242/"
] | It's well known that there are no elliptic curves over Spec $\mathbb{Z}$, but it's unclear (to me at least) if the proof generalizes.
My question is: If $S$ is a connected scheme such that has every prime as a residue characteristic, then can there exist an elliptic curve over $S$?
| Yes, there can. Choose any elliptic curve $E$ over $\mathbb{Q}$ with potential good reduction (for instance, a curve with potential CM) and pass to a number field $K$ over which the reduction is everywhere good. Then $E_K$ extends to an elliptic curve over the ring of integers $\mathcal{O}_K$, and the latter has all pr... | More interesting is the question of which fields admit what sorts of elliptic curves having everywhere good reduction. For example, how about quadratic fields? Here are a couple of results.
<strong>Theorem</strong> (Rohrlich [1]) Let $K$ be an imaginary quadratic field and $j$ the invariant of some fixed isomorphism c... | https://mathoverflow.net |
216,639 | [
"https://softwareengineering.stackexchange.com/questions/216639",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/75344/"
] | Sometimes, especially when working with third party code, I write unit-test specific code in my production code. This happens when third party code uses singletons, relies on constants, accesses the file-system/a resource I don't want to access in a test situation, or overuses inheritance. The form my unit-test specifi... | I normally add a layer of abstraction for a third party component.
Say I have a static class called User:
<pre><code>public static class User
{
public static void Login(string username, string password)
{
// Logic
}
}
</code></pre>
Imagine that <code>User</code> is a third party component for authent... | Few things before we look into what can be done<br>
-- Testing the code that we author to work as expected is a Must<br>
-- Having test code in production code is IMO a code smell
In reality, the module we author depends on libraries and other components<br>
1> The libraries could be authored by other team within th... | https://softwareengineering.stackexchange.com |
96,222 | [
"https://mathoverflow.net/questions/96222",
"https://mathoverflow.net",
"https://mathoverflow.net/users/12586/"
] | Let $\mathcal{I}$ be an uncountable set. Let $(\Omega, \mathcal{F},\mathbb{P})$ be a probability space, and $E_i, i\in \mathcal{I}$ be a measurable set such that $\mathbb{P}(E_i)=1$. What can we say about $\mathbb{P}(\cap_{i\in \mathcal{I}} E_i)?$.
I know that an uncountable intersection of measurable sets is not nec... | If the uncountable number of sets that you're intersecting is small enough, you <em>might</em> be able to guarantee that the intersection is measurable (and in fact of measure 1) --- it depends on information about the set-theoretic universe that the usual axioms (ZFC) don't decide. Specifically, the <em>additivity of... | Take $[0,1]$ with Lebesgue measure, let $X$ be any subset of $[0,1]$, and for each $x \in X$ let $E_x =[0,1] - \{x\}$. Then each $E_x$ has full measure, but their intersection is the complement of $X$, which could be anything.
However ... would this help? Say that $A$ <em>almost contains</em> $B$ if $B - A$ is null.... | https://mathoverflow.net |
42,101 | [
"https://electronics.stackexchange.com/questions/42101",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/13551/"
] | I am reading the book Electronic Principles by Malvino and I found the circuit shown below.
It asks to find the A(gain) when the switch is in position 1 and in position 2.
I am not sure about this but in position 1 I found that A = 10k/10k + 1 = 2.
What about position 2?
<img src="https://i.stack.imgur.com/vpSK6.png"... | Adding on to Dave's answer,
An ideal op-amp follows two basic rules when operating under closed-loop feedback conditions:
<ol>
<li>The voltage at the two inputs are equal</li>
<li>There is no current flowing into or out of the op-amp inputs</li>
</ol>
<strong>Position 1:</strong>
<img src="https://i.stack.imgur.com/... | (I'm assuming that the upper input to the opamp is the inverting input.)
Keep in mind that an opamp with negative feedback works to keep its input pins at the same voltage.
<ul>
<li>With the switch in position "1", the amplifier is configured as a unity-gain buffer. Gain = +1.0</li>
</ul>
In this configuration, the ... | https://electronics.stackexchange.com |
55,808 | [
"https://datascience.stackexchange.com/questions/55808",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/38091/"
] | I need to find the columns in data frame, which has numeric values and are stored as string.
<pre><code>data_set = pd.DataFrame({"Number":["1","2","3","4","5"], "Char":["A","B","C","D","E"]})
data_set.dtypes
</code></pre>
In above code, column "Number" has numeric values, but stored as string. I have to iterate throu... | I think this does what you want.
<pre><code>for column in data_set:
If isinstace(data_set[column].dtypes,str)
data_set[column]=data_set[column].astype(int)
</code></pre>
| I put together the following code but I don't claim it to be the best option:
<pre><code>for col in data_set.columns:
for element in data_set[col]:
if element.isdigit():
data_set[col] = data_set[col].astype(int)
</code></pre>
Please note, that this code will try to convert the whole column to ... | https://datascience.stackexchange.com |
18,630 | [
"https://cs.stackexchange.com/questions/18630",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/11616/"
] | Given the following:
$$\{ w\#x \mid w^R \text{ is a substring of $x$, with $x$ and $w \in \Sigma^*$} \}$$
What does $w\#x$ denote?
| This seems to just be a case of a lack of care in the definition. The symbol $\#$ isn't anything special, but is commonly used as a separator simply for the reason that it's not normally used for much else.
So in the language in question, all the strings in the language have two parts, $w$ and $x$, which are separate... | Usually $\#$ is just a symbol of the alphabet, i.e. $\# \in \Sigma$. And $w\#x$ is just concatenation of the word $w$, the symbol $\#$, and the word $x$.
| https://cs.stackexchange.com |
493,684 | [
"https://physics.stackexchange.com/questions/493684",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/218147/"
] | The force on one charged particle due to a uniform magnetic field is <span class="math-container">$F=qvB\sin\theta$</span>. According to this formula, the faster the particle's velocity, the greater the force of the magnetic field is going to exert on the particle. However, how does the magnetic field know how fast the... | Fields don't "know" anything. "Knowing" is a anthropomorphic concept, based around how humans believe they operate.
The effects of a magnetic field on a charged particle are proportional to the derivative of position with respect to time. This is simply the equation used to predict the effects a magnetic field has.
... | The closest argument to a reason why the magnetic force depends on the velocity is that, fundamentally, the the four potential <span class="math-container">$A^\mu = (V, A^x, A^y, A^z)$</span> is coupled to the charge current <span class="math-container">$j^\mu = (q, j^x, j^y, j^z)$</span>, which depends on the velocity... | https://physics.stackexchange.com |
335,948 | [
"https://mathoverflow.net/questions/335948",
"https://mathoverflow.net",
"https://mathoverflow.net/users/48839/"
] | Let <span class="math-container">$f\in L^2(0,\infty)$</span> be a positive, decreasing function. Is it then true that
<span class="math-container">$$
\limsup_{x\to\infty} xf(x) = \limsup_{x\to\infty} \frac{1}{f(x)}\int_x^{\infty} f^2(t)\, dt
$$</span>
(and similarly for <span class="math-container">$\liminf$</span>)?
... | No, this equality does not hold in general. What is true is that rhs is at most twice as large as lhs and this is sharp.
For the sake of brevity I will only show an example where lhs is <span class="math-container">$1$</span> and rhs is greater than <span class="math-container">$1.9$</span>. Choose a very fast growin... | Assuming lots of stuff, just to get the ball rolling:
<span class="math-container">$$\frac{1}{f(x)}\int_{x}^{\infty}f^{2}(t)dt=\frac{1}{xf(x)}\frac{\int_{0}^{\frac{1}{x}}f^{2}(\frac{1}{t})\frac{1}{t^{2}}dt}{\frac{1}{x}}.$$</span>
So we claim that
<span class="math-container">$$(xf(x))^{2}\sim \frac{\int_{0}^{\frac{... | https://mathoverflow.net |
1,084,725 | [
"https://math.stackexchange.com/questions/1084725",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/160881/"
] | I have these problems :
How to calculate : $\frac{1+i}{1-i}$ and $(\frac{1+\sqrt{3i}}{1-\sqrt{3i}})^{10}$
For some reason this is incorrect I'll be glad to understand why, This is what I done :
I used this formula : $(\alpha,\beta)*(\gamma,\delta)=(\alpha\gamma-\beta\delta,\alpha\delta+\beta\gamma)$
And also : $(\a... | What you calculated in the first part is not the same quantity as what you asked in the original question: is the quantity to be computed $$\frac{1-i}{1+i},$$ or is it $$\frac{1+i}{1-i}?$$ Even if it is the latter, you have made a sign error in the fourth line: it should be $$(1+i)(\tfrac{1}{2} + \tfrac{i}{2}) = \fr... | <ul>
<li>$$\left(1+i\right)\left(\frac{1}{2}+\frac{1}{2}i\right)\ne\left(\frac{1}{2}\underbrace{\color{red}{\bf -}}_{\small\text{wrong}}\frac{i^2}{2}+\frac{1}{2}i+\frac{1}{2}i\right)$$</li>
<li>$$((1+\sqrt{3}i)(1-\sqrt{3}i)^{-1})^{10}=
(1+\sqrt{3}i)\left(\frac{1}{\color{red}4}+\frac{\sqrt{3}i}{\color{red}4}\right)^{10}... | https://math.stackexchange.com |
405,959 | [
"https://softwareengineering.stackexchange.com/questions/405959",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145346/"
] | Imagine a twitter-like app where users are allowed to follow to a limited amount of users; say 100.
I have this code:
<pre><code>fun follow(followerId: String, followedId: String) {
if (repo.countFollowing(followerId) >= 100) {
throw MaxFollowingReached()
}
repo.insertFollowingRelationship(followerId, fo... | What’s the requirement? That there be some max number of followers or that it forever be 100?
This begs the question of whether this is a tuning variable that keeps the system happy and subject to change as the system changes, or if this is part of the user experience, like twitters character limit, and not to be cha... | If the code under test is not configurable, the unit test should not be configurable either.
If for any reason the code should change, the test will break. That is the idea. At that point you would fix the unit test so that it too is configurable, or you would mock and vary the configuration to ensure the code under t... | https://softwareengineering.stackexchange.com |
45,040 | [
"https://quant.stackexchange.com/questions/45040",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/30950/"
] | So I'm trying to verify the first two properties of a copula for the Clayton model. The first two properties being:
<ol>
<li><span class="math-container">$C(u_1,…,u_d)$</span> is non-decreasing in each component, <span class="math-container">$u_i$</span></li>
<li>The <span class="math-container">$i^{th}$</span> margi... | Your reasoning for the first property does not look correct or at least I do not understand it. Your arguments for the second property seem sound. But your wording of the second property is a bit fuzzy. You should state this more clearly, for example: <span class="math-container">$C(1,\ldots,1,u_j,1,\ldots,1) = u_j$</s... | <ol>
<li>Fix u, obtain derivative of v. And do it again for fixing v.</li>
<li>To get marginal density of v, one has to do the integration w.r.t. u</li>
</ol>
| https://quant.stackexchange.com |
875,683 | [
"https://math.stackexchange.com/questions/875683",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/164078/"
] | I have an equation,
$-(x_m - x_q)^2 = -(x_m - x_p)^2$
which I want to solve in terms of $x_q$. I can see (by using a number line) that $q$ can have two solutions:
$x_q = x_p$
or:
$x_q = 2x_m-x_p$
But I'd really like to be able to understand the algebra that could lead me to this. Could anyone walk me through it? ... | The equation you want to solve is a quadratic equation which has usually 2 solutions (I already eliminated the minus):
$$\begin{align} (-[x_m-x_p])^2 &= \\ (x_m-x_q)^2 &= (x_m-x_p)^2 \\ &= (-[x_m-x_p])^2 \\ \end{align}$$
So for solving we have to consider both possibilities
1.) $x_m-x_q = x_m-x_p$ (which ... | You should draw the parabola $y=(x-a)^2.$
The symmetry is clear. Just as $z^2= (-z)^2$ and there's no other number whose square equals $z^2$, you'll see the shape of your parabola.
The value $A^2$ is attained by $A$ and by $2a-A$, because the symmetry axis of the parabola is $x=A$. A picture is worth 1000 words, so ... | https://math.stackexchange.com |
621,213 | [
"https://math.stackexchange.com/questions/621213",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/91771/"
] | Determine the smallest positive value of x(in degrees) for which:
$\tan(x+100^{\circ}) = \tan(x+50^{\circ})\tan (x)\tan(x-50^{\circ})$
I tried to apply the formula of $\tan(A+B) = \frac{\tan A + \tan B}{1-\tan A \tan B}$ but that led me nowhere resulting in a huge equation.
Please help.
| Given $\displaystyle \tan(x+100^0) = \tan(x+50^0)\cdot \tan (x)\cdot \tan(x-50^0)$
$\displaystyle \Rightarrow \frac{\tan(x+100^0)}{\tan(x-50^0)}\Rightarrow =\tan(x+50^0)\cdot \tan(x^0)$
$\displaystyle \Rightarrow \frac{\sin(x+100^0)\cdot\cos(x-50^0)}{\cos(x+100^0)\cdot \sin (x-50^0)}=\frac{\sin(x+50^0)\cdot\sin(x)}{... | Another way.
We need to solve $$\tan(x+100^{\circ})\cot{x}=\tan(x-50^{\circ})\tan(x+50^{\circ})$$ or
$$\tan(x+100^{\circ})\cot{x}-1=\tan(x-50^{\circ})\tan(x+50^{\circ})-1$$ or
$$\frac{\sin100^{\circ}}{\cos(100^{\circ}+x)\sin{x}}+\frac{\cos2x}{\cos(x-50^{\circ})\cos(x+50^{\circ})}=0$$ or
$$\sin100^{\circ}(\cos2x+\cos1... | https://math.stackexchange.com |
195,666 | [
"https://security.stackexchange.com/questions/195666",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/188827/"
] | I'm developing a product with simple Cortex-M MCU (with no OS on board, firmware on bare metal) and internet connectivity via external module.<br>
How do I make it secure? More specifically, how do I protect the data that is sent to and from the remote server?
My thoughts are:
<ol>
<li>I can't assume that firmware ca... | <blockquote>
The process of generation and verification of digital signature requires considerable amount of time.
</blockquote>
I doubt this claim:
<ul>
<li>Currently used cryptographic hashes are designed to be fast. </li>
<li>Data can be feed into the hash in pieces: one does not need to keep all the data to be... | Typically asymmetric (public-private) cryptography is used to securely exchange a symmetric key in the case where large amounts of data are being transferred due to the relative speed of the symmetric cipher.
| https://security.stackexchange.com |
458,137 | [
"https://physics.stackexchange.com/questions/458137",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/2146/"
] | I understand that inertial mass, at least in part, comes from the inertia of energy in the zero momentum frame or rest frame of some physical system. So for a static charge the corresponding field energy is positive giving rise to a positive electromagnetic inertial mass. Is it also possible to define an inertial mass ... | There is no simple answer to this question. General relativity does not generically have any way to define the total energy of a system; it only has conserved, scalar measures of the total energy of a system in particular special cases, such as asymptotically flat spacetimes. Even then, there is more than one such meas... | A partial answer. It's possible to build up very simplified models of static self-gravitating "stars" where it's manifest that the total mass of the star is <em>less</em> than the volume integral of the rest density of the matter the star is made of. And that the difference is just the gravitational potential energy of... | https://physics.stackexchange.com |
28,194 | [
"https://physics.stackexchange.com/questions/28194",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/6818/"
] | In a certain lecture of Witten's about some QFT in $1+1$ dimensions, I came across these two statements of regularization and renormalization, which I could not prove,
(1) $\int ^\Lambda \frac{d^2 k}{(2\pi)^2}\frac{1}{k^2 + q_i ^2 \vert \sigma \vert ^2} = - \frac{1}{2\pi} ln \vert q _ i \vert - \frac{1}{2\pi}ln \fra... | Let's just look at the integral
$$\int \frac{d^2k}{(2\pi)^2} \frac{1}{k^2+\alpha^2}.$$
The other integrals should follow from this one.
Introduce the Pauli-Villars regulator,
$$\begin{eqnarray*}
\int \frac{d^2k}{(2\pi)^2} \frac{1}{k^2+\alpha^2}
&\rightarrow& \int \frac{d^2k}{(2\pi)^2} \frac{1}{k^2+\alpha^2... | perhaps since your itnegral is logarithmic divergent you could do the following
$$ \int_{0}^{\infty}\frac{kdk}{k^{2}+a^{2}}\to \int_{0}^{\infty}\frac{kdk}{k^{2}+a^{2}}- \int_{0}^{\infty}\frac{dx}{x+b}+\int_{0}^{\infty}\frac{dx}{x+b} $$
then the integral $$ A=\int_{0}^{\infty}\frac{kdk}{k^{2}+a^{2}}- \int_{0}^{\infty}... | https://physics.stackexchange.com |
20,385 | [
"https://softwareengineering.stackexchange.com/questions/20385",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/3542/"
] | I am currently working as an intern at a consulting firm. I am soon to move to a full time employee once I graduate next semester, and I love working there. However, as a student, I lack money and I have met a business owner outside of work who has offered to hire me for some freelance web development.
Because I met ... | Since you care about this issue, and are considering working for them full time, I think now is a great time to find out how they handle it. They may say "sure, go ahead, we like to see people improving themselves!" They may put some restrictions on you about using their tools. They may forbid you to do it, or even thr... | Check your contract first, but I would always advice to talk honestly with all your business relations which include your boss.
In any case, get a <strong>written</strong> approval.
| https://softwareengineering.stackexchange.com |
45,787 | [
"https://quant.stackexchange.com/questions/45787",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/32293/"
] | This would be my explanation for the reason that convexity adjustments must exist:
Futures are margined daily, such that if a trader is paid a future and rates goes up then money is paid into their margin account, and if rates goes down then money is taken from their margin account, daily, so that we have two outcomes... | This has been posted a few times now, so I will invest the time on a full response.
<h3>FRA / Futures convexity has <strong>nothing</strong> to do with profits/losses being <strong>immediately</strong> recognised on the future through margin settlement, and potential reinvestment, whilst deferred on the FRA.</h3>
Altho... | It’s an ok explanation until the last 2 paragraphs. You should say :” in order to offset this advantage from SHORTING futures versus the FRA....”. And then the equation is <span class="math-container">$$FRA rate = Futures\space Implied\space Rate - Convexity\space Adjustment$$</span>
| https://quant.stackexchange.com |
15,315 | [
"https://security.stackexchange.com/questions/15315",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/10160/"
] | I read the following statement in a security blog
<blockquote>
using the same source port over and over again for dns queries instead of randomizing them is a vulnerability for dns poisoning
</blockquote>
Could somebody elaborate on how this is a vulnerability and how it could possibly be exploited?
| Since DNS usually runs over UDP, response packets can be readily spoofed. UDP packets are identified by the combination of source and destination IP address and source and destination port numbers.
The classic DNS poisoning attack is to send a DNS server a query which you think will cause the server to do a recursive... | There are a lot of factors which play an important role in DNS poisoning but most probably the main one is <strong>timing</strong>. Using the same source port over and over again gives the attacker a huge time boost advantage, as he already knows the port he needs to send his queries to. If an attacker, with a rogue DN... | https://security.stackexchange.com |
140,933 | [
"https://mathoverflow.net/questions/140933",
"https://mathoverflow.net",
"https://mathoverflow.net/users/39401/"
] | Are there any good introductory type of books that contain dilation theories of Sz-Nagy, Rohlin and Akcoglu?
| I would suggest yet another larger set. Take two points $A$ and $B$ in the plane with $|AB|=d$. Let $S$ be the set of all points $X$ in this plane lying in one halfplane defined by $AB$ and satisfying $|XA|,|XB|\leq d$. Then rotate $S$ around the perpendicular bisector of $AB$; you get the convex body containing your c... | It seems you could curve the base of the cone, making it a sector of a sphere of
radius $r > d$ slightly larger than $d$, centered at a point $c$ directly above the
apex of the cone:
<br /><img src="https://i.stack.imgur.com/p9kWd.jpg" alt="Cone_r_d"><br />
(Arrows indicate segments of length $d$ that cannot fit.)
I... | https://mathoverflow.net |
1,795,970 | [
"https://math.stackexchange.com/questions/1795970",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/341126/"
] | I must admit that I've forgotten how to do multivariable limits. Nevertheless I need to know whether the following exists:
$$\lim_{(x,y)\to (0,0)} \frac{\sin(x^2+y^2)}{x^2+y^2}$$
Would it be as simple as defining a function $(x^2+y^2)\mapsto z$. Then $$\lim_{(x,y)\to (0,0)} \frac{\sin(x^2+y^2)}{x^2+y^2} = \lim_{z\to... | Hint: Change to polar coordinates and use a well-known limit. One does not even need to go to polar coordinates, but that is a useful move in general when the denominator is $x^2+y^2$. (Your solution is correct.)
| <strong>Hint</strong>. You may use polar coodinates, $x=r \cos \theta$, $y=r \sin \theta$, then you initial function writes
$$
\frac{\sin (r^2)}{r^2}
$$ and consider $r \to 0$.
| https://math.stackexchange.com |
115,698 | [
"https://mathoverflow.net/questions/115698",
"https://mathoverflow.net",
"https://mathoverflow.net/users/27962/"
] | Is it possible to classify finite simple groups whose every maximal subgroups are not of prime order? Is it possible to answer to this question in the class of finite groups?
| <strong>Prop:</strong> If $G$ is a finite simple group, then a maximal subgroup of $G$ is trivial or has composite order
<strong>Proof:</strong> A maximal subgroup of $G$ being trivial clearly corresponds to $G$ being cyclic of prime order. Assume, then, that $G$ is non-abelian.
If $G$ has a maximal subgroup $C$ of p... | Late answer, in a somewhat different direction from Nick Gill's answer: (Note, by the way, that an Abelian finite simple group has its only maximal subgroup (the trivial group), not of prime order).
Using some more sophisticated group theory, it is possible to prove (and is reasonably well-known to specialists) that i... | https://mathoverflow.net |
351,180 | [
"https://softwareengineering.stackexchange.com/questions/351180",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/251263/"
] | I am writing software that makes use of a neural net.
What makes my network special as compared to others, is the way I train them.
Its non standard, its something that I don't want to give away to another company. So I've been thinking about how to protect myself against miss-use / stealing of my neural net training ... | Create two assemblies. Assembly A contains all of the classes required to use the trained model, but none of the code which trains the model. Assembly B contains only the classes which train models, and nothing else. Assembly B references assembly A.
Deliver assembly A, and keep assembly B to yourself.
Your question ... | When a company is buying your software, you will have a contract that states what you deliver and what they can do.
Chances are that what you are planning will cause them to not sign a contract in the first place. They don't get what they want, and they have to work with someone who might come up with other interesti... | https://softwareengineering.stackexchange.com |
348,026 | [
"https://physics.stackexchange.com/questions/348026",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/164363/"
] | There are a lot of questions here dealing with infrared cameras and thermographic cameras. I think I understand the reason why a thermographic camera is able to retrieve the temperature values from any object and convert them to a falsecolor representation, but why is a "regular" infrared camera not able to retrieve th... | This is a common confusion, because both thermographic cameras and "normal" cameras with some IR capability are called IR cameras often.
The typical video camera with IR capability has a solid state semiconducting camera sensor normally used for capturing visible light, which relies on the photons interacting with ele... | It depends on the sensor. If all that makes a camera "infrared" is that it is capable of detecting light with a lower frequency than red light, that is not enough to identify temperature. Objects of different temperature emit different frequencies of infrared light at different amounts. In order to accurately determine... | https://physics.stackexchange.com |
152,793 | [
"https://chemistry.stackexchange.com/questions/152793",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/104657/"
] | <blockquote>
A water solution is prepared by mixing <span class="math-container">$\pu{200 g}$</span> of a ethylene glycol (ethan-1,2-diol; <span class="math-container">$\ce{C2H6O2}$</span>) solution (20% by weight) with <span class="math-container">$\pu{500 g}$</span> of glycerol (propan-1,2,3-triol; <span class="math-... | First, the <span class="math-container">$i$</span> in the equation you cited is the <em>van't Hoff factor</em> of the solute(s) (ethylene glycol and glycerol in this case). The van't Hoff factor accounts for how many species are generated by the solute. Specifically, it is the important for electrolytes such as <span c... | In the answer elsewhere, ĐỨc Lê Hồng has given how to find the volume of the solution and why van't Hoff factor is not important the case of ethylene glycol and glycerol are involved as solutes in the solution. However, you must know how to find the molality to find the freeding point depression and molarity to find t... | https://chemistry.stackexchange.com |
643,465 | [
"https://physics.stackexchange.com/questions/643465",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/44690/"
] | Consider the gravitational action as an integral over a differential 4-form <span class="math-container">$$ S = \int_{\mathcal{M}} \star F_{ab}\wedge e^a \wedge e^b$$</span> where <span class="math-container">$\star F_{ab} = \epsilon_{abcd} F^{cd}$</span> and <span class="math-container">$F$</span> is the curvature two... | Ok, I think I may have figured this out myself. Using the infinitesimal transformation stated in the question we can show that
<span class="math-container">$$\delta F^{ab} = D\wedge D\lambda^{ab} = F^{ac}\wedge\lambda^{b}_{~~c}+F^{cb}\wedge\lambda^{a}_{~~c}$$</span>
which proves that the curvature two-form is Lorentz c... | I think a point you may be missing here is that the indices <span class="math-container">$a, b, \dots$</span> are not mere labels, they actually conveniently label the representations involved and can be used to construct manifest invariants of the local Lorentz group. This point is sometimes assumed without emphasizin... | https://physics.stackexchange.com |
47,567 | [
"https://stats.stackexchange.com/questions/47567",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/18604/"
] | I came across this forum as I am trying to get a convincing answer. Apologies for speaking 'plain English' as I am not a statistical genius!
Basically I am implementing a pre- and post- questionnaire to be asked to young people (aged 12-17), and aimed at demonstrating the impact of a day intervention (educational prog... | While it is true that, for the same set of students, the <em>mean pre-post difference</em> will be the same between methods one and two, for statistical inference, all else being equal, the paired method is preferable. A common way to express this is to say that subjects "serve as their own controls." Through this me... | In simple words, the second method is better because, you have the ability to QUANtiFY THE NUMBER OF STUDENTS BENEFITED, and BY HOW MUCH.
The first method will not help with this because you only see a overall benefit for the group.
Suppose, you only see a small overall benefit, wouldn't you like to go deeper and s... | https://stats.stackexchange.com |
61,036 | [
"https://datascience.stackexchange.com/questions/61036",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/82983/"
] | Can I have X_train, y_train, X_test, y_test from data_generator?
Here is my code:
<pre><code>data_generator = ImageDataGenerator(
rescale = 1. / 255,
shear_range = 0.2,
zoom_range = 0.2,
horizontal_flip = True,
vertical_flip = True,
rotation_range = 180,
width_shift_range = 0.2,
heig... | in python 2:
<code>X_train, y_train = train_generator.next()
X_test, y_test = validation_generator.next()</code>
in python 3:
<code>X_train, y_train = next(train_generator)
X_test, y_test = next(validation_generator)</code>
| As per the above answer, the below code just gives 1 batch of data.
<pre><code>X_train, y_train = next(train_generator)
X_test, y_test = next(validation_generator)
</code></pre>
To extract full data from the train_generator use below code -
step 1: Install tqdm
<pre><code>pip install tqdm
</code></pre>
Step 2: Store th... | https://datascience.stackexchange.com |
285,251 | [
"https://softwareengineering.stackexchange.com/questions/285251",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/160147/"
] | I'm developing a social network website and I'm working with php/mysql/jquery and I want users to have the most user-friendly website experience. That's why I try to avoid a save (submit) button at all. So, when they're on their own profile and enter information like what languages they speak or where do they live, I w... | Have a save button.
There are very good reasons why applications use explicit save/submit buttons:
<ol>
<li>Gives the user a chance to change their mind about the edit. Unless you provide some sort of undo mechanism with auto-save, the user has no way to abort a modification.</li>
<li>Protects against accidental mod... | <h3>Use a button</h3>
<ul>
<li>It is what users expect, don't discount the value of a familiar interface.</li>
<li>It gives the users the control they need, including the power to not publish something if they change their mind before finishing.</li>
<li>It gives users confidence that their submission has been properly... | https://softwareengineering.stackexchange.com |
252,809 | [
"https://electronics.stackexchange.com/questions/252809",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/121002/"
] | I'm trying to connect atmega328P-PU micro-controller to a 9v battery. I added 20M ohm resistor and got the voltage down to 4.8v, which is in the range of atmega, but it doesn't turn on. I replaced the atmega with LED and the LED is very dim, even though I'm getting 4.8v. When I try to measure current, I guess it's too ... | 1) Your atmega is an active load (a variable resistor), lets say it draws (since I don't know but you can run through the caluclations again if you measure it) 20mA then at 5V its like a 250Ohm resistor.
$$ V = I*R $$
What if it draws 40mA when more transistors turn on? Then its like a 125Ohm resistor. If you put ... | Use a suitable voltage regulator, such as an LM7805.
| https://electronics.stackexchange.com |
243,403 | [
"https://electronics.stackexchange.com/questions/243403",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/107801/"
] | <strong>A step-up transformer takes AC input and gives AC output</strong>. Then, how does the E.H.T (Extra high-tension transformer) create 18 KiloVolt or more, DC-output on the CRT (enough to shot the electrons on screen) from the 12V rectified DC output from main power-transformer?
If I assume, the television EHT is... | The rectifier diode is built into the flyback transformer. Then the pulsating output is smoothed into DC by the giant capacitor formed by the CRT itself. You can't typically SEE the diode because it is inside the potted secondary winding and high-tension cable exit.
Television CRTs typically have a conductive coating... | The television EHT is an ordinary flyback transformer, one of the two common types of transformer we meet in engineering.
The 12v main power DC is not simply put across its input, but is chopped by semiconductor switches.
The EHT transformer will have a much higher ratio of turns than say the flyback in a switch mode... | https://electronics.stackexchange.com |
75,011 | [
"https://softwareengineering.stackexchange.com/questions/75011",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/23383/"
] | In the Ruby on Rails tutorial, I read something that suggested that experienced developers do not use scaffolding since they tend to like to just write the code to connect the MVC on their own.
In a different place I read that it is a good idea to use scaffolding because it helps you stick to convention so others who ... | Scaffolding serves a purpose - it's a rapid prototyping tool. Use it if that is what you are doing. Once you have your prototype, you can intelligently make the decision to modify what the scaffolding produced for you, or delete the scaffolding and build up the app <em>exactly</em> as you want it.
If this is your fi... | I developed many websites with RoR and in the company I worked we never used it. I think that is true for most RoR developers. Though I remember a few discussions about this and some professional developers where using it in some circumstances.
But I think they didn't use the default version of Rails scaffolding, imp... | https://softwareengineering.stackexchange.com |
13,001 | [
"https://electronics.stackexchange.com/questions/13001",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/3632/"
] | I am getting some strange character displays on hyper terminal, after establishing communication with my GSM modem using the appropriate baud rate. When I type "AT", it appears to get repeated or display strange characters (as though the baud rate were not correct) on the hyper terminal screen as "AATT". And all other... | You have local echo turned on in your terminal emulator. Turn it off.
Alternatively, turn off echo on your modem:
<pre><code>ATE0
</code></pre>
| I was able to rectify the problem and totally avoided the repetitions.
Simply use a 1k pull-up both at the TXD and RXD pins of the UART, to VCC. So all work with any baud rate. The problem was simply an issue with voltage levels.
Thanks to all who contributed!
| https://electronics.stackexchange.com |
105,517 | [
"https://electronics.stackexchange.com/questions/105517",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/22868/"
] | As simple as that. I assume that you use PID when you do not know the Transfer Function of the system, otherwise you use it and plug it directly in the closed-loop control.
| No, you do not have to know the whole transfer function. It is quite common practice to manually tune a PID either by hand or with some computer. Sometimes, the transfer function would be way to complex/arbitrary to be computed, so you may approximate it or use a device which generate a step response of your system i... | The goal in a typical control system is to produce the sequence of output stimuli which will allow the system to achieve a desired state at lowest "cost" [cost may be measured in energy, time, machine stress, imprecision in the achieved state, or various other ways]. If one knows precisely how the system will react to... | https://electronics.stackexchange.com |
5,913 | [
"https://mechanics.stackexchange.com/questions/5913",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/2306/"
] | I have a Nissan Micra (UK, 51-plate, 2001 model) and I've today noticed a sound a bit like skidding when I apply the brakes, gently, around 30mph. Driving and steering as usual is fine, no unusual pull to the left or right. It's due for it's service in a few weeks so I can get it looked at then - if I know what to ask ... | As the car was due for it's MOT and service I took it into the garage who diagnosed worn front brake pads and reccomended replacement. Since the replacement of the pads I have not had any further issues.
| Modern radial tires can look/feel just fine from the outside while still being dangerously low on air pressure. Skidding type sounds are typical for a tire with low air pressure.
| https://mechanics.stackexchange.com |
87,542 | [
"https://dba.stackexchange.com/questions/87542",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/56026/"
] | Suppose I have a website that communicates with a database.
In some page of my site i want to exhibit a list with all the students in my database. There are two kinds of students: regular students, that only participate in regular classes (with attributes such as <code>student_id, name, email, password</code>) an... | Both solutions are viable and each has different benefits / drawbacks - the best solution depends on your data and how many of your queries need this additional column.
<ol>
<li>Adding the <code>special_class_id</code> to the <code>students</code> table makes this table "wider", meaning that the performance of all que... | I have read your question, but not your proposed solutions, so I can't be influeced.
So, my ideas is that you can do a table STUDENTS and another table, let's say STUDENT_TYPE.
In STUDENTS, you put a column, ID_STUDENT_TYPE. In this column, you can set, with the ID of STUDENT_TYPE, the type of the single student.
In... | https://dba.stackexchange.com |
430,367 | [
"https://softwareengineering.stackexchange.com/questions/430367",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/177913/"
] | Imagine we have a Sprint Backlog defined, consisting of business features to code. When a feature is developed and delivered (deployed to a test server), QA can start manual testing (we don't have automated tests for a reason). Testing takes several days (we cannot decrease the time needed).
Is it ok for the developmen... | No, but it means you can't <em>release</em> after every sprint.
Everyone will tell you that the answer to this is automated testing and that will reduce your testing time to zero. But lets just go with 1 week of manual testing needed before a release and that week will throw up 2 or 3 bugs which will need to be fixed. ... | The fact that you have a hand-off between the people who develop the functionality and the people who test the functionality implies the existence of a sequential set of steps in the iteration, either for the system as a whole or on a workunit-by-workunit level. Most of the agile methods aren't built to support this ki... | https://softwareengineering.stackexchange.com |
51,890 | [
"https://datascience.stackexchange.com/questions/51890",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/74140/"
] | This is my code
<pre><code>import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#Importing Dataset
dataset = pd.read_csv('C:/Users/Rupali Singh/Desktop/ML A-Z/Machine Learning A-Z Template Folder/Part 1 - Data Preprocessing/Data.csv')
print(dataset)
X = dataset.iloc[:, :-1].values
Y = dataset.iloc[:... | Your error is due to using <strong>Simple Imputer</strong>'s fit and fit_transform on a <strong>numpy</strong> array. Here's how i used it on a <strong>Dataframe</strong>
<pre><code>imr = Imputer(missing_values='NaN', strategy='median', axis=0)
imr = imr.fit(data[['age']])
data['age'] = imr.transform(data[['age']]).ra... | SimpleImputer also works fine.
<pre><code>from sklearn.impute import SimpleImputer
imputer=SimpleImputer(missing_values=np.nan,strategy='mean')
imputer=imputer.fit(X[:,1:3])
X[:,1:3]=imputer.transform(X[:,1:3])
</code></pre>
which gives result
<pre><code>array([['France', 44.0, 72000.0],
['Spain', 27.0, 4800... | https://datascience.stackexchange.com |
2,471,976 | [
"https://math.stackexchange.com/questions/2471976",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/262321/"
] | I am trying to think about a function that maps a 360 rotation to every direction in 2D space.
$0^{\circ} \to (0,1) \\
\vdots \\
90^{\circ} \to (1,0) \\
\vdots$
Thank you in advance.
| $$ \theta \mapsto (\cos{\theta},\sin{\theta}) $$
| If you don't mind going via complex space, you can send:
$$\theta\mapsto\left(\mathcal{Re}(e^{i\theta}),\mathcal{Im}(e^{i\theta})\right),$$
although if $\theta$ is given in degrees, you'll want to change it to radians first, i.e., replace $\theta$ with $\frac{\pi\theta}{180}$.
| https://math.stackexchange.com |
71,886 | [
"https://electronics.stackexchange.com/questions/71886",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/1024/"
] | I am trying to study the operation of a single plate Induction Hob.
<img src="https://i.stack.imgur.com/hg7eD.jpg" alt="Prolectrix Induction Hob" />
I wanted to use an oscilloscope to measure some of the low voltage digital signals on the microcontroller inside. So I attached the ground lead of the 'scope to a pin labe... | Your 'scope lead is safety (as named in North American standards) what you need to do is to take two probes, one on channel A and the other on channel B and use the A-B function (that is what it is for). I take the ground clips, clip them together and use electrical tape to ensure that they don't come apart and short ... | The GND of the scope probe is connected to the case of the scope, which is connected to mains earth, so it is impossible to measure a device which is connected directly to mains, unless:
<ol>
<li>You use a special differential probe (expensive) or</li>
<li>You use an isolating transformer (230V/230V or whatever your ... | https://electronics.stackexchange.com |
528,422 | [
"https://physics.stackexchange.com/questions/528422",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/252982/"
] | Many questions and answers that I read are saying that it's not possible to determine absolute stationary position in space. But when I think about it, it seems weird and unlikely.
If you cross-reference speed of multiple objects in space with each other and the speed of light (which is constant) you <strong>should</s... | You will not be able to determine whether you are in absolute stationary or not in outer space. Actually you cannot do that even on earth because absolute stationary does not exist. Remember that motion is absolute and stationary is relative. You can only tell whether you are stationary in a particular frame of referen... | There is no absolute frame of reference. In any frame of reference the speed of light will always be the same, so you cannot use it to tell if you are moving or not. Even kinetic energy is frame dependent, and not invariant. Any frame of reference could correctly say that it is at rest, relative to other frames.
| https://physics.stackexchange.com |
31,011 | [
"https://softwareengineering.stackexchange.com/questions/31011",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/9521/"
] | How common are circular references? The less common they are, the fewer hard cases you have if you are writing in a language with only reference counting-GC. Are there any cases where it wouldn't work well to make one of the references a "weak" reference so that reference counting still works?
It seems like you shou... | Weak references work great for breaking loops, as long as it's clear a loop is being made and as long as the developer makes provision for it with a weak reference. This isn't the same as a more robust GC, which is intended to handle such things automatically so the developer doesn't have to think about them at all.
| They are very common. One ubiquitous example are hierachical structures where each node has a pointer back to its parent, and of course the parent has a collection of its childs. User interfaces toolkits like Swing work like this.
| https://softwareengineering.stackexchange.com |
130,249 | [
"https://electronics.stackexchange.com/questions/130249",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/40167/"
] | I was told that I should put a relay between my 5V motor and my Arduino. I asked why, but they didn’t know.
Why do I need to separate them with a relay? The motor requires 5V and the Arduino provides 5V.
Also, do I need to separate all components from the motor with a relay or could I, for example, put them in the or... | One Arduino OUTPUT pin should be used to supply no more than 0.02A (20mA) current. (one pin has an absolute maximum safe current of 40mA, however, that is reduced if other pins on the same 8pin port is being used as an output).
Most electric motors need <em>much</em> more current than an Arduino pin can supply. A smal... | Firstly, a motor is a very power hungry device. An Arduino IO pin can only provide an <em>absolute maximum</em> of 40mA from an IO pin, and Atmel don't guarantee anything over 20mA. A motor typically takes considerably more than that, especially during it's acceleration phase.
Powering a motor direct from an IO pin ... | https://electronics.stackexchange.com |
257,731 | [
"https://physics.stackexchange.com/questions/257731",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/35268/"
] | In biology class we learn that proteins are folded, and that the shape the protein takes affects its bioactivity. Typically we don't go much further into protein shape from that, at least not at the level of biology I've taken. Now, my biophysicist friends who are working on protein folding tell me that their typical a... | Yes folded proteins do fluctuate even in their native/folded state. They do not fluctuate like a polymer chain in good solvent for example but rather like atoms in a solid, where the concept of <em>neighbours</em> in 3 dimensions is well defined enabling one to give labels to the residues if needed.
For that reason p... | Take an egg, crack it and pour it out on a hot pan. The proteins are subjected to heat and they change their conformational shape. The heat causes these proteins to thermally vibrate more violently until these vibrations are sufficient to push the proteins into a different shape. In general the cooking of meat does muc... | https://physics.stackexchange.com |
221,971 | [
"https://softwareengineering.stackexchange.com/questions/221971",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/105337/"
] | In my case joining table inside subquery or outside subquery gives very few difference with <code>COUNT</code>
<strong>CASE 1:</strong> about 6202 rows.<br>
In this case <code>table_c</code> is joined inside subquery, but is only joined (No other actions for the table, not selecting any data or filtering whole query ... | I performed two queries in MySQL while using EXPLAIN.
The first one being the following:
<pre><code>select count(*) from parent
left outer join child on child.parent_id = id;
</code></pre>
The second being the following:
<pre><code>select count(*) from (
select * from parent p
left outer join child c on c... | After taking 20 min break I've found out what's going on:
In first case when joining inside the subquery, <code>GROUP</code>-ing done the job, but when joining outside it would be <code>GROUP</code>-ed again, sure that would be stupid but...
Seems I've got duplicate entries to <code>table_c</code> that is multiplyi... | https://softwareengineering.stackexchange.com |
201,537 | [
"https://physics.stackexchange.com/questions/201537",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/71884/"
] | When I was reading about the double-slit experiment in quantum mechanics, everything seems to make sense in terms of the waves and the interference pattern, but if thinking more about this observation, it brought up more questions on this experiment.
In basic terms, what does it mean for humans to observe an electron ... | As with most of the questions in this forum, the answer is right in the same section of the book where you read about the problem. Why don't you go back and find it?
First you talk about a photon hitting an electron, and then you suddenly change to a photon hitting a photon, a completely different problem (photons don... | If you had a laser you wouldn't see it unless it was aimed at your eye (ouch). Or if there is dust or such around for it to scatter off of.
And scattering is the key. If you want to see something then it either has to get to your eye or it needs to deflect something towards your eye.
If you have a beam of electrons ... | https://physics.stackexchange.com |
90,629 | [
"https://security.stackexchange.com/questions/90629",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/58546/"
] | I'm developing an ASP.NET MVC 5 website, which a user can select some filters, based on those fillers the server process a result, and the user can make a order and pay for it.
In my <code>Order</code> table i store the filters(5 columns), the <code>Id(PK)</code>, and i need to store a <code>OrderId</code> in a <code... | Depending on the sensitivity of the data, I would suggesting the following items, arranged from least secure to most secure.
Do Nothing: Based on the contents of your question, I'd probably choose this option. A lookup filter isn't associated to a user (apparently) and probably doesn't expose anything particularly int... | You never need to use cookies.
Put the order ID in the query string (rewrite the page links to include it).
On the server side validate the request by storing the IP of the client. Do not allow computers with different IPs to access the same order.
| https://security.stackexchange.com |
16,561 | [
"https://physics.stackexchange.com/questions/16561",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/5990/"
] | (tap=faucet)
When I turn a tap on full and then put my thumb over the spout covering, say, 90% of it, then the water spurts out. If I turn it on to, say 10%, then the water dribbles out.
What's the essential difference between the way that my thumb covers most of the hole and the way the tap valve opens that makes th... | It's the shape of the tap - in fact the very reason for their being a tap rather than just a valve on the end of the pipe.
When you open the valve slightly the water does come out at high speed, hits the inside of the tap spout and is stopped - it then runs out of the tap at slow speed instead of spraying you.
Ima... | The reason is that there is a valve between you and a very high-pressure main pipe. The pressure is not equal across this opening--- it drops to nearly atomospheric pressure, and the water dribbles out at a rate determined by the size. The opening allows a fixed amount of water per unit time through, determined by the ... | https://physics.stackexchange.com |
584,076 | [
"https://physics.stackexchange.com/questions/584076",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/276233/"
] | I was conversing with my professor about the forces acting on a ball that is thrown onto the air. He said that you would have the weight of the ball, air resistance and buoyant force. Although, I wonder if the buoyant force has a significant impact on the result, assuming that the ball's density is considerably greater... | Yes, the ball does experience an upward buoyancy force equal to the weight of the displaced air - not just when it is thrown, but when it is on the ground too. However, since the density of air is about <span class="math-container">$\frac 1 {1000}$</span> that of water, the effect of atmospheric buoyancy on the apparen... | <blockquote>
Although, I wonder if the buoyant force has a significant impact on
the result, assuming that the ball's density is considerably greater
than that of the air.
</blockquote>
Not sure what "result" you are referring to. But if the question is will the ball continue to rise after release, then the a... | https://physics.stackexchange.com |
178,750 | [
"https://electronics.stackexchange.com/questions/178750",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/80384/"
] | I have a BD135 NPN and BD136 PNP transistor, When i try to apply 5V of power to the collector pin, The emitter pin Voltage output is much lower.
The goal i want to achieve for this circuit is to control when the motor spins by a programmable circuit board which emits power which i believe is 0.5V from pins on the boar... | First: Without the proper tools you're doomed to fail, so at the very least do yourself a favor and get yourself a digital multimeter and learn how to use it.
Second: When you ask a question you should provide at least enough information (Like a schematic diagram of your circuit) to show how you connected all of the ... | Bipolar transistors act as <em>current amplifiers</em>. Inject a small current into the Base, and you can extract a proportionally larger current from the Collector. But how much current does your motor need, and how much Base current is required to get it?
The behavior of your motor indicates that it is <em>not</em> ... | https://electronics.stackexchange.com |
3,513,383 | [
"https://math.stackexchange.com/questions/3513383",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/741843/"
] | I have several doubts about this exercise because one of the conditions a function must have to be Riemann integrable is to be continuous in that interval, condition <span class="math-container">$\lfloor x\rfloor$</span> does not meet. How is this exercise done? Or what does the approach have to be?
Prove that <span ... | Monotone functions are integrable! To calculate the integral, integrate over [j,j+1] for j=0,1,2,3,4 and add.
| Hint: try to prove (or find a prove in your textbook) that a function is Riemann integrable if it has only finitely many discontinuities in the interval of integration.
More generally, a function is Riemann integrable if it has countable many discontinuities. You might also want to try to find a prove for this.
| https://math.stackexchange.com |
28,126 | [
"https://cs.stackexchange.com/questions/28126",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/19799/"
] | I'm confused as to why the MIPS designers would include 5 bits dedicated to shifting and have separate opcode and function bits.
Because MIPS is so RISC I assume that only shifting would be done in a few instructions, so those 5 bits seem like they're wasting space when they could be put in the immediate. I assume that... | There are a few different trade-offs going on here.
First, we want the instructions to be fixed width (32-bits). This guarantees that instructions are cache-block and page aligned which simplifies cache and page presence and permission checks.
Second we want the various instruction fields (<code>opcode</code>/<code>... | To understand the MIPS I instruction formats, you need to understand the MIPS pipeline and also think back to CPU implementation technology circa 1985. If you look at the diagram (you know the one), you'll see that register file reading is in the ID stage, right after IF.
For the purpose of an R-type instruction, the ... | https://cs.stackexchange.com |
163,933 | [
"https://physics.stackexchange.com/questions/163933",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/47373/"
] | I want to check if the fundamental representation of $SU(3)$ is irreducible.
The algebra is
$$\mathbb{su}(3) = \{ m \in Mat(3,\mathbb{C} )\ |\ m = -m^+,\ Tr[m] = 0 \}$$
and I've found the generators.
So, I've checked if the algebra is Abelian.
For example, taken the generators $t_1,t_2$ defined as
$$
t_1=
\left( \begi... | As far as I understood this distinction in plasma physics, you refer to weak/strong in terms of your Rayleigh decomposition of fields:<br>
Any field $X = $, $\vec v$,$\rho$,$T$,$\vec B$ can be decomposed into a background part $\bar X$ and a fluctuating part $X'$, while constructing $X'$ thus that the average $\bar{X'}... | A simple way to understand this is as follows.
Every system can be linearized and decomposed into linear eigenmodes. If the system was truly linear, the amplitude and phase of each eigenmode would remain constant, and each eigenmode would evolve dynamically by its corresponding eigenfrequency.
In the weak turbulence ... | https://physics.stackexchange.com |
81,939 | [
"https://softwareengineering.stackexchange.com/questions/81939",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/1338/"
] | I have the following situation. I have a factory method that returns a matrix. This matrix can be calculated at two levels of accuracy: level1 and level2. In order to calculate the matrix, I need to pass a bunch of information to the factory method, and this information is nicely packed in another object Info. Info is ... | I would go with the second option. I would think it's up to the calling function to decide what level it wants, and also if that level is appropriate (it's the caller's responsibility to ensure that if it requests level2, the request can be met with the Info object it gives).
Some pseudo-code of how I'd write it:
<pr... | Definitely #2, because it exposes the behavior to the caller rather than hiding important details.
| https://softwareengineering.stackexchange.com |
733,198 | [
"https://physics.stackexchange.com/questions/733198",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/289963/"
] | On page 183 of Peskin and Schroeder, we have the following scattering cross section
<span class="math-container">$$\tag{6.23}d\sigma(p\rightarrow p'+\gamma)=d\sigma(p\rightarrow p')\cdot \int\,\frac{d^3k}{(2\pi)^3}\frac{1}{2k}\sum_{\lambda=1,2}e^2\bigg|\frac{p'\cdot\epsilon^{(\lambda)}}{p'\cdot k}-\frac{p\cdot\epsilon^... | I will try to give some answers and I hope they are satisfactory.
With the label <span class="math-container">$k$</span> in the factor <span class="math-container">$\frac{1}{2k}$</span>, I think that the authors refer to the magnitude of the three-momentum <span class="math-container">$\textbf{k}$</span>. I think the r... | I think when he write (6.23) he is referring / using idea of (6.19), where he insert <span class="math-container">$k$</span> inside (6.18), he said <span class="math-container">$k$</span> is energy, while the integration variable <span class="math-container">$k$</span> is 3vector.
| https://physics.stackexchange.com |
149,197 | [
"https://softwareengineering.stackexchange.com/questions/149197",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/34865/"
] | Part of our ERP system is a sub-system for running background jobs. We track a variety of meta-data about our jobs in a table including timestamps for submitted, started, and end times.
I'm creating a report showing the performance of our job system, detailed by day. One KPI is maximum # of jobs running at once. The... | <ol>
<li>Include all the start and end points (in time) of the Jobs in an array (this creates 2*N elements (1 for start 1 for end))</li>
<li>sort the array ordering by the timestamp of the event,</li>
<li>then iterate over the (2*N) elements as follows:
<pre><code>for each element X
do
if(X.type == start)
cou... | SQL knows how to sort stuff, and I'd bet your engine uses the most efficient algorithm it can (i.e. <code>O(n log(n))</code>), while still working if the result set doesn't fit in RAM (in contrast with K.Steff's answer which will fail if the array doesn't fit in RAM). In python :
<pre><code>import sqlite3
connection =... | https://softwareengineering.stackexchange.com |
59,226 | [
"https://security.stackexchange.com/questions/59226",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/13763/"
] | My boss proposed me to code from home on the their machines via internet, in two possible ways:
<ol>
<li>I would connect to their computer and work on their machine, as if I was in front of the computer(from what he said the method used in this case would not be a VNC but something different)</li>
<li>Via SVN</li>
</o... | Fairly Safe for most purposes.
<strong>For a remote desktop tool like VNC, Citrix or Remote Desktop</strong>
These tools are more or less constrained to the graphical window on your box, they might be able to access your copy/paste buffer.
<strong>For a VPN Tool</strong>
These have the ability to, but probably woul... | Use GoToMyPC or TeamViewer or something similar, and you'll have an encrypted link, with none of your home network traffic visible to anyone at your work network. These tools are designed to do exactly what you want.
| https://security.stackexchange.com |
149,376 | [
"https://electronics.stackexchange.com/questions/149376",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/51675/"
] | I assume running an IC at one voltage (3.3v), and having the (digital) signal input be at a different voltage (5v) is fine. If both of these voltages are within the operating range of the chip, am I right in my assumptions?
Is this chip-dependent?
| No, this is not fine. Some inputs have protection diodes which are purposely integrated to prevent the thing you're about to do. In such event current flows from the input source to the Vcc of the circuit. If your input source has a low internal resistance, it's a straight short circuit, which most of the time triggers... | If the 3.3V chip is "5V tolerant" for the specific inputs you are using it may be okay. If it doesn't say that it is, it probably isn't. Another hint is the maximum input voltage specification. If Vdd is 3.3V and absolute maximum input voltage for the input in question is Vdd + 0.3V, then 5V would be a problem.
Going... | https://electronics.stackexchange.com |
169,711 | [
"https://security.stackexchange.com/questions/169711",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/149676/"
] | While discussing maximum password lengths, a poster made this comment:
<blockquote>
The longer the allowed input, the easier to supply an input that could
cause a hash collision
</blockquote>
To explain (since the lack of context might make the statement unclear), the poster is stating that it is easier to find a... | <blockquote>
What pieces of the puzzle am I missing? Does the ease of finding a collision depend on input length?
</blockquote>
For finding a collision it is not relevant how long a string is (apart from the time needed to compute the hash - which is actually longer for long strings) but how many different strings y... | I think the poster of the comment was referring to the following:
As the size of the input space (all possible input strings) increases, the probability to find a collision when exhausting the space increases and eventually reaches 100% when input space size is larger than size of all possible hash values.
<strong>Ex... | https://security.stackexchange.com |
109,567 | [
"https://mathoverflow.net/questions/109567",
"https://mathoverflow.net",
"https://mathoverflow.net/users/18420/"
] | I am trying to find some literature on infinite matrices because I want to know how to get the eigenvalues of infinite matrices. Seriously, it seems there are very few references available. Can someone tell me how to determine the spectrum of infinite matrices?
| One simple example with a special matrix, which has somehow "a continuum" as eigenvalue...<br>
Consider some function $ f(x) = K + ax + bx^2 + cx^3 + ... $ having a nonzero radius of convergence. Then think of the infinite matrix of the form
$$ \small \begin{bmatrix}
K & . & . & . & \cdots \\\
a... | to present an example: if the considered matrix is the adjacency matrix of a graph, there are relatively involved graph theoretical criteria <em>just</em> to decide whether the spectral radius is an eigenvalue, let alone further spectral values. i think you should make yourself clearer what exactly you would like to kn... | https://mathoverflow.net |
23,449 | [
"https://electronics.stackexchange.com/questions/23449",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/5780/"
] | According to wikipedia the only SI fundamental unit for Matters Electrickal is the ampere. Don't you at least need the ohm to derive anything? How would you make volts from only amps?
Perhaps I misunderstand the meaning of "fundamental unit".
| Ultimately, all SI units must be traceable to Mass, Length and Time. The <em>current</em> definition of the Ampere is:
<strong>The constant current which will produce an attractive force of 2 × 10–7 newtons per metre of length between two straight, parallel conductors of infinite length and negligible circular cross s... | Volt is defined as Work done for unit charge. Charge can be derived from product of current and time. So volt can be expressed in terms of mass, distance, time and current.
Now for ohms, it can be defined as the ratio of voltage and current. So it can also be expressed in terms of mass, distance, time and current.
... | https://electronics.stackexchange.com |
8,494 | [
"https://mathoverflow.net/questions/8494",
"https://mathoverflow.net",
"https://mathoverflow.net/users/675/"
] | Maybe this is a silly question (or not even a question), but I was wondering whether the cotangent bundle of a submanifold is somehow <strong>canonically</strong> related to the cotangent bundle of the ambient space.
To be more precise:<br>
Let $N$ be a manifold and $\iota:M \hookrightarrow N$ be an embedded (immersed... | It is possible to see the cotangent bundle of the submanifold as a kind of symplectic reduction of the cotangent bundle of the ambient manifold. I think it might be enough to explain the analogous fact from linear algebra.
Let V be a vector space and U a subspace. There is a natural symplectic form $\omega_V$ on $V^*\... | Here is an attempt.
Let $X$ be a submanifold of $Y$, and let $i : X \to Y$ be the inclusion. In general, we have the exact sequence of vector bundles $$ 0 \to N^\ast X \to i^\ast T^\ast Y \to T^\ast X \to 0$$
where $N^\ast X$ is the conormal bundle of $X$ in $Y$. The epi $i^\ast T^\ast Y \to T^\ast X$ in this sequence... | https://mathoverflow.net |
57,120 | [
"https://mathoverflow.net/questions/57120",
"https://mathoverflow.net",
"https://mathoverflow.net/users/10466/"
] | Does anyone have an example of two spaces which have the same homology groups, the same cohomology groups, but have different cohomology rings?
is it possible?
| A very standard example would be $S^2\vee S^4$ and $\mathbf{C}P^2$.
| There are also standard examples in which both spaces are compact manifolds. For instance, if $n \geq 1$ is an integer and $Q_n \subset \mathbb{P}^{2n+2}$ is a non-singular quadric, then $Q_n$ has the same integral homology and cohomology groups as $\mathbb{P}^{2n+1}$, but the cohomology rings are different.
| https://mathoverflow.net |
70,348 | [
"https://stats.stackexchange.com/questions/70348",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/30308/"
] | I am going through some more exam practice questions for my stats class - Here is the complete question, it has two parts:
<blockquote>
Let <span class="math-container">$X$</span> be a continuous random variable with known probability density function (pdf) <span class="math-container">$f_X(x)$</span> for <span class="... | $$
(1) \quad M_X(t) = \mathrm{E}\left[e^{tX}\right] = \int_{-\infty}^\infty e^{tx} f_X(x)\,dx \quad
$$
$$
(2) \quad M'_X(t) = \frac{d}{dt} \int_{-\infty}^\infty e^{tx} f_X(x)\,dx = \int_{-\infty}^\infty \frac{d}{dt} e^{tx} f_X(x)\,dx = \int_{-\infty}^\infty x\,e^{tx} f_X(x)\,dx
$$
$$
M'_X(0) = \int_{-\infty}^\in... | You have an error:
$$Ee^{pX}=\int_{-\infty}^{\infty}e^{px}f_X(x)dx$$
Note the limits of integration, you had them wrong. This way you can differentiate under integral. Of course there are conditions, when you can do this exactly, but you can assume that they are met.
The fact that you are integrating over infinite ... | https://stats.stackexchange.com |
64,934 | [
"https://security.stackexchange.com/questions/64934",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/53497/"
] | Please if you cant answer this question, don't down vote it and the let others to discuss their opinions instead of closing it.
Yesterday I watched a collection of videos at YouTube for people who can hack a car which is parked 200 meter away from them, they can turn the car on/off and even use the benzene pedal or t... | The first thing you need to be able to hack a car is access to it. In most cases, this means physical access to the wires inside the car that interface with the car's internal computer (often via a diagnostics connection either under the hood or inside the car interior.)
However, on a growing number of vehicles, th... | It is certainly possible to hack a car but it very much depends on the complexity, level of connectivity, and architecture of the technology in the car. The same is true for any other embedded technology such as a road sign.
There are two possibilities w.r.t. the car hacks you watched:
<ol>
<li>It's a prank - there's... | https://security.stackexchange.com |
348,057 | [
"https://stats.stackexchange.com/questions/348057",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/188956/"
] | The assumption of symmetricity for signed rank test (and its relevance) is becoming extremely confusing for me. I am hypothesizing that sub-population A (before treatment) and sub-population B (after treatment) come from same population (no effect of treatment). Does my paired difference need to conform to the assumpti... | Although on the surface the two statements above may appear contradictory, they aren't. The Wilcoxon Signed Rank test does require that the <em>paired differences</em> come from a continuous symmetric distribution (under the null hypothesis, as Michael Chernick points out in comments.) In the special case when the tw... | Note that the <em>samples</em> may tell you nothing about the suitability of the assumption that is required for the <em>null</em>. If the null is false, you don't necessarily require symmetry (and it's easy to demonstrate examples where everything works as desired without needing symmetry under the alternative).
Peop... | https://stats.stackexchange.com |
627,459 | [
"https://physics.stackexchange.com/questions/627459",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/127415/"
] | Assume that we have a magnetized spherical shell so that one half of this sphere is pole <span class="math-container">$S$</span> and the other is <span class="math-container">$N$</span>. Whether or not the magnetic field is uniform inside the shell, I want to know if the <em>direction</em> of the field lines are always... | You are missing the property <span class="math-container">${\bf v}\times {\bf v}={\bf 0}$</span> of the vector product. So if <span class="math-container">${\bf r}\to {\bf r}+ {\bf v}t$</span> the angular momentum <span class="math-container">${\bf L} \propto {\bf r}\times {\bf v}$</span>does not change.
| <span class="math-container">$L=\vec{r}\times \vec{v} = rv\sin\theta \times\vec{n}$</span>
(where <span class="math-container">$r$</span> and <span class="math-container">$v$</span> are the magnitudes, <span class="math-container">$\theta$</span> is the angle between <span class="math-container">$\vec{v}$</span> and <s... | https://physics.stackexchange.com |
467,433 | [
"https://physics.stackexchange.com/questions/467433",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/68278/"
] | I will use the below mentioned form of Reynolds Transport theorem(usually derived in Fluid Mechanics context) to give a relation between a Control mass system(no mass in or out) and Control Volume(randomly chosen time varying region of interest). It gives the relation between a chosen region of interest called control ... | Your original transport equation is based on a closed system. In this system the velocity of the system boundary and the velocity of the material at the system are always identical.
When you transition to the Eulerian/open system perspective via the RTT, you need to worry about the fact that there are (in general) <... | In the open system (control volume) version of the first law of thermodynamics, the rate of doing work is split into two separate parts: 1. Work associated with pushing fluid into and out of the control volume by fluid behind at the inlet and fluid ahead at the outlet acting like pistons and 2. All other work, called... | https://physics.stackexchange.com |
85,874 | [
"https://dba.stackexchange.com/questions/85874",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/50510/"
] | How to List all MS SQL Server Providers List available using SQL.
like
Microsoft.ACE.OLEDB.12.0
Microsoft.Jet.OLEDB.4.0
SQLXMLOLEDB.4.0
SQLXMLOLEDB
SQLOLEDB
| Executing the stored procedure <code>sp_MSset_oledb_prop</code> without parameters will return a table of the available providers and their options:
<pre><code>EXEC sp_MSset_oledb_prop
</code></pre>
| If you need to access it using code, try this (which is contained within the other procedure):
<pre><code>IF OBJECT_ID('tempdb..#providers') IS NOT NULL DROP TABLE #providers;
CREATE TABLE #providers ([name] NVARCHAR(100), [guid] NVARCHAR(100) NULL, [description] NVARCHAR(100) NULL);
INSERT INTO #providers EXEC sys.sp_... | https://dba.stackexchange.com |
568,449 | [
"https://physics.stackexchange.com/questions/568449",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/259671/"
] | Is current a tensor or a scalar quantity? The internet seems to be divided on this one. Tensors are too complicated. So I am unable to find an answer. Can someone please clearly state whether it is a scalar or a vector?
| Think about what the electric potential at a point means. It is the amount of work done in bringing a unit positive charge from infinity to that point without acceleration. A potential of <span class="math-container">$0$</span> means that you do <em>net zero work</em> in doing so. This emphatically <em>does not</em> me... | The potential being zero at a point is irrelevant. What really matters is the potential difference between two points, that is, suppose you have two points A and B separated by a distance of <span class="math-container">$\Delta r$</span>, and the potential of B is greater than A by <span class="math-container">$ \Delt... | https://physics.stackexchange.com |
21,896 | [
"https://scicomp.stackexchange.com/questions/21896",
"https://scicomp.stackexchange.com",
"https://scicomp.stackexchange.com/users/19011/"
] | Suppose we have an optimization problem
$$ \mathbf{x} = (x_1, x_2, \ldots, x_m) = \arg\!\min_{\mathbf{x}\in \mathbb{R}^m}f(\mathbf{x})$$
and a second related problem:
$$ \mathbf{y} = (y_1, y_2, \ldots, y_n) = \arg\!\min_{\mathbf{y}\in \mathbb{R}^n}g(\mathbf{y})$$
because we have the relations
$$ \mathbf{x} = \mathbf{t... | Generally speaking, adding a single variable to a continuous optimization problem does not drastically decrease algorithm performance. These sorts of manipulations happen routinely to transform apparently "difficult" problems into "easy ones"; examples are things like smooth reformulations of max functions or absolute ... | Depending of your problem, adding more variables can make the problem extremely easy to solve. All will depend of the structure of your problem.
For instance, LP problems are solved using a LU decomposition of the constraint matrix. If the decomposition is easy, the problem will be fast to solve.
Example for a sum. Y... | https://scicomp.stackexchange.com |
1,553,085 | [
"https://math.stackexchange.com/questions/1553085",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/243667/"
] | Let $(X, \Sigma, \mu )$ be a measure space. If $f: X \rightarrow \bar{\mathbb R}$ is measurable and $\int |f| \, d \mu < \infty$, then:
<ul>
<li>for any $a>0$, the set $\{x \in X : |f(x)|>a \}$ has finite measure</li>
<li>the set $\{x \in X: f(x) \neq 0\}$ has $\sigma$-finite measure, i.e. is a countable unio... | $1)$ Assume that the set $A = \{ x \in X : |f(x)| > a \}$ has infinite measure, then we have
$$\int_X|f| \mathrm{d}\mu = \int_A|f|\mathrm{d}\mu + \int_{A^c}|f|\mathrm{d}\mu \geq \int_A |f|\mathrm{d}\mu \geq a\cdot\mu(A) = \infty$$
which is contradiction to our hypothesis that $f$ is integrable.
$2)$ See the answer ... | Ok, Nigel got part $1$. For part $2$,
$\{x \mid f(x) \neq 0\} = \{ x \mid |f(x)| \neq 0 \} = \bigcup \limits_{n = 1}^{\infty} \{x \mid |f(x)| > \frac{1}{n} \}$. Of course, you should prove that these two sets are equal, but once you do, each of the sets in the union has finite measure by part $1$, and thus the se... | https://math.stackexchange.com |
73,719 | [
"https://mathoverflow.net/questions/73719",
"https://mathoverflow.net",
"https://mathoverflow.net/users/936/"
] | This is a topological question that came up tangentially to some material I was working on. Suppose $X$ and $Y$ are complete metric spaces and $D$ is a dense subset of $X$. Let $f:D\mapsto Y$ be a continuous injection. Extend $f$ to a function $g:X\mapsto Y$ by continuity. Must $g$ be injective? It seems to me that the... | Map the open unit interval to a circle minus a point, and then extend it to the closed interval.
| Joel has completely answered the question, but let me add another example, with a bigger failure of injectivity of $g$. Let $D$ be the set of points in the plane of the form $(\frac1n,\sin n)$ for positive integers $n$. Its closure consists of $D$ plus the segment $S=\{0\}\times[-1,1]$ on the $y$-axis. The projectio... | https://mathoverflow.net |
282,770 | [
"https://physics.stackexchange.com/questions/282770",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/131422/"
] | For instance, a typical Nichrome alloy has a resistance of $1.0 \times 10^{-6} \Omega \cdot m$, which is much higher than that of pure Nickel ($7 \times 10^{-8} \Omega \cdot m$) or Chrome ($1 \times 10^{-7} \Omega \cdot m$).
| A perfect crystal lattice of ions at very low temperatures would offer very little impediment to the free electrons i.e. it would have a very low resistance.<br>
Add some imperfections like making the lattice ions vibrate as a result of them being at a higher temperature will result in more interaction between the fre... | The higher resistivity in alloys as compared to the constituents is caused by an additional scattering mechanism of the electrons called "alloy scattering". The reason for this is that the atomic ions of the different constituents in an alloy are, in general, not periodically arranged in the crystal lattice but their r... | https://physics.stackexchange.com |
380,692 | [
"https://softwareengineering.stackexchange.com/questions/380692",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/80034/"
] | I have some older xsl transformations that I will modify soon. They generated XHTML code from a home-grown XML format. Since I am touching these XSL files anyway, I am wondering how I will deal with HTML 5 not being XML anymore.
I guess it won't be terrible if I still generate HTML (the browsers will still display it)... | <blockquote>
I am wondering how I will deal with HTML 5 not being XML anymore.
</blockquote>
HTML5, unlike its predecessors, is defined as an abstract document, with three different concrete representations (note, however, that it is not guaranteed that every representation can express every possible abstract docume... | If you can move forward to XSLT 3.0, then you can simply say <code><xsl:output method="html" version="5"/></code> to generate HTML5.
| https://softwareengineering.stackexchange.com |
262,392 | [
"https://mathoverflow.net/questions/262392",
"https://mathoverflow.net",
"https://mathoverflow.net/users/66131/"
] | Let $x$ be an indeterminate and $n$ a non-negative integer.
<blockquote>
<strong>Question.</strong> The following seems to be true. Is it?
$$x\prod_{k=1}^n(k^2-x^2)=\frac1{4^n}\sum_{m=0}^n\binom{n-x}m\binom{n+x}{n-m}(x+2m-n)^{2n+1}.\tag1$$
</blockquote>
The problem came out of simplifying some work which reduced... | It is sufficient to prove that the two sides agree when $x = n + \ell$ for $\ell \in \mathbb{N}$. As $k$ varies, the first term in $\prod_{k=1}^n (k-n-\ell)(k+n+\ell)$ contributes
$$-\ell(-\ell-1) \ldots (-\ell-n+1) = (-1)^n (\ell+n-1)\ldots (\ell+1)\ell$$
and the second term contributes $(n+\ell+1)\ldots (2n+\ell)... | Here is an argument for the leading coefficient (and more).
We use (formal) generating functions.
Let <span class="math-container">$f_{n,x}(t):= \sum_{m=0}^n {n-x \choose m } {n+x \choose n-m} e^{(x+2m-n)t}$</span>, we are interested
in the polynomial <span class="math-container">$q_n(x)=\frac{(2n+1)!}{4^n}\;[t^{2n+1}... | https://mathoverflow.net |
16,535 | [
"https://quantumcomputing.stackexchange.com/questions/16535",
"https://quantumcomputing.stackexchange.com",
"https://quantumcomputing.stackexchange.com/users/5787/"
] | <strong>Value</strong> of a qubit and its <strong>state</strong> - is there any difference between these two terms in sense of terminology?
For example, can we name this state of a qubit also a value of a qubit:
<span class="math-container">$$
|\psi\rangle = \frac{1}{\sqrt{2}} |0\rangle + \frac{1}{\sqrt{2}} |1\rangle
$... | For the <span class="math-container">$|\psi\rangle$</span> in your question, please call it a "state", not "value". The word "value" is not "mainstream" or popular in this context.
| I'm not aware of any widespread technical distinction between the "value" and "state" of qubits. I'd expect any paper or textbook or presentation using such a distinction to define its terms before expecting them to be understood in different ways.
| https://quantumcomputing.stackexchange.com |
128,265 | [
"https://math.stackexchange.com/questions/128265",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/28012/"
] | given two elements $r$,$s$ in a ring $R$, are the following two notations equivalent?
<ul>
<li>$(r,s)$</li>
<li>$(r)+(s)$</li>
</ul>
For example, in the ring $\mathbb{Z}[X]$, is $(2,X)=(2)+(X)$?
Thanks a lot.
| Assuming you mean $R$ to be commutative or ideal to be two-sided:
Yes, it is: by the definition, $(r,s)=\{rx+sy|x,y\in R\}$.<br>
On the other hand, $(r)+(s)=\{ax+by|a\in(r),b\in(s),x,y\in R\}$, which is the same since $a\in(r)$ implies that $a=r\alpha$.
| By definition, $(r,s)$ is the smallest ideal containing both $r$ and $s$.
By definition, $(r)+(s)$ is the sum of the ideals generated by $r$ and $s$.
That these two are equal is actually an easy theorem.
More generally, if $A$ and $B$ are subsets of $R$ then $(A,B)$ or $\langle A,B\rangle$ denotes the smallest ideal... | https://math.stackexchange.com |
1,192,770 | [
"https://math.stackexchange.com/questions/1192770",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/191488/"
] | <blockquote>
Define $$ E(\theta,k) = \int_0^\theta \sqrt{1-k^2\sin{^2{x}}} dx$$ and $$F(\theta,k) = \int_0^\theta \frac{1}{\sqrt{1-k^2\sin{^2{x}}}} dx$$ We are to show $$\left(\frac{\partial E}{\partial k}\right)_\theta = \frac{E-F}{k} $$
</blockquote>
Am I right in thinking: $$\left(\frac{\partial E}{\partial k}\ri... | Use your first lethal weapon (i.e adding and subtracting one):
$$
\begin{aligned}
\frac{d}{dk}\sqrt{1-k^2\sin^2x}&=-\frac{k\sin^2x}{\sqrt{1-k^2\sin^2x}}\\
&=\frac{1}{k}\frac{1-k^2\sin^2x-1}{\sqrt{1-k^2\sin^2x}}\\
&=\frac{1}{k}\biggl(\sqrt{1-k^2\sin^2x}-\frac{1}{\sqrt{1-k^2\sin^2x}}\biggr)
\end{aligned}
$$
| Starting from your correct assumption
$$\left(\frac{\partial E}{\partial k}\right)_\theta =\int_0^\theta \frac{\partial}{\partial k}\sqrt{1-k^2\sin{^2{x}}}\ dx$$
the differential, however, evaluates to
$$\begin{align}\left(\frac{\partial E}{\partial k}\right)_\theta &=\int_0^\theta \frac{-k\sin^2\theta}{\sqrt{1-k^2... | https://math.stackexchange.com |
157,657 | [
"https://stats.stackexchange.com/questions/157657",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/80118/"
] | I am having trouble comprehending the log-likelihood of a multivariate normal distribution.
For an n-dimensional vector $\mathbf{r}$ of N i.i.d. data points $\mathbf{r}=(r_1,...,r_N)$, the log-likelihood of the Gaussian pdf should be
$$
-2 \ln L = \mathbf{r}^{T} C^{-1} \mathbf{r} + \ln\det C + N\ln(2\pi)
$$
where ... | Might be easier to interpret if you think of $r$ as
$$
r = (x - \mu)
$$
where mu is a fixed vector and $x$ is a vector for which you are asking the question, "how likely is $x$, given a fixed $\mu$ (and $C$)?"
For example, if you label some pixels (vectors in 3D) in a picture as being skin or not-skin, then you c... | The log likelihood is a function of $C$, which is the parameter that you're estimating.
| https://stats.stackexchange.com |
234,361 | [
"https://security.stackexchange.com/questions/234361",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/99202/"
] | Users have the possibility to upload a sensitive personal file to a specific website. After uploading, only the user himself and the administrator of the website have the ability to download the file again.
All files of any user are uploaded to the following folder:
<code>https://example.com/folder/uploads/</code>.
Bef... | Under the following assumptions, the approach is safe:<br/>
<ul>
<li>the 15-byte prefix is truly random</li>
<li>the character set of the prefix consists of numbers and the characters a to z. (given the file name examples that O'Niel provided).</li>
</ul>
In practical terms, the file name cannot be guessed or bruteforc... | Since you know user name:
<ol>
<li>Using of random symbols during upload is not necessary. Just check that file name matches user name.</li>
<li>Same for download: On the server side check that user name and file name match.</li>
<li>User name is determined during login. One user cannot use name of other user, and thus... | https://security.stackexchange.com |
135,737 | [
"https://softwareengineering.stackexchange.com/questions/135737",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/47546/"
] | I'm a beginner in programming and I've been reading books, studying, reading articles, and whatnot. I'm getting great results since I've started learning programming, and when I was a beginner I used to think I knew everything about programming, but as I learned more I realized how difficult this field is (In fact all ... | <strong>Short answer: no.</strong>
<strong>Long answer:</strong>
Reading code of other people becomes easier, yes. But only reading. <strong>As you gain experience and skills, your personal requirements as a developer grow.</strong>
<ul>
<li>You don't want to just write code. You want to write <strong>beautiful code... | Short answer, Yes.
Given time and exposure these things become easier to comprehend.
Remember when you are looking at sites from the dev tools in your browser they are often generated by a framework. Let that be any number of things...ASP.NET, JSP, RoR, Django,...who knows. Some of these frameworks produce cleaner ... | https://softwareengineering.stackexchange.com |
104,315 | [
"https://dba.stackexchange.com/questions/104315",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/68727/"
] | Our web server uses SQL Server 2008 R2. I have one development machine that connects to it with the IP address through SSMS and when testing my aspx website. I have several other machines though that can't connect to the IP through SSMS. I'm getting this error:
<blockquote>
A Network-related or instance-specific err... | Here are some of the things from my connection issue checklist
<ul>
<li>Check for an alias on the machine that can't connect</li>
<li>Check for firewall rules</li>
<li>Check and make sure the SQL Server drivers on the machines that don't work are up to date.</li>
<li>Try connecting with servername:port rather than jus... | Turns out that our GoDaddy dedicated server had a Cisco hardware firewall that had one IP permitted for TCP port 1433. My VM was on the network that had that IP, while my other machine was not. After spending several hours trying to get the Cisco ASDM software to launch properly, I was able to add the IP address of m... | https://dba.stackexchange.com |
382,389 | [
"https://softwareengineering.stackexchange.com/questions/382389",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/22742/"
] | I'm developing a set of classes designed to communicate with external APIs, and I'm running into trouble with how to properly structure everything for proper loose coupling and unit testing.
Currently, each API we need to talk to has a distinct class, which implements an interface a bit like this:
<pre><code>public i... | Generally you have two axes for bugs: gravity and frequency.
So obviously something grave and frequent is of the highest priority. However, something that's serious but happens rarely should be weighed roughly at the same as something that's not serious but happens often. So supposing you rate gravity from 1 to 3 a... | This really boils down to what you consider to be more important. The P2 bug or the new feature?
Usually an agile project management system will include some sort of prioritisation meeting where tasks are ordered by priority and worked on in that order.
Developers are not allowed to choose the tasks they work on. Tha... | https://softwareengineering.stackexchange.com |
161,845 | [
"https://electronics.stackexchange.com/questions/161845",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/70497/"
] | I have a sinusoidal input beginning at time (t = 0).
\begin{equation}
x(t) = e^{j \omega_0 t} \cdot u(t).
\end{equation}
The Laplace transform of my input is:
\begin{equation}
X(s) = \dfrac{1}{s - j \omega_0}.
\end{equation}
The Laplace transform of my output is:
\begin{equation}
Y(s) = H(s) \cdot \dfrac{1}{s - j \omeg... | The value of R9 is specified in your list of parts. It's in the same line as R4.
R9 does two things. It, in conjunction with R4, sets the gain of the 2nd stage. It also acts as a low-pass filter in conjunction with C1.
[Edit]
Oops. I goofed. Looking closer at the diagram, I see that I mixed up the (-) & (+)... | R9 and R4 set the DC gain of the 2nd stage. In this case, having R4 = R9 = 100k ohms gives a gain of -1.
R9 and C1 set the cut-off frequency of the low-pass filter formed by the 2nd stage. In this case 100k and 2.2 uF gives about 0.75 Hz.
If you want to adjust R9, you should probably adjust R4 as well to maintain the... | https://electronics.stackexchange.com |
522,120 | [
"https://physics.stackexchange.com/questions/522120",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/173206/"
] | In the Canonical Ensemble, given a quantum system with <span class="math-container">$N$</span> distingishable and non-interacting particles distributed amongst <span class="math-container">$r$</span> energy levels of energy <span class="math-container">$\epsilon _1,\epsilon _2,\epsilon _3,...,\epsilon _r$</span> and de... | When considering a partition function of a system composed of several distinguishable subsystems you <strong>never</strong> add the separate partition functions up, and <strong>always</strong> multiply them.
The reason is that the partition function covers the possible states of a system, and when for a system compos... | Let us take the two-particle case explicitly: for one particle to have energy <span class="math-container">$\epsilon_1$</span> and the other to have energy <span class="math-container">$\epsilon_2$</span>, if they don't interact then the energy is <span class="math-container">$\epsilon_{(1,2)}=\epsilon_1+\epsilon_2$</... | https://physics.stackexchange.com |
472,144 | [
"https://stats.stackexchange.com/questions/472144",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/191643/"
] | I am working on statistical inference with instrumental variables (IV) following Wooldridge (2016) <em>Introductory Econometrics</em>, Ch. 15. I am using the Card data set (like the book), with wages as outcome (<span class="math-container">$y$</span>), education as a endogenous continuous treatment (<span class="math-... | HEre it is an option
<pre><code>use http://pped.org/card.dta, clear
keep nearc4 educ lwage id
rename nearc4 z
rename educ x
rename lwage y
bysort z: sum y x
gen byte one=1
mata:
y=st_data(.,"y")
x=st_data(.,"x one")
z=st_data(.,"z one")
xh=z*invsym(z'*z)*z'*x
bi... | Since this is just identified, the formula is pretty straight forward. Let <span class="math-container">$X$</span> be the matrix of the independent variables, <span class="math-container">$Z$</span> is the matrix of instruments, and <span class="math-container">$e$</span> be vector or errors, then
<span class="math-co... | https://stats.stackexchange.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.