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
70,113
[ "https://mechanics.stackexchange.com/questions/70113", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/46291/" ]
I posted a while back about my brakes being spongy. I've tried a lot of different solutions to no avail. I bought my 07 Mazda 3 around 7 months ago. They told me about the spongy breaks, and said they'd most likely need bleeding (silly me). I bled my brakes from the furthest away from the master cylinder and made my w...
Just thought I'd quickly update you on the situation. Put it simply, it's now fixed. It was indeed the ABS pump, and bought a used one on ebay for 55 dollars and I replaced it at home on my driveway. I've heard I needed to get it re programmed, but, I've drove around for a few days now and it's like new so I'm not goin...
I'm really not sure if I'm allowed to give an update on an oldish thread, but I'll see if I can get away with it. The new ABS pump worked great for a while. However, the brakes slowly started to get soft again to a point where they was back to it's original state. I then had to slam on for a deer, causing them to go b...
https://mechanics.stackexchange.com
664,308
[ "https://physics.stackexchange.com/questions/664308", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/292567/" ]
My initial doubt was if it is easier to <strong>turn</strong> a lawnmower while pushing it or pulling it? I thought that friction would provide a centripetal force (just like when we turn tires) and it more in case of pushing. So it is easier to turn while pushing. Please help me correct this.
It depends on <strong>how</strong> you push/pull the lawnmower specifically. Friction depends on the normal force to the ground. So if you manage to push (pull) by a strictly horizontal force, you will induce a torque, but your additional total normal force component will be zero. The only effect of the torque will be ...
In general it is easier to pull a (four wheeled) lawnmower than to push since you are reducing the normal force with the ground, however for turning, a tangential (downward) force on the handle will lift the front wheels from the ground reducing friction to rolling on the rear wheels.
https://physics.stackexchange.com
137,879
[ "https://electronics.stackexchange.com/questions/137879", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/57920/" ]
I'm attempting to use a TV addiction to help motivate an exercise routine. To do this, I am going to connect an elliptical trainer to the power of a television set (flatscreen). Here is my plan: I measured the power out to the fan on the elliptical at 6.6V (the fan only runs when the elliptical is being actively used)...
You could use RF transformers - each primary connects to each input and the secondaries are all wired in series to produce A+B+C+D as an overall output. What do you next depends on you - you could terminate the combined secondary with 200 ohms and use this into whatever it needs to feed or, you could use a fifth transf...
It's called a power combiner. There are several different types, and the idea is to make sure that all of the connections are properly matched so that you don't get any issues with reflections under normal operation. For example, if you use a BNC tee, then both sources will see a 25 ohm load and a very significant po...
https://electronics.stackexchange.com
9,994
[ "https://dsp.stackexchange.com/questions/9994", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/5067/" ]
I'm reading Schaum's DSP book, and in Fig 1-3 they demonstrate why shifting and reversal are order-dependent, showing a couple of simple systems, 1) delay followed by reversal, and 2) reversal followed by delay. <img src="https://i.stack.imgur.com/gIl4x.jpg" alt="enter image description here"> The equations they pre...
Your counterexample to the book's assertion is confusing between two different uses for $n$. There was a question earlier in which some user (endolith? datageist?) gave an answer containing a detailed description of what exactly this confusion is and how to interpret the results correctly. My cursory search has not fo...
If you take a signal and time reverse it meaning you flip it across n = 0, then the signal [0, 1, 2, 0] where the zeroth term is 1, becomes [2, 1, 0, 0] where the zeroth term is still 1, but the 2 is now to left or at -1. Now if you delay that signal by 1, meaning you add 1 to the locations, then the new signal becomes...
https://dsp.stackexchange.com
4,207,845
[ "https://math.stackexchange.com/questions/4207845", "https://math.stackexchange.com", "https://math.stackexchange.com/users/881209/" ]
I am working through the Algorithm Design Manual. Chapter 2 Problem 2 has us evaluate the return value of a function which consists of three nested loops which can be expressed by the following triply nested summation: <span class="math-container">$$ \sum_{i=1}^{n} \sum_{j=1}^{i} \sum_{k=j}^{i+j} 1 $$</span> I get stuc...
The <em>innermost</em> summation has the form <span class="math-container">$$ \sum_{k=\rm start}^{\rm finish} 1 $$</span> You are counting the value <span class="math-container">$1$</span> starting at <span class="math-container">$k={\rm start}$</span> and ending at <span class="math-container">$k={\rm finish}$</span>,...
<span class="math-container">$\sum_{i=1}^{i=n}\sum_{j=1}^{j=i}\sum_{k=j}^{i+j}=\sum_{i=1}^{i=n}\sum_{j=1}^{j=i}(i+j-j+1)=\sum_{i=1}^{i=n}i(i+1)=\sum_{i=1}^{i=n}i^2+\sum_{i=1}^{i=n}i=\frac{n(n+1)}{2}+\frac{n(n+1)(2n+1)}{6}$</span>
https://math.stackexchange.com
372,232
[ "https://stats.stackexchange.com/questions/372232", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/223811/" ]
I have a long list of independent events. Of these, <span class="math-container">$71\%$</span> are WINS and <span class="math-container">$29\%$</span> of them are LOSSES. I have calculated the probability of losses with this formula : <span class="math-container">\begin{align} 0.29^2 &amp;= P(\text{two losses}) \\ 0.2...
As they are independent events, The probability of any pattern is simply multiplication of events' individual probabilities. So, here pattern is loss, loss, win, loss, loss, loss <span class="math-container">$P = 0.29 * 0.29 * 0.71 * 0.29 * 0.29 * 0.29 $</span>
The easiest way to make sense of this question is to assume you are talking about particular patterns of length <span class="math-container">$k$</span> on the next <span class="math-container">$k$</span> trials. Then, the probability of <span class="math-container">$A = \{LL \text{ on next } 2\}$</span> has <span clas...
https://stats.stackexchange.com
202,323
[ "https://mathoverflow.net/questions/202323", "https://mathoverflow.net", "https://mathoverflow.net/users/70295/" ]
Similarly to the decomposition $L_2(\mathbb R^n) = L_2(\mathbb{R})^{\otimes n}$ as vector spaces (and even as Hilbert spaces) , do we have $bm(\mathbb{R^n}) = bm(\mathbb{R})^{\otimes n}$ where $bm(\mathbb{R})$ refers to the space of borel measures over the reals? The reason I was thinking of this decomposition is bec...
My answer is more a plan than a real answer. It aims to not close too early by a brutal "no-go" algebraic statement. Of course, if you ask for finite (i.e. algebraic) tensor product this is not true. If you are thinking of completed tensor products, then, I think yes. Of course, in order to have the <em>completed te...
This won't work. You can't approximate the restriction $\rho$ of one-dimensional Hausdorff measure to $\{(x,x): 0\le x\le 1\}$, say, in total variation norm by a finite linear combination $\sum c_j \mu_j\otimes\nu_j$. No matter what you do ($\mu_j,\nu_j$ continuous, or with a point part), $\mu\otimes\nu$ and $\rho$ wil...
https://mathoverflow.net
19,199
[ "https://softwareengineering.stackexchange.com/questions/19199", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7284/" ]
I'll use C# as an example, but it should apply globally. Say I have a string value that should be one of a few constants, but I also want the client to set which string value to use so: <pre><code>private int foo; private string bar; public int Foo { get { return foo; } set { foo = value; ...
It's perfectly valid OO technique, though I think it can be made a bit more efficient if the lazy-loading (which is what this effectively is) is deferred until the <code>Bar</code> value is actually needed. <pre><code>private int foo; private string bar; public int Foo { get { return foo; } set { ...
Well, it is similar in a way to Lazy Loading, but it's not exactly that. At first glance, it actually seems a tad dangerous, in that setting a property has side effects. I believe that's generally frowned upon, but this is hardly an egregious violation.
https://softwareengineering.stackexchange.com
12,631
[ "https://mechanics.stackexchange.com/questions/12631", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/7158/" ]
I have a 2006 Honda Odyssey (Japanese Imported). I am located in New Zealand. Normally you would remove the strut by loosening the c-clip and easily snap the strut off. But my struts do not have c-clips. What would be the best way to remove them, so that I can replace them with new ones? <img src="https://i.stack.im...
I contacted the official Honda dealer in New Zealand. They confirmed that I need to replace the entire assembly, rather than just the arm alone. They are not the "pop out" variety. The cost is NZD305 EACH, rather expensive. I contacted a local mechanic who said the same thing: need to replace whole assembly. He got a ...
They simply pop off. Gently pry them off, the spring holding it on the ball is internal. <strong>EDIT:</strong> (Adding some descriptive pics for Larry) Place a large flat tip screwdriver where the red arrow is at. <img src="https://i.stack.imgur.com/mnClJ.jpg" alt="enter image description here"> In the image below...
https://mechanics.stackexchange.com
80,803
[ "https://electronics.stackexchange.com/questions/80803", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/28263/" ]
I want to use Power over Ethernet (48V, 30W best case) to power something that's going to require up to 15W at 10V. That means I need to step down the PoE voltage but step UP the max current. As I understand it, a buck converter will have the input current off part of the time, so I would lose potential power. A linear...
First, it's absolutely expected that the output current and input current (averaged over a switching cycle) are not equal in a switching converter. If the currents were equal, the efficiency couldn't be any better than a linear regulator's. Now, let's look at a simple buck regulator: <img src="https://i.stack.imgur.c...
<blockquote> As I understand it, a buck converter will have the input current off part of the time, so I would lose potential power. </blockquote> Not really. Most fixed-frequency PWM-controlled switch mode power supplies (like a buck converter) use an inductor as an energy storage device. The field stored in the in...
https://electronics.stackexchange.com
60,299
[ "https://physics.stackexchange.com/questions/60299", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/7596/" ]
In my class, there is no distinction made between, $$ C_{ab}{}^{b} $$ and $$ C^{b}{}_{ab}. $$ All I know, and read about so far, is the distinction of covariant and contravariant, form/vector, etc. etc. But what is this slanted business all about?
An easy way to see that they are distinct is to consider what happens upon raising (or lowering) all indices. For example, upon lowering, $$ T_{ab}{}^{cde} $$ becomes $T_{abcde}$, whereas $$ T_{a}{}^{cd}{}_{b}{}^{e} $$ becomes $T_{acdbe}$, and similarly $$ T_{a}{}^{cde}{}_{b} $$ becomes $$ T_{acdeb}. $$ You need to "...
Each of the indices in a tensor have a particular left-right ordering. This ordering cannot be changed unless the tensor has some particular symmetry that permits it (or rather, that equates different components on interchange). The up-down positions of indices tells us about whether the index is associated with usin...
https://physics.stackexchange.com
172,699
[ "https://stats.stackexchange.com/questions/172699", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/70136/" ]
Is there a smart way to formulate the following as one matrix multiplication, $$\sum_{i=1}^nh_i \sum_{k=1}^KH_{ik} p_{ik}$$ as something like $\mathbf{h*(H*p)}$? The only way I can think of is to augment $\mathbf{H}$ and $\mathbf{p}$ with 0 to be n-by-nK, nK-by-nK matrices respectively.
Also if you define $*$ as coordinate-wise multiplication, and $\mathbf{1_k}$ as the $k$ dimension column vector, $$ \mathbf{ h^T (H * p) 1_k } $$ does the trick. And it should be fewer operations.
If $\mathbf{H}$ and $\mathbf{p}$ are $n\times K$ matrices and $\mathbf{h}$ is $n\times 1$ vector then you write this product as $$\mathbf{h}^T\mathrm{diag}(\mathbf{H}\mathbf{p}^T)$$ where $\mathrm{diag}$ is the operator which takes a matrix and returns its main diagonal as a vector.
https://stats.stackexchange.com
494,432
[ "https://stats.stackexchange.com/questions/494432", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/270780/" ]
I want to determine whether or not I get the same regression results when doing regression of <span class="math-container">$x$</span> on <span class="math-container">$y$</span> and of <span class="math-container">$y$</span> on <span class="math-container">$x$</span>. Using R's built in lm function I get the following r...
In the case of a simple linear regression: <span class="math-container">$$y = \alpha + \beta x + \epsilon$$</span> Beta can be estimated via <span class="math-container">$\beta = \frac{\text{Cov}(x,y)}{\text{Var}(x)}$</span>. And so if we flip x and y, the covariance stays the same, it is only the denominator part for ...
It depends on your loss function. A common way is to minimalize the residual sum of squares (case <span class="math-container">$y \sim x$</span>): <span class="math-container">$$ \sum_{i=1}^n (y_i - \alpha - \beta x_i)^2 \rightarrow min$$</span> This is what your function in R does. It takes into consideration only the...
https://stats.stackexchange.com
143,633
[ "https://softwareengineering.stackexchange.com/questions/143633", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/35414/" ]
I've got an SVN repository of a PHP site and the last programmer didn't use source control properly. As a result, only code since I started working here is in the Repo. I have a bunch of old copies of the full code base saved in <em>files</em> as "backups" but they're not in source control. I don't know why most of t...
If you have reasonable timestamps on each of these working versions then perhaps you can check them in one at a time until you get to the most recent version of the codebase, your latest changes. The problem with the Tag approach like everybody else suggests is that you will lose changeset history on each file and thi...
I would use a separate dir, something like "legacy" to have all the necessary Stuff in one Place.
https://softwareengineering.stackexchange.com
151,038
[ "https://mathoverflow.net/questions/151038", "https://mathoverflow.net", "https://mathoverflow.net/users/29730/" ]
Let $X, Y$ be varieties over $\mathbb{C}$, and the topology I am talking about is the Eucliden topology. I am not sure if the following two results are true, and where can I find the references: (1) If $X,Y$ are birational then they have the same fundamental group. (2) If $X$ is contractible (or maybe simply connect...
(1) is not correct unless you assume your varieties to be smooth and projective; for instance $\Bbb{P}^1$ with 2 points identified is not simply connected. In the smooth projective case it is true, see SGA 1. In (2), I assume you are talking about <em>topological</em> classification of line bundles. They are classifie...
Usually line bundles are "classified" by $H^2$. By Cartan's Theorem B, for Stein manifolds (therefore smooth affine varieties), holomorphic lines bundles are completely classified by $H^2$.
https://mathoverflow.net
412,596
[ "https://softwareengineering.stackexchange.com/questions/412596", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/369927/" ]
Not almost, but all modern CPUs have multiple cores, yet multithreading isn't really that common. Why to have these cores then? To execute several sequential programs at the same time? Well, when calculations are complex (rendering, compiling), the program is definitely made to use advantage of multiple cores. But for ...
The proliferation of multi-core CPUs is predominantly driven by supply, not by demand. You're right that many programmers don't bother decomposing their systems so that they can profit from multiple threads of execution. Therefore the customer sees a benefit mainly from OS multiprogramming rather than program multi-thr...
<blockquote> Why multithreading isn't everywhere? </blockquote> Because … <blockquote> I understand that multi-threading is hard to implement and has drawbacks if number of threads is less than expected. </blockquote>
https://softwareengineering.stackexchange.com
12,234
[ "https://chemistry.stackexchange.com/questions/12234", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/5423/" ]
I know that $\ce{RCH=NH}$ is an imine. What is it's structure?
<img src="https://i.stack.imgur.com/eOnS8.png" alt="enter image description here"> Here it is one of the isomers.
The general structure of an imine contains a carbon-nitrogen double bound. <img src="https://i.stack.imgur.com/u91Yg.png" alt=""> You can add hydrogen atoms or organic groups instead of $R^1$, $R^2$ or $R^3$. The structure of your formula is: <img src="https://i.stack.imgur.com/RVHqM.png" alt="">
https://chemistry.stackexchange.com
179,759
[ "https://mathoverflow.net/questions/179759", "https://mathoverflow.net", "https://mathoverflow.net/users/36688/" ]
Consider the elliptic PDE <span class="math-container">$$(CR)\;\;\;\;\;\;\begin{cases} U_{xx}=V_{yy}\\U_{yy}=-V_{xx} \end{cases}$$</span> And its consequence <span class="math-container">$$(LAP)\;\;\;\;\;\;U_{xxxx}+U_{yyyy}=0$$</span>. Somehow, these equations are similar to the classical Cauchi Riemann and Lap...
1.If $U$ satisfies LAP then there exists a $V$ such that $(U,V)$ satisfies CR. In fact, $V$ is unique up to the addition of a term of the form $a + bx + cy + d xy$, where $a$, $b$, $c$, and $d$ are constants. This is an elementary consequence of the Frobenius Theorem. 2.You need to specify what you mean by 'algebra...
All linear functions satisfy your CR equations, so it seems fairly natural that they should be included in any related function algebra $A$. But there is no algebra of $C^1$ functions satisfying the CR equations and including a function apart from the algebra of constant functions. (I assume that the algebra is suppose...
https://mathoverflow.net
135,973
[ "https://electronics.stackexchange.com/questions/135973", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/16399/" ]
On a 10MHz ATTiny10, the following code generates the same 40kHz 50% duty PWM on both pins 0 and 1: <pre><code>DDRB = (1 &lt;&lt; PB0) | (1 &lt;&lt; PB1); //Output on PB0 and PB1 TCCR0A = (1 &lt;&lt; COM0A0) | (1 &lt;&lt; COM0B0); //Toggle OC0A and OC0B on compare match TCCR0B = (1 &lt;&lt; CS00) | (1 &lt;&lt; WGM02);...
Use wavegen mode 14, set <code>COM0Ax</code> to 0b10 and <code>COM0Bx</code> to 0b11, and adjust <code>ICR0</code>, <code>OCR0A</code>, and <code>OCR0B</code> to give 40kHz 50% DC.
The best way to get the exact inverted PWM signal is to generate one signal with the MCU pin and then use an external inverter chip to logically invert the signal. A chip like a 74HC04 may be in order.
https://electronics.stackexchange.com
120,097
[ "https://stats.stackexchange.com/questions/120097", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/52898/" ]
I am analyzing a multiply-imputed complex sample survey data using Stata. For normally distributed numerical variables I want to report the mean and standard deviation. However, the Stata command for estimating mean of a multiply-imputed survey data <code>mi estimate: svy: mean [varlist]</code> does give the standard e...
In this context this refers to the fact that the model does not assume any spatial relationships between the features. E.g. for multilayer perceptron, you can permute the pixels and the performance would be the same. This is not the case for convolutional networks, which assume neighbourhood relations.
A function $f$ of a vector argument $x=(x_1, \dots,x_n)$ is permutation invariant if the value of $f$ do not change if we permute the components of $x$, that is, for instance, when $n=3$: $$ f((x_1, x_2, x_3))=f((x_2, x_1,x_3))=f((x_3,x_1,x_2)) $$ and so on.
https://stats.stackexchange.com
443,917
[ "https://softwareengineering.stackexchange.com/questions/443917", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/426827/" ]
I've studied how data transfer with secondary storage(HDD or SSD) works. Would you mind to check that my understanding is correct? File system <ul> <li>block is basic read/write <em>logical</em> unit which is used in file system</li> <li>OS page for memory management is different from block</li> <li>OS page size might ...
Yes, your understanding is correct. Thank goodness we see no mention of cylinder-head-sector, R.I.P.! There is one item I'd like to emphasize. <blockquote> SSD is much faster than HDD because it has no mechanical part like arm </blockquote> True. There are two I/O patterns: random &amp; sequential. Let's look at random...
In principle, a HDD can read or write complete blocks. An SSD can read a block or write to a complete erased block, and it can erase sets of usually 32 or 64 consecutive blocks. The difference in behaviour is usually not handled by the OS but by firmware in the SSD drive. The SSD drive keeps track of where blocks are a...
https://softwareengineering.stackexchange.com
151,648
[ "https://electronics.stackexchange.com/questions/151648", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/65553/" ]
<img src="https://i.stack.imgur.com/TWYFa.png" alt="enter image description here"> I have a question regarding simplifying a circuit of a function below that has 5 logic gates in original. f = (A + B) * (C + D) + (A + B) * (C + D)' + C = (A + B) * ((C + D) + (C + D)') + C = (A + B) * 1 + C Complement = (A + B) + C...
I have always put my PIC 18 bootloaders at the end of program memory. The reason you can't put them at the beginning is that this is where the interrupt vectors also are. Assuming your app uses interrupts, since most do, you don't want the bootloader owning that section of memory. Build the bootloader as a separate ...
Bootloaders by definition need to be called <em>before</em> the regular firmware so they can choose either to run, or immediately pass control on to the main firmware. On most devices this means the bootloader is written at the start address (<code>0x0000</code>) and the main firmware image is offset by some fixed amo...
https://electronics.stackexchange.com
694,872
[ "https://math.stackexchange.com/questions/694872", "https://math.stackexchange.com", "https://math.stackexchange.com/users/11333/" ]
Ok, I know this is wrong, but I want someone to tell me why. Let's take a normal heads tails example of a fair coin. The probability of getting head = 1/2. And I write this is because, <code>either it will be heads, or not</code>. Hence two cases that makes it 1/2. Now, I know I can't do this to all the cases. For e...
In the case of a fair coin, the two outcomes are equally probable. $P(\text{heads}) = P(\text{tails}) = 1/2$. In the case of a (fair) dice, the two outcomes $"2"$ and $"\text{not }2"$ are not equally probable. There are five possible ways of not getting 2, all equally probable, and only one possibility to get 2. In to...
To talk of probability, you need both the sample space <em>and</em> a probability assigned to each element of the sample space.<sup>*</sup> So in the case of a fair coin, the probability is given by the data that the sample space is $\{H, T\}$ <strong>and</strong> that $\Pr(H) = \frac12$ (and therefore $\Pr(T) = \frac...
https://math.stackexchange.com
423,227
[ "https://electronics.stackexchange.com/questions/423227", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/213323/" ]
Is it possible to make a synthesizable hierarchy of constants in System Verilog? For example: <ul> <li>There is a board with FPGA and several peripheral ICs.</li> <li>Each IC have some setting registers.</li> <li>Each setting register has a number of parts. </li> <li>And each part has some possible values.</li> </ul...
The first thing is to match the size, because if you don't modification to the chassis will be necessary. Then you'll probably want to match the connector (which will also match the voltage) The fan needs as much current as the channel it sources current from on the power supply (example, if the fan uses a molex co...
There's some correlation between the current drawn and the airflow a fan produces, no matter the other factors which affect this -- RPM, blade count, depth and pitch. Pick one of a similar or slightly higher current, but compare the blade details for similarity if possible. A higher current is unlikely to be an issue ...
https://electronics.stackexchange.com
367,946
[ "https://stats.stackexchange.com/questions/367946", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/177990/" ]
Consider the following model with the usual OLS assumptions: <span class="math-container">$\epsilon_i$</span> are uncorrelated random variables with mean zero and constant variance <span class="math-container">$\sigma^2$</span>. <span class="math-container">$$y_i=\beta+ 2 \beta x_i+\epsilon_i$$</span> <span class="m...
To finish off, write <span class="math-container">$$\operatorname{Var}\left(\frac{\sum\epsilon_it_i}{\sum t_i^2}\right)\stackrel{(1)}=\frac{\operatorname{Var}(\sum\epsilon_it_i)}{(\sum t_i^2)^2}\stackrel{(2)}=\frac{\sum\sigma^2t_i^2}{(\sum t_i^2)^2}\stackrel{(3)}=\frac{\sigma^2\sum t_i^2}{(\sum t_i^2)^2}\stackrel{(4)}...
If you use the transformed explanatory variable <span class="math-container">$x_{*i} = 1+2x_i$</span> then the model easily simplifies to a simple linear regression without an intercept term: <span class="math-container">$$y_i = \beta x_{*i} + \epsilon_i \quad \quad \quad \epsilon_i \sim \text{IID N}(0, \sigma^2).$$</...
https://stats.stackexchange.com
306,527
[ "https://physics.stackexchange.com/questions/306527", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/142760/" ]
I would like to know if by placing a solid rod of steel inside a piece of hollow steel pipe increase the strength ?
Of course it would, but not by all that much. However, the stiffness-to-weight ratio would drop dramatically. At identical material cross sections, the hollow rod (=pipe) will be much, much stiffer than a solid rod. The axial moment of inertia of a solid rod of diameter $D$ is $\frac{\pi}{64}D^4$, and the one of the ...
OK. Take a 6' hollow rod and bang it as hard as you can in the middle against the corner of an eye-beam or such and tell me how much it bends. Take the same rod with the solid insert and hit it 2 times as hard the same way. Let me know your results for how much it bends.
https://physics.stackexchange.com
252,999
[ "https://electronics.stackexchange.com/questions/252999", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/62112/" ]
I am implementing a Variable frequency Drive control of single phase induction motor. I am little bit confused about the V/f ratio and voltage level. i boosted voltage upto 380V for Inverter . if i operate the motor at 220 volt with 50 HZ. so the 220/50 = 4.4 . am i right . otherwise i have to use (1.414*220/50)=6.2 ...
<blockquote> I am little bit confused about the V/f ratio and voltage level </blockquote> Any power magnetic component running from AC will magnetically saturate the core if the volt.seconds starts to be exceeded i.e. too many volts of the same polarity for too long and you get trouble. Volts per hertz is exactly t...
The RMS value of the fundamental should be 220 volts at 50 Hz and 4.4 V/Hz for operation below 50 Hz. With V/f control of 3-phase motors, the V/f is "boosted" above the constant value at frequencies below 10 Hz or so to prevent reduced torque capability at low frequencies. The boost is needed because the voltage drop i...
https://electronics.stackexchange.com
229,232
[ "https://dba.stackexchange.com/questions/229232", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/172054/" ]
In a lecture, my lecturer showed us a table without a primary key. Upon questioning, he said that in 3NF when you remove transitive dependencies it's ok to then have a table without a primary key. However, no primary key implies there's no functional dependencies - but 3NF is the removal of transitive dependencies, an...
If a relation does not have <em>any</em> candidate key (and the primary key is just one of the candidate keys), then it can have duplicate rows, so in fact it is not a relation! (since relations are always sets). In that case, it is more correct to call it a table, not a relation, as you did in your question, and note...
3NF refers to a table compliant with the first 3 Rules of Data Normalization. <ol> <li>Elimination of repeating groups </li> <li>Elimination of redundant data</li> <li>Elimination of columns not dependent on key</li> </ol> The third rule requires a key. You are right, the lecturer's table was not 3NF.
https://dba.stackexchange.com
224,260
[ "https://dba.stackexchange.com/questions/224260", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/166462/" ]
I have a SQL Server and am looking at making it public. What I mean by this is: I can create a DB and give access to myself and friends etc. I need to create a login which can only view databases it has access, DISABLE access to stop the server. I've played around with permissions and settings but every time it bloc...
<ol> <li>There is no best method. It all depends on the circumstances: size of the database, downtime allowed, version difference, platform difference.</li> <li>It will create the tablespaces and schemas. The tablespaces can be changed with the <code>REMAP_TABLESPACE</code> parameter. </li> <li>Yes.</li> </ol>
<blockquote> What is a best way to migrate database from one server to another? </blockquote> When I have done this in the past migrating a production db to another server, where we could only have down time of a matter of minutes. I did it by log shipping. For the final log I cut off all applications etc, did the f...
https://dba.stackexchange.com
105,524
[ "https://softwareengineering.stackexchange.com/questions/105524", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/8115/" ]
The idea is to make use of HTML5 local storage to store frequently accessed CSS and JavaScript. For example (pseudo-code): <pre> var load_from_cdn = true; if (detect local storage) { if (cache of css, js found) { load the local storage cache load_from_cdn = false; } } if (load_from_cdn) { documen...
It is absolutely OK to use local storage to store JS and CSS. However, local storage has 5M per domain limitation. You might have to reconsider this strategy. For desktop web, you can leverage default browser cache to do the trick. Just set the JS &amp; CSS HTTP response to be cacheable. It is simple and easy. For m...
Doesn't the browser already do this for you, and probably better?
https://softwareengineering.stackexchange.com
217,446
[ "https://electronics.stackexchange.com/questions/217446", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/100493/" ]
I just purchased a DC bench power supply from Ebay. I have been trying to power up an op-amp circuit but with no luck. I checked the voltage of each output terminal with reference to the ground(earth ground) on the power supply. There is the correct positive potential but the negative terminal is showing no differen...
All linear regulators are similar to this- there is noise due to the reference and due to the amplifier. The popular band-gap reference tends to be noisy. A buried zener reference is typically less noisy but requires a relatively high voltage. All references drift with temperature and time, and there will be some effec...
There aren't really any improvements that can be made in the ideal sense such as the circuit you have shown here. Like @Spehro said, you can add a different feedback mechanism. This question is like saying, how can I make a refrigerator more efficient, without specifying what kind of cooling mechanism your using.
https://electronics.stackexchange.com
36,198
[ "https://security.stackexchange.com/questions/36198", "https://security.stackexchange.com", "https://security.stackexchange.com/users/18637/" ]
I am trying to find the live hosts on my network using nmap. I am scanning the network in Ubuntu using the command <code>sudo nmap -sP 192.168.2.1/24</code>. However, I am unable to find the live hosts. I just get the network address of my own PC as live. When I see the DHCP client list through my browser (my router ca...
This is the simplest way of performing <strong>host discovery</strong> with nmap. <pre><code>nmap -sP 192.168.2.1/24 </code></pre> <strong>Why does it not work all the time ?</strong> When this command runs nmap tries to ping the given IP address range to check if the hosts are alive. If ping fails it tries to send ...
The easiest way to check this is to verify the ARP-tables after doing the ping sweep using nmap: <pre><code>arp -a -n </code></pre> This lists all hosts which responded to an ARP query, even the ones which filter ICMP.
https://security.stackexchange.com
56,285
[ "https://physics.stackexchange.com/questions/56285", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/21738/" ]
I recently watch a lecture by Neil Tyson where he said the closest thing we have to a vacuum is interstellar space. I believe he said there will be one atom per 1 cubic meter or something close to that. I know that pressure equalizes, meaning that a higher pressure systems will move towards low pressure systems to reac...
They are technically falling to the sun. The gravitational force of the sun is what is keeping them in orbit around the sun and not floating away. But they are also moving really fast. They are moving so fast that the direction in which they are attracted to the sun is changing constantly and it makes them spin around ...
Let me answer another component: where the <em>initial</em> energy for their movement came from. Imagine two bodies separated by a large distance. In this case, the gravitational pull is small and the gravitational potential is low. Their relative velocities are just about zero. For all intents and purposes, our energ...
https://physics.stackexchange.com
2,095
[ "https://physics.stackexchange.com/questions/2095", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/892/" ]
A while ago someone proposed the following thought experiment to me: A horse attached to a cart is resting on a horizontal road. If the horse attempts to move by pulling the cart, according to the 3rd Newton's Law, the cart will exert a force equal in magnitude and opposite in direction, cancelling each other out and ...
The opposing force always work on a different body, thats why they dont cancel. For instance the moon pulls the earth and the earth pulls the moon with same force. Also, the horse dont move by pulling the cart, but by pulling the earth.
The horse also exerts a force on the road, and the road reacts on the horse. To compute the movement of the horse, you need to add the 2 forces acting on the horse (by the road and by the cart).
https://physics.stackexchange.com
199,539
[ "https://math.stackexchange.com/questions/199539", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26728/" ]
For the isomorphism of $U_8$ (where $U_8 = \{ z \in \mathbb{C} | z^8 = 1 \}$) with $\mathbb{Z}/8\mathbb Z$ in which $\zeta =e^{i2\pi/8} \mapsto 5$ and $\zeta \cdot \zeta = 5 +_8 5 =2$ Why is $\zeta^0 = 1$? I cannot figure out how we get 0 in this. EDIT: <strong>Directly quoting the problem</strong> <blockquote> ...
For your additional question: (2 + 5) mod 8 = 7 mod 8, but 7 and -1 are in the same conjugacy class.
In a homomorphism $f:G\to H$ of groups you always have $f(x^n)=f(x)^n$ for all $x\in G$, $n\in \mathbb Z$. Since here $H=\mathbb Z/8\mathbb Z$ is written additively, the power is in fact multplication, i.e. $f(x^n)=n\cdot f(x)$ for $x\in G$, $n\in \mathbb Z$. Especially, $f(\zeta^0)=0\cdot f(\zeta)=0$.
https://math.stackexchange.com
505,372
[ "https://physics.stackexchange.com/questions/505372", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31729/" ]
Am looking at different techniques available for identifying sources of energy. As part of it, have the following question : What is the maximum theoretical efficiency of conversion of potential energy to kinetic energy (and vice-versa)? Also is it known whether varies from case-to-case ? <h2>For example :</h2> ...
Although the maximum theoretical efficiency is 100% it can never actually be achieved due to friction which is always present to some extent resulting in some loss of mechanical energy as heat. If that were not the case you could build a perpetual motion machine. (For example a perpetually moving pendulum). Hope this ...
There are a number of misunderstandings in your question, which I will try to clear up. Firstly, energy is always conserved, so the conversion of PE to KE in a closed system is lossless, and thus the 'efficiency' in that case is 100%. If you where an astronaut floating outside your spaceship in otherwise empty space...
https://physics.stackexchange.com
6,607
[ "https://dba.stackexchange.com/questions/6607", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/3142/" ]
I am having difficulty to grab the idea of pros and cons of table partitioning. I am about to start work on a project which would have 8 tables and one of them will be the main data table which will hold 180-260 million records. As it will be properly indexed table, so I am thinking of limiting the table records to 20 ...
The following is just insane ranting and raving... If you leave all data in one table (no partitioning), you will have O(log n) search times using a key. Let's take the worst index in the world, the binary tree. Each tree node has exactly one key. A perfectly balanced binary tree with 268,435,455 (2^28 - 1) tree nodes ...
200 million rows is certainly in the range where you could benefit from table partitioning. Depending on your application, you could bet some of the benefits listed below: <ul> <li><strong>Ease of purging old data</strong> If you need to clear down records more than (say) 6 months old, you can partition the table on ...
https://dba.stackexchange.com
54,200
[ "https://dba.stackexchange.com/questions/54200", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/31128/" ]
I am having an issue where, for no apparent reason, my MySQL server crashes and has to restart. Essentially, the error log has entries like this: <pre><code>131128 12:16:35 mysqld_safe Number of processes running now: 0 131128 12:16:35 mysqld_safe mysqld restarted 131128 12:16:36 [Note] Plugin 'FEDERATED' is disabled...
In the end, it was only after changing my hosting plan (and moving away from cPanel, which seemed to obscure some of the logging) that I was able to see the issue. Turns out that from time to time, memory usage would spike (I'm guessing that this was because of a dramatic spike in apache child processes) and this would...
I had the same experience today. In <code>my.cnf</code> I had: <pre><code>innodb_doublewrite = 0 </code></pre> I removed that entry, restarted mysql and it was able to recover.
https://dba.stackexchange.com
200,559
[ "https://softwareengineering.stackexchange.com/questions/200559", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/37656/" ]
I'm setting up some requirements for a software extension and try to use user stories to describe what I want to achieve. <blockquote> As a creator I want to add a new entry, to let users access it through the main page. </blockquote> I have the idea of adding an entry via Drag&amp;Drop. My company has some guideli...
I think its wrong to divide the user-story into 3 pieces. You mentioned that every command should be accessible from 3 places. That can be pre-assumed in the user stories for new commands (or explicitly mentioned in every such user story). If you need to divide it because development will implement those as separate t...
It's my understanding that in Agile, a user story should be completed and tested in a single sprint. With that in mind, I would not start by making separate stories, but just make one and outline the various pieces within it. If after estimation (during planning) it's determined that the story will extend beyond a s...
https://softwareengineering.stackexchange.com
836,841
[ "https://math.stackexchange.com/questions/836841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/14311/" ]
Calculation of $\displaystyle \lim_{x\rightarrow 1}\frac{(1-x)\cdot(1-x^2)\cdot(1-x^3)\cdots (1-x^{2n})}{\{(1-x)\cdot(1-x^2)\cdot (1-x^3)\cdots(1-x^n)\}^2} = $ <b>My Trial</b> After simplification, we get $$\displaystyle \lim_{x\rightarrow 1}\frac{(1-x^{n+1})\cdot(1-x^{n+2})\cdot(1-x^{n+3})\cdots(1-x^{2n})}{(1-x)\cdot...
We can use the identity: $$1 - x^m = (1-x)(1 + x + \cdots+ x^{m-1})$$ in every single factor, there. All of those $1-x$ will cancel, and we'll be left with $$\lim_{x \to 1} \frac{(1+x+\cdots+ x^n)(1+x+\cdots+ x^{n+1})\cdots (1+x+\cdots +x^{2n - 1})}{(1+x)(1+x+x^2)\cdots(1+x+x^2+\cdots +x^{n-1})} = \frac{(n+1)(n+2)\cdot...
By L'Hospital's rule, \begin{align*} \lim_{x \to 1} \frac{1 - x^{n + k}}{1 - x^k} &amp;= \lim_{x \to 1} \frac{-(n + k) x^{n + k}}{-k x^k} = \frac{n + k}{k} \end{align*} Hence the desired limit is $$\frac{n + 1}{1} \cdot \frac{n + 2}{2} \cdot \frac{n + 3}{3} \cdots \frac{n + n}{n} = \frac{(2n)!}{(n!)^2}$$ Alternati...
https://math.stackexchange.com
321,033
[ "https://mathoverflow.net/questions/321033", "https://mathoverflow.net", "https://mathoverflow.net/users/66131/" ]
Let <span class="math-container">$\square_2=\{(x,y): 0\leq x, y\leq1\}$</span> be the unit square in <span class="math-container">$\mathbb{R}^2$</span>. Take <span class="math-container">$n&gt;1$</span> points <span class="math-container">$P_1, \dots, P_n\in\square_2$</span>. Denote the distances <span class="math-con...
We shall prove the more general result: for <span class="math-container">$n\ge2$</span> distinct points and any positive real <span class="math-container">$a,b$</span>, we have <span class="math-container">$D(R):=d_1^2+\cdots+d_n^2\le 2a^2+2b^2$</span>, where the points <span class="math-container">$P_j$</span> are now...
You draw the discs <span class="math-container">$D_j$</span> of radius <span class="math-container">$d_j/2$</span> and center <span class="math-container">$P_j$</span>. Then because <span class="math-container">$\|P_j-P_k\|\geq \frac{1}{2}(d_j+d_k)$</span> the discs are disjoint and we have <span class="math-container"...
https://mathoverflow.net
471,768
[ "https://math.stackexchange.com/questions/471768", "https://math.stackexchange.com", "https://math.stackexchange.com/users/83637/" ]
Repunit primes are primes of the form $\frac{10^n - 1}{9} = 1111\dots11 \space (n-1 \space ones)$. Each repunit prime is denoted by $R_i$, where $i$ is the number of consecutive $1$s it has. So far, very few of these have been found: $R_2, R_{19}, R_{23}, R_{317}, R_{1031}, R_{49081}, R_{86453}, R_{109297}, R_{270343...
The number whose decimal representation consists of $ab$ consecutive $1$'s is divisible by the number whose decimal representation consists of $a$ consecutive $1$'s. To see this, think of the usual "long division" algorithm. It will terminate with $0$ remainder. The quotient will have decimal representation $1$, follo...
$$\frac{10^{pq}-1}{9}=\frac{10^p-1}{9}\cdot \left(10^{q(p-1)}+10^{q(p-2)}+\cdots+1\right)$$ It is easy to see that the expression on the right-hand side telescopes.
https://math.stackexchange.com
627,195
[ "https://physics.stackexchange.com/questions/627195", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
I have four doubts regarding friction during rolling. <ol> <li>Does slipping mean zero angular velocity, or is it just the <span class="math-container">$v$</span> velocity not being equal to <span class="math-container">$\omega r$</span>? </li> <li>If a wheel is initially given the perfect velocity <span class="math-co...
<h2>To point 1</h2> <blockquote> Does slipping mean zero angular velocity or is it just the v velocity not being equal to wr? </blockquote> The geometric bond <span class="math-container">$v=\omega r$</span> tells the speed <span class="math-container">$v$</span> of a particle a distance <span class="math-container">$r...
Here are answers to your questions in order: <ol> <li>Slipping means <span class="math-container">$v \neq w r $</span>. </li> <li>As soon as it accelerates, <span class="math-container">$v &gt; w r $</span> and so it will not roll past the starting position, as <span class="math-container">$w$</span> will remain the sa...
https://physics.stackexchange.com
103,673
[ "https://softwareengineering.stackexchange.com/questions/103673", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7686/" ]
I am trying to understand things like linkers and loaders better. What area of computer science do they belong to? Compiler, Operating System, Computer Architecture? Where do linkers and loaders come into play during development?
The <em>exact</em> relationship varies somewhat. To start with, I'll consider (nearly) the simplest possible model, used by something like MS-DOS, where an executable will always be statically linked. For the sake of example, let's consider the canonical &quot;Hello, World!&quot; program, which we'll assume is written ...
Linkers and loaders are two related but separate concepts. Linkers are a part of compiler theory. When you compile a project made up of more than one module (source code file), it's common for the compiler to output a single intermediary file for each source module. This has several benefits, one of which is that if...
https://softwareengineering.stackexchange.com
252,417
[ "https://softwareengineering.stackexchange.com/questions/252417", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/145310/" ]
I am teaching myself to program in C and have been for a few months. I recently took a one month break and came back a week ago, and it's all gone. I had to look up some things that I really put effort into understanding (see: pointers) and some others just stuck with me. Now learning about <code>malloc</code> and dyna...
Practice, practice, practice. You'll still forget things that you haven't used for a while, but the more you practice, the faster they'll come back to you. Also, (in line with @Telastyn's comment), emphasize understanding things, not memorizing them.
Typically, the ways in which people learn are: <ol> <li>Read about the concepts</li> <li>Read the available source code</li> <li>Implement the given source code and exercises</li> </ol> This works very well for short-term memorization and learning. However, there are a few factors which help the transition from "<str...
https://softwareengineering.stackexchange.com
13,009
[ "https://ai.stackexchange.com/questions/13009", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/26644/" ]
I need to develop a convolutional neural network whose inputs are 1-channel images, but I dont know how to do it, given that most libraries use 3 channel images. Should I convert my images to RGB? Is there any way to implement a CNN that receive as input 1-channel images?
<strong>Ambiguity in Terms</strong> You are correct that there is something like overloading occurring in tensor terminology in posts and in software libraries. Confusing jargon often appears when those without the mathematical background use mathematical terms. You rarely find this confusion when reading NASA, Cambri...
By definition, tensors can be of any order (usually named differently if the order is less than three). So, I use <span class="math-container">$d_i$</span> to indicate the dimensionality of the <span class="math-container">$i$</span>th facet. Unless you have three or four-order tensors which each facet has a very spec...
https://ai.stackexchange.com
140,725
[ "https://cs.stackexchange.com/questions/140725", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/136543/" ]
Need to prove <span class="math-container">$(a + ab)^*a = a(a + ba)^*$</span> by using regular algebra. Concatenation does not commute. So repeated use of commutativity will fail. I am getting confused about which identity I should use to prove this. What I can interpret is that I just need to change the side of <span ...
This is an instance of the identity <span class="math-container">$(xy)^*x = x(yx)^*$</span> with <span class="math-container">$x = a$</span> and <span class="math-container">$y = 1 + b$</span>: <span class="math-container">$$ (a + ab)^* a = (a(1+b))^*a = a((1+b)a)^* = a(a +ba)^* $$</span>
Write: <span class="math-container">$\begin{align*} (a + a b) a &amp;= a a + a b a \\ &amp;= a (a + b a) \end{align*}$</span> Thus: <span class="math-container">$\begin{align*} (a + a b)^n a &amp;= (a + a b)^{n - 1} a (a + b a) \\ &amp;\;\;\vdots \\ &amp;= a (a + b a)^n \end{align*}$</span> Note...
https://cs.stackexchange.com
42,235
[ "https://cs.stackexchange.com/questions/42235", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/16802/" ]
Assume you have an infinite language $L$ over alphabet $\Sigma=\{a,b\}$ For example, $L=\{ax \mid x \in \Sigma^*\}$ Can a Turing Machine, $M$ decide this language? (Generalizing, are all the recursive languages finite?) In my opinion, it can, since I can enumerate all the strings and say if they are in the language ...
Some infinite languages are decidable, some are not. The algorithm that you give, however, doesn't work, for two reasons: <ol> <li>When the input is not in a language, you never find out.</li> <li>It is not always possible to enumerate all the words in $L$. A language $L$ for which this is possible is known as <em>rec...
Yes, a Turing machine can decide that langauge: it just looks at the first character and accepts or rejects without even needing to look at the rest of the string. The question "Are all recursive languages finite?" is not a generalization of "Is this particular infinite language recursive?" The fact that $\{ax\mid x\i...
https://cs.stackexchange.com
207,388
[ "https://security.stackexchange.com/questions/207388", "https://security.stackexchange.com", "https://security.stackexchange.com/users/204571/" ]
I have written a message and encrypted it using cipher block chaining. What will happen if the receiver loses the Initialization Vector, or doesn't receive at all?
When decrypting a message in CBC mode, each ciphertext block c<sub>i</sub> is decrypted with the chosen key, and then XORed with the previous ciphertext block c<sub>i-1</sub>. Since for c<sub>1</sub>, there is no c<sub>0</sub>, we use the IV instead. So if the receiver knows the ciphertext and the key used to encrypt...
In a cipher block chain, each block is XORed with the <em>ciphertext</em> of the previous block, not the plaintext. So even if you cannot decipher one block, as long as you have received the complete block intact and correct, you can still use it to decipher the next one. So, if your receiver doesn't have the Initiali...
https://security.stackexchange.com
244
[ "https://mechanics.stackexchange.com/questions/244", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/26/" ]
<A HREF="http://www.americanidlemotorcycles.com/Metric_Cruisers/403.html"><IMG SRC="http://www.americanidlemotorcycles.com/Metric_Cruisers/403%202000%20Kawasaki%20KZ1000P%201.JPG"/></a> It's a 4-cylinder engine, and the carbs are really wedged in there. The best way I know is to loosen the boots on both sides, pull th...
Don't worry, you're not the only one who had to endure this pain... I had an old KZ650 I pulled the carbs from what it looks like a similar design. Like yours, it was older and the plastic air intake tubes were very stiff. Here is what I had to do. <ol> <li>Pull gas tank off and disconnect from carbs.</li> <li>Pull...
On my old bike, I had to pull the fuel tank off to get the carbs out. If anything, it will make the job much easier in terms of access for your hands.
https://mechanics.stackexchange.com
118,582
[ "https://cs.stackexchange.com/questions/118582", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/113267/" ]
I was reading about Peterson's Solution for Synchronisation. Let's assume the two shared variables to be <code>int bool flag[2]</code> and <code>turn</code>. Lets also consider the two processes as P0 and P1. Initially, P0 executes causing - <code>flag[0] = true</code> and <code>turn = 1</code>. Now lets assume P0 is ...
There are two broad concepts at play here: "synchronization" and "pre-emption". To make sure both processes run mutually exclusively, they first try to make sure the other one executes in the hope that in the future, the other process will ultimately unblock them by setting their respective flags. To make sure both p...
<em>So does a process pre-empt if it's busy waiting?</em> - yes. From the perspective of a pre-emptive scheduler it is yet another process consuming CPU cycles, and can be swapped out. <em>But wouldn't this again require P1 to be pre-empted, and bring back P0 from 'Ready' to 'Running' and get it executed ?</em> - No,...
https://cs.stackexchange.com
10,612
[ "https://physics.stackexchange.com/questions/10612", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/1255/" ]
I understand that mass-energy equivalence is often misinterpreted as saying that mass can be converted into energy and vice versa. The reality is that energy is always manifested as mass in some form, but I struggle with some cases: <strong>Understood Nuclear Decay Example</strong> In the case of a simple nuclear re...
The statement that photons are massless means that photons do not have <b>rest mass</b>. In particular, this means that, in units where $c=1$, the magnitude of the photon 3-momentum must be equal to the total energy of the photons, rather than the standard relationship where $m^{2} = E^{2}-p^{2}$. But, you can crea...
There are no confusions in your understanding, everything you said is correct, and it is the nontrivial content of Einstein's E=mc^2 paper. These systems are the reason that "relativistic mass", as introduced by Tolman is pedagogically useful. The concept that we call "mass" in our day-to-day life is the energy of a sy...
https://physics.stackexchange.com
17,136
[ "https://softwareengineering.stackexchange.com/questions/17136", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5635/" ]
...in percentage. For example 60/40 or 90/10 or 100/0. My hypothesis is that the bigger the proportion of time you spend thinking the smaller your code can be as a result (and the less time will be needed to write it down). Think more, write less, in other words. Do you think it is true? As a side note, I think in ty...
I code in last resort. Say 50% thinking, 50% coding including 10% implementation and 40% debugging.
As with anything else, it depends At the beginning of something, the majority of time is spent thinking and planning how to code it. Once you have the plan in place, most of the time is spent coding.
https://softwareengineering.stackexchange.com
81,302
[ "https://stats.stackexchange.com/questions/81302", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/7787/" ]
In linear regression, the parameters $b$ can be estimated this way (least squares): \begin{align*} X'Xb &amp;= X'y \\ b &amp;= (X'X)^{-1}X'y \end{align*} but from another point of view: \begin{align*} X'Xb &amp;= X'y \\ Xb &amp;= (X')^{-1}X'y \\ &amp;= Iy = y \end{align*} This confuses me, be...
There is nothing wrong with your calculations, but they are special: For $X$ (and therefore $X'$) to be invertible, it must be a square matrix (and full rank of course). If it is a square matrix then it means that the number of regressors are exactly equal to the number of observations. Then you have an exactly identi...
Having your residuals sum to zero means that you have perfect linearity in your data, nothing wrong with that, but rare in most applications of least squares. The problem is in <blockquote> $Xb=(X')^{-1}X'y$ </blockquote> Because $X'$ isn't always invertible, or even square (a requirement for being invertible)
https://stats.stackexchange.com
8,514
[ "https://astronomy.stackexchange.com/questions/8514", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/4146/" ]
When I listen to the Planetary Radio podcast, there is a section at the end where they suggest objects to look out for in the night sky. If I am in the UK, but they are talking about the USA, will I still be able to find the objects they are referring to?
If they mention times of night then you have to figure out to what extent the time zone (BST/GMT vs the US time zones) makes any difference, but it shouldn't make more than an hour difference either way for an object that is moving sidereally with the rest of the night sky. The main difference would be that the USA is...
Supplementary answer in broad strokes for &quot;events&quot; rather than &quot;objects&quot;: <blockquote> I am in the UK, but they are talking about the USA, will I still be able to find the <s>objects</s> <em>events</em> they are referring to? </blockquote> <strong>If it's a conjunction between the Moon and a star or...
https://astronomy.stackexchange.com
37,644
[ "https://quant.stackexchange.com/questions/37644", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/30880/" ]
I've come across the following question and I'm slightly stuck in answering it: <blockquote> Suppose you have a two-stock portfolio that is long one stock of asset A, and short one stock of asset B, with A and B strongly correlated. Normally, you calculate the risk of the portfolio by calculating the standa...
I think the question refers to a rather simpler problem. It is difficult to calculate portfolio returns when the net value of the portfolio is 0. The concept of return involves the change in value expressed as a proportion of the original value. If the original value is zero, then there is no way to calculate returns! ...
In addition to the answer posted above, you also have the question of whether the correlation will remain as high as it looks in-sample. Sometimes you should expect this to be true for structural reasons (e.g. BRK.A and BRK.B should always be 99+% correlated), though these can sometimes break down (CHF was pegged to t...
https://quant.stackexchange.com
3,820,921
[ "https://math.stackexchange.com/questions/3820921", "https://math.stackexchange.com", "https://math.stackexchange.com/users/603537/" ]
Let <span class="math-container">$x$</span> and <span class="math-container">$y$</span> be two real and positive numbers. Let <span class="math-container">$\alpha\in\mathbb{R}$</span>. I am trying to understand if the inequality <span class="math-container">$$ x^{\alpha} + y^{\alpha} \leq (x+y)^{\alpha}$$</span> holds ...
We have that <span class="math-container">$$\frac{x^2+x}{4\sqrt{x^3+x^2}}=\frac{x(x+1)}{4\sqrt{x^2}\sqrt{x+1}}=\frac{x\sqrt{x+1}}{4|x|}=\frac{\sqrt{x+1}}{4}\operatorname{sign}(x)$$</span> and therefore <span class="math-container">$$\lim_{x\to 0^+}\frac{\sqrt{x^2+x}}{4\sqrt{x^3+x^2}}=\lim_{x\to 0^+}\frac{\sqrt{x+1}}{4}...
<span class="math-container">$$\lim_{x\rightarrow0+}\frac{\sqrt{x^2+x}}{4\sqrt{x^3+x^2}}=\lim_{x\rightarrow0^+}\frac{1}{4\sqrt{x}}=+\infty.$$</span> For <span class="math-container">$x\rightarrow0^-$</span> we have <span class="math-container">$x^2+x=x(x+1)&lt;0,$</span> which says that the function does not exist ther...
https://math.stackexchange.com
4,515
[ "https://electronics.stackexchange.com/questions/4515", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1177/" ]
How should I route USB Connector shield on PCB? Should it be connected to GND plane right where USB is placed, or should the shield be isolated from GND, or should it be connected to ground through ESD protection chip, high resistance resistor or fuse? PS. Should I put the shield connections on schematic, or just rou...
For the shield to be effective, it requires as low impedance connection as possible to your shield ground. I think those recommending resistors, or not connecting it to ground at all, or strictly talking about your digital logic ground, and assuming you have a separate shield ground. If you have a metal enclosure, th...
Herny Ott discusses this in his book, "Electromagnetic Compatibility Engineering". You need to look at it from the bigger picture. IE, what is the shield doing? For low frequency signals, the shield is used to protect the signal being transfered. You want to avoid power line/AM/FM radio signals to couple into your sig...
https://electronics.stackexchange.com
3,700,801
[ "https://math.stackexchange.com/questions/3700801", "https://math.stackexchange.com", "https://math.stackexchange.com/users/747634/" ]
When I try to solve the above equation using <span class="math-container">$t=\tan(x/2)$</span>, it reduces to a linear equation in t giving <span class="math-container">$x=\pi/2 + 2n\pi$</span>. However, I completely miss the solution <span class="math-container">$x=(2n+1)\pi$</span> this way. My test book says that al...
If I understand you correctly, you would like to know how to "see" without using derivatives <span class="math-container">$$x&lt;y \Rightarrow 2x+\sin x &lt; 2y + \cos y$$</span> To see this, you may use the fact that <span class="math-container">$|\sin t| &lt; t$</span> for <span class="math-container">$t&gt;0$</spa...
<span class="math-container">$x&lt;y\implies 2x+\sin x&lt;2y+\sin y$</span>, because <span class="math-container">$f(x)=2x+\sin x$</span> is increasing, because <span class="math-container">$f'(x)=2+\cos x&gt;0$</span>, because <span class="math-container">$-1\le \cos x\le 1$</span>.
https://math.stackexchange.com
18,120
[ "https://physics.stackexchange.com/questions/18120", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/4506/" ]
Is it possible that if you have 2 ultraviolet lasers, that are invisible to the human eye, and if you aim their beams to intersect at some point, that the place of intersection will show a lower visible wavelength of light, caused by interference of the light freqency? Can any other form of heat or energy be generated...
What you say is not possible with interference. Interference of light does not produce new colors of light. Light would have to scatter inelastically off of some molecules to produce a down-shifted frequency (Raman scattering or some type of wave-mixing phenomena). The point is, the light should interact with matter to...
You'd have more luck using two infrared lasers - if you shone two infrared lasers at your eye (or at a camera) with frequencies that are half that of a visible photon, a small percentage of them would undergo two-photon absorption; two photons each with half the energy needed would be absorbed by a sensor element at th...
https://physics.stackexchange.com
83,748
[ "https://security.stackexchange.com/questions/83748", "https://security.stackexchange.com", "https://security.stackexchange.com/users/60935/" ]
one of our web page is a contact form eg name, email, and a textbox for sending comments. It seems like if we leave all of those text fields blank and click the submit button, it still went through without giving any errors. Would you consider that a vulnerability, as I think an attack could be automated to submit the ...
No - I would't not consider the ability to submit an empty form as a security vulnerability. I can't think of a reason that the ability to submit an empty form would be more vulnerable than the ability to submit a form with valid or even dummy data. It <em>is</em> an indication of a poorly written application - and...
No, being able to submit an empty form is not a vulnerability. But if this happens due to the lack of front/back-end validation, then the form is vulnerable to many other forms of attacks such as XSS and injection. An empty submission is not much different to a proper submission when it comes to DOS. In a proper submis...
https://security.stackexchange.com
443,586
[ "https://electronics.stackexchange.com/questions/443586", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/223654/" ]
I've been measuring low DC-powered devices consumption, by measuring the current at the needed frequency (able to detect the fastest consumption changes). I can then have the mean, max, min. To get the mean, i just integrate these measure points over time and multiply the result with the supply voltage. One collegue ...
Mean and RMS are two different measurements which both have a use. It's not that mean current is somehow "wrong" and RMS current is "right". The kind of measurement you need will depend on what you plan to do with the value. RMS is useful for <em>power</em> measurements assuming a constant load resistance, because pow...
For a DC supply of near constant voltage, it is the average current taken by the load multiplied by that constant DC voltage that yields true power consumption. Any AC content in the current does not contribute to average power consumption on a stable DC supply. Why: because a sine wave multiplied by a DC value is stil...
https://electronics.stackexchange.com
125,656
[ "https://softwareengineering.stackexchange.com/questions/125656", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/25221/" ]
The company I am currently working for has me developing a bunch of internal mission critical software. I have one other person that works for me but he's more of a testing guy and not really a developer. The company is concerned about some of these projects and what happens if I am hit by a bus. How does the company p...
Unfortunately what they're doing is "putting all of their eggs in one basket". Working with an outside firm is quite likely to provide revenue for them, but I seriously doubt that it'll be worth the money. Documentation always looks nice and clear when you write it. The problem is that you only know how much it's wort...
I hope you don't get hit by a bus! You are correct, I don't see the value of doing this. First, the other company will charge an amount closer to a full time developer and they will critique things and slow you down. They may ask for too much deliverable and explanation from you. Also, there is no real guarantee that t...
https://softwareengineering.stackexchange.com
319,333
[ "https://dba.stackexchange.com/questions/319333", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/263658/" ]
Teradata Related question… I have a table containing new starters along with a start date, every 90 days from the start date I need to conduct a review with the starter How do I identify the next 90 day review date for the new starter? For example, If the start date was back in 2017, I would want it to show the next 90...
This is <em>exactly</em> the kind of &quot;heavy lifting&quot; that your database is <em>built</em> for. <blockquote> select all the data between two dates ... do all the work ... with a groupBy </blockquote> Bingo! If you retrieve all the rows, send them to the client and let <em>it</em> do the aggregation, then you'r...
Another benefit of doing the data transformations in the database layer is that it centralizes the code, results, and shape of the data to one place. You may later on decide you want to consume the same transformed data in some other report or application besides your main application, and having it centralized in the ...
https://dba.stackexchange.com
377,850
[ "https://electronics.stackexchange.com/questions/377850", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/59473/" ]
The title is the question. Is it something to do with batteries on a plane? I’ve tried Google but all the listings are “what happens when lightning hits a plane” So why does it happen I want to know? Thanks
Lightning is caused by the rapid and very high current discharge between one charged cloud and another or to ground. The metal skin and structure of an airplane provides a lower resistance path than the surrounding air. It is the preferred path. <blockquote> Is it something to do with batteries on a plane? </blockqu...
The triboelectric effect exists from high velocity conducting wings with friction with static bearing dust. The biggest problem is the insulated turbine bearings get pitted from induced ESD or lighting nearby arcs , which requires routine maintenance and if struck inducing current thru the turbine can seize the engine...
https://electronics.stackexchange.com
705,094
[ "https://physics.stackexchange.com/questions/705094", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/329778/" ]
The Earth rotates on it's axis in 24 hours. So, we see the Sun rotates around Earth in 24 hours and the phenomenon is absolutely correct according to the principle of relative velocity. Sun is approximately 1.5×10^8 km away from Earth. If the Sun rotates around Earth, the distance covered by Sun is (2π×1.5×10^8) km = 9...
For linear motion, the choice of an inertial reference frame is pretty much arbitrary. This is not true for rotation. From what we know about the size of the universe and motions of the distant stars, it is not reasonable to assume that the universe is rotating about us. It follows that a line of view from here to a...
there is no privlaged inertial refrence frame. the spinning frame of the earth is non inertial and therfore isnt just as valid a refrence frame to decide if the earth is spinning or if the sun is spinning around the earth.
https://physics.stackexchange.com
246,944
[ "https://physics.stackexchange.com/questions/246944", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/90893/" ]
It's usually said that "the direct observation of a process makes the wave function of the system to collapse". How does really that process happen? What exactly means for a wave function to collapse?
If you rely on Newton's second law, the definition of mass turns out to be circular or very intricate as also the notion of (undefined) force appears therein. A better approach consists of starting from the <em>experimental fact</em> that <em>momentum is conserved</em>. In a very theoretical picture you can deal with ...
<blockquote> However, I think that both these answers are circular in nature, as Newton didn't derive mass $m$ in terms of force $F$ , he derived $F$ in terms of $m$. </blockquote> Newton's 2nd law does not "derive $F$ in terms of $m$"; it states if force acting on the body $\mathbf F$, mass of the body $m$ and acce...
https://physics.stackexchange.com
416,077
[ "https://physics.stackexchange.com/questions/416077", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/96775/" ]
In free expansion W=0, even though volume changes and if q=0, then temperature and internal energy do not change. But what about pressure? I will present some arguments, please tell me which one(if any) is right, and also give your own arguments. Consider ideal gas in an adiabatic container separated from vacuum side...
In a nutshell, intermediate-mass black holes (IMBHs for short) cannot be formed by the collapse of a star, which is how stellar mass black holes are formed, and can't be formed from the extreme conditions that form supermassive black holes. The three proposed methods of formation of IMBHs are: <ul> <li>The merging of ...
I think there could be many reasons. Stellar-sized black holes are <em>common</em>. They are likely the end-points of very massive stars (<span class="math-container">$&gt;25 M_{\odot}$</span>) and seem to be clustered at masses of <span class="math-container">$5-15M_{\odot}$</span>. Somehwat larger examples might be f...
https://physics.stackexchange.com
88,132
[ "https://physics.stackexchange.com/questions/88132", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31496/" ]
Let's have generating functional $Z(J)$: $$ Z(J) = \langle 0|\hat {T}e^{i \int d^{4}x (L_{Int}(\varphi (x)) + J(x) \varphi (x))}|0 \rangle , \qquad (1) $$ where $J(x)$ is the functional argument (source), $\hat {T}$ is the chronological operator, $\varphi (x)$ - some field. I want to understand the reasons for its in...
The primary utility in introducing the generating functional is in using it to compute correlation functions of the given quantum field theory. Let's restrict the discussion to that of a theory of a single, real scalar field on Minkowski space, and let $x_1, \dots, x_n$ denote spacetime points. Of central importance a...
If you can calculate vacuum-to-vacuum transition amplitudes, you can calculate S-matrix elements, because the two are related by the LSZ reduction formula. The LSZ will in any case chop off the propagators for external lines that the generating functional inserts, so you will end up only needing to compute amputated di...
https://physics.stackexchange.com
91,108
[ "https://dba.stackexchange.com/questions/91108", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/57999/" ]
As you may know adding a new column to a MySQL table with millions of records is hard and in some cases impossible. Is it a good idea to add a text column to each table (say, meta) to save some headache in future? Of course, they are empty in most cases. These data can be stored as JSON. I know this field can not b...
I agree with "bad form". Plan A: Here's another approach when you <em>do</em> need to add another column(s). Create a new table with the same PRIMARY KEY ("Vertical partition"). (But not AUTO_INCREMENT.) Put the new column(s) in it. The JOIN to fetch the new data will be messy in your code, but only when you actu...
I echo the "bad form" comment of @JohnM - design the thing properly, and if you have new requirements (or your design isn't perfect first time - unlikely I know :-) ), then choose to add new fields. Use JSON if it suits your clearly demonstrated requirements, otherwise stick with "normal" field types. I've seen too m...
https://dba.stackexchange.com
695,522
[ "https://math.stackexchange.com/questions/695522", "https://math.stackexchange.com", "https://math.stackexchange.com/users/99645/" ]
The question is as follows: Let $G_1$ and $G_2$ be groups. Define $\pi_1 : G_1 \times G_2 \rightarrow G_1$ by $\pi_1((a_1,a_2))=a_1.$ Define $\pi_2 : G_1 \times G_2 \rightarrow G_2$ by $\pi_2((a_1,a_2))=a_2.$ Let $G$ be any group, and let $\phi : G \rightarrow G_1 \times G_2$ be a function. Show that $\phi$ is a grou...
It's also easy $$\varphi(gg')=((\pi_1\circ\varphi)(gg'),(\pi_2\circ\varphi)(gg'))={((\pi_1\circ\varphi)(g)\cdot(\pi_1\circ\varphi)(g')),(\pi_2\circ\varphi)(g)\cdot(\pi_2\circ\varphi)(g')))}=((\pi_1\circ\varphi)(g),(\pi_2\circ\varphi)(g))\cdot((\pi_1\circ\varphi)(g'),(\pi_2\circ\varphi)(g'))=\varphi(g)\varphi(g')$$
Look at it this way: $\phi: G \to G_1\times G_2$ takes an element of $G$ and returns a pair: one elment from $G_1$, and one element from $G_2$, i.e. $\phi(g)=(g_1,g_2)$. Can you manipulate this expression to get equations of the form $g_1=?$, $g_2=?$ The goal is to express $\phi$ entirely in terms of $\pi_1\circ\phi$...
https://math.stackexchange.com
20
[ "https://cs.stackexchange.com/questions/20", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/78/" ]
Considering this pseudo-code of a bubblesort: <pre><code>FOR i := 0 TO arraylength(list) STEP 1 switched := false FOR j := 0 TO arraylength(list)-(i+1) STEP 1 IF list[j] &gt; list[j + 1] THEN switch(list,j,j+1) switched := true ENDIF NEXT IF switched = false TH...
For lists of length $n$, average usually means that you have to start with a uniform distribution on all $n!$ permutations of [$1$, .., $n$]: that will be all the lists you have to consider. Your average complexity would then be the sum of the number of step for all lists divided by $n!$. For a given list $(x_i)_i$, ...
Recall that a pair $(A[i], A[j])$ (resp. $(i,j)$) is inverted if $i &lt; j$ and $A[i] &gt; A[j]$. Assuming your algorithm performs one swap for each inversion, the running time of your algorithm will depend on the number of inversions. Calculating the expected number of inversions in a uniform random permutation is e...
https://cs.stackexchange.com
284,663
[ "https://mathoverflow.net/questions/284663", "https://mathoverflow.net", "https://mathoverflow.net/users/36688/" ]
Assume that $(G,G^0,r,s)$ is a smooth groupoid such that $G$ is a compact connected manifold. The graph of "source" and "range" maps $s, r: G \to G^0$ are compact submanifolds $S$ and $R$ of $G\times G$. To our smooth groupoid we associate the quantity $$q= S\ \#\ R,$$ the intersection number of $S$ with $R$. This...
Steven Sam and Andrew Snowden and their other collaborators call these `twisted commutative algebras' and have been having fun writing papers about properties of generators and similar. But predating this, any topologist of a certain sort would call this a monoid in the category of symmetric abelian groups. If you...
As a warmup, an $\mathbb{N}$-graded ring is a monoid object in the symmetric monoidal category of $\mathbb{N}$-graded abelian groups under the convolution tensor product, which you can think of as Day convolution from the usual addition on $\mathbb{N}$. Similarly, this thing is a monoid object in the symmetric monoida...
https://mathoverflow.net
585,353
[ "https://stats.stackexchange.com/questions/585353", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/281542/" ]
Suppose that we have N-observations for a random variable <span class="math-container">$V$</span> from a population: <span class="math-container">$$\{v_1,\;\ldots,\;v_N\}$$</span> , and all of the observations is positive: <span class="math-container">$v_i&gt;0\quad \forall i=1,\;\ldots,\;N$</span>. Here, assume that t...
No. A sample generally does not allow you to &quot;prove&quot; anything about the underlying population with 100% certainty, it just allows you to infer it with varying levels of confidence. Suppose you have a distribution that truly has a negative expected value, but has non-zero probability for positive values. <em>N...
First, you usually can't <strong>prove</strong> much from samples, since any sample is possible to happen, and a proof is for something that must always be true regardless of what happens. Second, your intuition would closely apply to the <strong>median</strong> but <strong>not the mean</strong>. Such a data set gives ...
https://stats.stackexchange.com
150,205
[ "https://security.stackexchange.com/questions/150205", "https://security.stackexchange.com", "https://security.stackexchange.com/users/138172/" ]
I provide a service in which users can store data, files, etc in an encrypted form. The service that I have built has two applications for the user's password with which they login to my service: 1) authentication and 2) the password is used as the base for the secret encryption key for data they store with my service....
<blockquote> Can the user's password from the parent service be passed to my application allowing for it to be used as the secret key for encryption? </blockquote> No. That is sort of the point of the protocol. <blockquote> If a secret is randomly generated when the user registers for my service via SSO, can thi...
Depending on the authentication service you are using, you could ensure that a secret is returned from the SSO as part of the handshake, and utilise this. This then transfers the problem to the system doing the authentication. Receiving the password via SSO is out of the question, the whole point of it is to abstract ...
https://security.stackexchange.com
77,461
[ "https://dba.stackexchange.com/questions/77461", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/25319/" ]
I have setup database mirroring using SQL server on two servers. I have Enterprise Edition on the primary server and Standard Edition on the secondary server. In order to verify the data on the secondary server I manually broke the mirroring, so I could inspect data on the mirror. Now after the verification process, ...
Once you have broken the database mirror, you have no other option than to re-initialize it using a full backup and transaction log backup of the principal. The steps you must take are: <ol> <li>Restore a recent full database backup of the principal database, after making sure that the principal database was already ...
As far as I'm aware, a mirrored database needs to have a full backup and then a transaction log backup restored (with norecovery) in order for mirroring to initialise. I would strip the full backup of the database into multiple files and then transport over the network. If you are using 2008 and upwards, use compressi...
https://dba.stackexchange.com
218,192
[ "https://mathoverflow.net/questions/218192", "https://mathoverflow.net", "https://mathoverflow.net/users/31310/" ]
To me, as an non-expert in the field, it seems as if numeric mathematics should have lost its importance because nowadays symbolic calculations or calculations with unlimited precision are generally available.<br> So, just out of curiosity, I would like to know, whether my impression is wrong and what current hot resea...
No, research in numerical mathematics is still very relevant today. One of the main challenges is <strong>big data</strong>: scaling the usual algorithms up to larger dimensions. Today's linear systems may involve sparse matrices of dimensions 100k or 1M, for instance. Using traditional methods such as Gaussian elimin...
<blockquote> So, just out of curiosity, I would like to know, whether my impression is wrong and what current hot research-topics of practical relevance in numeric mathematics are. </blockquote> The question of practical relevance of numerical mathematics has very little to do with current hot research topics. Well ...
https://mathoverflow.net
54,388
[ "https://mechanics.stackexchange.com/questions/54388", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/4152/" ]
My daughter has a 2009 Honda Fit. It seems someone has done something to the car which has caused the battery to go flat. Also, the only door key (driver's side) won't unlock the door. Since the battery is flat, the car only makes a slight (and I mean <em>very</em> slight) noise when you press the unlock button on the ...
My solution to the situation was to completely remove the bottom aero stuff which connects to the bottom of the bumper (goes from wheel well to wheel well, from bumper to the engine cradle area). To do this, you have about 20 push pins holding it in place. I was then able to move the bumper portion out of the way towar...
The Honda fit should have a key override on the rear hatch as well as the drivers door, I'd try that first before anything else. Getting power to the car is tricky, if there's a trailer plug you could charge the battery through that, or at least power up the system enough to operate the locks. If the lights were left...
https://mechanics.stackexchange.com
229,804
[ "https://softwareengineering.stackexchange.com/questions/229804", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/114015/" ]
Is it good practice to use <code>__</code> convention while declaring the member variable? This also imparts private kind of feature of that data member. There have been cases when I found that its good to have hidden members of a class. This is certainly exposes only that feature that will help the the object to beh...
A lot of people erroneously use double underscores to simulate "private" members, because double underscores invokes code mangling and makes those members harder to reference outside the class. However, it does not actually make them inaccessible. Most of the time, it mainly adds a road bump to unit testing. Really t...
The feature is specifically meant for preventing <em>accidental</em> clashes between a parent class member and subclasses. The name is mangled by prepending it with the class name; the atribute <code>__foo</code> on a class <code>Bar</code> becomes <code>_Bar__foo</code>, and can still be accessed as such from outside...
https://softwareengineering.stackexchange.com
392,281
[ "https://mathoverflow.net/questions/392281", "https://mathoverflow.net", "https://mathoverflow.net/users/114951/" ]
Assume <span class="math-container">$x \in \mathbb{R}$</span>. We already know that <span class="math-container">$$\lim_{\epsilon \to 0+} \frac{1}{x-i\epsilon} - \frac{1}{x+i\epsilon} = 2\pi i \delta_x.$$</span> Here <span class="math-container">$\delta_x$</span> denotes the Dirac distribution. If we consider a slightl...
This question already has an impeccable answer but I would like to give a second one in the hope that it might be of interest to the OP. Before so doing, I will list the properties of distributions (on the line) that I require: <ol> <li>Any “reasonable” function can be regarded as a distribution (in our context, this ...
<span class="math-container">$\newcommand{\ep}{\epsilon}\newcommand{\de}{\delta}\newcommand{\R}{\mathbb{R}}$</span>Let <span class="math-container">\begin{equation*} K_\ep(x):=\frac{\ln^m(x-i\ep)}{x-i\ep}-\frac{\ln^m(x+i\ep)}{x+i\ep}. \end{equation*}</span> Let us show that, in an appropriate weak sense, <span cla...
https://mathoverflow.net
2,874,382
[ "https://math.stackexchange.com/questions/2874382", "https://math.stackexchange.com", "https://math.stackexchange.com/users/302692/" ]
I have a question related to the following proof of the divergence of the harmonic series. <strong>Proof</strong> Towards a contradiction, suppose that $\sum_{n=1}^\infty\frac{1}{n}&lt;\infty$ (denote the value of the sum as $\ell$). Then $$ \frac{1}{2}+\frac{1}{4}+\frac{1}{6}+\dotsb=\frac{1}{2}\sum_{n=1}^\infty\frac...
What the author uses is this: if we have two convergent series $\sum_{n=1}^\infty a_n$ and $\sum_{n=1}^\infty b_n$ and if $(\forall n\in\mathbb N):a_n&gt;b_n$, then $\sum_{n=1}^\infty a_n&gt;\sum_{n=1}^\infty b_n$. This is indeed true, because$$\left(\sum_{n=1}^\infty a_n\right)-\left(\sum_{n=1}^\infty b_n\right)=\sum_...
You are correct that $s_m&lt; t_m\ \forall m\Rightarrow\lim s_m\le \lim t_m$ does not by itself yield a contradiction. However, it is easy to prove the stronger statement: $$ s_m+\frac12\le t_m\qquad\text{for all $m$}, $$ which does yield a contradiction.
https://math.stackexchange.com
109,442
[ "https://softwareengineering.stackexchange.com/questions/109442", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/23355/" ]
Are there any major differences when we talk about "socket programming" compared to "network programming"? Are there some topics that cover "network programming" but not "socket programming"?
Socket programming (at least as the term is normally used) is programming to one specific network API. Sockets support IP-based protocols (primarily TCP and UDP)<sup>1</sup>. Network programming can be done using various other APIs. Windows has a number of protocol-independent APIs such as the WNet* and Net* functions...
"network programming" will require some networking technology - for example, RPC. Sockets (most likely you mean BSD sockets) are an example of such technology. So "socket programming" is a subset of "network programming".
https://softwareengineering.stackexchange.com
241,880
[ "https://mathoverflow.net/questions/241880", "https://mathoverflow.net", "https://mathoverflow.net/users/1050/" ]
While reading a number theory paper I encountered the identity $$ \int_{- \infty}^{\infty} (1 + x^2)^{ - \frac{z}{2} - 1} dx = \sqrt{\pi} \frac{ \Gamma(\frac{z + 1}{2}) }{\Gamma(\frac{z}{2} + 1)},$$ apparently true for all $z \in \bf{C}$ for which the integral on the left converges absolutely. The author offers neith...
Yes, there is a trick which generalizes to analogous integrals on the classical cones, using the Gamma functions attached to these cones. In this, the simplest case, the starting point is the observation that $\int_0^\infty e^{-ty}\,t^s\;{dt\over t}=y^{-s}\cdot \Gamma(s)$ for $y&gt;0$, and then for $\Re(y)&gt;0$ by ana...
It is nothing but beta-function. Consider only positive $x$ and denote $1/(x^2+1)=t$. You get $$\int_0^\infty (1+x^2)^{-z/2-1}dx=\frac12 \int_0^1 t^{z/2-1/2}(1-t)^{-1/2}dt=\frac12 B((z+1)/2,1/2)=\\=\frac{\Gamma(1/2)\Gamma((z+1)/2)}{2\Gamma(z/2+1)}=\sqrt{\pi}\frac{\Gamma((z+1)/2)}{2\Gamma(z/2+1)}.$$ I think, there shou...
https://mathoverflow.net
37,119
[ "https://mathoverflow.net/questions/37119", "https://mathoverflow.net", "https://mathoverflow.net/users/8871/" ]
The question arose while comparing the notions of compactness, countable compactness, local compactness, and "Lindelofness" in Hausdorff spaces. It is straightforward to show that compactness implies any of the other properties. I found ready counterexamples (I will be glad to provide them if asked) for all but one of ...
Examples abound: take for instance a $\Sigma$-product of two-point spaces. To be specific let $X$ be the set of points in $\lbrace0,1\rbrace^{\omega_1}$ that have only countably many coordinates that are $1$. This set is dense but not open in the product, hence not locally compact but it is countably compact as each co...
Example 3.10.17 of Engelking's General Topology (Heldermann Verlag Berlin 1989) is the following dense subspace of $I^{\mathbb R}$, where $I=[0,1]$: Let $X$ be the set of all $(x_t)_{t\in\mathbb R}\in I^{\mathbb R}$ such that $x_t$ is different from zero for at most countably many $t\in\mathbb R$.<br> Engelking shows ...
https://mathoverflow.net
19,169
[ "https://stats.stackexchange.com/questions/19169", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/6494/" ]
I'm trying to implement the extended binomial density function with support on c( 0 : (floor(N) + 1)), but I'm running into (I think) precision issues, as running: <pre><code>######################## #---DENSITY FUNCTION---# ######################## debinom &lt;- function(k, n, p, sum) { if (k &lt;= n) { return...
Well, it seems several problems here First, what is "extended binomial distribution". Will you please give some reference to it? I'm aware about extended (aka truncated) negative binomial distribution, but here it seems it's not the same. Looking into pebinom() it looks like you're just looking for ordinary binomial d...
There are several problems with your program. First, you set <code>totalDensity = cumProb = debinom(0.0, n, p, 0.0)</code> which sets <code>totalDensity</code> and <code>cumProb</code> to $(1-p)^n$. The first iteration of your loop (executed with <code>k = 0</code>) adds <code>debinom(0, n, p, totalDensity)</code> (...
https://stats.stackexchange.com
166,019
[ "https://dba.stackexchange.com/questions/166019", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/118768/" ]
I want to select a table without a specific row. Eg. the table below <pre><code>CREATE TEMP TABLE foo AS SELECT name, ssn, location FROM ( VALUES ( 'peter' , 1, 'Canada' ), ( 'peter' , 2, 'Canada' ), ( 'anna' , 3, 'Canada' ), ( 'sven' , 1, 'France' ) ) AS t(name,ssn,location); </code></pre> I...
Based on the comments, it appears you goal is to bring back the records that meet your basic criteria (<code>location = 'CANADA'</code>), but to exclude the record belonging to the current user. So, what you would need to do is exclude records for the current user, based on their unique identifier. If the current use...
From your question I understand you want to remove duplicates (the 'peter', 1 row). Easiest way is a grouping query: <pre><code>select name, max(ssn) as ssn, location from foo group by name, location </code></pre> If you want the exact ordering specified in your question: <pre><code>select name, max(ssn) as ssn, lo...
https://dba.stackexchange.com
252,023
[ "https://softwareengineering.stackexchange.com/questions/252023", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/92090/" ]
I'm just now learning about C. I find it odd that the creators chose the asterisk (<code>*</code>) as the symbol for pointers rather than a symbol that actually <em>looks</em> like a pointer (<code>-&gt;</code>). Considering how confusing dereferencing and function pointers can be, is there a historical, or even prac...
How about a benchmarking suite? Rather than letting the GC run at any random time, you might want to make it run between sets of tests, to (possibly) create more consistent conditions for each set.
What about a game where you want to control gc pauses. You could then call gc right before a level starts after assets are loaded.
https://softwareengineering.stackexchange.com
36,165
[ "https://ai.stackexchange.com/questions/36165", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/45832/" ]
I want to design a multi-arm bandit system for a multi-step, multi-location system. Locations are dynamic, so I can not design the system based on them. In each location, the alternative actions that can be taken would be different. When you take correct actions, taken in correct locations, then some rewards would be e...
You are describing an environment which requires a full Markov Decision Process (MDP) to model it and reinforcement learning (RL) algorithms to solve it. You will not be able to adapt k-armed bandit algorithms, without effectively re-inventing MDPs. The two key details that make this full RL, and not a bandit problem, ...
Neil Slater has a solid answer. In general you could have a bandit algorithm in which the reward <span class="math-container">$r \sim f(. | a)$</span>, or an mdp where reward <span class="math-container">$r \sim f(. |s,a,s')$</span>. Here <span class="math-container">$a$</span> is the current action, <span class="math-...
https://ai.stackexchange.com
455,217
[ "https://physics.stackexchange.com/questions/455217", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/220214/" ]
<strong>Backstory</strong>: I’m a software engineer just getting into electronics and it seems that everything I’ve ever been told about electricity my whole life is a candy-coated lie. I can’t find consistent logical answers to the most basic of questions and it’s driving me mad! The kindergarten math V = IR makes se...
What really happens to the electrons in a solid when an electric field is applied is extremely complicated, and depends heavily on the material in question. What's more, the electrons cease to be "electrons" as the elementary particle in vacuum, they become quasiparticles with non well defined velocity and with other s...
<blockquote> If charge causes the electrical field, then why does the voltage drop across the resistor? The electrons didn’t just magic themselves away. Isn’t the charge the same? </blockquote> Crudely, the electric field accelerates an electron. It flies along until it bumps into something (a molecule in the resist...
https://physics.stackexchange.com
5,251
[ "https://chemistry.stackexchange.com/questions/5251", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/1771/" ]
$\ce{[Cr(H2O)4Cl2]Cl}$, Tetraaquadichlorochromium(III) chloride According to a book, the (III) indicates the oxidation state of chromium, but it doesn't explain why. Cr has 6 valence electrons. How does it get to +3?
I think the easiest way to see this is to count the formal charges on the ligands. The four waters do not have net charge. The remaining ligands--the three Cl's--are likely $\ce{Cl-}$, and so their total charge contribution is $-3$. The only way the complex can be neutral is if the chromium has a $+3$ charge: hence...
Eric is correct about the easiest method to determine the most likely oxidation state of Cr. As for the rest of your question, the oxidation state of Cr in this compound means that it has three electrons less than in its neutral state, i.e. three valence electrons instead of six. This +3 oxidation state is the most sta...
https://chemistry.stackexchange.com
69,380
[ "https://electronics.stackexchange.com/questions/69380", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/23940/" ]
I know nothing about motors. I have DC motor (sealed in a casing) that uses 6v/12v 1a (mains switching power supply) with 2.1x5.5mm DC connector. It has variable speed controller, reversible direction, and can operate at between around 5-100rpm. The only available spec states it can be used with powersources of 6v to ...
You don't need to worry about the current input, the resistance of the motor (which can be obtained using V = IR : 12V = 1A*R => R = 12 Ohm ) will limit this. What ever 12V battery you use will only supply 1A at that resistance (V = IR again). A larger battery will last for a longer amount of time because it has more s...
The other answer that said you don't have to worry about current is correct but not for the right reasons. On a DC motor, from the perspective of the equivalent circuit, the current draw is going to be a function of the internal resistance and also the back-emf. The back-emf is a voltage of opposite polarity as your ...
https://electronics.stackexchange.com
111,005
[ "https://stats.stackexchange.com/questions/111005", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/53612/" ]
Is it necessary to calculate VAR before Granger causality test so that we can have the lag length to be used in Granger causality test
As requested, I illustrate using a simple regression using the <code>mtcars</code> data: <pre><code>fit &lt;- lm(mpg~hp, data=mtcars) summary(fit) Call: lm(formula = mpg ~ hp, data = mtcars) Residuals: Min 1Q Median 3Q Max -5.7121 -2.1122 -0.8854 1.5819 8.2360 Coefficients: Estima...
The original poster asked for an "explain like I'm 5" answer. Let's say your school teacher invites you and your schoolmates to help guess the teacher's table width. Each of the 20 students in class can choose a device (ruler, scale, tape, or yardstick) and is allowed to measure the table 10 times. You all are asked...
https://stats.stackexchange.com
37,502
[ "https://mathoverflow.net/questions/37502", "https://mathoverflow.net", "https://mathoverflow.net/users/2841/" ]
Let $\kappa$ be a cardinal (of uncountable cofinality). A subset $S \subseteq \kappa$ is called stationary if it intersects every club, i.e. closed unbounded subset of $\kappa$. Now my question is basically just: Why do we care about stationary sets? I know some statements, which are independent from ZFC, for example t...
Some intuition might be given by the following informal analogy with measure theory: if we have a measure space of measure 1, then club sets are analogous to subsets of measure 1, while stationary sets are analogous to sets of positive measure. In other words, club sets contain "almost all" ordinals, while stationary...
One answer to your question about intuition is simply that stationary sets arise very naturally once you begin to think of the natural measure surrounding club sets. The stationary sets are simply those that have positive outer measure with respect to the club filter. So if you care about club sets being large, then th...
https://mathoverflow.net
173,391
[ "https://security.stackexchange.com/questions/173391", "https://security.stackexchange.com", "https://security.stackexchange.com/users/163670/" ]
I started working on an app that connects to a RESTful service for authentication and data. User POSTs the user name and password to /token endpoint. Once they log in successfully, they get a bearer token that they then append to the Authorization header in the subsequent calls to different protected resources. My qu...
<blockquote> My question is what prevents users from intercepting their regular post form the app (getting the token) and then possibly sending bunch of POST requests (using something like postman or fiddler) to create a large number of fake posts or articles or whatever else the app does. </blockquote> Nothing <bl...
<blockquote> My question is what prevents users from intercepting their regular post form the app </blockquote> Nothing. <blockquote> Does the fact that the traffic to the service will eventually go via TLS make this a non-issue? </blockquote> If you make it for an mobile platform (Android/iOS), that makes it mu...
https://security.stackexchange.com
370,433
[ "https://softwareengineering.stackexchange.com/questions/370433", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/136084/" ]
Here is a simplified sample. Basically, it does checks on a string from a string list. If the check passes, it will remove that string (<code>filterStringOut(i);</code>), and it is no longer necessary to continue any other checks. Thus <code>continue</code> to the next string. <pre><code>void ParsingTo...
Don't nest: convert to functions instead. And have those functions return <code>true</code> if they perform their action and the subsequent steps can be skipped; <code>false</code> otherwise. That way you completely avoid the whole problem of how to break out of one level, continue within another, etc as you just chain...
From a more bird view perspective, I would refactor the code so that it looks like this... (in pseudo code, it's too long ago I touched C++) <pre><code>void filterStrings(sl) { /* Filter string list */ for (int i=0; i&lt;sl.length(); i++) { QString s = sl.at(i); if(!isProperString(s)) { ...
https://softwareengineering.stackexchange.com
20,005
[ "https://chemistry.stackexchange.com/questions/20005", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/4093/" ]
The following equilibrium occurs: $$\ce{2 NOCl(g) &lt;=&gt; 2 NO(g) + Cl2(g)}$$ A gaseous mixture of $\ce{NOCl}$, $\ce{NO}$ and $\ce{Cl2}$ is put in a container. After a few minutes it is found that two moles of $\ce{NOCl}$ react for every three moles of products which react. Is the mixture at equilibrium? Why? In ot...
The information you provided ("two moles of NOCl react for every three moles of products which react") confirms that the reaction occurs as depicted, but is insufficient to establish that the system is at equilibrium. The important missing information is not the relative proportions of these three species in the mixtur...
When a chemical system is at equilibrium the rate of the forward reaction equals the rate of the reverse reaction. The equilibrium expression is a ratio of the <em>conentrations</em> of the products raised to their stoichiometric coefficients over the concentrations of the reactants raised to their stoichiometric coeff...
https://chemistry.stackexchange.com
2,707
[ "https://cstheory.stackexchange.com/questions/2707", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/-1/" ]
I wrote an implementation of the Kuhn-Munkres algorithm for the minimum-weight bipartite perfect matching problem based on lecture notes I found here and there on the web. It works really well, even on thousands of vertices. And I agree that the theory behind it is truly beautiful. And yet I still wonder why I had to g...
<em>(Moved from a comment.)</em> Of course you can solve any LP by using a general-purpose LP solver, but specialised algorithms typically have a <em>much</em> better performance. It is not only about theoretical asymptotic performance guarantees, it is also about practical real-world performance. Algorithms such as ...
Although that answer is correct in a general sense, it is also helpful to try to understand specifically what goes wrong when applying primal simplex to the assignment problem. Consider an NxN assignment problem with square cost matrix c_ij. The corresponding LP has N^2 variables x_ij to solve for. Thinking of these ...
https://cstheory.stackexchange.com
106,806
[ "https://softwareengineering.stackexchange.com/questions/106806", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/29046/" ]
Five methods within my API call the same third-party method. In trying to abide by DRY, does it make sense to wrap this call in a private method?
Actually, I think wrapping or isolating third-party api's in a "shim" layer is good design. There are a number of advantage in doing this. For instance, what happens if you change operating systems assuming you are not developing in managed environment like .NET (Which basically provides the shim layer for you)? If yo...
I would recommend you leave your code as-is. However, say, if you're calling 20 differing methods in third-party code on 1000 lines of your code, perhaps creating a thin layer between you and your third-party code may save you (or someone else) some pain the future, in the event that the third-party code changes and ...
https://softwareengineering.stackexchange.com
24,923
[ "https://quant.stackexchange.com/questions/24923", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/19002/" ]
Consider a two-period binomial model for a risky asset with each period equal to a year and take $S_0 = 1$, $u = 1.15$ and $l = 0.95$. The interest rate is $R = .05$. a.) If the asset pays 10% of its value as dividend in the first period and 20% in the second period, find the price of the ATM call option. b.) Conside...
(a) First of all, ATM means strike price $K=S_0$. By the end of second period, the risky asset has values (from top to down) $S_0 u^2 (1-d_1) (1-d_2)=0.95$, $S_0 ul (1-d_1) (1-d_2)=0.79$ and $S_0 l^2 (1-d_1) (1-d_2)=0.65$. The risk neutral probabilities are calculated as $\hat{\pi}_u=(1+R-l)/(u-l)=1/2$ and $\hat{\pi}_l...
I did the calculations, and actually both current answers seem wrong... can someone confirm or point towards any mistake in the following reasoning? What I claim to show is that: you can use a <strong>standard</strong> stock price tree (i.e. the terminal values of the stock price do not involve the dividend yield and ...
https://quant.stackexchange.com
650,090
[ "https://electronics.stackexchange.com/questions/650090", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/321329/" ]
I have a 0..5 V digital signal with a minimum pulse width of 200 ns. I would like to measure the pulse width and the time between the rising edges of pulses. In my case it would be enough to measure the incoming signal for 500..1000 ms to get the pulse, send the measurements to a microcontroller and then start over. Wh...
This really sounds like a job for the Timer/Counter Unit of your microcontroller. Your ATMega4809 definitely has multiple of these (at least TCA, TCB, but probably a lot more). You can program them to count the clock cycles (== time) between a rising and a falling input edge – no interrupts for accurate timing needed. ...
Usually, some 8 bit and 16 bit CPUs such as NXP S08, Infineon and others can measure pulse edges spaced 20 μS or more. Measuring pulse edges in 200 ns or 0.2 μS scale is really not possible even with medium speed MCUs with a clock speed around 40 MHz.The GPIO signal detection accuracy of a MCU is perhaps in 5 μS range....
https://electronics.stackexchange.com