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
342,447
[ "https://softwareengineering.stackexchange.com/questions/342447", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/261956/" ]
<strong>Problem</strong> We have a number of different customers getting a number of different price files, each customer can then also have different styles of pricing files for example customers can have just two columns, product and price. Some customers can have up to 20-30 fields each of these fields can exist in ...
Simple method: One header per source file. If you have a complete subsystem where users are not expected to know about the source files, have one header for the subsystem including all required header files. Any header file should be compilable on its own (or let's say a source file including any single header should...
By far the most important requirement is to reduce dependencies between your source files. In C++, it is common to use one source file and one header per class. Therefore, if you have a good class design, you will not even come close to header hell. You can also view this the other way round: if you already have header...
https://softwareengineering.stackexchange.com
157,564
[ "https://electronics.stackexchange.com/questions/157564", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/50265/" ]
EMG signal is the signal generated by muscle flex. EEG electrodes is the scalp potential generated by neuron firing. EEG is on the order of micro Volts whereas EMG is on the order of mili Volts, this implies that EMG is 3 order greater than EEG. The problem is that when doing EEG experiments, some EMG signals are tra...
In your hypothetical example of trying to detect a 3VDC signal against a background of 250kVDC noise (say between the phase 1 and phase 2 power lines), imagine the signal is being measured by a well-insulated lineman who can put his DMM's positive lead on the "phase 1" 250.003kVDC wire, and the negative lead on the "ph...
EEG is low freq compared to EMG. You can isolate EEG with a high CMRR amp with a small enough gain to not saturate given EMG and other noise, then low pass filter and then amplify more. This is not perfect, and I suspect a good deal of EEG studies may show EMG contamination, particularly early brain-machine interfac...
https://electronics.stackexchange.com
349,356
[ "https://softwareengineering.stackexchange.com/questions/349356", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/273011/" ]
I am working on a very large ASP.NET Web Forms project. Our team wants to rewrite this project with ASP.NET MVC and domain driven design. Is it a good idea to combine Web Forms with MVC? With this idea we can develop every page and use newly developed page in current project. Old pages work with Web Forms and new page...
No, you should not write such tests. First of all, these tests can't execute. To make this test runnable, you would have to create a small program containing the error and then run the compiler, checking its output for errors. That's perfectly doable, but it isn't fast. The only scenario where I have seen such tests i...
A test which doesn't compile can't be a test of your code - it won't run and there is no way to make it run, much less pass. You <em>could</em> use such a test if you were writing a compiler for a statically typed language to verify the type checking.
https://softwareengineering.stackexchange.com
1,892,888
[ "https://math.stackexchange.com/questions/1892888", "https://math.stackexchange.com", "https://math.stackexchange.com/users/41872/" ]
I'm looking for the closed solution $\dfrac{\partial}{\partial X} tr(A\odot X)$. What I got is the diagonal matrix with entries $A_{ii}$. Is that correct? And one more question. What would be $\dfrac{\partial}{\partial X} tr((A\odot X)^T (A\odot X))$? When calculating this, do I simply use the definition?
Replace the trace with a Frobenius product, and recall that the Frobenius (:) and Hadamard ($\circ$) products are mutually commutative, i.e. $$\eqalign{ C:A\circ B &amp; =A\circ B:C \cr &amp;= A:B\circ C \cr &amp;= A:C\circ B \cr\cr }$$ Then the first function, differential, and gradient are $$\eqalign{ f &amp;= {\...
Is it possible that most college students do not know the concept of derivative (or differential) of a function ? It is as if Bolt runs 100 meters in wooden clogs... @ julypraise , if you ask for a formula in matrix cookbook, then certainly, you did not understand the Hans' answer. Let $f:X\in M_n\rightarrow tr(A\ci...
https://math.stackexchange.com
533,784
[ "https://electronics.stackexchange.com/questions/533784", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/235938/" ]
I've heard it's common practice to use many resistors in series within a voltage divider to scale down an AC voltage for both power dissipation and capacitance considerations (using 10, 100MOhm resistors in series instead of one 1GOhm in a voltage divider.) Is there any type of formula/reference document out there that...
With resistor values that high the power dissipation will almost certainly not be a problem. Voltage capability will be though. The voltage rating of a resistor depends largely on its physical construction. Large through hole resistors are often rated for 250V or higher. The power rating will also depend upon the physi...
Voltage rating is a more serious consideration, specifically transient voltage rating, which should be in the kV. A single resistor (particularly a special high voltage type) may be fine, or not, depending on what standard(s) your product must meet, and what mitigation you implement in the product (E.g., TVS or MOV or ...
https://electronics.stackexchange.com
283,119
[ "https://mathoverflow.net/questions/283119", "https://mathoverflow.net", "https://mathoverflow.net/users/95296/" ]
Let $X$ be a Riemannian $n$-manifold with tubular end $\mathbb R^+\times Y$, where $Y$ is a closed $n-1$-manifold. Suppose $L:L^{p,w}_2(X)\to L^{p,w}(X)$ is the Laplacian operator which is translation invariant on the cylindrical end; here $L^{p,w}_i$ is a weighted $L^{p}_i$ space, i.e. $w$ is a function on $X$ such t...
<blockquote> What I don't understand is why the exactly the same terms should appear in both sums. </blockquote> The Galois action on CM points is described in adelic terms via the fundamental theorem of complex multiplication (or Shimura's explicit reciprocity law) so identifying the terms appearing in the right-ha...
Thank you Olivier for this great answer, I wish I could be one of your students ;-) ! Though I still not quite fully understand the adelic setting, here is some "classical" explanation I found, using the theory of ideals in orders of imaginary quadratic fields. I guess this is supposed to be a very well-known result b...
https://mathoverflow.net
377,748
[ "https://stats.stackexchange.com/questions/377748", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/227411/" ]
I am studying ECM alone using a book and some parts are not explained. First, the book advise to test for a unit and for the order of integration of the series. In eviews options are not pretty clear to me : <ul> <li>What is the difference between level, 1st difference and 2nd difference in the ADF Unit root test ? <...
I'll answer your questions pertaining to cointegration. 1) If the context of your exercise is the forecasting of a particular dependent variable by using a set of independent variables as opposed to jointly forecasting a set of variables, then you want to explore an ECM not a VECM, with the latter one being potentiall...
1) In ADF, the <span class="math-container">$H_0$</span> is the presence of unit root and <span class="math-container">$H_a$</span> is for stationary (weakly dependent) series. In your both examples, you don't reject <span class="math-container">$H_0$</span>. To reject <span class="math-container">$H_0$</span>, you wan...
https://stats.stackexchange.com
49,774
[ "https://physics.stackexchange.com/questions/49774", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/16919/" ]
Why must quantum logic gates be linear operators? I mean, is it just a consequence of quantum mechanics postulates?
Suppose you pick a state $|\psi_i\rangle$ at random with probability $p_i$ and send it through a logic gate denoted by $G$. This random state is written as a density matrix $\rho = \sum_i p_i |\psi_i\rangle\!\langle\psi_i|$. Denote $G(|\psi_i\rangle\!\langle\psi_i|)$ as the result of applying $G$ to a particular state....
Linear operators that are unitary conserve probability. Losing such a conservation makes computation with quantum mechanics meaningless.
https://physics.stackexchange.com
423,451
[ "https://physics.stackexchange.com/questions/423451", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/198517/" ]
In the Schrodinger Equation for a free electron in three dimensions, can the energy eigenvalue E always be broken up into x y and z components such that $E^2 = E_x^2 + E_y^2 + E_z^2$? What is the reasoning behind the answer?
For this to work it must be possible to break up the Schrodinger equation into three independent equations: $$ -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x_i^2}\psi_i(x_i)+V(x_i)\psi_i(x_i)=E_i\psi_i(x_i). \tag{1} $$ with $x_1=x,x_2=y,x_3=z$, and this can happen only if the potential function $V(x_1,x_2,x_3)$ can be...
Okay, it's a long answer, but it can be found everywhere. I'll go quickly through it, tell me if you need more clarification. The euqation is $$ -\frac{\hbar^2}{2m} \left(\frac{\partial^2 \psi}{\partial x^2}+\frac{\partial^2 \psi}{\partial y^2}+\frac{\partial^2 \psi}{\partial z^2}\right)=E\psi$$ <strong>First idea: ...
https://physics.stackexchange.com
53,942
[ "https://dba.stackexchange.com/questions/53942", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/30963/" ]
I am wondering how to decide the value of <code>innodb_buffer_pool_size</code> for my Master-Slave style database. I have a set of MySQL, 1 x master + 1 x slave. As I know that the <code>innodb_buffer_pool_size</code> is generally for data storing in memory to speedup the data access (read). So can I set the differen...
The buffer pool also benefits writing changes. When you change a row, it is first changed in the <em>copy</em> of the row's page, which resides in the buffer pool. InnoDB flushes that page back to disk later, and doesn't make you wait for the flush to finish before it calls the update complete (it only has to log the c...
<code>InnoDB buffer pool</code> caches both data and index pages. You can set this value to 70-80% of available memory for Innodb-only installations. If you have 16GB RAM on Master then you can set this upto 12GB similarly for your slave as well.
https://dba.stackexchange.com
143,662
[ "https://electronics.stackexchange.com/questions/143662", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/35762/" ]
How do we realize the design of a simple Op-amp with Bipolar Junction Transistors or MOS Field Effect Transistors alone? I mean I understand the need for differential amplifiers for providing a differential mode gain and I understand the requirement of Darlington pair as voltage amplifiers of the differential gain, but...
The differential amplifier is what gives you the common-mode rejection. Differential gain implies common-mode rejection. The high input impedance also comes from the input stage. If FETs are used, the high resistance is a property of the gate of the FET. BJTs multiply the resistance of the bias current source, which i...
The basic differential front end of a opamp works like this: <img src="https://i.stack.imgur.com/f89dH.gif" alt=""> On a single chip, the resistors would be current sources, usually a current mirror. Either way, think of how this works. Q1 and Q2 are built to match as closely as possible. Assume they are identical...
https://electronics.stackexchange.com
354,025
[ "https://mathoverflow.net/questions/354025", "https://mathoverflow.net", "https://mathoverflow.net/users/74343/" ]
Let <span class="math-container">$q$</span> be a prime power. Let <span class="math-container">$\mathbb{F}_q$</span> be the finite field with <span class="math-container">$q$</span> elements. Then <span class="math-container">$\mathbb{F}_{q^n}$</span> is a field extension of <span class="math-container">$\mathbb{F}_q$<...
Let <span class="math-container">$F$</span> be any field and <span class="math-container">$F&lt;E$</span> a finite field extension. Fix <span class="math-container">$x\in E^*$</span> and consider the multiplication operator <span class="math-container">$g_x\in \text{GL}_F(E)$</span>, the group of invertible <span class...
Let <span class="math-container">$k=\Bbb{F}_{q},K=\Bbb{F}_{q^n}$</span>, <span class="math-container">$x\in K$</span> and <span class="math-container">$g_x\in M_n(k)\cong End_k(K)$</span> the matrix of the multiplication by <span class="math-container">$x$</span>. If <span class="math-container">$k(x)$</span> is small...
https://mathoverflow.net
306,305
[ "https://physics.stackexchange.com/questions/306305", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/95956/" ]
Is it an inherent portion of defining something as a wave? Say if I had something that was modeled as a wave. When this thing encounters something else, will it obey the principle of superposition. Will they pass through each other?
If a wave $f(x,t)$ is something that satisfies the wave equation $Lf=0$ where $L$ is the differential operator $\partial_t^2-c^2\nabla^2$ then, because $L$ is linear, any linear combination $\lambda f+\mu g$ of solutions $f$ and $g$ is again a solution: $L(\lambda f + \mu g)=\lambda Lf+\mu Lg=0$. In general, there mig...
As coconut wrote, the superposition principle comes from the linearity of the operator involved. This is the case for electromagnetic radiation in vacuum. Approximations to water waves are also linear (since it is an approximation) but probably will have small non-linear parts. Free quantum field theory is also linear,...
https://physics.stackexchange.com
322,148
[ "https://mathoverflow.net/questions/322148", "https://mathoverflow.net", "https://mathoverflow.net/users/105661/" ]
In a handful of contexts people study Calabi-Yau threefolds formed by taking the fiber product of two rational elliptic surfaces. I can't find any detailed explanation of why such geometries are actually Calabi-Yau, so I think it's just a straightforward computation which I don't fully understand. Let <span class="...
The diagonal <span class="math-container">$\Delta $</span> is linearly equivalent to <span class="math-container">$\{p\}\times \mathbb{P}^1 +\mathbb{P}^1\times \{p\} $</span> for any <span class="math-container">$p$</span> in <span class="math-container">$\mathbb{P}^1$</span>. Therefore <span class="math-container">$X$...
<span class="math-container">$S\times_{\mathbb{P}^1}S'$</span> is a complete intersection in <span class="math-container">$\mathbb{P}^1\times \mathbb{P}^2\times \mathbb{P}^2$</span>: it is given by two equations of degree <span class="math-container">$(1,3,0)$</span> and <span class="math-container">$(1,0,3)$</span>. T...
https://mathoverflow.net
857,342
[ "https://math.stackexchange.com/questions/857342", "https://math.stackexchange.com", "https://math.stackexchange.com/users/28885/" ]
We flip $n$ fair coins every iteration of the game. Every coin that shows heads is removed from the game and we use the remaining $n-k$ coins to play the game again (where $k$ is the number of heads in that iteration). What is the expected number of iterations we need to complete before all the coins are gone.
Note that each iteration of the game follows a binomial random variable, namely $$X_r \sim B(N_r, 1/2),$$ where $N_r$ is the number of remaining coins in each try. Now, the expectation of a Binomial random variable equals the probability parameter times the number of experiencies, in this case $$\mathbb{E}(X_r)=\cfrac...
Hint: After $m$ flips, the chance that a given coin has been removed is $1-2^{-m}$. The chance that all the coins have been removed is then $(1-2^{-m})^n$. The chance the last coin is removed on flip $m$ is then $(1-2^{-m})^n-(1-(1-2^{-m+1})^n)$ because it has to survive through flip $m-1$.
https://math.stackexchange.com
421,660
[ "https://mathoverflow.net/questions/421660", "https://mathoverflow.net", "https://mathoverflow.net/users/45397/" ]
Fix an integer <span class="math-container">$n \ge 5$</span>. Let <span class="math-container">$\mathcal{V}$</span> be a <em>countable</em> collection of closed subvarieties of <span class="math-container">$\mathbb{P}^n_{\mathbb{C}}$</span> of codimension at least <span class="math-container">$2$</span>. Choose a point...
Consider the case when <span class="math-container">$C$</span> is a line through <span class="math-container">$p$</span>. Lines through <span class="math-container">$p$</span> correspond to points of <span class="math-container">$\mathbb P^{n-1}$</span>, and this gives a projection map <span class="math-container">$\ma...
<span class="math-container">$\DeclareMathOperator{\scrV}{\mathcal{V}}$</span>Yes. As a test case consider the case that <span class="math-container">$n = 2$</span> and <span class="math-container">$\scrV$</span> is a countable collection of points. Then for any <span class="math-container">$d \geq 1$</span>, the space...
https://mathoverflow.net
27,164
[ "https://softwareengineering.stackexchange.com/questions/27164", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/85/" ]
If you were hired into a new company as a team lead (say a team of 10) one of the important things to do is to earn the respect of the members of the team. In the early days the new team lead may know nothing of the team culture, code base and business domain: in other words, is a complete neophyte. How does one go a...
Lots of good answers already. I tried to do all these when I was a team lead. <ul> <li>Treat team with respect</li> <li>Delegate to strengths, but also give tasks that may help team members improve on weaknesses</li> <li>Protect the team from interruptions or distractions</li> <li>Be willing to educate</li> <li>Be wil...
<strong>Be a bullshit umbrella.</strong> Management is going to pawn tasks upon you. Don't then pawn those tasks off onto your subordinates. Work to shelter your subordinates from the crap that rains from above so they can focus on getting their jobs done.
https://softwareengineering.stackexchange.com
3,259
[ "https://dba.stackexchange.com/questions/3259", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/2098/" ]
I'd like to get the ID of a dataset for each category (my grouping column) which has the smallest "order" column.<br> Here a set of data to explain my thoughts: <pre><code>CREATE TABLE DATAS ( ID INT(2) , CATEGORY INT(2) , ORD INT(1) ); INSERT INTO DATAS (ID, CATEGORY, ORD) VALUES (1, 1, 3), (2, 1, 2), (...
Oracle solution to both problems: <pre><code>SELECT ID, Category FROM ( SELECT FIRST_VALUE(ID) OVER (PARTITION BY Category ORDER BY Ord) IDOfSmallestOrdForCategory , Category, ID FROM DATAS ) WHERE ID = IDOfSmallestOrdForCategory; </code></pre> Generic solution to both problems: <pre><code>SELE...
<strong>MySQL Solution</strong> I think I got it !!!! Query for the First Answer: <pre><code>SELECT A.ID,A.CATEGORY FROM (SELECT ID,CATEGORY,ORD FROM DATAS GROUP BY ID,CATEGORY) A INNER JOIN (SELECT MIN(ORD) ORD FROM DATAS) B USING (ORD); </code></pre> Query for the Second Answer: <pre><code>SELECT AA.ID,AA.CATEG...
https://dba.stackexchange.com
85,262
[ "https://dsp.stackexchange.com/questions/85262", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/64302/" ]
Suppose I have a signal <span class="math-container">$x(t)$</span> with baseband bandwidth <span class="math-container">$W$</span> Hz and power <span class="math-container">$P$</span>, and consists of <span class="math-container">$K$</span> samples, and I draw the two-sided power spectral density (PSD) of this [baseban...
<blockquote> negative frequencies don't exist in practice, and this is just a mathematical representation? </blockquote> I'd say it's exactly the the opposite. Signals with only positive frequencies do not exist in nature and they are indeed just a convenient mathematical representation. All physical signals are real (...
<blockquote> Negative frequencies do/don't... </blockquote> <strong>First</strong> In practice, if you have a single-valued real signal, the spectrum is symmetric across 0Hz (specifically, the negative frequency component is the complex conjugate of the positive frequency component). If I hand you a spectrum of a signa...
https://dsp.stackexchange.com
51,927
[ "https://physics.stackexchange.com/questions/51927", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/12586/" ]
In Statistical Mechanics, we often postulate that for an isolated system, the phase-space density of all accessible microstates (i.e all microstates consistent with the energy) is the same. This is equivalent to assuming that the system is ergodic. This postulate leads us to the assertion that at any given time, the sy...
First, although it is common in some textbooks, I don't think it is a good thing to necessarily relate the equiprobability postulate to ergodicity. Second, what this postulate enables is to estimate the probability distribution for the macrovariable you want to look at. You can of course look at the most probable valu...
Correct entropy in the analysis of complex systems: What is the consequence of rejecting the postulate of equal A priori probabilities? Delas, N. doi: 10.15587/1729-4061.2015.47332
https://physics.stackexchange.com
508,035
[ "https://electronics.stackexchange.com/questions/508035", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/256536/" ]
&quot;I want to power a module that requires 3.3V and 500mA minimum for startup. I have a solar panel that outputs max 3V at 70mA and a 3.3V 3A max output boost converter. I know I need a super capacitor or a capacitor bank to store energy so I can get the current needed for start up. Also, my module only needs around ...
Will this work? You'll need more capacitors, a lot more. Another problem is you'll also need an MPPT tracker and capacitor charge controller. A bigger solar panel with a higher voltage would also be recommended. The best option would be to use a battery. The boost converter only works to 0.9V so there is energy stored ...
I finally got my device to turn on without using a battery source. I have charged the capacitor to a certain voltage, then had a switch to connect to the load when above a certain threshold. To do so, I needed to break down my calculations to Energy (Joules/sec). My device can turn on for at least 2 minutes before shut...
https://electronics.stackexchange.com
279,124
[ "https://physics.stackexchange.com/questions/279124", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/129676/" ]
My basic understanding of the CMB tells me that this 'wall of radiation' is currently the furthest electromagnetic wave from our position that we can detect. Through relativity we know that objects far away are seen in an 'older' state due to the emitted photons taking time to reach our measuring tools. My understandi...
The CMB will look very nearly the same to both us and your observer on a distant galaxy. Your argument is correct. Our model for the expansion of the universe is based on the assumption that the universe is the same everywhere - technically that is it isotropic and homogeneous. Though at the current time this is obvio...
In fact, the CMB could look substantially different. The strongest feature on the CMB is not its well-known speckle pattern, but a blue/redshift dipole due to the movement of our local group. This dipole is usually removed in most representations. In a very distant galaxy, this dipole could be absent or stronger or poi...
https://physics.stackexchange.com
1,334,472
[ "https://math.stackexchange.com/questions/1334472", "https://math.stackexchange.com", "https://math.stackexchange.com/users/238647/" ]
My calculus course book (Adams' Calculus) does not explain why $(-1)^n$ diverges (it just says "$(-1)^n$ simply diverges"), and I tried to see why it diverges by taking its limit as $n$ approaches infinity, also I introduced $e^{\ln( \, \cdot \, )}$... but the result I get is complex infinity because of $n\ln(-1)$. Now...
The definition of a divergent sequence $a_n$ is that there exists $\varepsilon&gt;0$ such that for all $x\in \mathbb R$, there is no $N$ such that $|a_n-x|&lt;\varepsilon$ for all $n&gt;N$. This is a formal way of saying that there is no point that the sequence stays close to after a long time. If $$a_n=(-1)^n=-1,1,-1,...
Assuming n is a continuous variable and you wish to take the limit $n \to \infty$ (please clarify your question), the behavior might be more easily seen: let $z \equiv (-1)^n = (e^{i \pi})^n = e^{i n \pi}$. This is not "divergent" in the sense that it goes to (complex) infinity, since $|z|$ remains unity, but does no...
https://math.stackexchange.com
32,435
[ "https://dsp.stackexchange.com/questions/32435", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/23159/" ]
Say input-output of a system is defined as: $$ x[n] \longrightarrow x[nM] $$ then what will be the output of $x[n-1]$? will it be: \begin{align} x[n-1] \longrightarrow &amp;x\left[(n-1)M\right] = x\left[nM - M\right]\\ &amp;\textrm{or}\\ x[n-1] \longrightarrow &amp;x\left[nM - 1\right] \end{align} And if someone...
There is absolutely no need for explicit interpolation. The DFT can do that for you. Take you signal frame and apply a windowing function to minimise edge artefacts. Afterwards pad the frame with zeros to determine the number to output bins of the DFT. Then apply your FFT and you have an interpolated spectrum with the ...
If you signal is stable long enough, one method is to gather more data over a longer time period, and then use a longer FFT. If the sine/cosine functions of interest are far enough apart in frequency, and the noise and interference levels are low enough, you can use your current FFT results and interpolate between the...
https://dsp.stackexchange.com
321,772
[ "https://softwareengineering.stackexchange.com/questions/321772", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/219569/" ]
<strong>Background</strong> I have an interface defined for a circular-buffer called <code>ICircularBuffer</code> in a separate project. This <code>ICircularBuffer</code> is something that we use all over the place, so it resides in the <code>CommonInterfaces</code> project. Well, we have another interface <code>IEqu...
There are two options for this type of dependency. <h3>Interface dependency</h3> You can define a method on the controller interface which accepts a buffer. This increases coupling between the modules, and <em>may</em> have a ripple effect in terms of dependencies and code changes. Existing implementations will need ...
<blockquote> Because of how the CommonInterfaces is used all over the place, is it okay for my IEquipmentController's project to take a dependency on the CommonInterfaces project? </blockquote> Of course it is. That's the whole point of a project like CommonInterfaces. You want to be able to freely reuse those i...
https://softwareengineering.stackexchange.com
2,261,149
[ "https://math.stackexchange.com/questions/2261149", "https://math.stackexchange.com", "https://math.stackexchange.com/users/292093/" ]
I already proved that if a set A is compact in a metric space M = (X,d) then A is closed and bounded, however, can we say that if I have a set A that's closed and bounded it's also compact in M?
(1). Take any metric space $(X,e).$ Let $d(p,q)=\min (1,e(p,q)).$ Then $(X,d)$ is a metric space. And the metrics $e,d$ generate the same topology on $X.$ Compactness is a property of the topology. So if $(X,e)$ is not a compact metric space then $(X,d)$ is not. But $X$ is a closed bounded subset in the space $(X,d)...
No. Take $A = M$, which is always closed, so you're asking if a bounded metric space is always compact. This is false and there are many counterexamples; for example, consider an infinite set with the discrete metric, where two non-identical points are at distance $1$ from each other.
https://math.stackexchange.com
651,073
[ "https://physics.stackexchange.com/questions/651073", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/267438/" ]
My textbook states that the linear magnification of concave mirrors <strong>can either be equal to one, less than one, or greater than one.</strong> It seems plausible enough considering the fact that concave mirrors can form images of the same size, diminished images, or enlarged images. <strong>However, upon further ...
We know that magnification of spherical mirrors is <span class="math-container">$$m=-\frac{v}{u}$$</span> and also <span class="math-container">$$\frac{1}{f}=\frac{1}{v}+\frac{1}{u}$$</span> Substituting <span class="math-container">$v$</span> in the magnification formula, we get <span class="math-container">$$m=\frac{...
When the object is placed very close to the mirror<span class="math-container">$^1$</span> so that <span class="math-container">$u \rightarrow 0$</span>, then the magnification <span class="math-container">$M\rightarrow +1$</span>. There is no contradiction. In this case, <span class="math-container">$$M=\frac{h_i}{h_o...
https://physics.stackexchange.com
308,817
[ "https://softwareengineering.stackexchange.com/questions/308817", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/128967/" ]
I was once advised that a C++ program should ultimately catch all exceptions. The reasoning given at the time was essentially that programs which allow exceptions to bubble up outside of <code>main()</code> enter a weird zombie state. I was told this several years ago and in retrospect I believe the observed phenomenon...
One problem with letting exceptions go past main is that the program will end with a call to <code>std::terminate</code> which default behavior is to call <code>std::abort</code>. It is only <em>implementation defined</em> if stack unwinding is done before calling <code>terminate</code> so your program can end without ...
The main reason for not letting exceptions escape from <code>main</code> is because otherwise you lose all possibility to control how the problem gets reported to your users. For a program that is not intended to be used a long time or distributed widely, it can be acceptable that unexpected errors are reported in wha...
https://softwareengineering.stackexchange.com
312,327
[ "https://softwareengineering.stackexchange.com/questions/312327", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/151380/" ]
Let's say I have a grid with square fields. For the fields I have an abstract <code>Field</code> class. This class has several subclasses, for example <code>EmptyField</code> or <code>RoadField</code>. Some of these fields can be connected to each other, thus I have an interface <code>IConnectable</code> that these cla...
Firstly, there is not a single conceivable solution modelled in <strong>any</strong> OO language using inheritance from a base class, which could not also be modelled effectively using composition. Inheritance from a base class can occasionally make code <em>more convenient to write</em> when compared with compositio...
Define the enumeration separately, then include it as a member in the interface. You cannot define an enumeration in the definition of an interface, but the defined enumeration can be a member in the interface. You can do this in the same file as the interface if you want, as I've done here: <pre><code>namespace Your...
https://softwareengineering.stackexchange.com
199,492
[ "https://softwareengineering.stackexchange.com/questions/199492", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/54384/" ]
Instead of programming the way we do, why don't we make specifications of common tasks such as "sorting", and then let the environment compile it to make best use of it's hardware? This way, we could ship computer with new specialized hardware such as sorting networks, and it would automatically work with existing code...
First of all, <strong>computers come with specialized hardware</strong>. Every laptop and desktop computer sold for quite a few years now has a specialized co-processor, a Graphics Processing Unit, that handles visual-processing algorithms, such as video and gaming applications require. Very large computers (<em>e.g....
The main issue is that sorting algorithms (1) need a lot of flexibility, and (2) would be very difficult to accelerate using hardware anyway. One thing is that sorting algorithms are already easily fast enough to outrun the memory bandwidth of the processor - the processor will already spend a large proportion of its ...
https://softwareengineering.stackexchange.com
441,575
[ "https://softwareengineering.stackexchange.com/questions/441575", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/403757/" ]
Let me clarify on a bit of an abstract question. I'm about to develop an app, through which users can capture and store images. Commercially, the main cost here that springs to mind is storage cost. There are platforms (e.g. facebook, dropbox, instagram) that may expose an API to allow consumers to upload images. Which...
This isn't something where there will be a law that says &quot;you can't use facebook for hosting&quot;, that will be left up to the contract between facebook and you, i.e. their terms of use. You might well find that for a small volume of images that you currently want to store, you <em>can</em> do exactly this. It wo...
It's an interesting idea, not for the commercials but for potential anonymous distributed storage. The problem of course is you would run afoul of the Terms and Conditions of any site you used and presumably have your accounts periodically banned and data deleted. To deal with that you would have to automate account cr...
https://softwareengineering.stackexchange.com
111,968
[ "https://stats.stackexchange.com/questions/111968", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/48876/" ]
I have a computer science background but am trying to teach myself data science by solving problems on the internet. I have been working on this problem for the last couple of weeks (approx 900 rows and 10 features). I was initially using logistic regression but now I have switched to random forests. When I run my ra...
To avoid over-fitting in random forest, the main thing you need to do is optimize a tuning parameter that governs the number of features that are randomly chosen to grow each tree from the bootstrapped data. Typically, you do this via $k$-fold cross-validation, where $k \in \{5, 10\}$, and choose the tuning parameter t...
How are you getting that 99% AUC on your training data? Be aware that there's a difference between <pre><code>predict(model) </code></pre> and <pre><code>predict(model, newdata=train) </code></pre> when getting predictions for the training dataset. The first option gets the <em>out-of-bag</em> predictions from the ...
https://stats.stackexchange.com
3,260,681
[ "https://math.stackexchange.com/questions/3260681", "https://math.stackexchange.com", "https://math.stackexchange.com/users/377870/" ]
Let <span class="math-container">$\phi : [0,\infty) \to [0,\infty)$</span> be continuous on <span class="math-container">$[0,\infty)$</span> and once differentiable in <span class="math-container">$(0,\infty)$</span>. Assume that <span class="math-container">$\phi(0)=0$</span> and <span class="math-container">$\forall ...
<strong>Hint:</strong> Use the mean value theorem to derive a contradiction.
We have: <span class="math-container">$(1) \quad\phi(t) \ge 0$</span> for all <span class="math-container">$t \ge 0.$</span> <span class="math-container">$(2) \quad\phi'(t) \le 0$</span> for all <span class="math-container">$t &gt;0.$</span> <span class="math-container">$(3) \quad \phi(0)=0.$</span> <span class="ma...
https://math.stackexchange.com
13,666
[ "https://physics.stackexchange.com/questions/13666", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/4951/" ]
I was having a discussion with a friend about human tolerances of g-force. He believed that the maximum human tolerance of negative g-force is low, in the order of .5 g. I countered, saying that you're able to stand on your head and do not die. An interesting discussion ensued but there was one thing that we couldn't f...
You are correct that standing on your head is the same as a G-force of -1 G. That is what Einsteins equivalence principle tells us. Your friend is correct that tolerance for negative Gs is lower, but it is around -3 G not -.5 G. Tolerance for positive vertical Gs is around 5 Gs without G suits or training. Tolera...
'g-force' (or acceleration) is actually a vector quantity. Therefore a negative g-force is identical to a positive g-force in the opposite direction. This is however a cluttered way of thinking about the situation. I recommend drawing a few free body diagrams to clear up the physical situation. I am deliberately av...
https://physics.stackexchange.com
218,311
[ "https://dba.stackexchange.com/questions/218311", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/161344/" ]
My database setup is modern (My)SQL. I've got a Content Table, including ids. Now, users should be able to comment on content. To achieve this, arrays have come to my mind. Now I see several options of representing them : <ul> <li>A second table Comments with Content id and Comment</li> <li>One new table for each Con...
In terms of relational databases each table represents a type. Table <code>Content</code> contains the items of <code>content</code> type. Table <code>Comment</code> contains the items of <code>comment</code> type etc. There is no strict requirement like "normalization" to keep all the items of the same type in the sam...
Second table for comments is the best option, as you can have many comments by different users at different time interval, which need paginated output during the display. Separate table for each content is bad idea not only from database side, but also how you are going to identify each content uniquely from frontend ...
https://dba.stackexchange.com
164,742
[ "https://mathoverflow.net/questions/164742", "https://mathoverflow.net", "https://mathoverflow.net/users/38889/" ]
Let $G$ be a finite group, $p$ a prime number. We denote by $\mathbb{F}_p$ the field of cardinality $p$. Let $V$ be an infinite dimensional representation of $G$ over $\mathbb{F}_p$. Must there be $G$-invariant, proper subspaces $U,W \leq V$ such that $U + W = V$? I do not require the sum to be direct. The question s...
I am not sure that I follow Rickard's argument, but here is a direct proof. Given an infinite dimensional module $V$ (over an arbitrary field.) for a finite group $G$, I want to argue first that there exists a proper $G$-submodule $U$ with finite codimension. Let $X &lt; V$ be an arbitrary proper subspace with finite c...
Yes. In fact, $V$ has an infinite dimensional semisimple quotient, which is decomposable since any simple $\mathbb{F}_pG$-module is a quotient of $\mathbb{F}_pG$ and so is finite-dimensional. Let $V'=\operatorname{rad}(V)=V.\operatorname{rad}(\mathbb{F}_pG)$. Then $V/V'$ is infinite dimensional if $V$ is, and is semis...
https://mathoverflow.net
15,082
[ "https://biology.stackexchange.com/questions/15082", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/5700/" ]
What are 5' and 3' in DNA and RNA strands? Please clarify with some images and please use simple English.
The 5' and 3' mean "five prime" and "three prime", which indicate the carbon numbers in the DNA's sugar backbone. The 5' carbon has a phosphate group attached to it and the 3' carbon a hydroxyl (-OH) group. This asymmetry gives a DNA strand a "direction". For example, DNA polymerase works in a 5' -> 3' direction, that ...
The no 5 and 3 are the carbon no of the carbon skeleton ring of deoxyribose as similar as any other organic compound. In any nucleic acid, RNA or DNA 3' refers to the 3rd carbon of sugar ribose or deoxyribose which is linked to OH group and 5' linked to a triple phosphate group. So these 5' and 3' group provide a d...
https://biology.stackexchange.com
243,209
[ "https://electronics.stackexchange.com/questions/243209", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/115207/" ]
When a buzzer 'rating' is 3v, What does that exactly mean? When my buzzer 'input range' is from 3-10v?What does 'rating of a device tell us? Can someone differentiate between the two parameters above?
If I heard something was "rated for 3V", I would try to avoid exceeding that voltage. "Rating" refers to a safe boundary, and that boundary is usually a maximum - things are more likely to break from too much power than too little. If the buzzer did not work just below 3V, then one might risk going just above. The inp...
A datasheet, or some information on where you saw this would be nice... A rating of 3 Volts means that the device is intended to operate from a 3 volt power supply. An input range of 3 - 10 volts means that the device will work on any power supply voltage within that range.
https://electronics.stackexchange.com
40,930
[ "https://mechanics.stackexchange.com/questions/40930", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/25217/" ]
I understand it depends on a lot of different factors and probably have a large range of #s. But could anyone give me some information about the range of the spring rate and where I can find more information about it? Just want to get an idea of what would be reasonable. Thanks in advance.
<strong>These are symptoms of a failing fuel pump.</strong> After Neil's answer, I filled with premium and the problem seemed to go away for a few days. Soon after it was back with a vengeance and about a week after asking this question, the vehicle wouldn't start at all. It would crank but no amount of fiddling would...
I am assuming no check engine light? Strange to have this mix of issues and not throwing diag codes - you'd get a misfire code for instance if you had a weak coil pack. Based on this intermittent issue I'm thinking it's possible you have bad gas ... I'd try topping up with premium. Fuel filter is in the gas tank and re...
https://mechanics.stackexchange.com
287,541
[ "https://softwareengineering.stackexchange.com/questions/287541", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/90352/" ]
I am planning to develop a new application that will heavily use a library that will be developed from scratch specifically for the application, but made general enough for it to be used for other programs once it's finished. So the development of this library is going to be heavily driven by the development of the ap...
First, if your library is generic, it should NOT be influenced by the application. It should provide the functionality that it is designed to provide. Application is based on the library, not the other way around. Whether you keep it the same repository or different one, doesn't matter - have it a separate project tho...
I'll start with the generic language neutral stuff first, and then I'll cover the python specific bits. Why are you so sure that there needs to be a seperate library? Is it because different developers working on the code? or are there plans to reuse the library in additional applications? or even to distribute the l...
https://softwareengineering.stackexchange.com
9,432
[ "https://softwareengineering.stackexchange.com/questions/9432", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/3712/" ]
I have recently started work at a company using their proprietary CMS. Unfortunately, there is virtually no documentation for the application, and the source comments are also quite sparse. Normally, given a particular task - I work down through the choices below, going to the next step if I can't find a solution 1:...
Explain to them that the lack of documentation is slowing you down and see if you can setup a block of time with the other developer for him/her to teach you the CMS system. If they really do not want you bothering the other developer, at least let them be aware that it is slowing you down because you are having to fig...
I have found that actually jumping in and trying something, a step you have omitted, after scanning - or failing to find - the documentation often helps. Call an API function, see what happens, examine the return value if provided. Sometimes carefully reading the documentation first makes things seem more complicated...
https://softwareengineering.stackexchange.com
100,664
[ "https://electronics.stackexchange.com/questions/100664", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/34787/" ]
I found the following question in a test. I am not looking for an answer to the question per se, but I am having difficulty understanding the part in bold, as explained below. <blockquote> A main memory unit with a capacity of 4 megabytes is built using <strong>1M×1-bit DRAM chips. Each DRAM chip has 1K rows of ce...
From the outside, each memory chip is organized as 1M words of 1 bit each, which means that it takes 20 address bits to specify a word. Internally, the memory is physically organized as a square matrix of 1024 rows and 1024 columns, with one bit in each position in the matrix. There are at least two reasons that the ...
How the <em>interface</em> is organized has nothing to do with how the memory is <em>logically</em> organized, nor how it is <em>physically</em> organized. Your basic assumption that the row size is equal to the word size is incorrect.
https://electronics.stackexchange.com
2,958,291
[ "https://math.stackexchange.com/questions/2958291", "https://math.stackexchange.com", "https://math.stackexchange.com/users/467366/" ]
I'm studying engineering and for the most part, I feel like I understand the main concepts behind <em>Linear Algebra</em>. However, I feel like my understanding is superficial. I feel like <em>Linear Algebra</em> is a subject that consists of different pieces loosely related to each other, I can't see what the most fu...
I struggled through the same thing in engineering school. Part of the issue is that it is easy to see how linear algebra works in 2- or 3-dimensional Euclidean space. It's the most basic algebra, solving simultaneous equations with straight lines. In fact, most of what you study in classic high school algebra is abo...
Linear maps, linear spaces, linear dependence, alternating forms and their interrelations.
https://math.stackexchange.com
156,585
[ "https://softwareengineering.stackexchange.com/questions/156585", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/58499/" ]
<em>Persistence Ignorance</em> is an application of single responsibility principle, which in practice means that Domain Objects (<strong>DO</strong>) shouldn't contain code related to persistence, instead they should only contain domain logic. a) I assume this means that the code which contacts lower layers ( ie per...
I believe you are correct in your assumptions A and B around persistence ignorance. How you would best accomplish lazy loading of database objects is greatly dependent on your particular problem and implementation. However, I will attempt a generic answer to how to do lazy loading while still maintaining separation o...
You just have some wireup class that populates the domain objects (say, something called "repository"). You can implement lazy loading or whatever kind of cache coherence scheme you want and the domain objects are none the wiser. You're separating the responsibility of populating domain objects from being domain obje...
https://softwareengineering.stackexchange.com
87,298
[ "https://security.stackexchange.com/questions/87298", "https://security.stackexchange.com", "https://security.stackexchange.com/users/19694/" ]
I'm studying application security and now I have a question which I couldn't find a good answer. Assume I have a vulnerable desktop application in my virus-free windows 7 PC. Let's say when the file size > 10 MB, it causes to an exception in notepad.(just an assumption, you might suggest another scenario). <strong>Who...
<blockquote> Whom should I save the pc from? </blockquote> If the desktop application is not listening on a port, it means if there is a potential vulnerability, it can only be exploited locally. The attacker might have exploited another vulnerability and now looking for privilege escalation or persistence. Don't al...
Let's suppose a >10mb file opened in notepad causes a buffer overflow and somehow the instruction pointer is set to a location inside that buffer. Somebody could create a maliciously crafted text file which contains shell code at that location inside the text file. You download the text from the internet, put it in not...
https://security.stackexchange.com
437,202
[ "https://stats.stackexchange.com/questions/437202", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/260797/" ]
<h3>RMSE vs RMSLE</h3> Root Mean Squared Error (RMSE) and Root Mean Squared Logarithmic Error (RMSLE) both are the techniques to find out the difference between the values predicted by the machine learning model and the actual values. <blockquote> <ul> <li>But, what is the purpose for RMSLE( "logarithmic")</li> ...
RMSLE is an error metric that is sometimes used for prediction of random variables. If you have a vector of random variables <span class="math-container">$\mathbf{x} = (x_1,...,x_n)$</span> and you make the predictions <span class="math-container">$\hat{\mathbf{x}} = (\hat{x}_1,...,\hat{x}_n)$</span> then the RMSLE of...
In the RMSLE you take the log of your predicted response variable (<span class="math-container">$y_{pred}$</span>) and of the actual response variable (<span class="math-container">$y$</span>). Using RMSLE can be beneficial if you do not want to penalize big differences between <span class="math-container">$y_{pred}$<...
https://stats.stackexchange.com
99,134
[ "https://electronics.stackexchange.com/questions/99134", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1235/" ]
I'm thinking about making a self contained Bluetooth LE temperature sensor. I'd like it to be usable up to the boiling point of water. All the BTLE device seem to be rated up to 85C. Do you think they would operate at 100C?
To answer your question, what do <strong>I</strong> think? I would lay better than even odds that most samples of such a chip will be functional at 15°C over the guaranteed range, possibly not quite meeting specifications in one way or another. However, my guess and $2 will almost get you a coffee. If it's a student ...
It's never a good idea to exceed the IC manufacturer's recommended operating conditions. You may get away with it with some devices from certain batches, but units from another production run will likely fail or operate flakey. It's a crap shoot. Look into the LM75B. This is an I2C interface temperature sensor with a...
https://electronics.stackexchange.com
9,719
[ "https://cstheory.stackexchange.com/questions/9719", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/186/" ]
Many results in cryptography depend on impossibility results/conjectures in complexity theory. For example, public-key cryptography using RSA is believed to be possible because of the conjecture about infeasibility of the factoring (and the modular root finding problems). My question is : <blockquote> do we have s...
In some sense, this is what the theory of parametricity is all about. Data abstraction is how we ensure that no client of a module can access the elements of a module except according to the interface exposed by the module. We rely on this to ensure that the internal invariants of data structures cannot be broken by...
Kolmogorov complexity might fall into this category. One can show that there are certain strings, which cannot be compressed by any Turing machine. These strings behave "generically" so you can study the random properties of certain information and computational tasks by studying the behavior with respect to a (non-ra...
https://cstheory.stackexchange.com
14,484
[ "https://physics.stackexchange.com/questions/14484", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/5201/" ]
In string theory, the first excited level of the bosonic string can be decomposed into irreducible representations of the transverse rotation group, $SO(D-2)$. We then claim that the symmetric traceless part (i.e. the <strong>35</strong> rep) is the spin-2 graviton - but isn't the label "spin-2" intrinsically 3+1 dimen...
It is traditional to label massless (and some massive) states in higher dimension by their 3-d "spin" counterparts, even thought he label is completely inaccurate, as you say. All antisymmetric forms are "spin-1", the symmetric two-index object is "spin-2", a fundamental spinor is "spin 1/2" and a vector of spinors is ...
I don't know anything about string theory, but the graviton has been described as a spin-2 particle well before string theory. In his "Lectures on Gravitation" Feynman explains why the graviton must be integer spin, then explains why it can't be 0 or 1, then proceeds to attempt to build the quantum field theory of a sp...
https://physics.stackexchange.com
15,690
[ "https://electronics.stackexchange.com/questions/15690", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1270/" ]
Are the thermal resistance values of heat sinks/etc reasonably reversible? If I wanted to dissipate an internal ambient temperature rise, could I use an internal heat sink on the enclosure wall coupled to a heat sink on the outside to pull heat out of the box? Can I use the same thermal resistances of the heat sinks i...
Yes, thermal resistance/conductance is a two-way street, for passive conductive cooling devices, with equal speed limits posted for both directions. OK, now for the caveats: If your heat sink is rated for forced air flow, and you have no forced air flow, then the heat flow through the heat sink will be different. Yo...
How much heat is drained to the environment is determined by two factors: the difference in temperature between the heat source and the environment and the total thermal resistance between those.<br> One of the elements in this thermal resistance chain is the resistance between the air inside your enclosure and the enc...
https://electronics.stackexchange.com
529,432
[ "https://physics.stackexchange.com/questions/529432", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/222889/" ]
Coulumb's law states that <span class="math-container">$$F \propto q_1 \cdot q_2 \tag{1} $$</span> and <span class="math-container">$$ F \propto \frac{1}{r^2} \tag{2} $$</span> Why can we combine these two proportions into <span class="math-container">$$ F \propto \frac{q_1.q_2}{r^2}?$$</span> What property allows tha...
Let us say we want to define electrostatic force between two charges. What would it be a function of? We make the simplest guess that it must be related to the charges <span class="math-container">$q_1,q_2$</span> and the distance <span class="math-container">$r$</span> between the two, <span class="math-container">$F\...
your description is imprecise ∝1.2 for fixed r and ∝1/^2 for fixed q1,q2 and r independent of q1 and q2 only then you can deduct Coulombs law
https://physics.stackexchange.com
358,069
[ "https://physics.stackexchange.com/questions/358069", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/117227/" ]
I am studying some things surrounding the Young's double slit experiment and am trying to understand the derivations. The part that is not clear to me is the far-field approximation. That is, I understand what it means, but am failing to obtain the same equation as the tutorial. We start with a wave of wavelength $\la...
You asked for a hint... express your equations as $r_1 = r+\delta$ and $r_2 = r-\delta$; then note that the intensity term ($1/r_1$ and $1/r_2$) will basically be the same for both (replace as above, and the $\delta$ term will vanish), and things will fall into place. You might need to be reminded that $e^{i\phi} = \co...
I am answering my own question with the help of @Emilio Pisanty and @Floris. Much appreciated! Here it goes. Consider the difference between the paths traveled by the wave emitted from slit 1 and the wave emitted from slit 2. Call them $r_1$ and $r_2$. The difference is $2\delta = r_1 - r_2$. Then, $r_1 = r + \delta$...
https://physics.stackexchange.com
311,218
[ "https://mathoverflow.net/questions/311218", "https://mathoverflow.net", "https://mathoverflow.net/users/129125/" ]
Let <span class="math-container">$M$</span> be a differentiable manifold. Let <span class="math-container">$\mu$</span> be a (probability) measure on <span class="math-container">$M$</span>. What are the conditions under which <span class="math-container">$\mu$</span> is given by a differential form on <span class="m...
I assume that <span class="math-container">$\mu$</span> is a measure defined on the <span class="math-container">$\sigma$</span>-algebra of Borel sets. First, on any manifold the notion of negligible set is well defined. If <span class="math-container">$M$</span> is orientable and <span class="math-container">$\mu(...
Any smooth manifold has a canonical σ-ideal of negligible subsets, and μ must vanish on these. Apart from that, the Lie derivative of μ with respect to any smooth vector field must exist. This is how smooth measures are defined by Ramanan in Definition 1.9 of Chapter 3 of Global Calculus, for example. Remark 2.8 in ...
https://mathoverflow.net
99,636
[ "https://softwareengineering.stackexchange.com/questions/99636", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/1300/" ]
I like to keep my code testable and have decided to go with the Dependency-Injection strategy for my current MVC framework, which definitely has proven to be a great way to ensure loosely coupled code, testability and modularity. But as being far from a master at Design patterns, I have a hard time of figuring out a ...
One way is to design your models before you design your database. When designing your models, the focus is on capturing the business logic and meanings within the problem domain. This should be captured in a way which makes sense to the business, including more than just entities and data fields. Some data elements ...
You want to have two things. <ol> <li>Your Models (accessors to the DBAL and doing most of the app logic).</li> <li>Your "Domain Models" aka Data Entities, these represent the entities of your system such as users, posts, products etc. <pre><code>class PPI_Model_User { protected $_conn = null; function __c...
https://softwareengineering.stackexchange.com
324,237
[ "https://mathoverflow.net/questions/324237", "https://mathoverflow.net", "https://mathoverflow.net/users/136356/" ]
Consider the structure of the positive real numbers <span class="math-container">$(0, \infty) $</span> with its unit <span class="math-container">$1$</span>, its addition <span class="math-container">$+$</span>, its multiplication <span class="math-container">$\times $</span>, and its strict ordering <span class="math-...
Another way to see o-minimality is to note that <span class="math-container">$log$</span> induces an isomorphism <span class="math-container">$$log : ((0,\infty), 1, +, \times, &gt;) \cong (\mathbb R, 0, \oplus, +, &gt;),$$</span> where <span class="math-container">$\oplus$</span> is the binary operation defined by <sp...
Yes. To see this, first note that we can interpret the positive reals in <span class="math-container">$(\mathbb{R},0,1,+,-,\times)$</span> as squares of non-zero real numbers. We can by induction on complexity of formulas define a translation map from formulas in the language of the positive reals to formulas in the la...
https://mathoverflow.net
129,653
[ "https://cs.stackexchange.com/questions/129653", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/121874/" ]
On my computer science course's exam I was given the following task: <em>You are given <span class="math-container">$n$</span> segments that lies on the same line: <span class="math-container">$i$</span>-th segment starts at coordinate <span class="math-container">$from_i$</span> and ends at <span class="math-container...
Let's first assume there is no common boundaries between all segments. Create the list of tuples (<span class="math-container">$pos$</span>, <span class="math-container">$ind$</span>) with a value (<span class="math-container">$pos$</span>) for each boundary of every segment (thus <span class="math-container">$2n$</spa...
<strong>Edit</strong>: By mistake I thought we were working in 2 dimensions, this answer is for the 2d case. (I don't know why plshelp mentioned order statistics tree in his/her deleted answer because I didn't understood it but maybe he/she misunderstood like me.) We can use a sweep line algorithm. We think of each act...
https://cs.stackexchange.com
98,402
[ "https://electronics.stackexchange.com/questions/98402", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/36467/" ]
I recently learned that capacitors have two sides that are interchangeable, meaning you can hook them up to a battery in either configuration. If this is true, can you just hook both sides up to a positive terminal?
mckryall, Here's a quick hands-on lesson in what capacitors do: <ol> <li>Get yourself an electrolytic capacitor with a value of 10 or more microfarads (uF,mfd). Any voltage rating (WVDC) will do.</li> <li>Connect the capacitor momentarilly to a standard D-cell, C-Cell or AA-Cell battery with the cap's negative lead c...
You could think of capacitors in 2 ways. The first is that in a purely DC path all they do is block current (once they have fully charged to the voltage across them). In an AC signal path they are more like a variable resistance, and the term for it is capacitive reactance, which is measured in ohms and changes with ...
https://electronics.stackexchange.com
223,373
[ "https://math.stackexchange.com/questions/223373", "https://math.stackexchange.com", "https://math.stackexchange.com/users/35366/" ]
If two random variables $x$ and $y$ are identical and independently distributed, do they need to have the same mean and variance? Can there exist a case where they are iid and still have different parameters?
If two variables are iid , then they must have the same distribution.Which means they have the same parameters namely mean, std dev.
The mean and variance are determined by the distribution. Thus, if they have the same distribution, they must have the same mean and variance.
https://math.stackexchange.com
100,264
[ "https://physics.stackexchange.com/questions/100264", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/28958/" ]
When renormalizing QED, we calculate the 1 loop correction to the fermion-fermion-photon vertex using the diagram, $\hskip2in$ <img src="https://i.stack.imgur.com/1VHVt.png" alt="enter image description here"> When doing the calculation we typically let the photon go off-shell but demand that the fermions be on-shel...
Actually, in renormalization of QED, there is no demand to put the fermions of vertex diagram on mass shell. Renormalization procedure is usually performed on the level of Green functions with general four-momenta of outer legs. Note that the off-shell propagator you mention is connected to vertex function via Ward-Tak...
Putting the fermions on-shell or off-shell doesn't change the divergent part of counterterms. In the renormalization schemes, the counter terms are determined to cancel the divergencies. You can put $p^2=m^2$ or $p^2=-\mu^2$ or etc in the diagrams to determine the counter terms, but notice that the derived renormalizat...
https://physics.stackexchange.com
3,443,910
[ "https://math.stackexchange.com/questions/3443910", "https://math.stackexchange.com", "https://math.stackexchange.com/users/308929/" ]
<blockquote> Prove that <span class="math-container">$f:[0,1] \rightarrow\mathbb{R}:f(x)= \left \{\begin {array}{ll} \sin \frac1x &amp;, \textrm{if}~ x\in(0,1]\\ 0 &amp;, \textrm{if}~~x =0 \end{array} \right.~~$</span> is Riemann integrable using Darboux sums. </blockquote> <em>Attempt.</em> The proof that I am...
Fix <span class="math-container">$n$</span> large. Then for <span class="math-container">$1/n\le x &lt;y\le 1,$</span> the mean value theorem shows <span class="math-container">$$\tag 1 |f(y)-f(x)|\le n^2|y-x|.$$</span> Now let <span class="math-container">$m\in \mathbb N$</span> be greater than <span class="math-con...
Take <span class="math-container">$\epsilon &gt; 0$</span> and <span class="math-container">$n \in \mathbb N$</span> such that <span class="math-container">$0 &lt; \frac{1}{n \pi} &lt; \frac{\epsilon}{4}$</span>. As <span class="math-container">$f$</span> is continuous on <span class="math-container">$[\frac{1}{n \pi}...
https://math.stackexchange.com
542,955
[ "https://physics.stackexchange.com/questions/542955", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/260137/" ]
If eigenvalues of an observable have the physical meaning of a possible result after a measurement, what's the interpretation of degenerate eigenvalues, and what is an example of such an observable?
<blockquote> If the value of the measurement is <span class="math-container">$a_2$</span>, how would we physically be able to tell if the system jumped to the state <span class="math-container">$|a_2\rangle$</span> or <span class="math-container">$|a_3\rangle$</span> </blockquote> Measuring <span class="math-contain...
<blockquote> What is a physical example of an observable with degenerate eigenvalues? </blockquote> A simple explicit example is the energy of a hydrogen atom. In the Schrodinger approximation, the <span class="math-container">$2s$</span> state and the <span class="math-container">$2p$</span> states all have the sam...
https://physics.stackexchange.com
541,788
[ "https://physics.stackexchange.com/questions/541788", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/117029/" ]
As we all know, a gauge invariant theory is of the form <span class="math-container">$$ \mathcal{L} = \bar{\psi} \gamma^\mu \left( i\partial_\mu + A_\mu^a T^a\right) \psi.$$</span> The multiplet <span class="math-container">$\psi$</span> and gauge field <span class="math-container">$A_\mu = A^a_\mu T^a$</span> transf...
Suppose that the lagrangian <span class="math-container">$$ \newcommand{\cL}{{\cal L}} \newcommand{\opsi}{{\overline \psi}} \newcommand{\pl}{\partial} \cL=\opsi\gamma^\mu(i\pl_\mu+A_\mu)\psi \hskip2cm A_\mu := \sum_a A^a_\mu T^a \tag{1} $$</span> is invariant under gauge transformations<span class="math-container">$^...
Since a gauge field is spacetime-dependent, a translation in spacetime is necessarily accompanied by some change in gauge. Thus, you can think of the gauge covariant derivative (<span class="math-container">$D_\mu$</span>) as an infinitesimal spacetime translation (<span class="math-container">$\partial_\mu$</span>) al...
https://physics.stackexchange.com
296,110
[ "https://stats.stackexchange.com/questions/296110", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/172217/" ]
I have a text field dataset. Each observation counts the number of appearances of that particular word, and the columns (variables) are most frequently appeared words. Within each column, zeros dominates with a percentage of over 90%. I have a binary response variable that I am predicting. So far, CART and neural netwo...
I would propose a few potential issues with your current procedure. (2) is more likely the primary issue. <ol> <li>Feature engineering / model selection: It may be the case that the models or the features are not well suited to extracting your signal of interest. This question is an empirical one, you should consider ...
I use four methods in case of excesses of zero: <ul> <li>Double Hurdle (the first step is a logit or probit)</li> <li>Zero Inflated (for discrete distribution as your case would be a ZIB Zero Inflated Binomial) - you could add an EM algorithm to improve accuracy.</li> <li>Tweedie Distribution (with a case that in my o...
https://stats.stackexchange.com
2,502,366
[ "https://math.stackexchange.com/questions/2502366", "https://math.stackexchange.com", "https://math.stackexchange.com/users/283259/" ]
I'm taking an introductory analysis course and I can't seem to get this. Here is the definition for continuity at a point: $f:A\rightarrow B$ is continuous at $c\in A$ iff: $\forall \epsilon&gt;0$, $\exists \delta&gt;0$ such that $|x - c|&lt;\delta$ (and $x\in A)$ $\Rightarrow |f(x) - f(c)| &lt;\epsilon$. Here is ...
Suppose that $\delta \leq 1$. Then if $|x-2| &lt; \delta$, then $$ -1 &lt; x-2 &lt; 1 \implies 1 &lt; x &lt; 3 $$ So $$ 3 &lt; 2x+1 &lt; 7 $$ which means that $|2x+1| &lt; 7$. Therefore, $$ |f(x) - f(2)| = |2x+1||x-2| &lt; 7 \delta $$ Suppose $\delta \leq \frac{\epsilon}{7}$. Then we have $$ |f(x) -...
For $x\in (1, 3)$, $\lvert 2x+1\rvert &lt; 7$, so for $\epsilon &gt; 0$, we let $\delta = \min(1, \epsilon/7)$. Then, $\lvert x-2\rvert &lt; \delta$ implies $$\lvert 2x^2-3x-2\rvert = \lvert 2x+1\rvert\lvert x-2\rvert &lt; 7\delta\leq \epsilon$$ Therefore, $\lim\limits_{x\to 2} f(x) = f(2) = 0$, so $f$ is continuous at...
https://math.stackexchange.com
255,534
[ "https://mathoverflow.net/questions/255534", "https://mathoverflow.net", "https://mathoverflow.net/users/84563/" ]
Let $C$ be a locally presentable category. Is it true that the category of pointed objects $C^{*/}$ in $C$ is also locally presentable?
Yes. The category of pointed objects is the category of algebras of an accessible monad on $C$, namely the monad $c \mapsto \ast \sqcup c$ (that is induced by the unique monoid structure on $\ast$ with respect to the monoidal product $\sqcup$), and such a category of algebras is again locally presentable. See Ad&aacute...
Over $C/K$ and under $K/C$ categories of a locally presentable category $C$ are locally presentable for every object $K$. See corollary 2.44 (and 2.47) in Adámek-Rosický, Locally Presentable and Accessible Categories.
https://mathoverflow.net
426,533
[ "https://softwareengineering.stackexchange.com/questions/426533", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/263233/" ]
Consider this simple example: We have the apartments table below: <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>ID</th> <th>Address</th> </tr> </thead> <tbody> <tr> <td>0</td> <td>555 Maple St</td> </tr> <tr> <td>1</td> <td>123 Oak St</td> </tr> <tr> <td>2</td> <td>999 Pine St</td> </tr> </tb...
As you already noted by yourself, if there is an <code>N:M</code> relationship between two entities, a single foreign key field is not sufficient, so a junction table would be the natural choice. Hence the interesting question is: <em>&quot;In case an <code>1:N</code> relationship is all what's needed, why would someon...
By adding a foreign key to the apartments table you make the assumption that there is only one tenant per apartment. If anyone wants roommates, your data model will need to be changed, or data would need to be duplicated — one apartment per tenant. This is specific to the problem domain. I would say it is reasonable to...
https://softwareengineering.stackexchange.com
3,439,372
[ "https://math.stackexchange.com/questions/3439372", "https://math.stackexchange.com", "https://math.stackexchange.com/users/448693/" ]
I'm basically trying to show that <span class="math-container">$f$</span> is summable <span class="math-container">$1$</span> to <span class="math-container">$\infty$</span> and that <span class="math-container">$f$</span> is integrable <span class="math-container">$1$</span> to <span class="math-container">$\infty$</s...
No. Let <span class="math-container">$f(x)=\frac 1{x \log x}$</span>. This is <span class="math-container">$o(\frac 1x)$</span> but not <span class="math-container">$o(\frac 1{x^{1+\epsilon}})$</span>
No it's not. Say <span class="math-container">$f(x) = \frac{1}{x^{1+\frac{\epsilon}{2}}}$</span> Think about another approach to show that f is integrable
https://math.stackexchange.com
10,200
[ "https://quant.stackexchange.com/questions/10200", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/2402/" ]
I'm doing a panel data analysis where the log of the freefloat number of outstanding shares is one of the explanatory variables, but it fails the Augmented Dickey Fuller and Person Phillips unit root tests. But intuitively I suspect it to be stationary but with structural breaks. (I know these unit root tests to be sen...
To quote Wikipedia: <blockquote> In mathematics, a stationary process (or strict(ly) stationary process or strong(ly) stationary process) is a stochastic process whose joint probability distribution does not change when shifted in time. Consequently, parameters such as the mean and variance, if they are present, als...
I would argue that this is the very definition of a non-stationary process. We know that shares outstanding are incrementally added to or removed from by the company issuing or repurchasing shares. These innovations are added to the previous outstanding share count. My first instinct would be to model this as: $$...
https://quant.stackexchange.com
368,369
[ "https://softwareengineering.stackexchange.com/questions/368369", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/286125/" ]
The title might be a bit vague, so let me explain. Let's assume we have a function that does something (changes state of the program), for example a function that creates a file. That function returns True if the file is created and False if the file isn't created. Now, we want to use that function in a conditional, f...
It's a bit of a judgement call but I would say that if you need to call <code>createFile()</code> early in a method it's slightly better to store the result in a variable. This is because if someone updates the code later and needs to check the <code>fileCreated</code> state, it's common to copy the condition from the...
To me, the main code smell is that a <code>createFile()</code> method returns a boolean indicating success. That reminds me of programming styles from the 1970s. A method named <code>createFile()</code> implies a contract that it creates the file, and if it can't, the contract isn't fulfilled, and the method should th...
https://softwareengineering.stackexchange.com
6,477
[ "https://stats.stackexchange.com/questions/6477", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/1320/" ]
I have run Levene's and Bartlett's test on groups of data from one of my experiments to validate that I am not violating ANOVA's assumption of homogeneity of variances. I'd like to check with you guys that I'm not making any wrong assumptions, if you don't mind :D The p-value returned by both of those tests is the pro...
The p-value of your significance test can be interpreted as the probability of observing the value of the relevant statistic <em>as or more extreme</em> than the value you actually observed, given that the null hypothesis is true. (note that the p-value makes no reference to what values of the statistic are likely und...
You're on "the right side of the p-value." I'd just adjust your statement slightly to say that, IF the groups had equal variances in their populations, this result of p=0.95 indicates that random sampling using these n-sizes would produce variances this far apart or farther 95% of the time. In other words, strictly s...
https://stats.stackexchange.com
167,503
[ "https://stats.stackexchange.com/questions/167503", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/52227/" ]
I have a question regarding the use of model based approaches to recommender systems. So, the goal is to create a model that predicts the user reaction to a specific item. Either a rating scale or a “like/dislike” expectation. The problem that I can’t quite understand is that, in order to so, you would need a specif...
For each fold, you are building a classifier that makes predictions for the observations. The classifiers within each fold have slightly different training sets and different weights, but they are all attempting to estimate the same underlying model. So yes, you can combine the predictions. If you have multiple predict...
After speaking with a few other folks about this problem, I think that <em>technially</em> you can't directly compare probabilities predicted for different folds, but <em>practically</em>, in most cases, you can. The time when you would not be able to is if you have a small, potentially diverse positive set. Then when...
https://stats.stackexchange.com
402
[ "https://security.stackexchange.com/questions/402", "https://security.stackexchange.com", "https://security.stackexchange.com/users/33/" ]
What about a Privacy Policy? Both internal, and external.
<strong>Key points:</strong> It should outline the security acceptance/appetite of the organisation in order that the standards which support the policy can be defined in the correct environment. It also needs to define responsibilities, ownership and sponsorship. Updated just to provide some examples, as I did leav...
A corporate security policy should be short, easy to read, and in general terms. It should basically list what the overall threats and risks are to the business and the general approach for mitigating them. For example, if you have a company who's value is in the data it stores in a database, a corporate security poli...
https://security.stackexchange.com
25,174
[ "https://mathoverflow.net/questions/25174", "https://mathoverflow.net", "https://mathoverflow.net/users/4535/" ]
I was curious if anyone has a reference for a formula giving the values of n and k so that $\binom{n}{k}&lt;\binom{n+j}{k-1}$ for a fixed $j$. Clearly this will be true if $k&gt;\frac{n}{2}$ because then one will have that $\binom{n}{k}\le\binom{n}{k-1}&lt;\binom{n+j}{k-1}$. One can improve on this result, and in t...
It doesn't get that ugly, if you're mainly concerned with large $n$ and $k$. Simple order-of-magnitude stuff indicates that something like $k&gt;\alpha n$ is true (where $\alpha$ depends on $j$). The inequality $\binom{n}{k}&lt;\binom{n+j}{k-1}$ is exactly equivalent to $$1 &lt; \frac{k}{n-k+1} \prod_{i=1}^j \frac{n+...
I think some computation can be done like this(I guess that's the tedious math you mentioned): Mark $C^{n}_{k}=P$; and $C^{n+j}_{k-1}=Q$, we have $\frac{P}{Q}$ equal $$\frac{(n!)}{(n-k)!k!}*\frac{(n+j-k+1)!(k-1)!}{(n+j)!}$$ Mark $n-k=S$, we have the above to be $$\frac{(n!)}{S!k}*\frac{(S+j+1)!}{(n+j)!}=k^{-1}\f...
https://mathoverflow.net
689,938
[ "https://physics.stackexchange.com/questions/689938", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/276270/" ]
Every book says that friction is independent of surface area in contact. It is pretty obvious that equation for our friction doesn't have any &quot;area term&quot; in it. But in some cases it seems counterintuitive. The definition of friction states that it is resisitive force emerged from attractive forces between mol...
<blockquote> Every book says that friction is independent of surface area in contact. It is pretty obvious that equation for our friction doesn't have any &quot;area term&quot; in it. </blockquote> The &quot;area term&quot; is built into the value of the normal (perpendicular) force, <span class="math-container">$N$</s...
The reason is that the weight of the cube is now spread over a larger area of contact, so each part of every plate is now pressed more lightly in contact with the surface.
https://physics.stackexchange.com
550,605
[ "https://physics.stackexchange.com/questions/550605", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
I read in fluid dynamics that the potential energy stored in the molecule of water due to the attraction by the other molecules is negative. Can energy be negative and what does it mean to have negative energy??
The [edit] volume [\edit] average energy of the gas is independent of vertical position. This compensates for the gravitational energy that the [edit] volume [\edit] average kinetic energy increases with z. No energy can be extracted.
The same process that makes the gradient of temperature inside happens outside. It only depends on difference of atmospheric pressure with altitude. In average there is no gradient of temperature in the walls of the material.
https://physics.stackexchange.com
226,959
[ "https://electronics.stackexchange.com/questions/226959", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/105588/" ]
I have the little doubt related to initializing condition in Verilog. Like in given statement: <pre><code>module rf(out1,ack,en,a,f,c,d,e,clka); input [7:0] a,f,c,d,e; input clka, en; output reg [7:0] out1; output reg ack; reg[7:0] b[1:5]; reg [1:0] first=0; reg [2:0] k; initial begin for (k = 1; k &l...
Initialising the registers at declaration is perfectly synthesisable. It tells the compiler what the power-on value of the register should be. Generally the initial value for the registers is always 0 anyway, and if you choose to have them set to 1, it will basically use bubble pushing optimisations to invert the regis...
It's generally poor practice to rely on that kind of initialization in synthesized logic. For one thing, the initialization &mdash; if it supported at all &mdash; only applies immediately after power-up configuration of the FPGA. This generally only works on SRAM-based FPGAs; other technologies don't support power-up i...
https://electronics.stackexchange.com
62,781
[ "https://mathoverflow.net/questions/62781", "https://mathoverflow.net", "https://mathoverflow.net/users/66/" ]
In algebraic geometry, it is a sad fact of life that pushforward doesn't preserve being a coherent sheaf; for example, the pushforward by the complement of a divisor of the structure sheaf (or more generally a line bundle) has essentially no hope of being again coherent. On the other hand, on a smooth variety, if I pu...
You probably know this, but it warrants pointing out. Suppose that $X$ is a normal variety. Set $U = X \setminus \text{Sing X}$ with the natural inclusion $i : U \to X$, and pushforward the structure sheaf, then $i_* \mathcal{O}_U = \mathcal{O}_X$. It just doesn't work for arbitrary line bundles. If your variety ...
On a normal variety, pushing forward a line bundle from the non-singular locus gives you a reflexive sheaf which is essentially the same as taking a Weil divisor representative of your original line bundle and take the Zariski closure of all the components keeping the same coefficients. So, what you get is a Weil divis...
https://mathoverflow.net
78,917
[ "https://math.stackexchange.com/questions/78917", "https://math.stackexchange.com", "https://math.stackexchange.com/users/7820/" ]
I have the following question: <blockquote> Give an example of a topological vector space $E$ with subspace $M$ and $N$, such that $E = M \oplus N$ algebraically, but not topologically (so $E \ncong M \sqcup N$). </blockquote> I suspect that it must be infinite-dimensional, but I have no clue how to construct an ex...
I have found an answer (I think) thanks to the previous answer, but I'm not sure it's correct. Take $\mathbb{R}$ as a $\mathbb{Q}$-vectorspace, with the euclidean topology. Suppose we have a $\mathbb{Q}$-basis $(e_i)_{i \in I}$, with some $e_j = 1$. Take $\mathbb{Q}$ as a subspace and take the quotient space $\mathbb{...
Let $M$ be a proper dense subspace of an infinite dimensional $E$, and pick $N$ to be any <em>algebraic</em> complement. Then $E=M\oplus N$ algebraically by construction, but the direct sum is not of topological vector spaces, as the projection $E=M\oplus N\to N$ is not continuous: its kernel is $M$, which is not close...
https://math.stackexchange.com
144,267
[ "https://security.stackexchange.com/questions/144267", "https://security.stackexchange.com", "https://security.stackexchange.com/users/52562/" ]
My understanding of worms like Mirai is the following: <ol> <li>Try to telnet/ssh into random IPs using default user/pass credentials from various router/IoT manufacturers</li> <li>If you get in, do Bad Things™.</li> </ol> It seems the targets are generally home/consumer devices, which would be on a home LAN. From Wi...
Whilst such devices shouldn't be directly exposed, it can happen and not just through sloppy setup or UPnP. A compromised router, internal malware, driveby malvertising, etc. could all create a gap into the internal network. In addition, it may happen occasionally that changes made to otherwise secure networks may in...
The problem results from people wanting to be able to access their camera from the internet. Instead of using a more secure strategy, they expose it to the internet via a port forward (or uPnP does it). Since these devices are often poorly maintained by the manufacturer and rarely receive updates, this presents a maj...
https://security.stackexchange.com
60,812
[ "https://dba.stackexchange.com/questions/60812", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/35585/" ]
I am going to move a database from the old server to a new one. <ul> <li>the old one runs PostgreSQL 9.1, the new one has 9.3.</li> <li>I want to change the database name.</li> <li>I want the new database to be in a dedicated tablespace (the old one is in default) - including indices, etc.</li> </ul> Unfortunately, I...
I have completed the migration with no problems. Creating the dump is easy: <pre><code>sudo -u postgres pg_dump --verbose --no-tablespaces --format=directory --file=/backup/path old_database_name </code></pre> Restoring on a new instance: first, create a new tablespace, and a target database in that tablespace. Then...
Since you are using pg_dump it will dump the schema and the data. <code>pg_dump -d mydb -f dump_file_name.sql</code> To restore you have to <code>createdb</code> first and then restore it so, the new name issue can be solved when creating the new database. <code>createdb mynewdb</code> For the tablespace, you firs...
https://dba.stackexchange.com
377,619
[ "https://physics.stackexchange.com/questions/377619", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/180284/" ]
Why does the Earth's not cast a shadow straight like a cylinder in the opposite direction of the sun? Instead, it forms "cones," the umbra and penumbra.
To get the change in temperature in each case, you use $$\Delta T=\frac{\Delta (PV)}{nR}$$ To get the change in internal energy in each case, you use $$\Delta U=nC_v\Delta T$$ To get $C_v$, you use $$C_v=\frac{3}{2}R$$ To get the work, you use $$W=\int{PdV}$$To get the heat, you use $$Q=\Delta U+W$$
Work is the area under the graph P-V. So you just need to integrate (there're lots of triangles, use them).
https://physics.stackexchange.com
659,570
[ "https://math.stackexchange.com/questions/659570", "https://math.stackexchange.com", "https://math.stackexchange.com/users/125431/" ]
Consider a buffer, in which every second the number of packets increases by 1 with probability $.4$ and decreases by 1 with probability $.6$. Currently there are $n$ packets in the router. Calculate the expected amount of time to empty the buffer.
<strong>A formal argument:</strong> Consider a random walk on the integers that jumps to the left with probability $q$ and to the right with probability $p$ where $p+q=1$ and $q&gt;p$. Let $e$ be the expected number of jumps to hit the state to the left of the starting position. First step analysis says that $e=...
HINT: For every sample, you decrease an average of 0.2 samples (ie: After 10 samples, 4 will add and 6 will subtract, will leave you 2 samples lower). When would you reach 0 in average?
https://math.stackexchange.com
67,755
[ "https://stats.stackexchange.com/questions/67755", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/28940/" ]
I am working with a binary predictive model for data that belongs to A and B. The learning sample that I am using contains 6000 row that belongs to group A and 1000 row that belongs to group B. I would like to make my learning sample equal in number for both variables (i.e. 1000 row that belongs to A and 1000 row that ...
I will start with two (to my best knowledge) better ways of approaching the problem then subsampling the bigger set: <ul> <li>Is it possible to oversample the second class instead? This way you will not lose any information (at the cost of additional computational complexity),</li> <li>Isn't your model able to use imb...
What classifier are you working with? I would definetly try out a random forest model for your particular problem. It is an ensemble method that consists of a large amount of orthogonal trees. This is achieved by taking a bootstrap sample of your data and then using this to grow a clasification tree. This is done a pre...
https://stats.stackexchange.com
664,873
[ "https://physics.stackexchange.com/questions/664873", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/99945/" ]
A question in Giancoli's <em>Physics for Scientists and Engineers</em> (2. ed) has me confused. Here it is (Ch 1, Problem 3): <blockquote> What is the area, and its approximate uncertainty, of a circle of radius <span class="math-container">$2.7 \times 10^4$</span> cm? </blockquote> I got the correct answer of <span c...
A rough and ready way is to say that the radius is <span class="math-container">$2.7\pm 0.1 \times 10^4\,\rm cm$</span> which is approximately a <span class="math-container">$3.7\%$</span> error. The area is the radius squared so the error in the area is twice the error in the radius, <span class="math-container">$2\ti...
Most likely, the authors assume Gauss error propagation in which the error on a function <span class="math-container">$f(x)$</span> of a variable <span class="math-container">$x$</span> is calculated as <span class="math-container">$$ \Delta f = \frac{\partial f}{\partial x} \Delta x~.$$</span> In your case, <span clas...
https://physics.stackexchange.com
301,885
[ "https://electronics.stackexchange.com/questions/301885", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/29996/" ]
Once I found out you can use solder paste to assembly at home I was shocked. Think about it, any hardware startup build a pcb, its cheap, then you get it and you want 5-10 copies, and you also have some parts that you can't assembly. What you do ? you go to assembly house. This will cost you between <strong>300 -500$</...
I have used solder paste (for small one offs at work, rather than at home). My first thoughts looking at your question is basically that you CAN do SMT solder paste at home. No one is stopping you at all. As some of the people have mentioned in the comments, Mouser doesn't do solder paste for the shelf life and other...
It is not as easy as just using a stencil to "draw" interconnects on a board with solder paste. Hand production will result in high variation in interconnect width, resistivity and quality. Secondly, there is precise thermal processing required to properly flow and set the solder minus the flux. Lastly, there is the...
https://electronics.stackexchange.com
20,634
[ "https://scicomp.stackexchange.com/questions/20634", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/16934/" ]
Is the projection method of integrating Navier-Stokes equations exact? Take the incompressible flow equations: $$ \frac{\partial\mathbf{u}}{\partial t} = -\mathbf{u}\cdot \nabla \mathbf{u} -\nabla p + \mu \Delta \mathbf{u} \\ \nabla\cdot\mathbf{u} = 0 $$ along with some meaningful boundary conditions. Using a projec...
The projection scheme is indeed analytic, provided that the initial conditions are incompressible. You can derive it by taking the divergence of the evolution equation for $u$. Finding the projection <strong>P</strong> can be tricky; it's easier with some methods like spectral / pseudospectral methods. But one has t...
<em>Note: I originally posted an answer that I was not 100% pleased with, so I have revised it heavily. 1/20/2017</em> The projection method is not in an exact approximation to the full system in general. There are a few reasons for this, but the most immediate has to do with the boundary conditions. Let's look at the...
https://scicomp.stackexchange.com
556,745
[ "https://physics.stackexchange.com/questions/556745", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/82136/" ]
I’m trying to figure out why raising zero to the zeroth power equals one. What kind of a scenario would occur in a laboratory experiment where something with a quantity of zero would be raised to the power of zero and you end up with one? How do I explain how something is created out of nothing? What is happening?
The thing is, zero to the zeroth power is not always one. It is technically undefined. We can try to get around that by asking the question; What happens if we take the limit of a function that approaches zero to the zeroth power? It should be easy to find two functions that both approach zero at some point (lets call ...
If we consider this operation (<span class="math-container">$a \neq 0$</span>) <span class="math-container">$$\frac{a^n}{a^n}=a^{n-n}=a^0=1$$</span> and taking a special case for illustration with <span class="math-container">$a= \textit{e}$</span> i.e. the exponential, we could write <span class="math-container">$$...
https://physics.stackexchange.com
69,179
[ "https://mathoverflow.net/questions/69179", "https://mathoverflow.net", "https://mathoverflow.net/users/4047/" ]
I suspect I am asking a very stupid question. Suppose you have self-adjoint negative-definite operator $L$ densely defined on a space $L^2(\pi)$, with $Lf = \nabla \cdot ( A(x)\nabla f)$, for some symm. pos. def matrix A. Here assume that differentiation $\nabla = (D_i)_{i=1,..,n}$ is a skew-adjoint operator densely ...
It is possible to make sense of $T^{1/2}$ without some of the particulars mentioned, when $T$ is a positive self-adjoint (densely-defined) operator on a Hilbert space. Namely, Friedrichs' argument (as in Riesz-Nagy, for example) shows that the resolvent $(T-\lambda)^{-1}$ exists and is a bounded operator for $\lambda$ ...
In short, "yes, probably, but you should be careful about boundary conditions." The long version: First a cautionary result. Let the Hilbert space be $L^2(0,1)$ and let $Lf =f''$ on the domain of functions $f\in L^2(0,1)$ with two derivatives in $L^2$ and such that $f(0)=-f'(1)$ and $f(1)=f'(0)$. This is a self-adjo...
https://mathoverflow.net
180,982
[ "https://electronics.stackexchange.com/questions/180982", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/81336/" ]
<img src="https://i.stack.imgur.com/c111y.jpg" alt="enter image description here"> <img src="https://i.stack.imgur.com/kTkUe.jpg" alt="enter image description here"> <img src="https://i.stack.imgur.com/Bx4J0.png" alt="enter image description here"> I have found this circuit mounted to a DC motor. It is probably an enc...
You'll notice that there are 8 magnets, but the "coil" (the serpentine traces) have 3-fold symmetry. This means that as the magnets rotate, the induced voltage in the pickup will vary with rotation, with a period 3 x 8 or 24 (EDIT - oops, 12, since the magnets need to alternate north and south) times the shaft rotation...
The zig-zag is designed to intersect the magnetic field of that magnet. It must have not been constructed as a series of opposite poles horizontally, it must be of same poles vertically. In that way it will expose the magnetic field which the zigzag can intersect most perpendicularly. The change of the rotation angle w...
https://electronics.stackexchange.com
185,845
[ "https://physics.stackexchange.com/questions/185845", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/82009/" ]
Suppose I have a solar-sail-powered starship flying directly away from a star. The sail is flat and perpendicular to the direction of travel. Now, in order to make the trajectory more stable (we think), we make the ship spin around its center of mass and the axis aligned with motion. <ol> <li>Would the sail's spin cau...
The answers to all three of your questions are "there is no effect due to the rotation." A mirror moving parallel to its own surface does not cause any Doppler shift in the reflected light, or any Doppler aberration in the angle of reflection. This is an exercise in Zangwill's <em>Modern Electrodynamics</em> (Problem...
This is a loose answer, not aimed at getting the bounty. Just creating a clearer mental image. A spinning light sail is something like a spinning hovering frizbee. If you knock it upward in the center, it goes up. Consider a flat sail traveling directly away from a star, and something shades the left half, but not ...
https://physics.stackexchange.com
40,526
[ "https://mechanics.stackexchange.com/questions/40526", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/24953/" ]
I need to connect some circuitry in a car, which needs 12V. It's my understanding that when a car starts, the power spikes well above 12V, and the battery itself can have a charged voltage of ~14V. What is the ideal way to provide 12V to my devices? Additionally, what is the best way to connect to a car's electric s...
When properly installing an amplifier a large gauge wire is run from the battery to trunk area. A fuse is installed as close to the battery as possible. The amplifier then connects to that wire. If multiple devices need to connect use a fused distribution block. Don't forget to run a remote wire from your head unit t...
In addition to vini's answer, I always run a relay. Run the switch side from the battery to the trunk to power the amp / sub. Put a fuse right at the battery. I always switch the relay using the radio's ignition wire, so it is only on when the key is in the on or accessory positions. There might be another more ap...
https://mechanics.stackexchange.com
79,998
[ "https://electronics.stackexchange.com/questions/79998", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/27595/" ]
I posted a similar question a while ago and got the answer I thought I was looking for but I now have a new multimeter so I'm able to get readings that should be of some use. I have a solar panel, charge controller and battery. I've left it out for over a week to charge in very good sunlight and the battery hasn't cha...
Throw out (put it back on the shelf) that charge controller, there isn't enough information about it to make sense of. Just get a Schottky diode (1A will do. Find one on eBay or whatever, look for 'solar panel blocking diode') and put it between the solar panel and the battery. You will at least get some charging from...
Your solar panel may be able to put out 17 V open circuit but it quickly drops when you put a load on it which,apparently, is what your charge controller is doing. Without a data sheet and/or schematic for the charge controller, it is difficult to troubleshoot anything.Given the specifications you have listed, it is a...
https://electronics.stackexchange.com
15,138
[ "https://softwareengineering.stackexchange.com/questions/15138", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/1554/" ]
I'm looking into Entity Framework for a new project that I'm going to be taking on and as part of my research into it I'm asking some industry professionals if it's stable and ready for 'real world' implementation. In the running is: <ul> <li>EF</li> <li>NHibernate</li> <li>DevExpress XPO</li> </ul> I already have a...
Yes, but with some caveats: <ul> <li>It's fully supported by Microsoft, and has a growing community--but being newer than its closest competetor, nHibernate, it still doesn't have quite as mature a community.</li> <li>Along with having a less mature community, there will be times where a feature is available with EF4 ...
We have been using EF in several production applications. We also have NHibernate in several production apps. The comment by STW that EF works best "when used as Microsoft intends" is certainly true. It is also true of NHibernate that it works best when used following the patterns that the NHibernate team intended. ...
https://softwareengineering.stackexchange.com
3,751,374
[ "https://math.stackexchange.com/questions/3751374", "https://math.stackexchange.com", "https://math.stackexchange.com/users/473541/" ]
If <span class="math-container">$(\Omega,\mu)$</span> is a finite measure space, i.e., if <span class="math-container">$\mu(\Omega)&lt;\infty$</span>, then does <span class="math-container">$f\in L^1(\Omega)$</span> imply that <span class="math-container">$f\in L^p(\Omega)$</span> for every <span class="math-container"...
No, it's the other way around. If <span class="math-container">$p&gt;1$</span> and the measure space is finite then <span class="math-container">$f\in L^p$</span> implies <span class="math-container">$f\in L^1$</span>. The proof uses Holder's inequality. Take <span class="math-container">$q$</span> such that <span clas...
As indicated in the other answer, it is the other way round. However, your desired implication holds on measure spaces for which there exists a constant <span class="math-container">$\tau &gt; 0$</span> such that every null set has measure at least <span class="math-container">$\tau$</span>. A typical example is <span ...
https://math.stackexchange.com
29,045
[ "https://electronics.stackexchange.com/questions/29045", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/5613/" ]
I am using STM32F4 discovery board and Atollic TrueStudio for ARM Lite 3 I would like to pass some debugging data to PC using printf and I can't find a way to do it through STLink. Is it even possible? It seems essential feature for any debugging process. Edit: I need to use Serial Wire Viewer, but still no luck mak...
OK, The way to achieve communication in Atollic TrueStudio for ARM Lite (yes it works under lite wersion since 3.0): <ol> <li>Enable Serial Wire Viewer in active debug configuration</li> <li>Show SWV Console (under Debug prespective)</li> <li>Open Serial Wire Viewer settings (first button in SWV Console window)</li> <...
It is using Crossworks.. In crossworks, we use dbg_printf but it is slow, be warned.
https://electronics.stackexchange.com
249,266
[ "https://mathoverflow.net/questions/249266", "https://mathoverflow.net", "https://mathoverflow.net/users/74367/" ]
The Carmichael Numbers can be factorized in polynomial time. Are weak fermat pseudoprimes (w.r.t. a given base) easy to factorize as well? What are some large/broad classes of numbers that are easy to factorize (i.e. in polynomial time). This part is pretty broad, so i would be thankful if someone can provide some e...
Six classes of "lucky numbers", that can be factorized easily, are discussed on page 107 and following of <A HREF="https://www.fdi.ucm.es/profesor/m_alonso/Documentos/factorizacion/arjlensfac.pdf">Integer Factoring</A> by Arjen Lenstra (2000). These include: trial division by a small prime (very effective, since 88% of...
Pollard's $p-1$ method will likely find $p$ quickly if $p-1$ is a least common multiple of positive integers, all of which are small. (To put it another way, $p-1$ is a product of small primes, none of which is repeated too many times.) There are analogous methods that target $p+1$ or any other product of cyclotomic...
https://mathoverflow.net
16,329
[ "https://quantumcomputing.stackexchange.com/questions/16329", "https://quantumcomputing.stackexchange.com", "https://quantumcomputing.stackexchange.com/users/15096/" ]
I am trying to find information/ help on Rényi entropies given by <span class="math-container">$$ S_n(\rho) = \frac{1}{1-n} \ln [Tr(\rho^n)] $$</span> and how it acts under unitary time evolution? Is the entropy independent on the state of <span class="math-container">$\rho$</span> i.e it doesn't matter if <span class=...
No, weak measurement and quantum tomography don't break BB84. I recommend that you create an explicit quantum circuit that implements the weak measurement or the quantum tomography, and check for yourself that it actually fails. The basic problem comes down to the fact that there is a trade-off between how much informa...
Tomography generally speaking uses a collection of measurements to reproduce an underlying state. So you experimentally reproduce the same situation over and over, collect statistics and find the most likely estimate for that state. In QKD, information is sent once and doesn't repeat. So for each unit of information, y...
https://quantumcomputing.stackexchange.com
146,500
[ "https://dba.stackexchange.com/questions/146500", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/103318/" ]
Problem Statement - I want to configure DR site in SQL Server 2012 with the existing backups. The backup scenario is as below. FULL – on every Sunday, DIFF – daily except Sunday, LOG – every 15 minutes Now, I want DR site for my production for which I am interested in using Log Shipping. But, the problem in Log Shi...
Try this : <pre><code>SELECT received_quantity , delivery_qty , unit_cost FROM tbl_inward_list WHERE datediff(current_date,date(date_created)) BETWEEN 31 AND 60; </code></pre> Similarly <pre><code>SELECT received_quantity , delivery_qty , unit_cost FROM tbl_inward_list WHERE datediff(current_date,date(d...
<pre><code>WHERE date_created &gt;= CURDATE() - INTERVAL 60 DAY AND date_created &lt; CURDATE() - INTERVAL 30 DAY WHERE date_created &gt;= CURDATE() - INTERVAL 90 DAY AND date_created &lt; CURDATE() - INTERVAL 60 DAY </code></pre> No, don't use 31 and 61; use the inequality. <code>CURDATE()</code> will...
https://dba.stackexchange.com
56,263
[ "https://mathoverflow.net/questions/56263", "https://mathoverflow.net", "https://mathoverflow.net/users/12198/" ]
Hi, given a local ring $A$ with maximal ideal $m$ which are differences between $Spec(\hat{A})$ ($\hat{A}$ completion of $A$ along $m$) and $Spf(A)$?
The difference is total, the spaces and the sheaves are different. The underlying space of $Spf(\hat{A})$ is just a point (in general, if $m$ is not maximal, it is all the prime ideals containing $m$, i.e. the <em>open</em> ideals. The underlying space of $Spec(\hat{A})$ is made of all prime ideals. Therefore $Spf(\hat...
There is a nice introduction to formal schemes in Luc Illusie's section of the book ``Fundamental Algebraic Geometry (Grothendieck's FGA Explained)''. Recommend!
https://mathoverflow.net
3,707,827
[ "https://math.stackexchange.com/questions/3707827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/713321/" ]
Numbers which are of the form <span class="math-container">$2^n-1$</span> are <span class="math-container">$1, 3, 7, 15, 31...$</span> Can we find directly using a formula that a number is of the form <span class="math-container">$2^n-1$</span>? Please help.
Let <span class="math-container">$k$</span> be the number in question. <span class="math-container">$$k=2^n -1$$</span> <span class="math-container">$$\therefore k+1=2^n$$</span> <span class="math-container">$$\therefore n=\log_2(k+1).$$</span> If <span class="math-container">$n$</span> is a positive integer, then <spa...
Here's a quick algorithm you may want to use if you can't be doing with those logarithms. Let <span class="math-container">$k$</span> be the number you start with. <ol> <li>Add <span class="math-container">$1$</span>, to get <span class="math-container">$k + 1$</span>.</li> <li>Is what you have left an even number? I...
https://math.stackexchange.com