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
416,412
[ "https://softwareengineering.stackexchange.com/questions/416412", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/366265/" ]
I often use function closures for storing data (e.g. database URL), which doesn't change between function calls. Is this an (anti-)pattern? Does it have a name? <hr /> While developing apps, which recieve data, process and send data (using a variety of protocolls), I stumpled upon this recurring problem: A functions ne...
This is just using closures. When you're from an OO background building and using a closure ends up feeling like using constructors/factories and methods, respectively. The big difference is you just get the one &quot;method&quot;. Oh and you don’t get any of that silly <code>new</code> business anymore. Of course func...
As @candied_orange mentioned, what you're doing there is very similar to currying. Its worth learning about. Javascript arrow functions were designed to allow for easy currying. An example of a fully curried function: <pre class="lang-js prettyprint-override"><code>// Definition let dbRequest = connectionInfo =&gt; opt...
https://softwareengineering.stackexchange.com
183,275
[ "https://dba.stackexchange.com/questions/183275", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/-1/" ]
Should I use <code>varchar(255)</code> or <code>varchar(256)</code> when designing tables? I've heard one byte is used for the length of column, or to store metadata. Does it matter anymore at this point? I saw some posts on the internet, however they apply to Oracle and MySQL. We have Microsoft SQL Server 2016 Ente...
Size <em>each and every</em> column appropriately. Do NOT use a "standard" size for each column. If you only need 30 characters, why create a column that can handle 255? I'm so glad you're not advocating using <code>varchar(max)</code> for your string columns. This is especially prudent advice if you ever need to i...
Others have already pointed out that that the number of bytes required to store the length is fixed. I wanted to focus on this part in your question: <blockquote> Does it matter anymore at this point? </blockquote> You have your question tagged with enterprise edition, which generally means you'll have a fair amoun...
https://dba.stackexchange.com
179,532
[ "https://physics.stackexchange.com/questions/179532", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/48676/" ]
I'm studying the general formalism of angular momentum in quantum mechanics from Zettili's "Quantum Mechanics: Concepts and Applications", and came across the following equation (labeled 5.37) on page 287: $$\hat{J}_+|\alpha,\beta_{max}\rangle = 0$$ The book states that this is because $\beta$ has an upper limit of $...
You say you get the physical justification for having some ladder operator(s) give $\hat L_+ \left|\text{state}\right&gt; = 0$. For angular momentum both the raising and lowering operators eventually terminate; for the harmonic oscillator only the lowering operator terminates, at the ground state. Here's a mathematica...
The raising operator has to raise something. It can't operate on an eigenstate of $J_z$,i.e. $|\alpha,\beta_{max}\rangle$, and give the same thing back. Think of it as raising the eigenstate to a new eigenstate, but with a 0 multiplying the resulting eigenstate to ensure an unphysical value of angular momentum doesn't ...
https://physics.stackexchange.com
24,015
[ "https://dba.stackexchange.com/questions/24015", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/7860/" ]
In Visual Studio, when trying to create a DAC which has a schemabound view which contains hierarchyid::GetRoot() this error is generated and the project does not build. However, the t-sql is ok as if I create the view directly in the database it works ok. Is there a two part name for hierarchyid to solve this? In a ...
The answer is to add sys. in front of the hierarchyId: sys.hierarchyid::GetRoot()
There are a couple of prerequisites to use the SCHEMABINDING option: Β· You cannot use * in the SELECT clause in the query, you have to specify column names Β· You have to use two-part naming convention when referring to objects (which is in general a good practice) So, you need to use schema name alw...
https://dba.stackexchange.com
14,375
[ "https://quantumcomputing.stackexchange.com/questions/14375", "https://quantumcomputing.stackexchange.com", "https://quantumcomputing.stackexchange.com/users/13244/" ]
I am attempting to intentionally add noise to my qiskit circuit by applying n-pairs of CNOT gates. The effect of this should be to yield the same result of my baseline (no pairs of CNOT gates applied) circuit with the addition of some noise. However, the result of my &quot;noisy&quot; circuit looks the same as my basel...
There are different ways to prove what you want to prove, including the solution tsgeorgios has suggested, but for the sake of gaining greater intuition I would suggest starting with the recognition that the trace norm of any matrix is equal to the sum of its singular values. Once you have this, the inequality you are ...
We still have <span class="math-container">$ \big| \langle B, A \rangle \big| = \big|\text{Tr}(AB^{\dagger}) \big| \leq \text{Tr}|A| $</span> for any operator <span class="math-container">$B$</span> with operator norm <span class="math-container">$ ||B|| \leq 1 $</span>. First observe that <span class="math-container">...
https://quantumcomputing.stackexchange.com
2,587,074
[ "https://math.stackexchange.com/questions/2587074", "https://math.stackexchange.com", "https://math.stackexchange.com/users/222931/" ]
Preamble: an apology. I have a limited knowledge of mathematics. I know basic trigonometry, and use a lot of maths professionally as a programmer - but all of it basic maths. I know my sines and cosines, exponents etc, but am lost when it comes to differential calculus. I don't know the jargon, and I don't know my $\a...
If you let $A^\top$ denote the result of "exchanging the rows and columns" of $A$, then you can directly check that $(Ax)^\top = x^\top A^\top$ for any $x$. Thus $(Ax)^\top y = x^\top (A^\top y)$ holds for any $x,y$. Conversely, suppose $(Ax)^\top y = x^\top (Ty)$ for all $x,y$. By considering $x=e_i$ and $y=e_j$ to b...
Hint: look at what the defining equation says if $x$ and $y$ are all the different possible pairs of basis vectors.
https://math.stackexchange.com
353,424
[ "https://physics.stackexchange.com/questions/353424", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/167240/" ]
Suppose that we take principle of least action as given. Also assume that any manifold allowed by the action would carry Levi-Civita connection (torsion-free characteristic). Also assume that the local symmetry imposed on the tangent space of each manifold point is that of Poincare group, via general covariance princip...
"What about a free electron, how big or small will that cloud be?" As big or as small as you want it to be, in principle – that is, in an infinite vacuum at zero Kelvin. The most common example of a normalized wave packet is the Gaussian (because it's rotationally symmetric and computationally simple): \begin{align} ...
The surrounding cloud is just a picture of a zone where the electron has a very high probability of being there. Note that we are dealing with <em>probabilities</em>, so the electron has the possibility (a very small one) of being in the other side of the universe. Questions like "where is exactly the electron?" or "wh...
https://physics.stackexchange.com
76,191
[ "https://mathoverflow.net/questions/76191", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
A cone is a $R_+$-module. That is, a cone is an abelian monoid that is closed under nonnegative real scalar multiplication. An automorphism of a cone is a bijective $R_+$-linear map. That is a map $f:C\to C$ such that $f(\alpha x +\beta y)=\alpha f(x) + \beta f(y)$ for all $\alpha,\beta \ge 0 $ and $x,y\in C$. Suppose...
No. Consider solid angles in $\mathbb R^2$. They all (except the half-plane) are isomorphic, yet one may be strictly included in another. Furthermore, a generic cone in $\mathbb R^d$, $d\ge 3$, has a trivial automorphism group, so you may have $Aut(C)=Aut(D)$ in the strongest possible sense but $C\ne D$.
Unless there is something I misunderstand, a cone can be isomorphic to a strict subcone (hence no). Take e.g. for D a cone in $\mathbb{R}^2$ generated by two linearly independent vectors, and for C the cone generated by two linearly independent vectors in D that don't generate D (i.e. that are not on the boundary).
https://mathoverflow.net
430,257
[ "https://stats.stackexchange.com/questions/430257", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/261852/" ]
I want to simulate a 2x2 contingency table with fixed row totals. I know that the distribution would be binomial but I can't seem to do it in a matter than constraints the randomly generated elements to a sum that equals the row totals.
The comments you refer to in your last paragraph are correct, but perhaps misleading. It is true that regression does not make an <em>assumption</em> about the distribution of the dependent variable (it assumes things about the errors). But just because a model doesn't violate assumptions doesn't mean it is a good mod...
Using the ggpmisc package might help : <pre><code>densityCurve &lt;- ggplot(df, aes(x=MyVariable)) + geom_density() # extract the data from the graph densityCurveData &lt;- ggplot_build(densityCurve) # get the indices of the local minima localMins &lt;- which(ggpmisc:::find_peaks(-densityCurveData<span class="math-con...
https://stats.stackexchange.com
2,618,848
[ "https://math.stackexchange.com/questions/2618848", "https://math.stackexchange.com", "https://math.stackexchange.com/users/524400/" ]
Players are pulled up to pick a ball out of a hat containing $14$ red and $1$ blue. If the odds of drawing the blue ball are $1/15$ what are the odds of every person not drawing the blue ball and leaving it for the last person to draw? Initially I thought you would multiply the probability of not drawing the blue b...
Yes, the answer is $\frac{1}{15}$, and there is a much easier way of reaching it by re-thinking the question. Essentially, the $14$ people drawing balls are uniquely determining which ball the final person will choose. Though the final person really makes no choice at all, the final person <em>recieves</em> a randomly ...
Rephrase it like this: There is a blue ball together with $14$ red balls. The balls will be numbered with $1,2,\dots,15$ randomly. So for a fixed ball the numbers have <em>equal probability</em> to become the number of that ball. Now what is the probability that the blue ball will be numbered with $15$? Yes, of...
https://math.stackexchange.com
17,520
[ "https://quant.stackexchange.com/questions/17520", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/16040/" ]
I have a very simple problem that hopefully someone could help me with or at least point me in the right direction. I am testing to see which factors affect index returns the most and would like to find the correct way to transform variables used in the multiple regression model. The data sample covers the time perio...
I suggest you to implement all the analysis you cited above and analyze the results choosing the best model on model performance measures, as, for instance, the model $R^2$ value, the AIC (BIC) value, etc.; this should be the proper way to develop a model. As regards your question particularly, the literature about th...
Basic rules for what you want to follow to have a meaningfull result <pre><code>1 All your variables should be in the same terms 2.All your regression variables should be stationary (weak sense stationary) - check if there are long term dependencies 3.Test for multi-collinearity / Serial correlation / Homocedasticit...
https://quant.stackexchange.com
177,578
[ "https://softwareengineering.stackexchange.com/questions/177578", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/40984/" ]
I have forked a repo and branched that clone to code a story, and because I didn't understand the problem, wrote code that isn't solving my task at hand, but may prove useful later. Should I: <ol> <li>Delete it, and don't worry about it. Then commit without the extra code.</li> <li>Make yet another branch for just th...
You should have included option number 4.... <pre><code>4. Commit it with the extra code, and then delete it and commit it again. </code></pre> If you don't commit it, it is lost. If you commit it and leave it in, then you have an extra source of confusion -- you should try to avoid having other people scratching t...
Option #2 is legitimate if the code really could be useful later on. #3 is not the right answer. Option #1 is probably the right answer. More often than not, the code should just be scrapped. As programmers, we don't like to delete code--if feels like throwing out our babies. One of the biggest rules of programming i...
https://softwareengineering.stackexchange.com
38,051
[ "https://electronics.stackexchange.com/questions/38051", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/2062/" ]
It's been a long time since x86 was introduced (80386 for example was manufactured 27 years ago... Oh god I am old), so I wonder, what is stopping 3rd party companies from manufacturing x86-compatible processors? Also, I've heard that one cannot patent instruction set architecture, what is patented then which prevent...
Why isn't anyone interested in licensing the Ford T? That was a great car! Well it <em>was</em>. And at the time the x86 probably <em>was</em> a good processor too (though we had to suffer from its 64 kB segment limit for several computer generations). But for high end it has been surpassed by several generations of P...
Your going to have to be a lot more specific. 'x86' spans generations of processors and numerous instruction sets. The players at hand are also diverse. Depending on what subset of 'x86' your defining you may have to talk to different partys. AMD for example owns the 64bit extensions to x86 but they have a cross li...
https://electronics.stackexchange.com
688,860
[ "https://math.stackexchange.com/questions/688860", "https://math.stackexchange.com", "https://math.stackexchange.com/users/130915/" ]
<blockquote> I want to show that $f:(0,2\pi]\to S^1$ defined by $t\to (\sin t, \cos t)$ is not a homeomorphism. I will do this by showing that its inverse is not continuous. </blockquote> The inverse is defined by $(\sin t, \cos t)\to t$. So at $(0,1)$ we want to have $\lvert 2(1-\cos t)\rvert &lt;\delta \Rightarro...
Your proof is correct, but you could have saved yourself some work: $S^1$ is compact, $(0,2\pi]$ is not. Therefore they can impossibly be homeomorphic. This doesn't only show that $f$ is not a homeomorphism, but also that no other map $(0,2\pi]\rightarrow S^1$ can ever be a homeomorphism. <em>Note:</em> To elaborate...
Intuitively, as $(\cos t,\sin t)$ goes past the point $(1,0)$ on the circle, then $t$ jumps abruptly from $0$ to $2\pi$ or vice-versa, so you have a jump discontinuity. Your $\varepsilon$-$\delta$ proof is right. One may also say this: under a continuous function (in this case $f^{-1}$), the inverse-image of every op...
https://math.stackexchange.com
405,806
[ "https://mathoverflow.net/questions/405806", "https://mathoverflow.net", "https://mathoverflow.net/users/153228/" ]
Let <span class="math-container">$X$</span> be a compact Hausdorff space and <span class="math-container">$C(X)$</span> its algebra of continuous complex valued functions. The Gelfand-Naimark theorem tells us that we have a duality between commutative <span class="math-container">$C^*$</span>-algebras and compact Hausd...
In addition to Nik Weaver's references, let me just sketch the proof which is in fact not very difficult: <ol> <li>A construction of Kaplansky (Rings of operators, Thm 26) shows that if <span class="math-container">$\mathcal{A}$</span> is a <span class="math-container">$*$</span>-algebra with the property that for ever...
Yes, every finitely generated Hilbert module comes from a hermitian complex vector bundle in this way. In fact more is true: arbitrary Hilbert modules over <span class="math-container">$C(X)$</span> correspond to continuous (in an appropriate sense) bundles of Hilbert spaces over <span class="math-container">$X$</span>...
https://mathoverflow.net
45,474
[ "https://mathoverflow.net/questions/45474", "https://mathoverflow.net", "https://mathoverflow.net/users/4600/" ]
Suppose $X$ and $Y$ are jointly distributed real-valued random variables and for all outcomes $\omega_1$, $\omega_2$, we have $$ X(\omega_1)\le X(\omega_2)\quad\Longrightarrow\quad Y(\omega_1)\le Y(\omega_2). $$ <b>Edit</b>: As Louigi Addario-Berry's answer below shows, it may be better to consider the following varia...
This is along the lines of Tom's answer. $X$ induces a partial order on $\Omega$. In fact, it induces a total order on a partition of $\Omega$ into sets $X^{-1}(x)$, $x \in \mathbb{R}$); simply say $X^{-1}(x) &lt; X^{-1}(y)$ if $x &lt; y$. By your property, there is then some non-decreasing function $y:\mathbb{R} \t...
Suppose that $\Omega$ is partially ordered. If $$\omega_1 \le \omega_2 \qquad \mathrm{implies} \qquad X(\omega_1) \le X(\omega_2),$$ we say that $X$ is an <i>increasing random variable</i>. This comes up naturally in percolation theory. In this setting, $\Omega = \{0,1\}^{\mathbb Z^2},$ where $\omega(z) = 0$ if a ...
https://mathoverflow.net
81,241
[ "https://dsp.stackexchange.com/questions/81241", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/58048/" ]
I have a system I'm working on that inputs an 18 bit ADC output into an FIR filter on a Xilinx FPGA. I'm a little concerned I may be representing the numbers wrong. My ADC outputs a signed 18-bit number. <ul> <li>I treat the ADC output as a fixed point decimal with one integer (the sign bit, MSb) and 17 fractional bits...
You'll find that in order to maintain precision and avoid overflow, you'll need to pay attention to how bits are shifted during and after the MAC operation. The fundamental operation will be something like <pre><code>On each clock: accumulator &lt;- accumulator + ((fir_tap[i] * input[k]) &gt;&gt; shift_val); When al...
Fixed point processing is not for the faint of heart, but fortunately a single FIR filter is about as easy it gets. In this case it would be easiest to do anything in fractional, i.e. assuming both signal and filter coefficients are on <span class="math-container">$[-1, +1]$</span>. Obviously that doesn't work if you h...
https://dsp.stackexchange.com
129,371
[ "https://dba.stackexchange.com/questions/129371", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/82568/" ]
Hope someone can clarify how to do this query from SQL Server 2012, or maybe what it is asking; it seems I am being asked to do a query that combines aggregates with non-aggregates, leading to what seems like an impossible query, since one can only group by fields that appear in the <code>Select</code> clause, which me...
The solution is what you already found, in DBMS like SQL Server 2005+ that have implemented window functions, we can use them to get aggregates <code>over</code> each <code>partition</code> while keeping the original table, so not collapsing the table as a <code>group by</code> does. I'm not writing the query here, ple...
I just ran over the answer by accident, while looking at the book: We use <code>OVER</code> clause and <code>PARTITION BY</code>. <pre><code>Select VendorId, InvoiceDate, InvoiceTotal, Sum(InvoiceTotal) OVER (PARTITION BY VendorId) AS VendorTotal, Count(InvoiceId) OVER (PARTITION BY VendorId) AS VendorCount...
https://dba.stackexchange.com
55,386
[ "https://stats.stackexchange.com/questions/55386", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/3903/" ]
I'm want to get PCs scores through matrix approach. My calculated PCs scores for correlation matrix matches with <code>prcomp</code> results but the PCs scores for covariance matrix do not match with the results of <code>prcomp</code>. Could you point out what am I missing? Thanks <strong>PCA on Correlation matrix</st...
<blockquote> Translating the answer of @ttnphns into <code>R</code>. </blockquote> <strong>PCA on Correlation matrix</strong> <pre><code># PCA on Correlation matrix X &lt;- USArrests Cor &lt;- cor(X) EigenCor &lt;- eigen(Cor) ECor &lt;- EigenCor$vectors head(t(t(ECor) %*% t(scale(X)))) [,1] ...
I don't know R but can see your mistake. When you do it with correlations, you correctly multiply <strong>standardized</strong> data by the eigenvectors (I guess it's <code>scale(X)</code> which standardizes) to get the PC scores. When you analyse covariances, you must multiply <strong>centered</strong> data by the ei...
https://stats.stackexchange.com
55,724
[ "https://dsp.stackexchange.com/questions/55724", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/40584/" ]
I have written a matlab function for a constellation mapper and I want to create a Fixed-point version of that code for implementation on FPGA. I know matlab has a specific toolbox for fixed-point conversion but i want to do this manually. My specific question is: 1) which parts of the code would require this conversi...
I think you need to use the <code>floor()</code> or <code>round()</code> functions in MATLAB, to emulate fixed-point variables and operations. So you have to know the range of the fixed-point value and the precision of it. The ratio of the range to the precision is the dynamic range and you get 6.02 dB and one bit of...
You need to calculate the mean and standard deviation of your data. Then you pick say 4 standard deviations from your mean as the useable range of your data. Everything outside of that range is clipped, but if your data is Gaussian, it will contain >99% of all your values. You then use the maximum range represented by ...
https://dsp.stackexchange.com
1,216,137
[ "https://math.stackexchange.com/questions/1216137", "https://math.stackexchange.com", "https://math.stackexchange.com/users/197636/" ]
$Hom(R,S)$denote the set of all homomorphisms of rings. $Char$ denote characteristic of a ring.<br> 1) If either $Char R \neq 0$ but $Char S=0$ then $Hom(R,S)=\{0\}$<br> For example $Hom(\mathbb{Z}_{n},\mathbb{Z})=\{0\}$<br> 2) If $Char R \neq 0$ and $Char S \neq 0$ but $Char S$ does not divide $Char R$<br> For exa...
So the universal property of the polynomial ring gives you that you have to specify an element of $S$ for every element $x_i$ to obtain a unique ring homomorphism. Vice versa every ring homomorphism gives such elements. So ring homomorphisms correspond 1-1 to $n$-tuples in $S$, i.e. $Hom(\mathbb Z[x_1,\cdots,x_n],S]=S^...
$\phi:\mathbb{Z}[ x_{1},\ldots,x_{n }]\rightarrow S^{n}$ defined by<br> $\phi(x_{1},\ldots,x_{n})=(x_{1}+x_{2}+…+x_{n})$ for each $x_{i}\in S$
https://math.stackexchange.com
214,422
[ "https://mathoverflow.net/questions/214422", "https://mathoverflow.net", "https://mathoverflow.net/users/8628/" ]
Let $\mathbb{N}=\{1,2,3,\ldots\}$ be the set of positive integers. For $n,k\in\mathbb{N}$ we define $$\text{Sol}(n,k) = \{(a,b,c)\in \mathbb{N}^3: |a^n + b^n - c^n| \leq k\}.$$ (The set $\text{Sol}(n,k)$ denotes the solutions of the inequality $|a^n + b^n - c^n| \leq k$ for fixed $n,k$.) Moreover, for $j\in\mathbb{N}...
A 4-variable version of the infamous ABC Conjecture says the following: Let $a,b,c,d\in\mathbb{Z}$ be non-zero, satisfy $a+b+c+d=0$ and $\gcd(a,b,c,d)=1$, and no subsum of two or three of $a,b,c,d$ equal to $0$. Then for every $\epsilon&gt;0$ there is a constant $K_\epsilon$ such that $$ \max\{|a|,|b|,|c|,|d|\} \le K_...
Not counting the trivial solutions suggested by <code>July</code>, it is known that an integer cube or twice a cube is sum of three integer cubes in infinitely many ways via polynomial identities. To get to the naturals, adjust the sign. For $n=3$, one of the simplest is: $$ (6kx^2)^3+(k(6x^3-1))^3-(k(6x^3+1))^3 = -...
https://mathoverflow.net
14,611
[ "https://robotics.stackexchange.com/questions/14611", "https://robotics.stackexchange.com", "https://robotics.stackexchange.com/users/18657/" ]
I am supposed to design a pick-and-place robot. I have a prismatic joint to go down to a particular depth to pick an object which is located in 2D using computer vision. What is the recommended way to detect the height at which the object is placed? The object can be at a maximum vertical distance of 15 inches (around ...
Based on your actuator and their sensor you can try force based control, relying on admittance filter. You command the arm to go down and when an external force is applied it means you pushed the object top. Alternatively, if you don't need millimeter accuracy you can use cheap ultra-sound sensors to detect the depth....
One of the experimental methods is to mount the camera on the actuator itself(called eye in the hand). Then use vision algorithms to detect the object of interest using edge detection techniques and use the images for visual odometry.
https://robotics.stackexchange.com
178,001
[ "https://physics.stackexchange.com/questions/178001", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/75825/" ]
I didn't go to the lesson of work-energy theorem, so I miss something about this subject. I know the formulas, but I can't figure it out. This question has many quantities. Here is the problem, <blockquote> The sled ($m = 11.1\;\mathrm{kg}$) shown in the figure leaves the starting point with a velocity of $25.1\;\m...
Try to keep this tidy. It is a straight forward calculation, but there are many terms, so tidiness is the key. Start with the Energy work relation: $$E_A - E_E = W$$ where $E_A$ is the energy at the beginning, $E_E$ the energy at the end and $W$ the energy loss due to friction. We have to split $W$ further into $$W ...
<blockquote> The sled ($m = 11.1\;\mathrm{kg}$) shown in the figure leaves the starting point with a velocity of $25.1\;\mathrm{m/s}$. Use the work-energy theorem to calculate the sled’s speed at the end of the track or the maximum height it reaches if it stops before reaching the end. The straight sections of the tr...
https://physics.stackexchange.com
48,364
[ "https://security.stackexchange.com/questions/48364", "https://security.stackexchange.com", "https://security.stackexchange.com/users/36924/" ]
I know most, if not all, ISPs log the IPs you had tied to your network, but do ISPs keep logs of the IPs you have tried to connect to? For example, let's say I went to google.com, would the ISP be able to go through their logs and find whether I have ever connected to that site?
I cannot give a source nor which ISP this concerns since someone accidentally crossed their NDA by telling me this, but I think it should be known that there are ISPs that, at least in the Netherlands, <strong>log all DNS requests.</strong> This would mean that any hostname you ever looked up will be logged, including ...
A lot of ISP's use tools like Netflow for generating statistics of traffic on their network. This statistics can be used for route optimization and DDoS mitigation for example. Often sampling is used, so data of one in every few hundred packets is inspected, but it is possible to do 1:1 sampling on some equipment. Net...
https://security.stackexchange.com
103,245
[ "https://dba.stackexchange.com/questions/103245", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/67865/" ]
I'm trying to write a query to retrieve exactly two rows from a table using the same column for identification. <pre><code>SELECT * FROM teams WHERE name = $1 OR name = $2; </code></pre> Is there any way to ensure that the result for <code>name = $1</code> is the first result returned and <code>name = $2</code> is th...
<pre><code>SELECT * FROM teams WHERE name IN ($1, $2) ORDER BY CASE WHEN name = $1 THEN 0 ELSE 1 END; </code></pre>
Another way would be to arrange the arguments and their respective sorting values as a (derived) table, join that table and use the sorting column in ORDER BY: <pre><code>SELECT t.* FROM teams AS t INNER JOIN ( SELECT $1 AS name, 1 AS sort UNION ALL SELECT $2 AS name, 2 AS sort ) AS s O...
https://dba.stackexchange.com
384,292
[ "https://mathoverflow.net/questions/384292", "https://mathoverflow.net", "https://mathoverflow.net/users/61536/" ]
A semigroup <span class="math-container">$S$</span> is defined to be <em>squared</em> if there exists a subset <span class="math-container">$A\subseteq S$</span> such that the function <span class="math-container">$A\times A\to S$</span>, <span class="math-container">$(x,y)\mapsto xy$</span>, is bijective. <blockquote>...
I think, as implicitly suggested by Yemon Choi, it is possible to explain the proof of the answer of user49822 by making more use of idempotents. Suppose that the finite group <span class="math-container">$G$</span> is squared via the subset <span class="math-container">$A$</span>. The element <span class="math-contai...
It seems that every squared finite group is indeed trivial. Let <span class="math-container">$G$</span> be a squared finite group with the subset <span class="math-container">$A$</span> showing the squared-ness of <span class="math-container">$G$</span>. For any irreducible representation <span class="math-container">$...
https://mathoverflow.net
60,137
[ "https://dba.stackexchange.com/questions/60137", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/23203/" ]
What I'd like to do is order my query so that the results show every row found, but are ordered by showing results that begin with the letter 'D' first. Is this something that is possible to do with ORDER BY? I know I can use WHERE field LIKE 'D%', but I'd like all the results not just those with D. My query currently...
Have a look at below example <pre><code>DROP TABLE IF EXISTS products; create table products(pname CHAR(30),pdescription CHAR(30),price DECIMAL(10,2),manufacturer CHAR(30)); INSERT INTO products VALUES ('Toys','These are toys',15.25,'ABC'), ('Dolls','These are Dolls',35.25,'PQR'), ('DustPan','These are D...
You can create a new field in the SELECT statement to specify that text like 'D%' is the preferred sort order then order by the new field. Example: <pre><code> SELECT pname , pdescription , price , CASE WHEN pname LIKE 'D%' THEN 1 ELSE 2 END AS sortpreference FROM products WHERE man...
https://dba.stackexchange.com
126,444
[ "https://mathoverflow.net/questions/126444", "https://mathoverflow.net", "https://mathoverflow.net/users/14024/" ]
I have an impression that there is linkage or relation between singulariry of algebraic variety and continued fraction when I read some book on resolution of singularity or algebraic geometry.Could any one give some reference for that?
Continued fractions appear naturally in the resolution of quotient singularities of surfaces (and presumably in higher dimensions as well). From a topological point of view, a neighborhood of the singularity is the cone on a lens space L(p,q), and a particular continued fraction for q/p gives an explicit piece of a sm...
In the case of Hilbert modular surfaces, continued fractions appeared in the work of Hirzebruch on their singularities. This is easy to find online. This generalises somewhat in Shintani's work, as was written up in Sankaran's thesis.
https://mathoverflow.net
205,208
[ "https://security.stackexchange.com/questions/205208", "https://security.stackexchange.com", "https://security.stackexchange.com/users/200199/" ]
I was going through a web application from my account and I was able to view some confidential information about my other account. I want to know if this is a case of missing function level access control or privilege escalation. Say my URL is: <code>www.example.com/user1/info/1</code> This URL contains my profile in...
You are trying to use a technical tool to solve a social problem. The answer is that cannot fit. Techniques can provide great security when correctly used, but only user education can allow proper use. I often like the <em>who is responsible for what</em> question. That means that users should know that they will be a...
This might not be the nicest way to do it, and I cannot say that I endorse it, but I have seen it used in practice: You could have security guards patrol by night, taking any USB key-or-token plugged into a computer with them and filling a security incident. If the next day the users go fetch their USB thingies, they ...
https://security.stackexchange.com
439,578
[ "https://softwareengineering.stackexchange.com/questions/439578", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/408555/" ]
I am well aware of a <strong>programming-to-an-interface</strong> term. That's a good thing! I understand that these allow to add decorators; or perhaps one can implement a service that works faster and by injecting it instead of the original the whole thing would work faster as a result. In all of these cases the end ...
I think this puts your question better than the other thread. No, you shouldn't be able to change the <em>functionality</em> of an object by injecting different implementations of its dependencies. Your tests of both the class in question and its dependencies should be on their interfaces. Any implementation of those i...
<blockquote> I am curious whether it is ok to manipulate the class functionality by replacing its dependencies (so that they behave differently) </blockquote> This is literally <em>the</em> reason to use polymorphism (and dependency injection). If this were not &quot;ok&quot; then polymorphism would be considered bad d...
https://softwareengineering.stackexchange.com
53,990
[ "https://mathoverflow.net/questions/53990", "https://mathoverflow.net", "https://mathoverflow.net/users/290/" ]
The goal of this question is to find a "geometric" definition of Frobenius element in $\text{Gal}(\overline{\mathbb{Q}}/\mathbb{Q})$. Here are two definitions that don't work, but that should help explain what I mean. Fix an algebraic closure of $\mathbb{Q}$ and, for a prime $p$, fix an algebraic closure of $\mathbb{...
Your guess is right. $\pi_1(Spec(R))$ is the automorphism group of the maximal extension $\mathbb{Q}^{p\textrm{-}ur} \subset \overline{\mathbb{Q}}$ unramified at $p$. (This is a special case of SGA 1 Exp. V Prop 8.2 about the fundamental group of normal schemes). The morphism $g_*$ is simply the restriction map $Gal(\o...
I think you must write $\mathbf{Q}$ as $\mathrm{colim}_n \mathbf{Z}[\frac{1}{n}]$.
https://mathoverflow.net
254,315
[ "https://mathoverflow.net/questions/254315", "https://mathoverflow.net", "https://mathoverflow.net/users/100908/" ]
I would like to know if for $A,B\in SO(3)$ the inequality $$ \|AB-BA\|_F\leq \|A-I\|_F\|B-I\|_F $$ holds, where $\|\cdot\|_F$ denotes the Frobenius norm and $I$ the identity matrix. Using the identity $$ AB-BA=(A-I)(B-I)-(B-I)(A-I) $$ one can show the inequality with a factor $2$. However the inequality seems to be tru...
I confirm Peter's suggestion that the best constant is $\frac1{\sqrt2}$. For let $\omega$ be this best constant. Then the inequality amounts to writing $$3-{\rm Tr}(A^tB^tAB)\le2\omega^2(3-{\rm Tr}\,A)(3-{\rm Tr}\,B).$$ Let me parametrize $A$ by the angle of rotation $\theta$ and the axis of rotation $u$, a unit vector...
Numerical experiments suggest that actually $\|AB-BA\|_F\leq\frac{1}{\sqrt{2}} \|A-I\|_F\|B-I\|_F$ could be true, and that this bound is sharp. I don't know if that helps, but this sharpened inequality is equivalent to \begin{equation} 3-\text{trace}(ABA^tB^t)\le(3-\text{trace}(A))(3-\text{trace}(B)). \end{equation}
https://mathoverflow.net
14,817
[ "https://scicomp.stackexchange.com/questions/14817", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/761/" ]
I am looking for a fast (dare I say optimal?) explicit solution the 3x3 linear real problem, $\mathbf{A}\mathbf{x} = \mathbf{b}$, $\mathbf{A} \in \mathbf{R}^{3 \times 3}, \mathbf{b} \in \mathbf{R}^{3}$. Matrix $\mathbf{A}$ is general, but close to the identity matrix with a condition number close to 1. Because $\ma...
FLOPS count based on the suggestions above: <ul> <li>LU, no pivoting: <ul> <li>Mul = 11, Div/Recip = 6, Add/Sub = 11, Total = 28; or</li> <li>Mul = 16, Div/Recip = 3, Add/Sub = 11, Total = 30</li> </ul></li> <li>Gaussian Elimination with back-substitution, no pivoting: <ul> <li>Mul = 11, Div/Recip = 6, Add/Sub = 11,...
You can't beat an explicit formula. You can write down the formulas for the solution $x=A^{-1}b$ on a piece of paper. Let the compiler optimize things for you. Any other method will almost inevitably have <code>if</code> statements or <code>for</code> loops (e.g., for iterative methods) that will make your code slower ...
https://scicomp.stackexchange.com
293,283
[ "https://electronics.stackexchange.com/questions/293283", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/136142/" ]
In the case of the induction motor the rotor never catches up with the rotating field of the stator because if it did the induced voltage would be zero as there is no relative movement between the rotor and the stator field. What changes in the synchronous generator that makes the stator field rotate as fast as the r...
In an induction motor, the speed of the rotor structure is always less than the speed of the stator field. However the rotor field rotates faster than the rotor structure so that the rotor and stator fields are synchronized with each other. In a synchronous motor, the rotor magnetic field is produced by permanent magn...
The synchronous machine has a field winding or permanent magnets to generate the d-axis flux, where the induction machine relies on the changing magnetic field to induce flux in the rotor. If the rotor speed in an induction machine equals the synchronous speed then there's no induction and no flux. In the synchronous...
https://electronics.stackexchange.com
295,174
[ "https://softwareengineering.stackexchange.com/questions/295174", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/194077/" ]
I'm working on C# code where a static method of an abstract base class is being overridden by the class that inherits the base class. Why is this being done? I thought that only a virtual method of an abstract base class should be overridden. What purpose does it serve to make the base method static, or is it the case ...
Overloading of static methods should not be compared to overriding of instance methods. They are fundamentally different concepts. <strong>Overriding</strong> is when implementations of a virtual method are selected <em>at runtime</em> based on the instance. <strong>Overloading</strong> is when one of multiple methods...
In addition to @JacquesB-s excelent (+1) answer <blockquote> Why <strike>override</strike> overload a static method? </blockquote> I have seen usecases in java where there were static factory methods <pre><code>public class Customer { public static Customer newInstance(String name) {} .... public class Busines...
https://softwareengineering.stackexchange.com
66,045
[ "https://physics.stackexchange.com/questions/66045", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/15672/" ]
I have two questions. <strong>First</strong>, I understand that in a nuclear reaction $$Q:=K_{after}-K_{before}\equiv E_{0,before}-E_{0,after} \qquad (1)$$ where $K$ is the total kinetic energy, and $E_0$ is the total rest energy. My question is, in the reaction $^{9}Be\left(\gamma,n\right)^{8}Be$, where should I put ...
Your equations (2), (3) and (4) are all correct. I don't like the way (1) is written, because it relies on an unstated understanding that the $E$'s represent only mass energy, but with that understanding it is also correct. This is just the conservation of energy in it's relativistic form where mass is just another ki...
No because beta has to be a factorial product of the reaction in relation to the mass-rest energy.
https://physics.stackexchange.com
587,339
[ "https://electronics.stackexchange.com/questions/587339", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/296133/" ]
In my experience, an emitter-follower amplifier is usually AC-coupled to both its input and output: <img src="https://i.stack.imgur.com/N1FyTm.png" alt="schematic" /> However, I recently came across such an amplifier which is DC-coupled - the capacitors C1 and C2 are replaced by resistors: <img src="https://i.stack.img...
Vdd is the power supply for the device. Vref is the reference voltage for the ADC. The conversions are relative to that voltage and it determines the size of the LSB. It would normally be an accurately controlled voltage, maybe from a voltage reference device. The specific relationship between the voltage at the Vref p...
VDD is the 'main' power supply input -- it supplies the current to operate the ADC. Its value typically does not have to be particularly precise -- maybe Β± 5% or even 3 to 5 V for example. VREF is the reference for the ADC and needs to be accurate in order for the whole ADC to be accurate (the ADC converts VIN/VREF to ...
https://electronics.stackexchange.com
83,129
[ "https://stats.stackexchange.com/questions/83129", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/37723/" ]
I am not sure how to ask this question without giving an example. I am trying to measure the "cleanliness" of office buildings. I have two variables that try to measure this. Variable one is a person who inspects a random sample of the offices in a building and rates the cleanliness of each office. These scores ...
I am answering your first two questions together through example. <pre><code>library(multcomp) Group &lt;- factor(c("A","A","B","B","B","C","C","C","D","D","D","E","E","F","F","F")) Value &lt;- c(5,5.09901951359278,4.69041575982343,4.58257569495584,4.79583152331272,5,5.09901951359278,4.24264068711928,5.09901951359278...
You are correct, there is a random number generation involved, and it makes the calculations vary from run-to-run. The culprit is actually not Dunnett's procedure, but the multivariate t distribution required for the single-step adjustment. The following code shows an example calculating $P(X&lt;0)$ with a 5-dimension...
https://stats.stackexchange.com
54,132
[ "https://softwareengineering.stackexchange.com/questions/54132", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/19090/" ]
I've been programming for a while on different languages. I never really studied programming at school nor worked on a team of more than two people (me included). Still, I've been a professional developer for over three years. Last year, I took over my first C# project and it ended up being fine. I can't help but thin...
I can guarantee to you that <em>everyone</em> who is working in isolation, especially when writing code, but with any and all kinds of work, believes, 100%, that they are doing much better than they actually are. So, the first advantage you'll find (and I found) when starting to work with a team is actually a rather h...
Ya, when working solo you kinda miss your own mistakes/pitfalls so it doesn't seem like as big of a deal, but once you start working with people and people start suggesting/pointing out things you'll be like "Oh ya....why didn't I think of that" Trust me....an extra set of eyes is ALWAYS worth it when it comes to prog...
https://softwareengineering.stackexchange.com
12,718
[ "https://quant.stackexchange.com/questions/12718", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/8251/" ]
When reading the book of <code>Financial Risk Forecasting</code>, I saw the following example. I am not very clear about two points marked with yellow and green respectively. Regarding the first point marked with yellow color, why $VaR^{1\%}=100$, I think it should equal to $-100$ instead. Regarding the second point ...
Value at risk is quoted by absolute value. This is the amount of money you can lose, so everyone knows the sign by default. For the second question, the last line explains it. Probability of at least one of the assets losing money is ~9.6%. Probability of both losing money is pretty small and is ignored. So, since 9.6...
I think that in theory the VaR can be negative. The VaR is only a given quantile of your loss distribution depending on the confidence level you set and the time horizon you wanna consider (how many loses can I afford next year/quarter/month/week/day etc). Imagine that the loss distribution you are looking at contains ...
https://quant.stackexchange.com
357,512
[ "https://softwareengineering.stackexchange.com/questions/357512", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/112351/" ]
I'm reading <em>Code Complete (2nd Edition)</em> and in Chapter 21 the author mentions the terms <em>system code</em> and <em>application code</em> in the context of formal inspections, saying that <em>system code</em> has to be handled at a slower pace than <em>application code</em> in order to be productive. I've tr...
It's been a few years since I've read the book, but if I recall correctly, what he's referring to as system code would be operating system code. System code would be the low level code that your application calls to allocate and free system resources like memory, UI windows, etc. or that sends a packet over the network...
The author defines neither of those terms in the book. However, "system code" can be taken to mean software that performs necessary functions to maintain the system (e.g. graphics drivers, etc) and possibly the run-time environment (e.g. Java Virtual Machine, etc) that the "application code" is executing in. For examp...
https://softwareengineering.stackexchange.com
3,888,959
[ "https://math.stackexchange.com/questions/3888959", "https://math.stackexchange.com", "https://math.stackexchange.com/users/762056/" ]
I have two related(but separate) questions that are both heading toward something I am trying to prove(I think anyway). <ol> <li>Let's assume that <span class="math-container">$A_1,A_2,...,A_n$</span> is a collection of subsets of <span class="math-container">$S$</span> such that <span class="math-container">$|A_i|=m$<...
For your second question, it isn’t always possible to re-index the sets in the desired manner. To see this, let <span class="math-container">$m=n$</span> and <span class="math-container">$S=[n]\times[n]$</span>. If we let <span class="math-container">$A_k=\{k\}\times[n]$</span> and <span class="math-container">$B_k=[n]...
<span class="math-container">$$\sum_{i=1}^{k}|A_{i}|=mk$$</span> Note that every element in <span class="math-container">$\bigcup_{i=1}^{k}A_{i}$</span> appears at most <span class="math-container">$m$</span> times in the left hand side of the above equation, i.e. it is contained in at most <span class="math-container"...
https://math.stackexchange.com
521,770
[ "https://physics.stackexchange.com/questions/521770", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/117301/" ]
I've just started special relativity and have a quick question on the terminology. From a stationary frame, lorentz transformation gives both length and time of moving frame scaled by the same factor:<br> <span class="math-container">$$\Delta x = \gamma \Delta x'\\\Delta t = \gamma \Delta t'$$</span> Then why does my ...
I'm not particularly conversant in special relativity, but I think your first equation is incorrect. Assuming prime designates the moving frame, I believe gamma in the first equation should be in the denominator. Then, given <span class="math-container">$Ξ³&gt;1$</span> <span class="math-container">$$\Delta x=\frac{\De...
Suppose a rocket going from Earth to Alpha Centauri. From the rocket frame, the distance between these two locations is shorter than the 4 light years that an Earth observer measures. That is length contraction. And when the rocket arrives in Alpha Centauri, the clocks of the star (if synchronized to the Earth) will sh...
https://physics.stackexchange.com
171,594
[ "https://dba.stackexchange.com/questions/171594", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/35732/" ]
People say that the primary key for a table should ideally be an integer "Id" which has no meaning in the outside world. Under these circumstances how does one handle the following situation in a clinical database? Patient is a table containing one record per patient with a primary key <code>Id</code>. Admission is a ...
First - if the <code>Patient</code> table has an internal unique ID (often, but not always, an integer value), and a distinct real-world ID, then there are a few rules that should normally be followed: <ul> <li>The internal ID is normally going to be the primary key; however, the "real_world" ID should ideally be cons...
In my system I have an "Account" table which has both "account_id" (PK, UID) and "account_number" (UK, UID) the account number is what the app uses rather than the account id and it gives you more freedom in assigning that number. It basically means there's no constraints on you assigning whatever number you like to wh...
https://dba.stackexchange.com
640,696
[ "https://physics.stackexchange.com/questions/640696", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/301247/" ]
If work done equals change in kinetic energy and change in gravitational potential energy, is any work done if we move a standing object and at end point its speed is 0 km/h and height remains same? On the other hand, work equals force times displacement. We did change its place and applied force, which implies that th...
There was a work <span class="math-container">$w$</span> to accelerate the object to a given velocity, and another work <span class="math-container">$-w$</span> to decelerate it to zero. The net work is zero. Remember that <span class="math-container">$dw = \mathbf {F.dx}$</span>. When F changes direction the dot produ...
First, there are two key statements that are important to keep separate. <ol> <li>The work-energy theorem says that the net work is equal to the change in kinetic energy. </li> <li>The work done by a gravitational field, is equal to the minus the change in the gravitational-potential energy. </li> </ol> The way I inter...
https://physics.stackexchange.com
199,661
[ "https://dba.stackexchange.com/questions/199661", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/146233/" ]
Say, for example, I have 2 tables - Table 1 is Drink Type and Table 2 is Flavor. What is the query to create the unique identifier column which would result to drink_type_drink_flavor? <pre><code>+-------------+-------------------+ | drink_type | drink_flavor | +-------------+-------------------+ | Fruity ...
Well I think I made it sound too complicated! But here's what I did: I added a new column first: <pre><code>ALTER TABLE drink ADD COLUMN dtype_dflavor VARCHAR(50); </code></pre> Then used the UPDATE and SET to do it: <pre><code>UPDATE drink SET dtype_dflavor = concat(drink_type, '_', drink_flavor); </code></pre> T...
I think you just need a proper <code>UNIQUE</code> or <code>PRIMARY KEY</code> constraint: <pre><code>ALTER TABLE drink ADD CONSTRAINT drink_pk PRIMARY KEY (drink_type, drink_flavor);` </code></pre> If you often want the concatenation of the 2 columns in query results, you can use a view or a ge...
https://dba.stackexchange.com
146,116
[ "https://physics.stackexchange.com/questions/146116", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/62099/" ]
I once noticed a tire pressure table on a farm recommended a tire pressure of around <strong>1.0 bar</strong> (I don't remember the exact number, but it was definitely below 1.9) for the rear tire of farm tractors. The recommended pressure on a car is around <strong>2.2-2.5 bar.</strong> My bike tire recommends <stro...
The main considerations are grip and rolling efficiency. A tyre dissipates energy as it flexes, and any energy dissipated in the tyre means extra effort from the rider or motor and therefore fewer miles per gallon. The more you pump up the tyre the harder it becomes and the less it flexes, so higher pressures are more...
The principle is based on Laplace's law. Essentially, the wall or casing tension is tire firmness. If this force (casing tension) value is held constant, increasing the volume (tire width) the inflation pressure goes down, conversely in a narrow road tire requires higher inflation pressure to achieve the casing or wal...
https://physics.stackexchange.com
535,485
[ "https://electronics.stackexchange.com/questions/535485", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/258880/" ]
I originally planned to use Lead-Acid rechargeable batteries in a medical device prototype, but it seems that nowadays most devices on the market are using Li-ion rechargeable batteries, which are definitely more expensive and generally have less capacity. I also realize that many lithium-ion rechargeable batteries are...
Lead-Acid is dependable, easy to use (i.e. easy to recharge, and easy to stay within its Safe Operating Area), very safe, and very heavy. Despite the rise of Lithium-chemistry batteries, it still has a place in various applications, including medical (especially for backup/UPS purposes), where weight isn't so much of ...
The characteristic of these two technologies should be considered to make the best choice. As far as my experience goes, you can choose them by considering this: <strong>Lead-Acid:</strong> (Specially sealed ones) Pros: <ul> <li>Easy to use</li> <li>Very stable</li> <li>Low maintenance</li> <li>Low cost</li> <li>Suitab...
https://electronics.stackexchange.com
1,593,241
[ "https://math.stackexchange.com/questions/1593241", "https://math.stackexchange.com", "https://math.stackexchange.com/users/102435/" ]
I would like to calculate the infinite sum of odd terms of $\zeta(2)$ as follows. Setting $2k-1 = \ell$ yields $k = (\ell+1)/2$ and so $$\sum_{k=1}^{\infty}\frac{1}{(2k-1)^{2}} = \sum_{\frac{l+1}{2}=1}^{\infty}\frac{1}{\ell^{2}} = \sum_{\ell = 1}^{\infty} \frac{1}{\ell^{2}} = \frac{\pi^{2}}{6}.$$ This is obviously n...
$$\sum_{\frac{\ell+1}{2}=1}^{\infty}\frac{1}{\ell^{2}} = \sum_{\ell = 1}^{\infty} \frac{1}{\ell^{2}}$$ is the problem. The left is perfectly valid if you solve the equations $$\frac{\ell+1}{2}=1\qquad\frac{\ell+1}{2}=2\qquad\frac{\ell+1}{2}=3\qquad\ldots$$for $\ell$. But you substituted $\ell$ in the place of $\frac{\...
Adding to my comment, if you want to calculate the first sum, we think of it as $$\sum_{k=1}^{\infty} \frac{1}{(2k-1)^2} = \sum_{k=1}^{\infty} \frac{1}{k^2}-\sum_{k=1}^{\infty} \frac{1}{(2k)^2} = \zeta(2)-\frac 14 \zeta(2) = \frac{\pi^2}{8}$$
https://math.stackexchange.com
164,552
[ "https://softwareengineering.stackexchange.com/questions/164552", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/64055/" ]
I work for a small development company, 20 people total in the entire company, 3 in actual development, and we've adopted CD for our commits to trunk, and it works great, from a code management and up-time side. However - we're getting flak from our support staff and marketing department that they don't feel that they...
Your problem isn't one of communication of changes and isn't one of a poor execution of CD, it is fundamentally a problem of the current structure of your company, and one of developer fanaticism. <h2>Organizations that LIKE Continual Delivery</h2> Much like with people, companies can lean Conservative and Liberal. ...
The best way to keep everyone in the loop is to have a set production deployment day/time on a reoccurring basis. Then you can send out a notification to all affected employees a list of all changes that will be implemented with the next deployment. This should be sent out well in advance of the changes being deployed ...
https://softwareengineering.stackexchange.com
444,232
[ "https://softwareengineering.stackexchange.com/questions/444232", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/55904/" ]
Over the years I've many times seen folks enumerate error codes for exceptions in Java. I generally have felt this leads to more tedious code and does not provide value. For example, there will be an <code>enum</code> like this <code>ErrorType</code>, often times with a numeric <code>errorCode</code>, which I find addi...
<blockquote> It implies callers should explicitly deal with each possible type, which makes the client exception handling tedious. </blockquote> Yes, your calling code has to catch <em>each and every</em> Exception, then work out (from the error code) if it's an Exception that it can do something [useful] about and, if...
You haven't talked about proposed alternatives to this approach so I'll answer in generalities that may not be relevant to you in a particular situation. Usually, I would expect something like this to be done when you have a distributed system in which agreeing on the meaning of specific error codes is useful, if not ...
https://softwareengineering.stackexchange.com
289,850
[ "https://electronics.stackexchange.com/questions/289850", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/134757/" ]
The literature states that a SR flip flop is a sequential device and that sequential devices are those whose output depends on its <em>current inputs</em> and <em>prior state</em>. However, that doesn't make sense to me: flip flops are the basic building blocks of some memories and I wonder how useful a memory can be i...
The output of a FF depends on not only the present values of its inputs, but also on the previous values of those inputs. This is the definition of a sequential circuit. In other words, there are combinations of input values for which the output can be in either of two states &mdash; which one is determined by the pas...
What is the current output state of this FlipFlop? <pre><code> _______ 0-|S Q|-? 0-|R | |_______| </code></pre> It depends on the previous state!
https://electronics.stackexchange.com
41,065
[ "https://physics.stackexchange.com/questions/41065", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/10833/" ]
This is perhaps a naive question, but why do we write down the Lagrangian $$\mathcal{L}=\frac{1}{2}\eta^{\mu\nu}\partial_{\mu}\phi\partial_{\nu}\phi - \frac{1}{2}m^2\phi^2$$ as the simplest Lagrangian for a real scalar field? This is by no means obvious to me! After all it gives rise to a kinetic energy term (fine),...
I have a slightly different perspective from the other two answers which provides a more elementary motivation. Suppose you know nothing about renormalizability or energy-momentum relations and all you know is that a Lagrangian density is a function of fields and their derivatives that transforms as a scalar under Poin...
The standard motivation, as QuantumDot explained, is to reproduce the energy momentum relation of relativity from the scalar field. But there is an independent argument for this which comes from statistical mechanics. Consider a statistical mechanical partition function for a field defined on a very fine lattice. In g...
https://physics.stackexchange.com
96,704
[ "https://softwareengineering.stackexchange.com/questions/96704", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/26019/" ]
Some time ago, we were tasked with a project to come in and replace a customer's old Mainframe system with a new intranet ASP.NET solution using SQL Server as the back end. Part of this was a re-engineering of the business as well - essentially, as we change the system, we were to be thinking of how we can better do b...
Your team needs to do the data conversion for them. You really <em>should</em> have done it for them in the first place. I've been involved in a number of expensive platform migrations and the vendor always, <em>always</em> has their own data conversion team who are responsible for understanding the legacy system, wr...
They are the ones paying the bills so in the end you have to give them what they are asking for even though it wouldn't be the best solution and a step backwards. You have to consider however that perhaps the people who used to use the mainframe have a point. My wife used to work for a bank where she used some mainfr...
https://softwareengineering.stackexchange.com
163,641
[ "https://mathoverflow.net/questions/163641", "https://mathoverflow.net", "https://mathoverflow.net/users/10072/" ]
If $X_1\supseteq X_2\supseteq \ldots$ is a sequence of "nice" compact spaces, I would like to know whether the natural map from $H_*(\cap X_i)$ to the inverse limit $\lim \, H_*(X_i)$ is surjective. In particular, if there exist nonzero $\beta_i\in H_q(X_i)$ such that the inclusion-induced homomorphism $i_*$ takes $\be...
To expand on my answer above, consider the sequence $\dots\subset Y_2\subset Y_1$ of spaces where $Y_i=X_i$ for $i\leq n$ and $Y_i=X_n$ for $i&gt;n$. Milnors proof proceeds by taking $M_i$ to be the mapping cylinder of $X_{i+1}\rightarrow X_i$ and $M_0$ the cone over $X_0$ with vertex $t$. Then one takes the union $...
Here is a counterexample, which is probably not "nice". Let $X$ be the Warsaw-circle. Let $X_n$ be the obtained from the Warsaw-circle by thickening the limit inverval by $1/n$. The intersection of all the $X_n$'s is the Warsaw-circle, and its first homology vanishes. Each $X_n$ is homotopy equivalent to $S^1$ and th...
https://mathoverflow.net
82,404
[ "https://electronics.stackexchange.com/questions/82404", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/9968/" ]
I'm looking at a system using a gray code on 16-QAM. When a symbol changes, you move from one of the 16 symbols in the constellation to any of the 16 symbols. I'm wondering if there is in fact an advantage to using a Gray coding? It seems to me to just be arbitrarily renumbering the constellation and won't actually cha...
In the theory and practical world of today's Digital Communications, Source and Channel are separated way too much. Source coding happens somewhere up in the 6th or 5th layer of the Protocol stack and Channel coding occurs at the PHY layer(layer 1), beyond which Modulation happens. So when it comes to transmission at t...
On an ideal basis your statement is true. A gray code minimizes the entropy change between adjacent states in a sequence, since you can't predict the order of the data sequence coming at the modulator this is just addition complexity. If your data is coming in an orderly fashion, I'd suggest that a gray coding would ...
https://electronics.stackexchange.com
78,726
[ "https://softwareengineering.stackexchange.com/questions/78726", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/22523/" ]
I have some questions regarding whether to crash or report errors to the user. We are developing a web site and mobile clients in which we allow our users to report any bugs and crashes through e-mail. We require the user to send the e-mail from their e-mail account, so they can be identified. Here are some questions r...
My two cents. Keep in mind, this particular community is likely to be a cross section of programmers, so we aren't your average user. :) I can see reading my own thoughts that I'm answering as the "user who knows how to program", and not a regular human being. <ul> <li><em>We used to send the last stacktrace of jav...
<ol> <li>Always show the stack trace. A magic mail is opening doors for law suits.</li> <li>Always respect privacy. See point 1 above - that is the option for user to deny sending it to you if they find any private info. Ideally NONE of the parameters should come to you.</li> <li>Always have an EULA that gets them to a...
https://softwareengineering.stackexchange.com
1,623,620
[ "https://math.stackexchange.com/questions/1623620", "https://math.stackexchange.com", "https://math.stackexchange.com/users/292442/" ]
Is there a proof or disproof for this statement? If <strong>P</strong> is a plane in $\mathbb R ^3 $ then { $proj_\mathbf{p}\mathbf{v}$, $perp_\mathbf{p}\mathbf{v}$ } is linearly independent for any <strong>v</strong> in $\mathbb R ^3 $ ?
They are only linearly independent if both are non-zero: For a plane $P\subseteq \mathbb R^3$ choose an orthonormal basis $p_1,p_2$ of $P$ and let complete to an orthonormal basis $p_1,p_2,p_3$ of $\mathbb R^3$. Then $$ {\rm proj}\colon \mathbb R^3\longrightarrow \mathbb R^3, v\longmapsto \sum_{i=1}^3\langle v,p_i\rang...
Edit: Apparently I had a slightly different idea then the question asker about what the unspecified projections $\operatorname{proj}_P$ and $\operatorname{perp}_P$ are meant to be, so this post probably does not answer the question in the way the asker intended it. In the case that the plane $P$ goes through the origin...
https://math.stackexchange.com
113,428
[ "https://security.stackexchange.com/questions/113428", "https://security.stackexchange.com", "https://security.stackexchange.com/users/100046/" ]
I would like to fetch data from a website to do data analysis on a server. Username and password are required for login to the website. Therefore I will need to run an auto-login script on the server. My questions are: <ol> <li>Is there any security concern about running an auto-login script on the server side?</li> ...
I will assume that clients answer a series of <code>n</code> boolean questions. The server stores their answers in such a way that you that admin can not know their responses. Then the server identifies pairs of clients with identical responses. Then could not you the admin (or anyone really) create <code>2^n</code>...
I'm not a security expert but my reasoning is the following: If you encrypt the information using shared key (known to you) then you can decrypt data on server and compare it. If you encrypt data on the clients using individual keys you can not decrypt the data but you cannot compare them. I see two solutions <ul> <l...
https://security.stackexchange.com
1,554
[ "https://mathoverflow.net/questions/1554", "https://mathoverflow.net", "https://mathoverflow.net/users/613/" ]
Suppose you have an incomplete Riemannian manifold with bounded sectional curvature such that its completion as a metric space is the manifold plus one additional point. Does the Riemannian manifold structure extend across the point singularity? (Penny Smith and I wrote a paper on this many years ago, but we had to as...
Once we considered a similar problem but around infinity, try to look in our paper "Asymptotical flatness and cone structure at infinity". Let us denote by $r$ the distance to the singular point. If dimensions $\not= 4$ then the same method shows that at singular point we have Euclidean tangent cone even if curvature ...
Take a cone over a finite quotient S^{2n-1}/\Gamma. The curvature is 0, but the manifold structure does not even extend. (More generally, you can take the cone over any compact Einstein manifold of dimension n-1 with Einstein constant n-2.)
https://mathoverflow.net
593,600
[ "https://physics.stackexchange.com/questions/593600", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/210955/" ]
I know that Isentropic Efficiency is a comparison between the actual performance of something(turbine for example) and the performance that would be achieved under idealized circumstances for the same inlet and outlet. Let's say a turbine has an isentropic efficiency of 0.75. What does 0.75 mean and the rest (0.25) mea...
Contrary to popular belief, the HUP is not a principle about the <em>accuracy</em> of a measurement. The HUP is simply a statement that relates the spread of position measurements to the spread of momentum measurements of similarly prepared systems. It is a statistical principle about multiple measurements and their st...
No, the uncertainty principle is purely a property of the state of a system. Given two observables <span class="math-container">$A$</span> and <span class="math-container">$B$</span>, you have a statement of the form <span class="math-container">$$ \Delta A \Delta B\ge k$$</span> for some constant <span class="math-con...
https://physics.stackexchange.com
34,101
[ "https://quant.stackexchange.com/questions/34101", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/5839/" ]
Seem to be confused over the difference between PV01 of a bond and DV01 of the bond. PV01, also known as the basis point value (BPV), specifies how much the price of an instrument changes if the interest rate changes by 1 basis point (0.01%). DV01 is the dollar value of one basis point change in the instrument. Is ...
They are both price changes in response to a 1 bp change. DV01 is valid for a single bond. It is the price change in response to a 1 bp change in yield of this instrument. It arises from the mathematical relationship between yield and price. PV01 is a more general concept for all fixed income securities , not just bo...
Market practitioners many times refer to these two concepts in different ways and sometimes as the same thing. Not sure the different usages in regards to bonds, but here is my two cents, at least in regards to swaps... <strong>PV01</strong> refers to <strong>present value of 1 basis point</strong> and it's the discoun...
https://quant.stackexchange.com
394,460
[ "https://softwareengineering.stackexchange.com/questions/394460", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/340637/" ]
I've always considered long lived feature branches a symptom of some underlying problem, but I've recently moved jobs and the company I am working for now encourages long lived feature branches. They say it's fine as long as you merge master (well, the Dev branch, but whatever branch we all work off of) into the featur...
This will work only and only if: you only have 1 long-lived-feature-branch. Let's take the following scenario: 3 developers all working on 3 different long-lived-feature-branches. Every day they merge develop into their branch. And......achieve nothing, because develop will be the same as the day before, unless 1 of ...
Yes, this is true! But it also illustrates the problem of long-lived feature branches: you have to continue paying "rent" until you finally merge it, because you need to regularly merge master into the feature branch. When you merge Git branches, you only need to unify the changes after the most recent common ancestor...
https://softwareengineering.stackexchange.com
46,157
[ "https://physics.stackexchange.com/questions/46157", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/10915/" ]
Why can't one see the tidal effect in a glass of water like in an ocean?
A very sensitive device would be required to measure the minuscule change in the water depth along the glass walls, because the differences in the strength of the gravitational field between each side of the glass are essentially zero. Because of this the force exerted on the glass is the same, but due to the small vol...
Because the differences in the strength of the gravitational field between each side of the glass are essentially 0. However, the difference in the strength of the gravitational field between the side of the Earth closest to the Moon and furthest to the Moon is enough to pull water more towards the side close to the Mo...
https://physics.stackexchange.com
102,051
[ "https://mathoverflow.net/questions/102051", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
Let us call the $\ell_1$-product of intervals $[0,k_1]\times...\times [0,k_n]$ a <i> brick of size </i> $k_1+...+k_n$. Consider a tessellation $T$ of $\mathbb{R^n}$ by (shifted) bricks so that every point belongs to at most $n+1$ bricks and the $\ell_1$-distance between any two disjoint bricks is at least 1 (thus every...
Edit: Per Tapio's answer, $1 \times 2 \times 3 \times ... \times n$ bricks always suffice, so $s(n)\leq \left(\begin{array}{c} n+1 \\ 2 \end{array}\right)$. Consider the lattice in $\mathbb Z^n$ defined by the equations $x_1 \equiv x_2$ mod $2$, $x_2 \equiv x_3$ mod $3$, ..., $x_{n-1} \equiv x_n$ mod $n$. Place a $1 \...
If I undderstand the problem correctly one case would be that all bricks are translates of each other in which case a tessalation can be summarized by the lattice of centers of bricks. Up to reordering coordinates, generators for this lattice can be chosen to be the columns of a triangular matrix $M$ and two which dif...
https://mathoverflow.net
440,365
[ "https://math.stackexchange.com/questions/440365", "https://math.stackexchange.com", "https://math.stackexchange.com/users/68016/" ]
<blockquote> Let $V=M_2(\mathbb R)$ and $T(A)={ A }^{ t }$. </blockquote> I was asked to find the characteristic polynomial of $T$ and it's eigenvalues, and finally to say if $T$'s diagonalizable. Is there a way to solve this without actually finding a matrix representation of $T$? (since I've tried turning it ...
You can solve it all in one go. First notice that $T^2 = id$, therefore the only possibles eigenvalues are $\pm 1$. Now you simply need to solve the equations $A^t = A$ and $A^t = -A$. This gives you as eigenvectors for the eigenvalue $1$: $$\begin{pmatrix} 1 &amp; 0 \\ 0 &amp; 0\end{pmatrix}, \begin{pmatrix} 0 &amp; ...
Since $T^2=\mathrm{Id_{M_2(\mathbb R)}}$ then the polynomial $x^2-1$ annihilates $T$ and since $T\neq\pm \mathrm{Id_{M_2(\mathbb R)}}$ then $x^2-1$ is the minimal polynomial and its roots are simple then $T$ is diagonalizable (<em>we can see that $T$ is diagonalizable since $T$ is a symmetry</em>), moreover by the deco...
https://math.stackexchange.com
3,393,711
[ "https://math.stackexchange.com/questions/3393711", "https://math.stackexchange.com", "https://math.stackexchange.com/users/272453/" ]
Let <span class="math-container">$G_1, G_2$</span> be subgroups of a group <span class="math-container">$G$</span> and <span class="math-container">$G_1G_2 = \{g_1g_2: g_1 \in G_1, g_2 \in G_2\}$</span>. Prove that <span class="math-container">$|G_1| \cdot |G_2| = |G_1G_2| \cdot |G_1 \cap G_2|$</span>. I've thought ab...
Define <span class="math-container">$\varphi: G_1\times G_2\to G_1G_2$</span> by <span class="math-container">$\varphi(g_1,g_2)=g_1g_2$</span>. The map <span class="math-container">$\varphi$</span> is obviously surjective. Now let <span class="math-container">$g_1\in G_1,g_2\in G_2$</span>. For all <span class="math-co...
Hint: Given <span class="math-container">$g_1g_2\in G_1G_2$</span>, the same element is counted as all different possible <span class="math-container">$(g_1g)(g^{-1}g_2)$</span> for each distinct <span class="math-container">$g\in G_1\cap G_2$</span>. That's the connection.
https://math.stackexchange.com
2,929,902
[ "https://math.stackexchange.com/questions/2929902", "https://math.stackexchange.com", "https://math.stackexchange.com/users/592741/" ]
A symbol in a password is either one of <span class="math-container">$26$</span> latin letters or one of <span class="math-container">$10$</span> digits. How many <span class="math-container">$8$</span> symbol passwords with at least <span class="math-container">$1$</span> digit? I know there are <span class="math-con...
The whole length <span class="math-container">$8$</span> password space has size <span class="math-container">$36^8$</span>. There are <span class="math-container">$26^8$</span> passwords with only letters and no digits. So <span class="math-container">$36^8 - 26^8$</span> counts the number of passwords with at least o...
<span class="math-container">$36^7 \times 10$</span> represents all passwords with one number in a chosen position. For <span class="math-container">$7$</span> of the places you choose from all possible letters and numbers and for the chosen one you choose only from the numbers. Assuming your title is correct and you ...
https://math.stackexchange.com
360,216
[ "https://mathoverflow.net/questions/360216", "https://mathoverflow.net", "https://mathoverflow.net/users/37419/" ]
Let <span class="math-container">$S_{\pi}$</span> where <span class="math-container">$\pi$</span> is an integer partition of <span class="math-container">$n$</span>, denote the Specht module corresponding to <span class="math-container">$\pi$</span>. I am trying to decompose the set of all homogeneous polynomials in <...
The span of the monomials of the form <span class="math-container">$x_i^2x_jx_k$</span> is the Young permutation module <span class="math-container">$M^{(n-3,2,1)}$</span>. (<em>Proof.</em> Observe that <span class="math-container">$x_1^2x_2x_3$</span> has stabiliser <span class="math-container">$\langle (2,3)\rangle \...
In general, these decompositions can be computed using the Pieri rule. (This is essentially the same as Mark's answer) Fix an integer partition of <span class="math-container">$d$</span> as <span class="math-container">$\lambda = 1^{e_1} \dots r^{e_r}$</span>. Then consider the <span class="math-container">$S_n$</...
https://mathoverflow.net
2,328,102
[ "https://math.stackexchange.com/questions/2328102", "https://math.stackexchange.com", "https://math.stackexchange.com/users/118359/" ]
Assume I have only read chapter 1 of Rudin up to exercise 6b). So we are still proving the properties of exponentiation and don't know how to fully manipulate exponents. Right now I am stuck showing the following (: $$ \text{ if } t &lt; r \implies b^t &lt; b^r $$ where $b&gt;1$ and $t,r \in \mathbb{Q}$ I know it's ...
We consider:$$t&lt;r \Rightarrow \exists x \in \mathbb{Q}_{&gt;0} : t&lt;r = t+x $$ Now the inequality to be proved becomes: $$b^t&lt;b^r\Rightarrow b^t&lt;b^{r} = b^{t+x} \Rightarrow b^t&lt;b^t\cdot b^x \Rightarrow 1&lt;b^x.$$ Finally, raising both sides to the power $\frac1x$ (note that $x&gt;0 \Rightarrow\frac1x&...
So you see that it suffices to show that $1 &lt; b \leq c$ and $n \in \mathbb{N}^*$ implies $b^{1/n} \leq c^{1/n}$. Assume to the contrary that $b^{1/n} &gt; c^{1/n}$. Then raising both sides to the power of $n$ yields $b &gt; c$, a contradiction$^*$. <hr> $^*$ As a consequence of Proposition 1.18b) of Rudin, if $0 ...
https://math.stackexchange.com
2,405,763
[ "https://math.stackexchange.com/questions/2405763", "https://math.stackexchange.com", "https://math.stackexchange.com/users/453011/" ]
If we convert an equation in Cartesian coordinates to polar coordinates, can we always represent one variable by the rest?
$x=r \cos\phi;\;y=r\sin\phi$ $r=\sqrt{x^2+y^2}$ The equations can be written as $r\cos\phi+ r(r\sin\phi)=2$ and then $x+y\sqrt{x^2+y^2}=2$
<strong>Hint</strong>: This is a quadratic equation in $r$, waiting for you to solve it.
https://math.stackexchange.com
201
[ "https://mathoverflow.net/questions/201", "https://mathoverflow.net", "https://mathoverflow.net/users/2/" ]
Is there an example of a variety over the complex numbers with no embedding into a smooth variety?
Yes, there are even toric varieties. In fact, there are complete toric varieties with trivial picard group (see e.g., Eickelberg "Picard groups of compact toric varieties..." 1993). We have the following simple observations: 1) Any variety which can be embedded into a smooth variety has an ample family of line bundles...
A really neat well known example is as follows: Choose a conic $C_1$ and a tangential line $C_2$ in $\mathbb{P}^2$ and asssociate to a point $P$ on $C_1$ the point of intersection $Q$ of $C_2$ and the tangent line to $C_1$ at $P$. This gives a birational isomorphism from $C_1$ to $C_2$. Identify the curves by this ma...
https://mathoverflow.net
21,659
[ "https://cs.stackexchange.com/questions/21659", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/14481/" ]
As we all know the million dollar question in Computer Science P=NP or not. I was trying to understand it and got some doubts please tell me whether I'm right or wrong N=NP in two cases <blockquote> Case 1: We have found an algorithm which can solve a NP-Complete problem in P-Time. This implies that P=NP=NP-Comple...
Case 1 is almost correct: if you could solve a single <strong>NP</strong>-complete problem in polynomial time, then every other <strong>NP</strong> problem can be solved by first reducing to the solved problem and then using the polytime algorithm for that. However, even if <strong>P</strong>&nbsp;<strong>NP</strong>, ...
No, your case 2 is wrong. NP-hard is <em>definitely</em> not equal to P. NP-hard includes problems that are not even decidable/computable. The following diagram might help: it shows that there is no upper bound on how hard NP-hard problems can be. <img src="https://i.stack.imgur.com/k8GGs.png" alt="NP-hard problems ...
https://cs.stackexchange.com
57,618
[ "https://quant.stackexchange.com/questions/57618", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/49734/" ]
I'm building a machine learning model with the aim of learning a daily strategy of buy or sell the stock. I was wondering if I should use adjusted close price or something else to calculate returns (I was thinking about considering open price/close price the day before) and to evaluate the strategy. I know that adjuste...
You can use the adjusted close price; it is far better than using unadjusted prices and having your strategy tell you to short a stock on its ex-dividend days. The bigger issue is using closing prices -- adjusted or unadjusted. Closing prices are determined by an auction and the presence of your order in the auction wi...
Tautolotigally, a stock holder receives the dividend if they're the stock holder of record on the record date. Even if your trading strategy assumes that you will put on some position at the beginning of the day and then always flatten before the close, keeping no risk overnight, whatever information is contained in th...
https://quant.stackexchange.com
235,010
[ "https://softwareengineering.stackexchange.com/questions/235010", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/-1/" ]
I'm currently reading 'Head first design patterns' and I already have a few questions on the first chapter of the book. This chapter introduces the 'prefer composition over inheritance' design principle, by explaining the 'Strategy-Pattern'. My question isn't about the pattern, but rather about a more basic design deci...
You have to understand that examples are almost always oversimplified to such an extent that techniques like inheritance look like overkill. If the real-world code were of a similar complexity as the <code>Duck</code> hierarchy, with each class only differing in which picture/text they show, then you would have a case...
If you assume that display operation will only send rasterized image to display device, then you are right - one implementation of display method would suffice. But, if you have an abstract method for display operation, this method can also do some implementation-specific stuff like: <ul> <li>create the image of a du...
https://softwareengineering.stackexchange.com
838,320
[ "https://math.stackexchange.com/questions/838320", "https://math.stackexchange.com", "https://math.stackexchange.com/users/109256/" ]
please excuse the stupid question but I cant find anything online.. If $$f(\vec{x}) = \vec{x}^TA\vec{x}$$ with $A$ being a matrix, then $$ \frac{df}{d\vec{x}} = \vec{x}^T(A+A^T)$$ Can someone tell me why this is? And I am also interested in knowing what the derivatives of the following termes are: $$ \frac{d}{d\vec{x...
So you have a function $f \colon \mathbb{R}^n \to \mathbb{R}$, given by $f(x) = x^T Ax$. If you know the concept of derivative in $\mathbb{R}^n$, you just compute $$ f(x+h) -f(x) = (x+h)^TA(x+h) -x^TAx= x^TAh + h^TAx + O(|h|^2), $$ where $O(|h|^2)$ is a term that behaves like $|h|^2$ as $h \to 0$. Now you simply use th...
Well you have to write the things... $$f(x) = x^TAx = \sum_{i = 1}^n \sum_{j = 1}^n A_{i,j} x_i x_j$$ so using the classic definition of partial derivatives you get $$\frac{\partial}{\partial x_k}f(x) = \sum_{j = 1}^n A_{k,j}x_j+ \sum_{i = 1}^n A_{i,k} x_i = (A^Tx)_k+(Ax)_k=((A+A^T)x)_k,$$ using this shows $$\nabla f(...
https://math.stackexchange.com
434,802
[ "https://mathoverflow.net/questions/434802", "https://mathoverflow.net", "https://mathoverflow.net/users/102946/" ]
Let <span class="math-container">$(X, \mu)$</span> be your favourite measure space (finite or <span class="math-container">$\sigma$</span>-finite if you like), let <span class="math-container">$g \in L^2$</span> (say, the scalar field of <span class="math-container">$L^2$</span> is <span class="math-container">$\mathbb...
In a stable <span class="math-container">$\infty$</span>-category, there are no nontrivial projectives. Of course, <span class="math-container">$0$</span> is always projective. Now let <span class="math-container">$X$</span> be an arbitrary projective in some stable <span class="math-container">$C$</span>, <span class=...
If <span class="math-container">$f\colon X\to Y$</span> is morphism in a triangulated category, we have a distinguished triangle <span class="math-container">$X\xrightarrow{f}Y\xrightarrow{i}Cf\xrightarrow{d}\Sigma X$</span>, so in particular <span class="math-container">$if=0$</span>. If <span class="math-container">...
https://mathoverflow.net
37,550
[ "https://security.stackexchange.com/questions/37550", "https://security.stackexchange.com", "https://security.stackexchange.com/users/18541/" ]
Okay, so storing digitized credit card information/records is a well documented process when it comes to best practices. I recently got asked how a company can store, retrieve and process physical credit cards. I'm not particularly familiar with PCI-DSS standards The scenario is this: A hotel wants to be PCI complian...
For cardholder present transactions, there's very little in terms of physical security within the PCI DSS. Cardholders are responsible for their cards and aren't supposed to hand them over to others for third party storage. What should happen in this scenario to limit the access of all bartenders etc to the card is tha...
I'm not sure how storing the physical card regards to pci dss, the thing I wonder about is why they would store the card in the first place? The easy thing to do would be swiping the card and storing the details in a computer system. ( assign a CC to a tab) that's how most hotels do it these days.
https://security.stackexchange.com
458,917
[ "https://physics.stackexchange.com/questions/458917", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/121760/" ]
I've been trying to convince myself that the assertion that I've read in basic E&amp;M books (Halliday &amp; Resnick, Purcell), and even Griffiths, that the electrostatic potential at a point in space is equal to the sum of the potential contributions from each of the individual charges. My hang-up has been the direct...
Alternatively, potentials superpose because electric fields superpose: <span class="math-container">$$ V=-\int_\infty^r \sum_{s}\vec E_s\cdot d\vec \ell=\sum_s \left(-\int_\infty^r \vec E_s\cdot d\vec\ell\right)=\sum_s V_s $$</span> where <span class="math-container">$$ V_s=-\int_\infty^r \vec E_s\cdot d\vec\ell $$</s...
Electrostatic potentials superpose because Poisson’s equation is <em>linear</em>. (And it is linear because Maxwell’s equations are linear in both the fields and their sources, and the potentials and the fields have a linear relation.) Specifically, if <span class="math-container">$$-\nabla^2\varphi_1=4\pi\rho_1$$</s...
https://physics.stackexchange.com
503,899
[ "https://physics.stackexchange.com/questions/503899", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/218496/" ]
I have no physics background, which is the genesis of my question. In pop-science, it is frequently mentioned that Newton's apple didn't fall toward his head, but rather that his head came up and smacked the apple. Or, put another way, if you jump out of a window, you don't crash into the Earth, the Earth comes up an...
The earth's gravity attracts the apple with a force of <span class="math-container">$mg$</span> where <span class="math-container">$m$</span> is the mass of the apple and <span class="math-container">$g$</span> is the acceleration due to gravity, which may be considered a constant and equal to 9.81 <span class="math-co...
<blockquote> Newton's apple didn't fall toward his head, but rather that his head came up and smacked the apple. </blockquote> This is relative: <ol> <li>From the <em>apple's</em> point of view, the <em>Newton's head</em> came up.</li> <li>From the <em>Newton's</em> point of view, the <em>apple</em> fall toward his...
https://physics.stackexchange.com
42,924
[ "https://softwareengineering.stackexchange.com/questions/42924", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/15385/" ]
I work for a company that has a hosted .net internet application with many clients. Those clients often want to write customizations for our application. We have APIs to hook into the app, but the customizations themselves are written in .net. This is a shared, secure hosting environment and we have to code review thes...
Frankly, I think thats awfully brave of you to offer that option in a <em>shared</em> hosting environment. Are there databases in use too that are shared? If this was a company I worked for, I'd suggest scrapping completely the notion of paying per line or other metric, and replacing it with flat rate fees based on w...
Test coverage may be another area that would be worth adding as that can help when new things are added to ensure things aren't broken. Design pattern use may be another idea to help with making the code be better organized at times as there are times where this can be quite useful in helping to make code that is unde...
https://softwareengineering.stackexchange.com
3,519,507
[ "https://math.stackexchange.com/questions/3519507", "https://math.stackexchange.com", "https://math.stackexchange.com/users/736935/" ]
I have the following pde <span class="math-container">$$w_x -y w_y-w_z = 0 \,\,,\,\,\, w = w(x,y,z)$$</span> <span class="math-container">$$w(x,y,x)=x+y$$</span> Using System of characteristic ODEs : <span class="math-container">$$\frac{dx}{x}=\frac{dy}{-y}=\frac{dz}{-1}$$</span> I get: <span class="math-container">...
We first need to find the derivative of the equation, with respect to <span class="math-container">$m$</span>: <span class="math-container">\begin{align}\frac{\partial}{\partial m}\left(\frac nm+m-1\right)&amp;=\frac{\partial}{\partial m}\left(nm^{-1}+m-1\right)\\ &amp;=-1nm^{-2}+1+0\\ &amp;=-\frac{n}{m^2}+1\end{align...
The derivative w.r.t <span class="math-container">$m$</span> is <span class="math-container">$-\frac n {m^{2}}+1$</span> which is <span class="math-container">$0$</span> when <span class="math-container">$m =\pm \sqrt n$</span>. The second derivative at <span class="math-container">$m=\sqrt n$</span> is positive so thi...
https://math.stackexchange.com
159,208
[ "https://stats.stackexchange.com/questions/159208", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/81010/" ]
Let's say ABC drug company claims their medicine cures 90% of patients. Now a doctor conducts a trial by taking a random sample of 15 patients. Result shows 11 of them are cured but 4 are not. In this case, $H_0$ should be: $p=0.9$. And $H_1$ is: $p&lt;0.9$. If we use $X$ to represent the number of people cured in th...
You are using your data to set your rejection region. This is incorrect. If you want to test $H_0: p=0.9$ vs. $H_a: p&lt;0.9$ using an iid sample of 15, then the cutoff is determined as follows: <ol> <li>Let $X_i=1$ if patient $i$ is cured, $0$ o/w</li> <li>Assume $X_i \sim Ber(0.9) \implies T:=\sum X_i \sim Bin(15,0...
We know that $$P(\text{Type I Error}) = P(\text{rejecting} \ H_0|H_{0} \ \text{is true})$$ $$ = 1-\sum_{x=x_c}^{15} \binom{15}{x} \left(\frac{9}{10} \right)^{x} \left(\frac{1}{10} \right)^{15-x}$$ For $\alpha = 0.05$, the rejection region is $\{x: x \leq 11 \}$. The p-value is the probability that we would get a resu...
https://stats.stackexchange.com
119,663
[ "https://mathoverflow.net/questions/119663", "https://mathoverflow.net", "https://mathoverflow.net/users/30869/" ]
Is there an algorithm that takes in a set of ellipses and gives back an ellipse that encloses the original set of ellipses?
The short answer is yes, the centres $Z_i$ are contained in the cyclotomic extension $E_n= {\mathbb Q}(e^{(2\pi i)/n})$ where $n$ is the order of the group. As pranavk says, we need only prove that the simple factors of the centre of ${\mathbb Q}[G]$ are contained on $E_n$. But the centre is spanned by the averages $ C...
The simplest case of your question is the case where $G$ is the cyclic group of order $n$, it is known that $\mathbb{Q}G\simeq\mathbb{Q}[X]/(X^n-1)$. As $X^n-1=\Pi_{d|n}\Phi_d(X)$ where $\Phi_d(X)$ is the $d$-th cyclotomic polynomial, it follows that $\mathbb{Q}G\simeq\Pi_{d|n}\mathbb{Q}(\zeta_d)$ where $\zeta_d\in\ma...
https://mathoverflow.net
1,140,679
[ "https://math.stackexchange.com/questions/1140679", "https://math.stackexchange.com", "https://math.stackexchange.com/users/206947/" ]
A function $f(x)$ in some domain $a\leq x \leq b$ is convex if and only if for any $x_1 &lt; x_2 &lt; x_3$ from domain $[a,b]$, $$\frac{(f(x_2)-f(x_1))}{(x_2-x_1)} \leq \frac{(f(x_3)-f(x_1))}{(x_3-x_1)} \leq \frac{(f(x_3)-f(x_2))}{(x_3-x_2)}.$$ I am aware that for any $(x_1,x_2)$ for a convex function $f(x_1) \geq f...
If you're talking about as a subset of real numbers, no. If you're talking about an arbitrary set, then sure, as long as you define what you mean by $\infty$. For instance, you could mean it as the one point added in the one point compactification of the real numbers, then it certainly can be an element of a set
$\infty $ is indeed not a real number. However, sets don't have to only have real numbers as elements. So, if you want, you can add the symbol $\infty $ to any set you like. You can define the meaning of $\infty $ in various ways too.
https://math.stackexchange.com
128,926
[ "https://stats.stackexchange.com/questions/128926", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/63699/" ]
<pre><code>Call: glm(formula = darters ~ river + pH + temp, family = poisson, data = darterData) Deviance Residuals: Min 1Q Median 3Q Max -3.7422 -1.0257 0.0027 0.7169 3.5347 Coefficients: Estimate Std.Error z value Pr(&gt;|z|) (Intercept) 3.144257 0.218646 14.381 &lt; 2e-16 ***...
I don't think the title of your question accurately captures what you're asking for. The question of how to interpret the parameters in a GLM is very broad because the GLM is a very broad class of models. Recall that a GLM models a response variable <span class="math-container">$y$</span> that is assumed to follow a kn...
My suggestion would be to create a small grid consisting of combinations of the two rivers and two or three values of each of the covariates, then use the <code>predict</code> function with your grid as <code>newdata</code>. Then graph the results. It is much clearer to look at the values that the model actually predic...
https://stats.stackexchange.com
274,461
[ "https://stats.stackexchange.com/questions/274461", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/157870/" ]
The PDF of a random variable X is given by: $$f(x) = \left\{\begin{array}{ll} 2 &amp; : -c \le x &lt; 0\\ 2e^{-4x} &amp; : 0 \le x &lt; \infty\\ \end{array} \right.$$ In this example, how would I calculate the value of c? In all of the previous examples I've encountered in the book, they are of the form of: $$f(x) ...
In this case the first part is $2c$ (area of the rectangle). Then calculate the integral of $2 e^{-4x}$ from $c$ to infinity. That part will be in closed form ${2\over{4}} -0$. So calculate $c$ as $2c+{1\over{2}} = 1$. Since the entire integral must equal $1$.
In order to solve for the value $c$ in the PDF $$f(x) = \left\{\begin{array}{ll} 2 &amp; : -c \le x &lt; 0\\ 2e^{-4x} &amp; : 0 \le x &lt; \infty\\ \end{array} \right.$$ It would seem proper to first find the stepwise CDF $F(X)$ by integrating each part separately. i.e. $$F(x) = \left\{\begin{array}{ll} \int{2} dx &...
https://stats.stackexchange.com
1,320,357
[ "https://math.stackexchange.com/questions/1320357", "https://math.stackexchange.com", "https://math.stackexchange.com/users/224409/" ]
I have been given these instructions: <ul> <li>Cut out sector from a circle having central angle $\theta$ and radius <em>r</em></li> <li>Form a cone from what's left of the circle (I thought of it as taking a circular piece of paper, cutting a pizza shape out of it, then push the rest of the paper together to make a c...
The angle of the sector not taken is $2\pi-\theta$. The length of the circular arc with central angle $2\pi-\theta$ radians and radius $r$ is $r(2\pi-\theta)=2\pi r-\theta r$ (by the definition of radian measure). When you form the cone, this will be the circumference of the circle at the base of the cone. The radius o...
The radius $R$ of the cone is given as $$2\pi R=(2\pi-\theta)r$$$$ \implies R=\frac{(2\pi-\theta)r}{2\pi}\tag 1$$ &amp; the slant height of the cone will be $r$ hence its vertical height $H$ is given as $$H=\sqrt{(\text{slant height})^2-(\text{radius})^2}$$ $$=\sqrt{(r)^2-\left(\frac{(2\pi-\theta)r}{2\pi} \right)^2}$$ ...
https://math.stackexchange.com
864,809
[ "https://math.stackexchange.com/questions/864809", "https://math.stackexchange.com", "https://math.stackexchange.com/users/30074/" ]
Got it. $$\dfrac{|x|}{|x+2|}&lt;2$$ $$|x|&lt;2|x+2|$$ $$|x|&lt;2x+4$$ $$-x&lt;2x+4&lt;x$$ $$-2x-x&lt;4&lt;x-2x$$ $$-3x&lt;4&lt;-x$$ $$x&gt;\dfrac{-4}{3},x&lt;-4$$ $$(-4,-\infty)\cup(\dfrac{-4}{3},\infty)$$
In yor second line, you multiplied both sides by $x+2$, which is negative when $x&lt;-4$. This changes the sign of the inequality. A more productive way to solve absolute value equations of this sort is to translate it into an equivalent pair of inequalities: $$|u|&lt;a\implies -a&lt;u&lt;a.$$
As $\displaystyle\frac{|x|}{|x+2|}=\left|\frac x{x+2}\right|,$ we have $\displaystyle\left|\frac x{x+2}\right|&lt;2$ For real $\displaystyle x,-2&lt;\frac x{x+2}&lt;2$ If $\displaystyle x+2=0\iff x=-2,\frac x{x+2}=-\infty$ Assuming $x+2\ne0,$ $$\frac x{x+2}&lt;2\iff \frac x{x+2}-2&lt;0\iff-\frac{x+4}{x+2}&lt;0\i...
https://math.stackexchange.com
229,185
[ "https://mathoverflow.net/questions/229185", "https://mathoverflow.net", "https://mathoverflow.net/users/36687/" ]
Consider a set of linearly independent vectors $\{x_1,\dots,x_n\}$ in some finite-dimensional Hilbert space $H$. For any subset $S \subset [n]$, let $P_S$ be the (orthogonal) projection (operator) onto the span of $x_S := \{x_i, \;i \in S\}$. Let us also write $P_j = P_{\{j\}}$. We would like to study the collection o...
I don't know about question 2, but question 1 can indeed be answered using a general result about the projection lattice $P$ (ordered by $p\leq q\Leftrightarrow p=pq$) of a von Neumann algebra $A$. <blockquote> $Q=\{q\in P:pa=qa\}$ is a complete sublattice of $P$, for any $a\in A$ and $p\in P$ </blockquote> Proof: ...
This is an expanded version of Tristan Bice's argument above, as far as I understand. Please feel free to correct. (For example, is it also true that $p \le q \iff p = qp$?) Let $[b]$ be the range projection of any $b \in A$, i.e., projection onto the closure of the range of $b$. For any $q \in P$ and $a \in A$, we ha...
https://mathoverflow.net
61,046
[ "https://dba.stackexchange.com/questions/61046", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/16363/" ]
My table has one clob column and one blob column. I need to insert data into it through insert statements. The length of data to be inserted is more than 4000 chars. When I do export of insert statements is sql navigator I get empty values. <pre><code>INSERT INTO mytable VALUES('REQUEST',EMPTY_CLOB(),EMPTY_BLOB()); ...
In SQL, the limit is 4,000 characters. Using straight SQL like that, without a bind variable, you'll be limited to 4,000 characters. <strong>Steps to insert lob values :</strong> <ul> <li>1) Create a table and name it TBL_CLOB with 2 fields: <pre> id_int = integer; clob_txt =clob; </pre></li> <li>2) Create...
For inserting CLOB data using SQL Developer (in my case), you can do something like this: <pre><code>INSERT INTO mytable VALUES('REQUEST2',:a,NULL); </code></pre> Writing :a will result in a window popping up for you to enter value for parameter :a. Just write all your <strong><em>'{"customer"asxcbasjbab....:}'</em>...
https://dba.stackexchange.com
546,716
[ "https://stats.stackexchange.com/questions/546716", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/76484/" ]
<span class="math-container">$\newcommand{\szdp}[1]{\!\left(#1\right)} \newcommand{\szdb}[1]{\!\left[#1\right]}$</span> <strong>Problem Statement:</strong> Show that the least squares prediction equation <span class="math-container">$$\hat{y}=\hat\beta_0+\hat\beta_1x_1+\cdots+\hat\beta_kx_k$$</span> passes through the ...
One place to start would be to replace your <span class="math-container">$a^T$</span> vector with <span class="math-container">$\frac1n$</span> times a row vector of <span class="math-container">$n$</span> 1's times <span class="math-container">$x$</span>. This is just the matrix version of finding the means (<span cl...
An alternate approach: <ol> <li>If the mean of all the <span class="math-container">$x$</span>s was zero, the mean point would be <span class="math-container">$(0,\dots,0,\hat\beta_0)$</span>. The matrix <span class="math-container">$X^TX$</span> would be block diagonal, with a block for the intercept and a block for ...
https://stats.stackexchange.com
51,542
[ "https://cs.stackexchange.com/questions/51542", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/12532/" ]
A pseudo-polynomial time algorithm is an algorithm that has polynomial running time on input value (magnitude) but exponential running time on input size(number of bits). For example testing whether a number $n$ is prime or not, requires a loop through numbers from 2 to $n-1$ and check if $n$ <em>mod</em> $i$ is zero ...
What this means is that <em>unary knapsack</em> is in P. It does not mean that <em>knapsack</em> (with binary-encoded numbers) is in P. Knapsack is known to be NP-complete. If you showed that knapsack is in P, that would show that P = NP. But you haven't shown that knapsack is in P. You've shown that unary knapsac...
I would add one small thing to D.W.'s answer: I have seen people who think that because unary Knapsack is in P therefore we can use it in place of Knapsack which best current algorithms have exponential time. Let the input be $W=\{w_1, \ldots, w_n\}$ and $k$ and consider the dynamic programming algorithm for Knapsac...
https://cs.stackexchange.com
86,660
[ "https://cs.stackexchange.com/questions/86660", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/78255/" ]
<span class="math-container">$L = \{ \langle M \rangle \mid \epsilon \in L(M) \}$</span>, where <span class="math-container">$M$</span> is any Turing machine. Why is the above problem undecidable? Can't we just check whether the initial state is a final state and say the TM accepts <span class="math-container">$\epsil...
First, a note on notation: $L(M)$ is a language which is a set. Languages don't accept or reject, Turing machines do. You can either say "$\epsilon \in L(M)$" or "$M$ accepts $\epsilon$". There are many Turing machines in this language that don't meet your description. For example, imagine a machine that upon reading...
Consider a TM $M$ that, on input $\epsilon$, computes $3654^{256}$, divides it by two, and then accepts. Then $\langle M \rangle \in L$, even if $M$ does <em>not</em> get to the accepting state on blank. Before reaching the accept state it does a lot of computation, traversing many states and writing a lot of data on ...
https://cs.stackexchange.com
2,486,334
[ "https://math.stackexchange.com/questions/2486334", "https://math.stackexchange.com", "https://math.stackexchange.com/users/411780/" ]
What is the plane graph of $|z-1|+|z-5| &lt; 4$ ? What i know is that there is nothing for $y\geq4$ or $y \leq -4$ or $x \geq 5$ or $x \leq 1$. Trying to let $z=x+y i$ such that $x,y \in \mathbb{R}$ did not help either.
$\left| x+i y-5\right| +\left| x+i y-1\right| &lt;4$ $\sqrt{(x-5)^2+y^2}+\sqrt{(x-1)^2+y^2}&lt;4$ $2 \sqrt{(x-5)^2+y^2} \sqrt{(x-1)^2+y^2}+2x^2-12 x+2 y^2+26&lt;16$ $\sqrt{(x-5)^2+y^2} \sqrt{(x-1)^2+y^2}&lt;-x^2+6 x-y^2-5$ $\left((x-5)^2+y^2\right) \left((x-1)^2+y^2\right)&lt;\left(-x^2+6 x-y^2-5\right)^2$ $x^4-12...
Consider two points in cartesian plane, $A(1,0)$ and $B(5,0)$. You have to find a locus of point $P$ such that <em>sum of distance from these two points is less than</em> $4$. $$PA+PB &lt; 4$$ Since the points themselves are at a distance $4$, ie $AB = 4$ , you can never have $PA+PB &lt; 4$, because <strong>triangle...
https://math.stackexchange.com
382,046
[ "https://stats.stackexchange.com/questions/382046", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/203151/" ]
I have troubles with my CNN. The code runs and my network learns something, but the performance is really poor. The goal is to play the game Connect 4. The network therefor receives a numpy array with the size (batch_size, row, cols, 2). The 2 stands for two channels. In channel one there are all places obtained by pla...
OP points out in an edit that s/he was not using the same loss function as was used in the reference code. Because OP’s code didn’t match the reference, it’s not surprising that the RL agent found a different result. Incidentally, this is why I recommend unit tests and careful debugging as a core part of building neu...
It's difficult to answer this without reproducible code. However, one thing that jumps out is you don't seem to be doing any pooling between convolutions. This might be making it difficult for your network to recognize longer patterns. So for example if you do a 3x3 convolution in the top left of the board, and a 3x3 o...
https://stats.stackexchange.com
35,917
[ "https://softwareengineering.stackexchange.com/questions/35917", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/963/" ]
Do you know any scenario where asp.net mvc can outperform asp.net? Because while comparing these two, people always say that each of them are different beasts and may be a better choice depending upon the scenario.
I think if you are talking performance like efficiency of HTML generated, speed the page is returned, etc., it doesn't matter which framework you choose. It matters which developers are on the project. You can make a speedy website with either framework, and you can make a horrifically slow website with either framew...
I have seen many aps.net web forms suffer from Viewstate bloat which severely affects performance. Using MVC take the problem of Viewstate away which will increase performance - however both web forms and MVC suffer when bad designs or developers are at the helm.
https://softwareengineering.stackexchange.com
163,534
[ "https://mathoverflow.net/questions/163534", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
Consider a set of $N$ points in $n$-dimensional space, i.e. \begin{align*} \{x_1, \dots, x_N\} \subset \mathbb R^n. \end{align*} Let us be given a finite family of non-injective matrices \begin{align*} \{M_j \in \mathbb R^{m \times n} : j = 1, \dots, J\}, \end{align*} e.g. $m&lt;n$. In a nutshell, the problem I ...
Denote by $S$ your finite collection of $N$ points in $\newcommand{\bR}{\mathbb{R}}$ $\bR^n$. Here is how you can recover $S$ from the knowledge of its images via a finite collections of linear maps of rank $&lt;n$. More precisely one can use a universal family consisting of roughly $\frac{N^4}{2}$ matrices of typ...
I don't provide an actual answer (I don't have one), but do provide some musings that might be helpful to others who would like to consider this problem. First, if there is only one point, then the condition $$\bigcap_{j = 1,\dots, J} \ker M_j = \{0\}$$ is both necessary and sufficient. It is clearly necessary even if...
https://mathoverflow.net
32,597
[ "https://mathoverflow.net/questions/32597", "https://mathoverflow.net", "https://mathoverflow.net/users/2510/" ]
John Hubbard recently told me that he has been asking people if there are compact surfaces of negative curvature in $\mathbb{R}^4$ without getting any definite answers. I had assumed it was possible, but couldn't come up with an easy example off the top of my head. In $\mathbb{R}^3$ it is easy to show that surfaces o...
You will find examples (topologically, spheres with seven handles) in section 5.5 of <em>Surfaces of Negative Curvature</em> by E. R. Rozendorn, in <em>Geometry III: Theory of surfaces</em>, Yu. D. Burago VI A. Zalgaller (Eds.) EMS 48. Rozendorn tells us that Β«from the visual point of view, their construction seems fa...
In "Y. Martinez-Maure, A counter-example to a conjectured characterization of the sphere. (Contre-exemple à une caractérisation conjecturée de la sphère.) (French), C. R. Acad. Sci., Paris, Sér. I, Math. 332, 41-44 (2001), the author disproves an old characterization of the 2-sphere by giving an exemple of a "hyperboli...
https://mathoverflow.net