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 |
|---|---|---|---|---|---|
8,023 | [
"https://mathoverflow.net/questions/8023",
"https://mathoverflow.net",
"https://mathoverflow.net/users/78/"
] | I'm looking for an easily-checked, local condition on an $n$-dimensional Riemannian manifold to determine whether small neighborhoods are isometric to neighborhoods in $\mathbb R^n$. For example, for $n=1$, all Riemannian manifolds are modeled on $\mathbb R$. When $n=2$, I believe that it suffices for the scalar curv... | If the Riemannian metric is twice differentiable in some co-ordinate system, then this holds in any dimension if and only if the Riemann curvature tensor vanishes identically.
In dimension 2, it suffices for the scalar curvature to vanish.
In dimension 3, it suffices for the Ricci curvature to vanish.
In higher dimens... | Deane already answered the question. I just want to add that knowing the existence of local flat coordinates (by the vanishing of the curvature) and actually <em>finding</em> the flat coordinates are two very different things. I've had "fun" in the past finding explicit flat coordinates for flat metrics and it can be... | https://mathoverflow.net |
117 | [
"https://robotics.stackexchange.com/questions/117",
"https://robotics.stackexchange.com",
"https://robotics.stackexchange.com/users/73/"
] | In graph-based planning (say, A*), states are connected to their neighbors. How should one decide whether to connect to the 4 neighbors or the 8 neighbors? What are the pros and cons of each approach?
| I believe it simply boils down to what your robot can do.
If you are for some reason restricted to moving only in 4 directions, then you connect each grid cell to 4.
If you can go in 8 directions, you connect each grid cell to 8.
If you can go in 6 directions, you use a honeycomb grid and connect each grid cell to 6... | Graph-based planning algorithms are typically performed for high level planning, for example getting a robot across an office. But, the actual actuator planning for the robot is planned completely differently. This means it completely depends on your application and your desired level of complexity. If you have a grid ... | https://robotics.stackexchange.com |
108,662 | [
"https://physics.stackexchange.com/questions/108662",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/35837/"
] | See, the energy of a photon is given out by $E = pc = hv$ why don't we substitute for $p$ in $E ^2= p^2 c^2 + m^2 c^4$ by putting $p = \gamma mv$ and then get a value for $m$ (which will be $0$ for a photon) and therefore rendering the equation to $E = 0$. I am just getting a bit confused.
<strong>EDIT</strong>
Since... | <blockquote>
by putting $p=\gamma mv$ and then get a value for $m$ (which will be 0 for a
photon) and therefore rendering the equation to $E=0$
</blockquote>
First, let's write this out in full (in 1D)
$$p = \frac{m v}{\sqrt{1 - \frac{v^2}{c^2}}} $$
Then, solve for $m$
$$m = p\frac{\sqrt{1 - \frac{v^2}{c^2}}}{v... | That's because the relation $p=\gamma mv$ doesn't hold universally. As you just showed yourself, using this relation for a photon would lead to a contradiction because the energy of a photon isn't zero.
A heuristic way of seeing why this relation won't hold for a photon is by recognizing that $$p=\gamma mv =m\frac{d x... | https://physics.stackexchange.com |
33,833 | [
"https://mathoverflow.net/questions/33833",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6646/"
] | I've been reading the book of Hilton, Mislin, and Roitberg on Localization of Nilpotent Groups and Spaces. In Section II.2 they define a principal refinement at stage $n$ of a Postnikov system $$\cdots \to X_n\overset{p_n}{\to} X_{n-1}\to \cdots$$
to be a factorization of $p_n$ into a finite sequence of fibrations
$$X... | The key idea is that not all fibrations $E \to B$ with fibre an Eilenberg-MacLane space $K(\pi,n)$ can be constructed by pulling the principal path fibration $K(\pi,n) \to PK(\pi,n+1) \to K(\pi,n+1)$ along a classifying map $B \to K(\pi,n+1)$. If you can construct the fibration in this way then the classifying map is ... | A fibration with $K(G,n)$ fibers need not be principal. The base of the universal fibration with fiber $K(G,n)$ is not a $K(G,n+1)$, even if $G$ is abelian. For example, in the case $G=\mathbb Z$ and $n=1$ it is $BO(2)$, with $\pi_1=\mathbb Z/2$ and $\pi_2=\mathbb Z$. In fact, in general it has homotopy groups $\pi_1=A... | https://mathoverflow.net |
14,094 | [
"https://quant.stackexchange.com/questions/14094",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/11600/"
] | I came to the conclusion that in literature Markowitz' Portfolio Theory is believed to be compliant with the Efficient Market Hypothesis. The weakest form states that the current price fully incorporates information contained in the past history of prices only. That is, nobody can detect mispriced securities and “beat”... | EMH says that one can not earn <em>excess</em> return using some information. This is known as joint-hypothesis problem: to test for market efficiency one have to determine first what is "normal" market return, i.e. what type of information is normally priced by the market. Usually to test for EMH they use CAPM or 3-fa... | The weak EMH states that it is impossible to earn an <em>excess</em> return given publicly known information such as past prices. Clearly, different securities have different <em>expected</em> returns. For example: the bond and the stock of one company or a security that generates twice the return of another one.
Thi... | https://quant.stackexchange.com |
672,596 | [
"https://physics.stackexchange.com/questions/672596",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/283030/"
] | I have a lot of doubts regarding the potential energy definitions
First of all,I would try to express my Understandings(they might be wrong)regarding the issue
I was told that if Work done on a body by a Force F is positive then The source Applying The force Looses some of its energy and that energy is transferred to t... | <blockquote>
So I can't understand from where does the potential energy come
from?
</blockquote>
The potential energy comes from the negative work done by gravity. The work done by gravity is negative because the direction of the force is opposite to the displacement. When a force does negative work on an object it tak... | The thing is that the work done by gravity <strong>is the potential energy.</strong>
<em>Potential</em> is just a name given to work done by conservative forces since their work isn't wasted but becomes "stored" (there is a <em>potential</em> for releasing it again).
You can thus call them work, <span class="... | https://physics.stackexchange.com |
299,991 | [
"https://physics.stackexchange.com/questions/299991",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/139895/"
] | in a given (TD)DFT code with an atomic basis set, i.e.
$$
\psi(\mathbf{r},t) = \sum_i c_i(t) \phi_i(\mathbf{r})
$$
(where the non-on-site basis functions $\phi_i$ aren't necessarily orthogonal), the kinetic energy matrix is calculated via
$$
T_{ij}=\langle \phi_i|\hat{\mathbf{T}}|\phi_j\rangle \sim\langle\phi_i|\hat{\m... | Sometimes it may not be possible to deduce the metric of the background a theory lives in. Consider for example Liouville theory, given by the action,
$$S = \frac{1}{4\pi}\int d^2 x \, \sqrt{g} \left(\frac{1}{2}g^{ab}\partial_a \phi \partial_b \phi + \frac{1}{\gamma} \phi \mathcal R + \frac{\mu}{2\gamma^2}e^{\gamma \p... | Two different metrics can have the same Hamiltonian, for instance for a conformally invariant scalar field and two conformally related metrics. Hence I do not believe it is generally possible to do.
| https://physics.stackexchange.com |
277,151 | [
"https://mathoverflow.net/questions/277151",
"https://mathoverflow.net",
"https://mathoverflow.net/users/9253/"
] | It is well known that the only homogeneous surfaces in $\mathbb{R}^3$ are the spheres, cylinders or planes. My question is about other examples in dimension $4$. Such a surface should have "constant curvature" but it seems that there is no good scalar invariant such as mean curvature or Gauss curvature...except perhaps... | I'm rearranging my answer a little bit because I realized that I overlooked an apparent possibility (that turns out not to occur), and I didn't want my answer to be misleading:
If the surface in Euclidean $\mathbb{R}^4$ has positive Gauss curvature and is homogeneous, it will be complete and hence compact. Hence the g... | Obviously, $S^1\times S^1$ is homogeneous in ${\mathbb R}^4$.
If disconnected surfaces are allowed, then there are many more, already curves in ${\mathbb R}^3$ and surfaces in ${\mathbb{R}}^4$.
| https://mathoverflow.net |
134,661 | [
"https://electronics.stackexchange.com/questions/134661",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/26049/"
] | If I know total power of the signal and spectrum of the signal with amplitudes in dbV, how do I compute bandwidth, which transfers 95% of the power?
| You integrate the PSD (power spectral density) of the signal over various widths centered on the center of the channel until you get 95% of the total.
This can be done analytically for some signals, but must be determined empirically for others.
It's an interesting experiment to take the FFT of a signal to get it's P... | It all depends on the signal. If the signal is flat spectrally but constrained to a certain bandwidth then that's easy. If your signal is more like FSK then there will be a complicated shape to the spectrum and it's harder to compute.
In the simple version (band limited white noise) the power is directly proportional ... | https://electronics.stackexchange.com |
83,456 | [
"https://softwareengineering.stackexchange.com/questions/83456",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/27627/"
] | I'm new to web applications. I have developed a web application using ASP.net. After hearing about jquery and going through some examples, I changed the existing application and used jquery to do most of the ajax work. On the server side I used html handlers for db connections and data processing.
Because I'm using jq... | jQuery is not a programming language. It is a JavaScript framework. Your AJAX code is not any more visible just because you switched to jQuery. No matter what, AJAX relies on JavaScript in the client, so that code is visible to whomever uses the web application. (Afterall, AJAX stands for Asynchronous Javascript An... | No. JQuery is executed in the browser, an from a security point of view, the browser is always unreliable. No matter how much JavaScript you use or which JS frameworks, it's always under control of the attacker. Security has to implemented on the server side. It's a common mistake beginners make, to place security chec... | https://softwareengineering.stackexchange.com |
33,286 | [
"https://stats.stackexchange.com/questions/33286",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/12450/"
] | What's the similarities and differences between parametric regression analysis and estimation theory?
I notice that they are both about parameter estimation, and both require some models for estimation.
One difference is that regress requires both independent and dependent variables, while estimation only requires ob... | Regression analysis is a form of statistical model.
Estimation methods like maximum likelihood, method of moments, or least squares (which is the same as minimum mean squared error - minimising the total of squared residuals is the same as minimising the mean of them) are ways of estimating the values of parameters of... | One perspective is estimation theory provides a unified view for estimation where as mean square error can be chosen as a loss function, a metric for describing a state. A maximum likelihood estimator is similar to the most probable Bayesian estimator given a uniform prior distribution on the parameters. A central con... | https://stats.stackexchange.com |
177,930 | [
"https://mathoverflow.net/questions/177930",
"https://mathoverflow.net",
"https://mathoverflow.net/users/51663/"
] | Let $W$ be an infinite word over a finite alphabet $\{1,\dots,n\}$ and $k$ a positive integer. An easy application of Van der Waerden's theorem implies the existence of $k$ disjoint and consecutive intervals in $W$ such that the sum of letters in each interval are equal (<strong>Edit</strong>. See Barber's answer).
On... | Your claim is not true.
Two consecutive blocks having the same number of occurrences of each letter (such as the English word "reappear") form what is called an "abelian square". A google search will easily produce a large literature on this subject. The best result (in terms of alphabet size) is due to the Finnish ... | Here's a proof of the first statement from Van der Waerden's theorem for $n$ colours and progressions of length $k+1$ for those who'd like to see it.
Given a word $w = a_1a_2a_3\cdots$ on alphabet $[n] = \{1, 2, \ldots, n\}$, obtain a new word $w'$ by replacing each $a_i$ by a copy of $[a_i]$ (listed in increasing ord... | https://mathoverflow.net |
515,975 | [
"https://math.stackexchange.com/questions/515975",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/49057/"
] | I am trying to calculate $2^{32101}\bmod 143$ with using paper and a calculator.
What bothers me is that $32101 = 47 \times 683$ and $143=11 \times 13$, so they are not prime numbers. This means i can't use Fermat's little theorem. I tried also to solve it by square and multiply algorithm, but i am stuck there too, so... | Well, you already thought about using Fermat's Little Theorem and Chinese Remainder theorem, which combined <em>can</em> do this.
The basic idea is that you can compute
$2^{32101} \pmod{11}$ and $2^{32101} \pmod{13}$ using Fermat's Little Theorem, and then use the results to compute $2^{32101} \pmod{143}$ using Chine... | Square and multiply should work. The calculation is long enough that it's easy to have made a mistake, though, if you aren't careful. I usually wind up doing long calculations twice (hopefully with variations in the two tries -- e.g. one calculation might use the bottom-up variation and the other the top-down variation... | https://math.stackexchange.com |
66,086 | [
"https://datascience.stackexchange.com/questions/66086",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/67971/"
] | My data (continuous) is highly skewed and it doesn't follow the normal distribution. Using <code>sns.distplot</code> I found out that <strong>exponweib</strong> fits the data better.
How to deal with this?
My end goal is to use the data for machine learning model (SVM).
| You’re fine to proceed without worrying about lacking normal data. Go run your SVM.
Even in linear regression, the frequent assumption about normality has to do with the error term. Further, that assumption is not part of prediction. The Gauss-Markov theorem does not assume a normal error term, so the <span class="mat... | To address skewed data you can do data transformation like logarithmic transformation, squared transformation etc.
Alternately you could try non-parametric machine learning algorithms that does not have any assumption of normality of x variables.
Hope this will help....
| https://datascience.stackexchange.com |
188,891 | [
"https://physics.stackexchange.com/questions/188891",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/83378/"
] | I live near two ponds whose water levels appear to differ by a few feet. The ground is hard clay, so I don't think there's any underground water exchange between the ponds. The ponds are separated by about 30 feet of a bumpy terrain, with the bumps reaching a few feet above the "higher" water level. What is the clevere... | Fill a garden hose with water. Hold both ends closed, and walk to the "higher" pond. Have someone helping you hold the end of the hose under water.
Now walk to the other pond (still holding the end of the hose shut). Hold the hose near the surface of the pond - you should feel water pressing against your finger. Make ... | Buy or rent a laser level, the kind that sits on a tripod. Place where it can "see" both ponds. A self leveling one will be easiest to use.
Working at twilight, poke a stick into the mud of each pond, site it with the laser, and measure the height between the laser dot on the stick and the water level.
Repe... | https://physics.stackexchange.com |
162,583 | [
"https://softwareengineering.stackexchange.com/questions/162583",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/34327/"
] | In F# it is necessary to use the <code>rec</code> keyword. In Haskell there is no need to explicitly tell if a given function is recursive or not.
Given the role of recursion in functional programming, the F# design seems rather odd to me. Is it a good language design decision or does it only exist for historical r... | There is an inherent difference in Haskell and F# semantics. In Haskell, a function call does not perform any real calculation, but allocates a heap object known as a 'thunk'. It is perfectly okay for a thunk to have a link to itself or another thunk. However, in F#, a function call is an actual call, making expression... | A recursive <code>let</code> defines a significantly more complicated semantics than a normal one. Therefore, for a sake of simplicity and clean language design, there is a good reason to have both, just the same as having separate <code>let</code>, <code>let*</code> and <code>letrec</code> in Scheme.
Simple <code>let... | https://softwareengineering.stackexchange.com |
19,781 | [
"https://chemistry.stackexchange.com/questions/19781",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/9913/"
] | I assume spontaneous separation to ions of salt solution (or acid) requires energy to occur, right?
Where does that energy come from? Is it from the heat of the solution?
Now, if someone devised a way to draw potential energy from those separated ions, could he make this process continuous (assuming solution would d... | These words are in many cases interchangeably used: an <em>alkaline</em> solution/compound is the same as a <em>basic</em> solution/compound.
But you can specify "alkali" to refer to those bases that are soluble in water and that are salts of alkaline or alkaline earth metals too.
Alkali is like a subset of bases whi... | I think an alkali is a substance that <em>dissolves in water</em> to produce $\ce{OH- (aq)}$ ions. Since the $\ce{OH- (aq)}$ ions can react with acids, that makes alkalis bases as well. Therefore alkalis are <em>soluble</em> bases.
Ammonia can also dissolve in water to form ammonium, $\ce{NH4+ (aq)}$ ions and $\ce{OH-... | https://chemistry.stackexchange.com |
19,787 | [
"https://stats.stackexchange.com/questions/19787",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/5946/"
] | I'm using naive bayes classifier to classify between two groups of data.
One group of the data is much larger than the other (above 4 times).
I'm using the prior probability of each group in the classifier.
The problem is that the result I get has 0% true positive rate and 0% false positive rate.
I got the same result... | Assigning all patterns to the negative class certainly is not a "wierd result". It could be that the Bayes optimal classifier always classifies all patterns as belonging to the majority class, in which case your classifier is doing exactly what it should do. If the density of patterns belonging to the positive class ... | Enlarge the smaller data group to fit the big group by calculation. It will stretch the smaller group's data, but it will allow a more equal calculation.
If you still get weird results like you currently do, check your whole implementation from start to hunt down a (probably simple) error.
| https://stats.stackexchange.com |
316,378 | [
"https://electronics.stackexchange.com/questions/316378",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/155388/"
] | I need to convert 12V input power to 3V (not 3.3). The output current needs to be 1A or better.
My gut-reaction was to get an off-the-shelf DC/DC, but it doesn't look like there are any commercially available that provide 3V at anywhere close to the current output I need.
I also need short circuit (over current) pro... | In general, you are looking for a buck converter. While many buck converters show applications for 3.3 volts due to the popularity of this voltage, many are in fact adjustable.
As an example take a look at the LTC3824. You will see the app notes show 3.3 volts but take note of the resistive divider on the output conne... | My gut reaction is that at only an amp of output, any number of integrated switch buck chips should suffice, LT or TI would be my instinctive starting point (in that order if only building a few, I like the LT datasheets more then the TI ones, and webbench sometimes offers really weird suggestions).
The LT1375 looks o... | https://electronics.stackexchange.com |
391,089 | [
"https://physics.stackexchange.com/questions/391089",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/120462/"
] | Mathematically I can understand Canonical Transformations but I don't have an intuitive understanding of them.
<ul>
<li>Why do we need to a canonical transformation? Is it to simplify the form of Hamilton's equation?</li>
<li>We can view the Hamiltonian as the generator for infinitesimal time transformation, but don't... | <blockquote>
The first term, however, corresponds to motion with uniform velocity, so in addition to the jiggling motion the electron starts to drift away. Can you see why?
</blockquote>
It's all to do with velocity.
The particle initially moves away with a positive force on it until the force has completed half it'... | The net displacement of the electron will be due to the resultant of the two terms in the equation. The net effect of the two terms in the displacement equation (first linear term and the second oscillating term) is only oscillating.
So the electron only jiggles about the original place and there would not be ant net d... | https://physics.stackexchange.com |
271,300 | [
"https://softwareengineering.stackexchange.com/questions/271300",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/66567/"
] | This code:
<pre><code>Double.parseDouble("ABC")
</code></pre>
throws a <code>NumberFormatException</code>.
Why is it wrong to expect a <code>Double.NaN</code> (NaN is literally Not-A-Number).
A working example is this:
<pre><code>public static void main(String[] args) {
System.out.println("Is ABC a number? " ... | NaN has a very specific meaning as the result of an undefined numerical operation such as division by zero or taking the square root of a negative number (within the realm of real numbers). It's not an appropriate return value from code that parses a floating point number.
Code like that should signal an error when... | This lets you easily detect the cases where the input is completely nonsensical. You can parse the string "NaN" and get NaN, so if the user wanted to give you NaN, he could type that. The fact that you received "ABC" means they weren't even trying to enter a <code>double</code> at all.
| https://softwareengineering.stackexchange.com |
342,294 | [
"https://stats.stackexchange.com/questions/342294",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/203934/"
] | Can anyone give me more details why is it always better to work with the distribution of a variable than with its average?
I know that by taking the average we take into account the outliers but is it that bad? I mean it's quite easier to work with the mean...
Can someone give me some examples why is it REALLY better t... | It isn't "always" better to work with the full distribution. It's a matter of judgment as to what point it is reasonable to talk about the "average" value. The average is one particular characterization of the distribution, and how relevant it is depends on the situation. If you're running a casino, the average payout ... | The average (mean) $\mu_1$ is the first moment of the distribution $f(x)$:
$$\mu_1=\int xf(x)dx$$
There's an infinite number of moments $\mu_k$:
$$\mu_k=\int x^kf(x)dx$$
Knowing the distribution includes knowing the average. Since the argument is that it's better to know more than less, we're told to better know the w... | https://stats.stackexchange.com |
2,574,221 | [
"https://math.stackexchange.com/questions/2574221",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/511636/"
] | Does divergence of $\sum a_k$ imply divergence of $\sum \frac{a_k}{1+a_k}$?
Note: $a_k > 0 $
I understand that looking at the contrapositive statement, we can say that the convergence of the latter sum implies $\frac{a_k}{1+a_k}\rightarrow 0$ but from here is it possible to deduce that $a_k\rightarrow 0$ because ... | If $a_k\geq 0$ for every $k$, then you can reason as follows.
If $(a_k)$ does not converge to $0$, then there exists a subsequence $(a_{n_k})$ with limit $l\in (0,+\infty]$.
It is then easy to verify that
$$
\frac{a_{n_k}}{1+a_{n_k}} \to
\begin{cases}
1, & \text{if}\ l=+\infty,\\
\frac{l}{1+l}\neq 0, &\text{i... | If $\sum_n \frac{a_n}{1+a_n}$ converges, $\frac{a_n}{1+a_n}$ goes to $0$ as $n$ goes to $\infty$, hence $a_n$ goes to $0$ as $n\to \infty$.
But since $\lim_{n\to \infty} \frac{a_n}{\frac{a_n}{1+a_n}} = 1$, for large enough $n$, $\left|\frac{a_n}{\frac{a_n}{1+a_n}} - 1 \right|\leq \frac 12$, hence $a_n\leq \frac 32 \fr... | https://math.stackexchange.com |
164,336 | [
"https://electronics.stackexchange.com/questions/164336",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/50265/"
] | <img src="https://i.stack.imgur.com/DG0hS.png" alt="enter image description here">
I sent in a function
$$T = -0.1 \frac{s+400}{(s+20)*(s+2000)}$$
<pre><code>> T = -0.1*(s+400)/((s+20)*(s+2000));
> bode(T)
> grid on
</code></pre>
I was expecting the phase to start at -180 deg, but instead the MATLAB is sho... | You can add or subtract 360 deg (2*pi rad) as many times as needed in Bode phase graph. Right click in your graph, Properties > Options > Phase Response > Adjust phase offsets [on] > Keep phase close to [-pi] (in your case), At frequency [0.000]. Done in MATLAB R2015a.
Edit: still works in MATLAB R2020b.
| The phase plot should start at -180. You need to write the numerator block as (-0.1s -40)
| https://electronics.stackexchange.com |
53,601 | [
"https://electronics.stackexchange.com/questions/53601",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/5872/"
] | I have a PIC16 that is not connected to an external clock. If I program the PIC with the FLAG setting the clock to an external clock, then will I ever be able to reprogram the PIC?
Is the programming clock the one specified by the flags, or is it an external one provided by the programmer (PICKIT 3)?
| Make sure all peripherals are off, the watchdog and brownout are off, and the processor is asleep. That should minimize current draw of the PIC itself. Make sure all digital input pins are driven solidly high or low, and make sure all output pins are set so that they don't cause current in the rest of the system.
Th... | To add to Olin's answer (which covers all the practical details), at the end of the datasheet there is a list of power down states with various peripherals/WDT/etc activated/deactivated and current draw. According to the clip below you should be able to get under a uA. I have measured around this (1-2uA IIRC) with a 16... | https://electronics.stackexchange.com |
388,140 | [
"https://softwareengineering.stackexchange.com/questions/388140",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/330290/"
] | Just like the title says, I want to use the pipeline design pattern for chaining related API calls. The context will store the data that will be used to create a payload. For example, I have the context object, a map of some sort, contain a "raw" data.
<ol>
<li>First in the line is a formatter handler that formats t... | I assume that by REST you mean web, hence asynchronous requests/responses. That's important because the pipeline should not progress until it has something to pass from pipe to pipe.
<blockquote>
Handler n may need data from the "raw" data, from the data generated
in the 1st request, etc, so there is a need of tra... | It looks like you fell into a trap of premature generalization. When you want to design <strong>generic solution</strong> you need to be able to analyze <strong>specific cases</strong> and then generalize if needed/possible. Otherwise you will end up with unusable solution, not good for most of the cases and a use will... | https://softwareengineering.stackexchange.com |
372,959 | [
"https://softwareengineering.stackexchange.com/questions/372959",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/173910/"
] | In my current project, I find my self making factories, but for two very distinct reasons:
<strong>Reason #1</strong>: To assist my IoC container if a particular class needs an parameter that is only known when the class is created. This might also include reading data from a config. <em>This kind of factory contains ... | When creating or deleting an entity, where the logic for both is non trivial, the code validating the conditions has more to do with a <strong>Use Case</strong> and should go in the layer of your application where use cases are handled.
For architectures similar to Onion Architecture, this would be the service layer.
| <blockquote>
I find myself tempted to put deletion logic there as well
</blockquote>
This is a sign that you should put validation logic into an initialize method; then you can control the deletion logic as well.
<blockquote>
When I create a factory for reason #2, ...
</blockquote>
Reason #2 may point else where... | https://softwareengineering.stackexchange.com |
39,406 | [
"https://mechanics.stackexchange.com/questions/39406",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/12309/"
] | I bought a peugeot 206 last year (a second hand one). Such car is my first car, I haven't owned one before, although I used to drive before such purchase. The car is quite old (I think 8-10 years), I never done a car servicing before, and I think I should do one to check that my car is still functioning well. I don't k... | I would always service a second hand car which is new to me so I knew the condition. You don't need to use a specific Peugeot garage, you may find an independent garage cheaper and for servicing on an older car, anywhere should be able to do it.
The alternative is to buy a Haynes or similar manual, some basic tools a... | Generally speaking servicing means replacing consumable items after a specified interval (either miles, years or both) this can include things like engine oil, oil and fuel filters, brake fluid, spark plugs air filters etc.
The specific interval for a given item will be specified by the manufacturer and tends to cover... | https://mechanics.stackexchange.com |
384,800 | [
"https://softwareengineering.stackexchange.com/questions/384800",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/287384/"
] | I've made an engine that plays Connect Four using the standard search algorithms (minimax, alpha-beta pruning, iterative deepening, etc). I've implemented a transposition table so that the engine can immediately evaluate a same position reached via a different move order, and also to allow for move-ordering.
The prob... | In that particular example the use of Java as compared to C++ does indeed hide the benefit of interfaces. Interfaces (or more generally, <em>late binding</em>) are useful to break direct dependencies.
<pre class="lang-none prettyprint-override"><code>Direct dependency Indirect dependency
================= ======... | Note that even if you don't "implement" an interface, the public members of your class form an implicit interface.
<blockquote>
I had my doubts and did some testing. (Martin explicitly used Java for his example, so I did as well.) Even without any interfaces any change in OPS does not cause any user to be recompiled... | https://softwareengineering.stackexchange.com |
573,141 | [
"https://physics.stackexchange.com/questions/573141",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/270276/"
] | A theorem in my physics textbook says:
<blockquote>
The overall translational motion of a system of particles can be
analyzed using Newton’s laws as if all the mass were concentrated at
the center of mass and the total external force were applied at that
point.
</blockquote>
Why does the translatory motion of the cente... | Consider a system with <span class="math-container">$N$</span> point particles each has mass <span class="math-container">$m_{i}$</span> for <span class="math-container">$i = 1, 2, ..., n$</span>. And each point particle is under an influence of a net force of <span class="math-container">$\vec{F}_{i}$</span> for <span... | *Since I have joined recently I would really appreciate it if more experienced users edit my sloppy english.
First of all it does not model all the possible motions of the system for example the familiar case of rigid bodies in which you cannot know the behavior of the system simply by looking at the CM's position vect... | https://physics.stackexchange.com |
43,051 | [
"https://dba.stackexchange.com/questions/43051",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/20605/"
] | I'm part of a small company so as usual covering a number of different roles. The latest of which is procuring a dedicated SQL Server box for our .NET web app. We've been quoted on a dual Xeon E5-2620 (six core) 2.00 GHz CPU configuration (12 cores in total), with 32 GB of RAM. This has left us with a limited budget fo... | Speaking from experience which is humble but I think worth sharing, the major bottleneck with SQL databases (Sybase and SQL server here) is storage.
But I think it's only fair that someone first benchmarks their setup before making any wrong assumptions. In my case, CPU usage has never risen high enough to justify upg... | Somewhat not the answer you are probably looking for in the first part, but: have you considered pushing it to the cloud? AWS could allow you to provide for most of the needs above and extend your buying power without having to deal with the hardware as well.
Second part - The hardware really depends on the tasks. I t... | https://dba.stackexchange.com |
110,108 | [
"https://cs.stackexchange.com/questions/110108",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/106036/"
] | <blockquote>
Prove that the average codeword length in a Huffman tree is <span class="math-container">$\Omega(\log n)$</span>, where <span class="math-container">$n$</span> is the number of characters.
</blockquote>
My try:
I think that the worst case is when the tree is full and all the characters are in the highe... | This answer assumes that by <em>average</em> you mean just that – the sum of all codeword lengths divided by <span class="math-container">$n$</span>.
Let us show that <em>any</em> prefix code satisfies your property. Consider any prefix code whose codewords have lengths <span class="math-container">$\ell_1,\ldots,\ell... | If by average you mean the average length of the n codewords, then if the k-th symbol has probability <span class="math-container">$2^{-k}$</span>, the length of the code words ranges from 1 to n-1, with average about n/2.
If by average you mean the average length of a codeword in a compressed message, then if the fir... | https://cs.stackexchange.com |
10,032 | [
"https://electronics.stackexchange.com/questions/10032",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | in university we had our internal program called HLCCAD - it was very nice, and now I need to do design & debug some digital circuit and wondering what is current state of art software for that kind of things (price is out of consideration for now)?
I.e. I want to visually place components, and then simulate it.
... | I've heard good from Qucs (which has some basic digital logic, including VHDL apparently) and tkgate, which is an event driven logic simulator. Both are free open source software.
| Both Xilinx and Altera provide their development environments for free. They are meant for designing the logic for placing on FPGA's and CPLD's, but you can simply use them in simulation mode. They let you place items on a schematic view like the above, and when you need more advanced components that are not built in, ... | https://electronics.stackexchange.com |
233,240 | [
"https://softwareengineering.stackexchange.com/questions/233240",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/124215/"
] | I like using .NET MVC and have used it quite a bit in the past. I have also built SPA's using AngularJS with no page loads other than the initial one. I think I want to use a blend of the two in many cases. Set up the application initially using .NET MVC and set up routing server side. Then set up each page as a mi... | You can certainly use any mix of client-side rendering and server-side rendering, but I would recommend against trying to mix ASP.NET MVC helpers with AngularJS directives. It might seem like a good idea at first because you're already used to using those helpers and you don't have to write "raw html", but they defeat ... | A bit of an outsider comment/answer, I'm not a .NET MVC programmer but have done a lot of PHP, Java, and AS3 programming and relatively recently switched to AngularJS as well.
My general feeling is that the back end should just be RESTful and shouldn't touch the front-end really and the front-end should only depend on... | https://softwareengineering.stackexchange.com |
3,094,682 | [
"https://math.stackexchange.com/questions/3094682",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/495707/"
] | <span class="math-container">$V=\{(x,y):x^2+y^2=1\}$</span> is compact and f is continuous on V so for Weierstrass global max and min exist.To find them I have used lagrange multipliers but the system don't give a clear solution.
| We know that the differential of <span class="math-container">$f(x^1,\dots,x^k) = (x^1)^2 + \cdots + (x^k)^2$</span> at <span class="math-container">$a=(a_1,\dots,a_k) \in \mathbb{R}^k$</span> is <span class="math-container">$df_a = \sum 2a_i \, \text{d}x^i $</span>. It is clear that if <span class="math-container">$f(... | <strong>Hint:</strong> What is the rank of the linear map <span class="math-container">$2(a_1,\dots, a_k):\Bbb R^k\rightarrow \Bbb R$</span>? (And, what is the dimension of <span class="math-container">$\Bbb R$</span>?)
| https://math.stackexchange.com |
400,246 | [
"https://physics.stackexchange.com/questions/400246",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | I was reading an article and came across the following paragraph:
"A thin lens of focal length f is used to collimate the light emerging from an optical fibre. The fibre has small core diameter and numerical aperture NA. It achieves a diffraction limited divergence angle θ for the collimated beam."
I am wondering how... | As we don't know anything about the intial temparature of the water, another fun but unlikely explanation would be to consider what we call supercooled water.
Basically, at atmospheric pressure, water below 0°C doesn't <em>have</em> to be solid. Sure enough, it would be its most natural state. But actually if you cool... | I just finished watching the pilot episode and the way they treated the physics of freezing water alone is enough to make me not want to watch the second episode.
First I will say that I am not a physicist by any means, although I have been interested in physics from a young age. My expertise stems from the fact that... | https://physics.stackexchange.com |
3,980 | [
"https://dba.stackexchange.com/questions/3980",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/1285/"
] | I have a stored procedure which accepts various varchar parameters. The middle tier code which calls the procedure has not been consistent in terms of the values it submits. For example, sometimes a parameter like "Transport Description" will be submitted as NULL and sometimes it will be an empty string.
In terms of ... | As a DBA, your sacred duty is to take whatever data was entrusted to you, and leave it as is.
A NULL in a field usually means "DATA was not entered" or "DATA is not applicable" (but can have other meanings - it is context specific), and may actually MEAN something to the business layer. An empty string may actually be... | This is where theory meets practice: it's a big grey area
Thoughts:
<ul>
<li>NULL goes into the record NULL bitmap which always exists. An empty string takes 2 bytes, so NULL is more efficiently stored</li>
<li>IS NULL checks use the NULL bitmap = an optmisation</li>
<li>When indexed, a NULL <em>adds</em> a NULL bitm... | https://dba.stackexchange.com |
132,547 | [
"https://softwareengineering.stackexchange.com/questions/132547",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/46395/"
] | I am profoundly disturbed by a request that asks me to develop an iPad app to measure the actual size of an object using camera.
It is simply not practical.
Translating 2D object into 3D is never easy. I either need extra hardware, or have to make a lot of assumptions (which will almost never hold true). Regardless ... | It's called "Forced Perspective"
Step 1. Go outdoors with a friend. Stand in front of a building.
Step 2. Take a picture so that the friend is really close to you and the building is really far away. Assure that the friend's head lines up with the top of the building.
Step 3. Ask your customer how tall <stron... | Instead of trying to convince someone that something cannot be done try to analyze and determine what it would take to get this done.
When you calculate that it would take you alone 10 years and $1 billion the solution of what to do with the project will become obvious.
| https://softwareengineering.stackexchange.com |
300,485 | [
"https://stats.stackexchange.com/questions/300485",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/175426/"
] | I have this project proposal entitled "Android Based Program Recommendation App". (This application is for those college students who wants to shift to other programs).
The app will find a program that take less time to finish based on the subjects that the student already took and passed. So if other programs has the ... | Your approach is about as sensible as doing the same with another statistical distribution. There are some problems that need to be addressed.
Regarding p-values, if you allocate half of your $\alpha$ level to each one sided test you should be on the safe side. That's a Bonferroni correction for multiple testing. Othe... | Well, the problem is, you are trying to use hypothesis testing for something it can't really do, which is claiming that a certain (even approximate) value GAVE rise to something you observed.
What in my opinion would work as a heuristic is that you take your lower ($0.5 - \delta$) and upper bound($0.5 + \delta$) and ... | https://stats.stackexchange.com |
2,162 | [
"https://iot.stackexchange.com/questions/2162",
"https://iot.stackexchange.com",
"https://iot.stackexchange.com/users/4276/"
] | I want to build an audio system for my apartment, that would have speakers in multiple rooms, and that would activate corresponding speakers automatically upon entering a room. It would have to be connected to Spotify, AirPlay and support mini jack input.
Is this possible? Is there some system that has this implement... | Requirements: Multiple rooms, spotify, airplay mini-jack.
Functionalities: Activating speakers on presence/motion. Playing Spotify when you get home.
This is actually a very broad question that can have a very broad set of answers. However, let me explain how I would do this.
<hr>
<strong>Audio</strong>
For up to ... | For an easy start I would go with PIR (<strong>P</strong>assive <strong>I</strong>nfra<strong>R</strong>ed) sensors to detect presence. They are quite nice and cheap. On detection, you should activate your room sound system, this might be done in several ways.
Maybe a BT loudspeaker and its power supply controlled by ... | https://iot.stackexchange.com |
300,438 | [
"https://mathoverflow.net/questions/300438",
"https://mathoverflow.net",
"https://mathoverflow.net/users/8110/"
] | Suppose you are given a simplicial complex $K$ homeomorphic to the sphere and for each each edge of the complex a label specifying a length of that edge (this gives us a polyhedral metric on $K$). In other words, I'm specifying the local geometry and combinatorics of a polyhedron, but not its realization.
We'll call a... | No, I don't think so - I think there are more Bredon $1$-cochains than that.
The orbit category $\mathcal{O}C_4$ looks like
$$
C_4/e \to C_4/C_2 \to C_4/C_4
$$
where the automorphism groups of the objects are $C_4$, $C_2$ and the trivial group, respectively. The Bredon cochains in degree $i$ are natural transformation... | To expand on Mark Grant's answer, but looking at it slightly differently: You need to look at the chains as contravariant functors on the orbit category, and they will be projective functors. $\underline C_0(\mathbb S^\sigma)$ is a sum of two copies of $\mathbb Z\mathcal O C_4(-,C_4/C_4)$ while $\underline C_1(\mathbb ... | https://mathoverflow.net |
87,432 | [
"https://cs.stackexchange.com/questions/87432",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/81369/"
] | I'm recently reading some papers on the <em>maximum independent set problem</em>, all the algorithms' time complexity is donated by $O^*()$ notation, like $O^*(1.0836^n)$. One paper says "<em>the $O^*$notation suppresses polynomial factors in the input size.</em>" I'm a little bit confused and couldn't find helpful ma... | Similarly as $O$ notation which "ignores constant factor", $O^*$ notation "ignores polynomial factor" that is: $f(n) = O^*(g(n))$ if there exists some polynomial $p$ such that $f(n) \leq p(n) g(n)$ for $n$ large enough. This is mainly used to compare functions which are growing exponentially, in which case polynomial f... | If you want an authoritative source for the definition, you can see [1, pp. 1-2]:
<blockquote>
In this book we use a modified big-O notation that suppresses all polynomially bounded factors. For functions $f$ and $g$ we write $f(n) = O^*(g(n))$ if $f(n) = O(g(n) \text{poly}(n))$, where $\text{poly}(n)$ is a polynomi... | https://cs.stackexchange.com |
420,756 | [
"https://mathoverflow.net/questions/420756",
"https://mathoverflow.net",
"https://mathoverflow.net/users/164946/"
] | I was wondering if it is well understood under what circumstances say three univariate polynomials <span class="math-container">$f(x),g(x),h(x)$</span> have a common root.
In this situation, I can see that the resultant of each pair must vanish but that only ensures that each pair has a common root. Is there a way to g... | Assume that <span class="math-container">$f_n$</span> is monic. Then for indeterminates <span class="math-container">$u_1,\ldots,u_{n-1}$</span>, all coefficients of the polynomial <span class="math-container">$Res_x(f_n,u_1f_1+\ldots+u_{n-1}f_{n-1})\in k[u_1,\ldots,u_{n-1}]$</span> vanish if and only if <span class="m... | Well, the "naïve" answer (already implied in @Somnium's comment) is that a general method for finding the solutions of a system of simultaneous polynomial equations
<span class="math-container">$$
f_1(x)=0, \ \ f_2(x)=0, \ \ \cdots \ \ f_n(x)=0
$$</span>
is finding the <span class="math-container">$\gcd\bigl(... | https://mathoverflow.net |
2,091,766 | [
"https://math.stackexchange.com/questions/2091766",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/373877/"
] | Suppose $h:R \longrightarrow R$ is differentiable everywhere and $h'$ is continuous on $[0,1]$, $h(0) = -2$ and $h(1) = 1$. Show that:
$|h(x)|\leq max(|h'(t)| , t\in[0,1])$ for all $x\in[0,1]$
I attempted the problem the following way:
Since $h(x)$ is differentiable everywhere then it is also continuous everywhere. $... | First, your definition of $S$ is not quite precise. Let us sidestep this and take for the final set the union of all the sets you write down. That is,
$$(d=2) \to S_2= \{a, \frac{a+b}{2},b\}$$
$$(d=3) \to S_3= \{a, \frac{2a+b}{3}, \frac{a+2b}{3}, b\}$$
$$(d=4)\to S_4= \{a, \frac{3a+b}{4}, \frac{a+b}{2}, \frac{a+3b}{4... | You ask "How can I disprove it", but you didn't really define a strict mathematical statement. Your statement
<blockquote>
As $d\to\infty$, $S=[a,b]$
</blockquote>
lacks definitions. You seem to imply that for a sequence of sets $A_1,A_2,\dots $, there exists a limit $$\lim_{n\to\infty} A_n$$
but limits are really ... | https://math.stackexchange.com |
524,127 | [
"https://electronics.stackexchange.com/questions/524127",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/264182/"
] | I just have a quick question.
I'm connecting PN532 NFC reader with RPi, for this I am using around 30m of UTP cable from my front door to rack with RPi, preliminary test showed the device is able to communicate over 30m of cable in UART mode - with data and power each via single pair.
Now I have one pair in UTP cable f... | Since there are no more comments here, to sum it up:
With this setup there should be one pair for each TX and RX, where in one pair there are TX and GND wires and in second pair there are RX and GND wires, but this set up will not work reliably over such a long distance.
To make this connection work properly RS-485 or ... | Considering the power for the data lines source is from the power line, it would be wiser to decrease the drop to the NFC reader that will also decrease the voltage drop in the GND and power line for the rest of the circuit.
| https://electronics.stackexchange.com |
550,771 | [
"https://physics.stackexchange.com/questions/550771",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/249106/"
] | Since your are weightless in space, your arm has no weight, right? Does this mean that bending it in space requires no energy? Why or why not?
| The short answer is yes, bending your arm in the weightlessness of space still requires energy. You are correct that bending your arm does not require us to overcome the weight of your arm, but we do have to overcome its inertia. Inertia refers to the sluggishness that massive objects have (even in the weightlessness... | Well, yes.
Movement of your body parts (hands, legs eyelids, etc.) occurs due to the contraction of muscle fibers. This process requires energy (from cleavage of ATP molecule to form ADP). This is the only way an astronaut can move his arm.
Transforming the internal energy (chemical) into mechanical energy requires the... | https://physics.stackexchange.com |
135,880 | [
"https://dba.stackexchange.com/questions/135880",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/92570/"
] | I follow below syntax by which I achieve the result. but it takes time
<pre><code>IF NOT EXISTS(select * from #tblxyz)
BEGIN
INSERT INTO #tblxyz select NULL
END
Select a.*
FROM
tblabc a
INNER JOIN #tblxyz b ON a.ID = ISNULL(b.ID,a.id)
</code></pre>
If second joined table has some row... | I think the condition <code>ON a.ID = ISNULL(b.ID,a.id)</code> is not the best way to do this. It may lead to inefficient plans and may return unwanted results (according to your specifications). If the <code>tblxyz</code> table has rows with <code>NULL</code> values, you'll still get all the rows from table <code>a</c... | The way you've done it is correct.
So the reasons for slowness will likely come down to: when is it slow (is it when the temp table has a lot of rows, or when it has few rows?), how many rows are usually in each table, what indexes exist on each table, and what data type is ID?
You can also look at your real-world ... | https://dba.stackexchange.com |
3,264,379 | [
"https://math.stackexchange.com/questions/3264379",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/410481/"
] | I've been given an interesting homework question:
Given three coins in a box, where two have a probability of heads ( <span class="math-container">$p(h) = 0.5$</span> ), and the third has <span class="math-container">$p(h) = \frac{1}{3}$</span>. I draw one coin, and the result is a tail. What is the probability that I... | It is not that it is possible to express...etc., it is just that that's the way we have to check continuity of <span class="math-container">$\;F\;$</span> at <span class="math-container">$\;a\;$</span> . In fact, we have that
<span class="math-container">$$F(x)=\begin{cases}f(x),&x\neq a\\{}\\0,&x=a\end{cases... | You have an assumption that <span class="math-container">$f $</span> has a limit <span class="math-container">$0$</span> at <span class="math-container">$a$</span>, so when you define <span class="math-container">$F $</span> to be equal <span class="math-container">$f$</span> near <span class="math-container">$a$</spa... | https://math.stackexchange.com |
145,097 | [
"https://mathoverflow.net/questions/145097",
"https://mathoverflow.net",
"https://mathoverflow.net/users/-1/"
] | Deligne's Weil I has been published under the title "La conjecture de Weil: I" in 1974, and Weil II in 1980. So did Deligne know in 1974 that there would be a Weil II, and can one explain the period between the two publications?
| To complete Carlo's answer, I think that one thing that can explain the long
gap (in addition of the amount of difficult material in Weil II) is that Deligne
felt the need to consolidate his result of Weil I before going further.
It should be reminded that Weil I was criticized from various directions for relying on r... | This is what Pierre Deligne writes himself in the introduction to part I about the need for a part II:
<blockquote>
Dans un article faisant suite à celui-ci, je donnerai divers raffinements de résultats intermédiaires, et des applications, parmi lesquelles le théorème de Lefschetz "difficile".
In a follow-up ar... | https://mathoverflow.net |
16,487 | [
"https://electronics.stackexchange.com/questions/16487",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/4927/"
] | I'm interested in building very long led lighting strip. Does anyone know where to get a long, thin prototyping/matrix board(if they even exist)? I can't think of a good approach for mounting/soldering two dozen leds(each with its own resistor) in parallel, spaced 2" apart. Thanks!
| 24 LEDs 2 inches apart, that's 46 inches (+ 1 solder pad :-)). The largest PCBs I've seen (minicomputer in the 80s) were 25"x25", and I don't believe that they're being made bigger than that. You'll have to construct the strip from several shorter pieces. Unless you wanted to leave them bare this isn't necessarily a pr... | If you want them 2 inches apart, you could punch the leads thru cardboard and solder them together with the resistors on the back.
If you're asking about off the shelf true prototyping boards, many of the common "solderless breadboards" can snap together to make any length and width you want.
However, with 24 LEDs ... | https://electronics.stackexchange.com |
127,997 | [
"https://electronics.stackexchange.com/questions/127997",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/45524/"
] | <img src="https://i.stack.imgur.com/tAPUy.png" alt="enter image description here">
This is not an assignment I'm prcaticing for my mids
Can someone solve this problem for me. Will the node betweeb R4 and R3 be equal to Vi? If so what case will there be a virtual ground and what case will a node be in some reference v... | In addition to Andy`s answer (which I completely agree upon) I like to point to the fact that both opamps are to be considered as IDEAL (watch the infinity symbol). Hence, you can rely on the fact that the difference between both opamp input terminals is zero (Vin+=Vin-). Together with known formulas for a simple volta... | To answer your first question about the node between R4 and R3 you have to decide if the feedback is positive or negative. I'll leave that up to you but if you conclude that the feedback is positive then the answer is a certain "no" and both op-amp outputs will be pushed against the power rails in saturation.
If you d... | https://electronics.stackexchange.com |
689,234 | [
"https://physics.stackexchange.com/questions/689234",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/156987/"
] | In QM, active transformations are <span class="math-container">$|\psi (a)\rangle=U(a)|\psi \rangle$</span>. And passive transformations are supposed to be <span class="math-container">$U^{\dagger} A U$</span> applied to all operators <span class="math-container">$A$</span>, leaving <span class="math-container">$|\psi \... | I got an idea. Take (on classical phase space):
<ol>
<li>A co-ordinate system
</li>
<li>Field1 - A binary field representing the location of the object. It's valued 1 at the location of the object in the phase space, and zero everywhere else
</li>
<li>Field 2- A Hamiltonian scalar field under which the object moves
</l... | The difference is in what is changing over time: the state vector or the operators.
In the active transformation, the state vectors change via unitary transformation as you have given:
<span class="math-container">$$|\psi (t)\rangle=U(t)|\psi(0)\rangle$$</span>
while the operators <span class="math-container">$A$</span... | https://physics.stackexchange.com |
361,009 | [
"https://softwareengineering.stackexchange.com/questions/361009",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/65549/"
] | Say I have a database structure like this:
<pre><code>CREATE table Customer (id identity, name varchar(30), dateofbirth datetime, Photo varbinary, primary key (id))
CREATE table Order (id int, Date datetime, Primary Key (id))
create table CustomerOrder (CustomerID, OrderID)
</code></pre>
Say I wanted to copy the da... | In the NoSQL world you do lose <em>some</em> relational behavior. However, you don't need to have complete redundancy of data.
In my case I created a pair of objects: <code>SomethingRef</code> which specified a lookup id and enough data for display purposes, and <code>Something</code> which extends <code>SomethingRef... | Yes, this is normal in the NoSQL world.
The idea is that you use NoSQL when the available storage is large in comparison to the volumes you'll actually be writing, so that you can simply shrug off the non-optimal storage requirements. Obviously, duplicated image data is a particularly gross waste of space because imag... | https://softwareengineering.stackexchange.com |
343,262 | [
"https://softwareengineering.stackexchange.com/questions/343262",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/262132/"
] | What is the better way to organize exception in a Python project? What is the right way to use exception description?
For example I have a function that parse email and return some data from it's attachment. It should raise an exception that specify and explain an error in a better way.
Options:
<ol>
<li>Use one gen... | Occam's razor:
<blockquote>
More things should not be used than are necessary.
</blockquote>
Python gives you the ability to subclass exceptions. That extensibility is great, when you need it. But it's rare you actually <em>need</em> to do that. Often you can get just as much error reporting clarity through customi... | A typical good practice is to have an 'umbrella' exception class per library / module / subject area, and have more specific exceptions as subclasses of it:
<pre><code>CarException # The umbrella class
NoFuelException
FlatWheelException
EngineException
SparkPlugException # You can get as specific as you wa... | https://softwareengineering.stackexchange.com |
142,632 | [
"https://dba.stackexchange.com/questions/142632",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/84438/"
] | Few days I just learned indexes.I my New app(running on node js) There will no write operation.And my server has 500mb of ram.Can I set Index to all of My column.I almost have 500K rows.My query is dead simple as Like this
<pre><code>SELECT * FROM users ORDER BY RAND() LIMIT 1
</code></pre>
Limit may vary upto 10k Ac... | It's likely the disk space is the root cause. Watch the space free in the tmpdir location whilst the ALTER is running.
| if you are using docker and docker-compose you can add a line to your volumes to a spot where you have more disk space. E.g.,
<pre><code>volumes:
- /data/mysql_tmp:/tmp
</code></pre>
Again, this will allow you to get more than the default tmp space you need and is helpful if that table you are ALTER-ing is big (ove... | https://dba.stackexchange.com |
519,935 | [
"https://electronics.stackexchange.com/questions/519935",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/262281/"
] | I have a 12 V, 24 Ah lead-acid battery that I have to charge using a solar panel.
My initial solution to the problem was to implement a buck or a buck-boost DC-DC converter with MPPT and control the charge by sensing the output voltage and current. I then realized that when implementing MPPT I can not keep the output v... | You don't want to charge lead-acid from a constant voltage, and if you do, you need to change the voltage depending on the state of charge of the battery (switching from constant voltage "second stage" charging to trickle charge).
Google "lead acid charging algorithm".
| Never done this, but I think it could work: you could control the DC/DC converter's input for MPPT during CC charging, and control its output during CV charging and float charging.
You would only have MPPT in the CC stage. You would still have to monitor the voltage and current to decide which stage to start (and end).... | https://electronics.stackexchange.com |
130,280 | [
"https://cs.stackexchange.com/questions/130280",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/126516/"
] | In analysis of algorithms, we sometimes use the (unsimplified) Master Theorem for recurrence relations.
What should be done in the case that there is a constant factor in the numerator following T?
<span class="math-container">$$
T(n) = 2T\left(\frac{5n}{8}\right) + 1
$$</span>
Does b simply equal <span class="math-con... | Usually the general form of the recurrences solved by the Master theorem is stated as:
<span class="math-container">$$
T(n) = aT\left(\frac{n}{b}\right) + f(n).
$$</span>
In your recurrence you have <span class="math-container">$a=2$</span>, <span class="math-container">$b=\frac{8}{5}$</span>, and <span class="math-con... | Your confusion stems from the fact that the MT is often stated in the form
<span class="math-container">$$T(n) = aT(n/b) + f(n),$$</span>
so <span class="math-container">$b$</span> is expected to be some constant larger than 1.
The recurrence relation you give is not in this form, so to rewrite it to fit the form you k... | https://cs.stackexchange.com |
319,265 | [
"https://physics.stackexchange.com/questions/319265",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/145380/"
] | If current is just the movement of charged particles, why do the all have to move in the same direction?
For example, if you reverse-bias a diode (connect the positive terminal to the n-type side and the negative terminal to the p-type side), the positive "holes" are attracted to the negative terminal and the electro... | All charges don't move in the same direction. It's the net effect that we see. I think you're missing the fact that conventially current was thought to be the flow of positive charges.
Let's consider an example (something less complex than the diode example you've mentioned)
Consider an area element of a conductor a... | The battery supplies a part of its chemical energy to the electrons that emerge out of it. These energized electrons lose this energy in the outer circuit, when they go through various electronic components. The electrons in a simple conductor collide due to their thermal energy.
Electrons move from the -ve terminal o... | https://physics.stackexchange.com |
103,419 | [
"https://physics.stackexchange.com/questions/103419",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/42491/"
] | I apologize in advance if this is too basic for this site.
Considering that hydrogen is lighter then oxygen, and water is 2/3 hydrogen, and only 1/3 oxygen, and our "air" is comprised mainly of oxygen, why isn't water lighter then air?
| Air is lighter because there are fewer molecules per unit volume compared with a unit volume of liquid water. A mole of water is 18 grams, so a liter of water contains about 55 moles (1000 grams).
A mole of air at standard temperature and pressure, however, occupies a volume of 22.4 liters, much more. Dividing a mol... | You forgot to mention what amount of water and air you are taking as a comparison. Weight is proportional to mass. So if you take more amount of air and less amount of water in two equal containers, then i am sure air is going to be heavier. don't go for taking the same 'volume' of both the things, since it is not nece... | https://physics.stackexchange.com |
16,187 | [
"https://security.stackexchange.com/questions/16187",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/10608/"
] | I have input box with <code>maxlength=12</code>, and that input box is vulnerable to xss.
But because of maxlength 12 it is not possible to construct any really valid xss vector. The user input is stored in the attribute <code>value="user input"</code>. When the user intercepts the post request with burpproxy, he can ... | Yes. It is possible. Maxlenght is a html attribute in client browser's DOM object.
Maxlenght is significant only in the client browser, it is not significant on server side unless you code the server side to validate input length.
If you are using a intercept proxy which doesn't create DOM object can easily bypass ... | <code>maxlength</code> isn't a protection, is rather for usability purpose (than security).
There are a lot of ways to bypass this kind of protection. The easiest one is creating another website with form, which submits to your location.
Every sanitization/limitation shoudn't be use on the client-side. Every JavaScrip... | https://security.stackexchange.com |
206,293 | [
"https://softwareengineering.stackexchange.com/questions/206293",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/197372/"
] | Is there a reason, historical or otherwise, why the modulus operator is part of a small set of standard operators in what seems like many languages? (<code>+, -, *, /</code> and <code>%</code>, for Java and C, with <code>**</code> in Ruby and Python).
It seems strange to include mod as a "fundamental" (not to knock it... | I am sure it is common because many CPU architectures implement <code>modulus</code> as a second output of the integer divide instruction.
I don't recall it being present in 1970s CPUs (6800, 8080, Z80, 1604, etc.), but by the 1980s, the Intel 8086 and 8088, as well as the Motorola 6809 had it.
The PDP-11 instruction... | Many programming languages have a "remainder" operator which may be used as a modulus operator when both operands are positive; said operator is often called the "modulus" operator, because that is its primary use. Languages generally have such an operator because many hardware platforms' division hardware automatical... | https://softwareengineering.stackexchange.com |
145,272 | [
"https://mathoverflow.net/questions/145272",
"https://mathoverflow.net",
"https://mathoverflow.net/users/17508/"
] | In Pontriaguin's classic book <em>Grupos continuos</em> (in English <em>Continuous Groups</em>), says that A. Markov proved that:
<blockquote>
There are topological groups that are not normal.
</blockquote>
Furthermore, he says it is deduced from a deeper result of Markov that says:
<blockquote>
Every completely... | For example, look at the vector space $S(n)$ of symmetric $x\times n$ real matrices and the action of the orthogonal group $O(n)$ by conjugation:
$$
\ell:O(n)\times S(n)\to S(n),\quad \ell(U,X)=UXU^{-1}
$$
Let $\Sigma$ be the linear subspace of diagonal matrices. Then each $O(n)$-orbit hits $\Sigma$ orthogonally, and $... | Whatever the way you define your map, you cannot expect a diffeomorphism for dimension reasons. The simple fact that you can rescale your eigenvectors makes you lose some dimensions (at least n). In a more formal way, you are defining of map from the matrix algebra (over the real or complex numbers I guess) to the quot... | https://mathoverflow.net |
93,936 | [
"https://security.stackexchange.com/questions/93936",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/10859/"
] | It seems (to me at least) that is is generally accepted that "electronic identity" and "digital signatures" are a different thing. For example, in the Estonian ID card there are two certificates - one for identity, and one for signing.
They correspond to the real-world actions of "showing" your ID card to the authorit... | There are a few reasons for using different keys for signing and authentication:
<ol>
<li>When using two keys, associated certificates can be issued from different CAs which allows web sites to only ask the user for the authentication certificate on login.</li>
<li>The certificates can be issued with different key usa... | A digital signature is a technological mechanism by which you can do several things, one of them being <em>proving</em> your identity to another entity: this is an authentication protocol.
Your <em>identity</em> is a property inherent to, say, yourself; the notion of "electronic identity" really means "something which... | https://security.stackexchange.com |
21,603 | [
"https://ai.stackexchange.com/questions/21603",
"https://ai.stackexchange.com",
"https://ai.stackexchange.com/users/36107/"
] | Is there any good tutorials about training reinforcement learning agent from raw pixels using PyTorch?
I don't understand the official PyTorch tutorial. I want to train the agent on the atari breakout environment. Unfortunately, I failed to train the agent on the RAM version. Now, I am looking for a way to train the ... | Both algorithms should give the same answer. However, their main difference is that alpha-beta does not explore all paths, like minimax does, but prunes those that are guaranteed not to be an optimal state for the current player, that is max or min. So, alpha-beta is a better implementation of minimax.
Here are the ti... | Minimax is the base algorithm, and alpha beta pruning is an optimisation that you can apply to minimax to make it more efficient.
| https://ai.stackexchange.com |
87,919 | [
"https://stats.stackexchange.com/questions/87919",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/38348/"
] | Often times, several theorems in mathematical statistics depend on regularity conditions.
For example, there is a theorem that states:
"Let $\hat{\theta}_n$ be the maximum likelihood estimator of $\theta$ based on the sample $X_n = (X_1,...,X_n)$, then under <strong>regularity conditions</strong>, $\hat{\theta}_n$ i... | Hm, you need much more than those three conditions for MLE to be consistent.
The log-likelihood function $L(X, \theta)$ (if I am interpreting your notation correctly) is a random function of the data $X$. Your condition 2) says that the family of all possible realizations of this random function $\{ L(x, \theta) \}_{x... | seems like
2) means that parameter is not 'degenerate' so that two different values of the parameter don't give you same probability density
3) means that there are no 'boundary' value of the parameter, so that for every value you can change it a little and still get a new valid value
both probably important for dif... | https://stats.stackexchange.com |
162,408 | [
"https://softwareengineering.stackexchange.com/questions/162408",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/-1/"
] | Could older C++ compilers (e.g. VS2008 and gcc3.4) link with external libraries written in C++11?
My thought is that the C++11 .lib files are just byte code at this stage, and it shouldn't bother the older compilers how it was generated, as long as it is somehow resolvable and callable.
I'm developing a small library... | Provided your library only uses C++11 in its implementation and doesn't expose C++11 facilities or types publically, and especially if you use static linkage, then yes, this is possible and even standard.
Consider the common case where a library exposes a C-level interface (to be usable by the widest variety of client... | Sounds like you want to write a new library for others to use, and that you would like to use C+11 as your implementation language. There are a number of issues to consider:
<ul>
<li>by introducing a new version of C++ you will introduce the need to deploy the new C++ runtime libraries with your library, is that OK?</... | https://softwareengineering.stackexchange.com |
171,368 | [
"https://mathoverflow.net/questions/171368",
"https://mathoverflow.net",
"https://mathoverflow.net/users/52782/"
] | The <em>cofinality</em> of a partially ordered set $\left( P,\leq \right)$, written $cof(P)$, is the smallest cardinality of a subset $T$ of $P$ that is [EDIT: cofinal] in $P$, i.e. for every element $p\in P$ there is a larger element $q\in T$ such that $p\leq q$.
A <em>$\sigma$-ideal</em> $I$ of $\mathbb{R}$ is a col... | $\textbf{A counterexample when $2^{\aleph_{0}}$ is regular}$.
This holds if $2^{\aleph_{0}}$ is a regular cardinal. In fact, it holds for any regular cardinal. If $\kappa$ is a regular cardinal, then the ideal of non-stationary sets in $\kappa$ cannot be generated by $\kappa$ many elements. To prove this fact, suppose... | If the continuum hypothesis holds, then there is such an ideal. Indeed, we need only to assume that $2^\omega\lt
2^{\omega_1}$, a weakening of CH.
Consider the tree $T=2^{\lt\omega_1}$ of all binary sequences of
some countable ordinal length. This tree has continuum many nodes,
and so let us associate with every node ... | https://mathoverflow.net |
52,455 | [
"https://dsp.stackexchange.com/questions/52455",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/35851/"
] | My question is, Why do we usually use baseband in simulation rather than passband? however, if we want to test our simulated idea in real environment, it must be sometimes in passband !!
So, should simulation in baseband give the same results if we made it in passband? for term of BER, MSE and so on
Here is an exam... | In OFDM or any other system, if you understood what is the difference between the baseband and passband, then you would decide by yourself if there is a difference or no. However, its already mentioned in above comments, you shouldn't have any major difference between simulating base-band and pass-band.
Now let me ex... | One very obvious advantage of baseband simulation of communication systems is the low sampling rate it requires.
Considering a narrowband communication system having a few MHz of bandwidth to a few GHz of carrier frequency, it would be much easier (in terms of computation) to simulate it in the baseband sampling rate.... | https://dsp.stackexchange.com |
123,327 | [
"https://dba.stackexchange.com/questions/123327",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/81591/"
] | I have a table with a <code>value</code> column. I want to calculate the last row minus the first row, as shown here:
<pre><code> id value
1 10
2 45
3 65
4 95
. .
. .
. .
500 200
</code></pre>
I want to obtain <code>200 - 10 = 190</code>
I've tried t... | You were close - <code>FIRST</code> and <code>LAST</code> are from Access; in SQL Server (starting with SQL Server 2012) they are <code>FIRST_VALUE()</code> and <code>LAST_VALUE()</code>.
So, if you are 2012 or better (or Azure SQL Database), here's one way to get your answer:
<pre><code>CREATE TABLE #fl
(
Identit... | One more way (that works in older versions as well):
<pre><code>SELECT
result = (SELECT TOP (1) value FROM counter ORDER BY id DESC)
- (SELECT TOP (1) value FROM counter ORDER BY id ASC) ;
</code></pre>
| https://dba.stackexchange.com |
608,543 | [
"https://physics.stackexchange.com/questions/608543",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/284763/"
] | I want to understand precisely where the formula for the expectation value of <span class="math-container">$x$</span> comes from (in QM):
<span class="math-container">$$\langle x\rangle=\int _{-\infty}^{\infty}\psi ^*x\psi dx $$</span>
I know that an expectation value (in statistics) is just the sum of the products of ... | In quantum mechanics, the expectation value of an observable <span class="math-container">$\hat{O}$</span> in a state <span class="math-container">$|\Psi\rangle$</span> is defined by <span class="math-container">$$ \langle \Psi|\hat{O}|\Psi\rangle \quad . $$</span>
In your case the observable is the position operator w... | Inside the integrals, everything is a scalar, you can rearrange terms as you wish. It's a bit hard to see because you omitted the <span class="math-container">$x$</span>-dependence of <span class="math-container">$\psi$</span>. It really is
<span class="math-container">$$\int \psi^*(x)\,x\,\psi(x) dx$$</span>
where <sp... | https://physics.stackexchange.com |
222,444 | [
"https://math.stackexchange.com/questions/222444",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/42344/"
] | <blockquote>
Prove the irrationality of $2^{\frac{1}{n}}$ for $n > 2$
</blockquote>
So, we suppose $2^{\frac{1}{n}}$ is rational (= $\frac{p}{q}$). Therefore, $$2 = \frac{p^n}{q^n} \Rightarrow q^n + q^n = p^n$$ and this contradicts Fermat's last theorem. Is this a correct proof?
What do you think about this proo... | You still need to prove it for $n=2$ though. The proof is right for $n >2$.
But this proof falls under the category of mosquito nuking proofs.
| Well if $2=p^n/q^n$, then $2\cdot q^n=p^n$. This implies that 2 divides $p$; thus $2^n$ divides $p^n$. This in turn implies that $2^n$ divides $2\cdot q^n$, but since $n>1$, 2 must divide $q$ as well. This is a contradiction.
| https://math.stackexchange.com |
17,523 | [
"https://mathoverflow.net/questions/17523",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4400/"
] | In "continuous" mathematics there are several important notions such as covering space, fibre bundle, Morse theory, simplicial complex, differential equation, real numbers, real projective plane, etc. that have a "discrete" analog: covering graph, graph bundle, discrete Morse theory, abstract simplicial complex, differ... | A lot of ideas from topology and analysis don't have obvious discrete analogues to me. At least, the obvious discrete analogues are vacuous.
<ul>
<li>Compactness.</li>
<li>Boundedness.</li>
<li>Limits.</li>
<li><strike>The interior of a set.</strike></li>
</ul>
I think a better question is which ideas have surprising... | Is there a discrete analogue of the notion of discreteness?
| https://mathoverflow.net |
373,639 | [
"https://stats.stackexchange.com/questions/373639",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/184022/"
] | Let <span class="math-container">$X_1, ..., X_n$</span> be <span class="math-container">$i.i.d$</span> random variables, uniformly distributed over <span class="math-container">$(0,\theta)$</span>. Derive the likelihood function given the sample <span class="math-container">$x_1, ..., x_n$</span>.
<strong>Answer</stro... | The fact that all the observable values <span class="math-container">$X_1,...,X_n$</span> are all non-negative is generally considered to be <em>implicit</em> throughout the working (since this is the support of the original distribution) and so it is not stated explicitly. You can certainly add it in explicitly if y... | You are correct that the third equality could use the event <span class="math-container">$\{\min(X_1, \ldots, X_n)\geq 0, \max(X_1, \ldots, X_n)\leq\theta\}$</span>.
The more compact notation is used because for any value of <span class="math-container">$\theta$</span>, <span class="math-container">$\min(X_1, \ldots, ... | https://stats.stackexchange.com |
821,197 | [
"https://math.stackexchange.com/questions/821197",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/108039/"
] | Trying to prove that
$$ \sum_{i=1}^n \frac1{\sqrt i} > 2(\sqrt{n+1}-1), \forall n \in \mathbb N$$
using induction.
My only attempt so far has consisted of squaring both sides (during the $P_{k+1}$ part) to get rid of square roots, but it turned real messy, real fast.
Tried using
$$\Bigg[\sum_{i=1}^{k+1} \frac1... | <strong>Hint</strong>. To make proof by induction work, you need a relationship (fairly simple if possible) between the statement for $k$ and the statement for $k+1$. In this case the relationship is that the LHS for $k+1$ is equal to the LHS for $k$ plus one more term. So you need to prove that
$$2(\sqrt{k+1}-1)+\f... | <em>Hint</em>. How about using the inequality
$$ \frac{1}{\sqrt{i}}
= \int_{i}^{i+1} \frac{dx}{\sqrt{i}}
> \int_{i}^{i+1} \frac{dx}{\sqrt{x}}
= [2\sqrt{x}]_{i}^{i+1}
= 2\sqrt{i+1} - 2\sqrt{i}.
$$
| https://math.stackexchange.com |
144,178 | [
"https://dba.stackexchange.com/questions/144178",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/100363/"
] | I use SQL Server agent notifications a lot for notifying of failed jobs. Usually, jobs run every hour so I don't mind getting a few emails if the job fails.
However, I want to run a job every minute now and leave it running. I really don't want to get 100s of emails if it fails for a few hours.
Can I set a limit on t... | This feature is already built into SQL Server. I had a similar situation and what I did was to change my code to use a custom error number, above 50000, and set up a new Alert, under SQL Server Agent|Alerts in Management Studio, with that custom error number. Under the Options section, there is a Delay between response... | I don't think there's an option available to limit the number of times that a job can report failure.
What comes to mind is to handle the notification yourself. Don't have SQL Server send an email on job failure, make that email part of your job script.
You can log the email activity and control when your job sends th... | https://dba.stackexchange.com |
248,272 | [
"https://security.stackexchange.com/questions/248272",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/209238/"
] | I was told that IP whitelisting should not be considered safe and are hence obsolete.
I fail to understand why this statement holds: can IPs be impersonated? if not, then why is it a bad/obsolete way of securing a service? (assuming the traffic can't be sniffed)
| As with many/most/all things in security, this will depend on the threat model of the service(s) you're looking to protect.
The downside of IP address whitelisting as a single control is that it assumes that you can trust all the traffic that comes from the white listed addresses, which is often not a great assumption ... | Whitelisting itself is not a great security measure. With whitelisting, you are trusting the network(s) behind those IPs to be 100% secure, without any way to obtain a physical connection (a spare hot jack somewhere), wireless connection (including IOT devices that typically have weak default passwords), VPN access (la... | https://security.stackexchange.com |
109,615 | [
"https://softwareengineering.stackexchange.com/questions/109615",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/8029/"
] | It's not entirely uncommon in IT that programmers are added to an existing project somewhere in the middle, or closer to finish.
Unfortunately, I've seen that people quickly get disillusioned and leave the job.
So, is there an actual problem? If there is a problem, is there some research in or are there best practice... | I think attitude is the first thing. There have been a lot of decisions made already in the project that you didn't have a chance to give input to. Likely you will disagree with some or even most of them. The last stages of a project is not usually the best time to revisit decisions made months ago and that a lot of th... | You must be illusioned before you can become disillusioned.
If you join a project at any point during development, make sure that you have a clear understanding of the task and your role in it. If you have realistic expectations of the project and the project has realistic expectations of you, you're more likely to re... | https://softwareengineering.stackexchange.com |
19,410 | [
"https://dsp.stackexchange.com/questions/19410",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/11934/"
] | Given a z transform with one pole can you have a 2 sided Region of convergence or does 1 pole limit it to being only left or right sided? I know when you have two poles the 2 sided scenario is when a "ring" forms between the two poles in the z-space but when you have one pole does the case when the entire z space is in... | With one pole you have only two possible regions of convergence, either $|z|<r$ (where $r$ is the pole radius), which corresponds to a left-sided sequence, or the region $|z|>r$, corresponding to a right-sided sequence. I think the misunderstanding lies in the concept of 'the ring formed by the one pole', becaus... | What nobody ever explains is why you need the two sided z transform in the first place!
Now usually in control systems all systems are causal so nothing exists in negative time anyway.
Now of course for optimal control the maths needs positive and negative sequences but for most problems of ordinary engineering we don... | https://dsp.stackexchange.com |
415,270 | [
"https://softwareengineering.stackexchange.com/questions/415270",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/59802/"
] | For code, we know approaches like DRY and we tend to extract common functionality. What approaches are recommended for comments? Perhaps it's a really open question, so I'm going to go with my specific scenario:
In a project I work for, we use a library for charts, which has a few bugs. It's not very well maintained an... | Ticket and work tracking systems change. Adding defects to the backlog is not ideal because nobody is going to fix them, clearly.
Duplicating comments is not ideal either for the very reasons you listed.
Commit messages are not that great either, because there are so darn many of them. A single voice gets drowned out b... | In this particular case, it would make sense to create a ticket in an issue tracker where the bug and the general workaround strategy are documented. Often it is possible to attach further documents to a ticket, such as stack traces or screendumps. In each affected source file, have a comment linking to the ticket and ... | https://softwareengineering.stackexchange.com |
66,753 | [
"https://datascience.stackexchange.com/questions/66753",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/88635/"
] | I want more info into if <strong>k-means with Mahalanobis distance</strong> is a mathematically/methodologically correct option for <strong>datasets with different variance clusters</strong>.
The steps are:
<ol>
<li>Create aggregate datasets (initially randomly or another way, doesn't matter)</li>
<li>Estimate mu, sigm... | You install the version you want with:
<code>pip install tensorflow=={version you want}</code>
for example:
<code>pip install tensorflow==2.0.0-beta1</code>
If you are working in Google Colab it's even simpler, just type:
<pre><code>%tensorflow_version 2.x
import tensorflow as tf
</code></pre>
and it will automat... | As has been mentioned, <code>pip install</code> and the appropriate TensorFlow version should do it for you.
However, if you are having trouble installing locally (maybe your Python version is not suited for TensorFlow v2.0), there is always the option of spinning up a Jupyter Notebook in <strong>Amazon SageMaker</str... | https://datascience.stackexchange.com |
146,158 | [
"https://dba.stackexchange.com/questions/146158",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/15452/"
] | I have two table A and B
<strong>Table A</strong>
<pre><code>C1
----
11
232
454
65
78
87
45
87
98
99
</code></pre>
<strong>Table B</strong>
<pre><code>C2
----
c1
c2
c3
c4
</code></pre>
How can I join these table to get output like
<pre><code>C1, C2
--------
11 ,c1
232 ,c2
454 ,c3
65 ,c4
78 ,c1
87 ,c2
45 ,c3
... | Below query seems to work,If anybody has better solution please comment.
<pre><code>select
c1,c2
from
(select mod(rownum,(select count(1) from r2))+1 rn,customer_Key as c1 from r1) t1,
(select rownum rn,customer_Key as c2 from r2) t2
where
t1.rn=t2.rn
</code></pre>
| Since the tables have no column in common, we'll have to use the <code>rownum</code> pseudocolumn which is asigned to every row in a resultset. Do not confuse with rowid which is hash-like and exists phisycally in the table. Since rowids go 1,2,3...n, they provide a way to join two unrelated tables.
<pre><code>select
... | https://dba.stackexchange.com |
282,663 | [
"https://mathoverflow.net/questions/282663",
"https://mathoverflow.net",
"https://mathoverflow.net/users/7108/"
] | Suppose $R$ is a perfectoid ring in mixed characteristic, and $R'$ its characteristic-$p$ tilt. Scholze's results on tilting say that the étale theories over $R$ and $R'$ are equivalent in an almost sense (i.e. considering the category of extensions in the sense of "almost mathematics"). I want to know whether this is ... | "Every set is really climbable": this contradicts AC. By AC construct a set $X\subseteq \omega_1$ such that $L[X]\models $"$\omega_1 =\omega_1^V$". Then for arbitrarily large $\gamma < \omega_1$ we have that $L_\gamma[X\cap \gamma] \models $"<em>Every set is countable</em>". But such a set cannot be climbable, for... | <hr>
Concerning <em>Copy(K)</em>-determinacy: you mention that every set of countable ordinals being climbable would lend plausibility to this in ZFC (that is with AC). We just saw that climbability fails under AC; of course $\forall K$<em>Copy(K)</em>-determinacy holds under AD; and if you make the game harder for I... | https://mathoverflow.net |
561,258 | [
"https://electronics.stackexchange.com/questions/561258",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/283516/"
] | I don't get why there would be a voltage across a resistor as that would mean electrons pile up on 1 side of the resistor and as far as I know, that's not the case. My assumption is that voltage is dropping all over the circuit and the resistor just happened to be between a potential difference in the circuit. Someone ... | <blockquote>
electrons pile up on 1 side of the resistor
</blockquote>
That is entirely correct. And there is a "shortage" of electrons on the opposite side.
<blockquote>
as far as I know, that's not the case.
</blockquote>
It <em>is</em> the case.
Except in the case of a super-conductor, electrons interact w... | If the voltage across a resistor is non-zero, then the current is non-zero. This means that some charge carriers are dissipating energy, in the form of heat (neglecting radiation). Since energy must be conserved, the dissipated energy came from somewhere, and it was a reduction in the potential energy of the charge car... | https://electronics.stackexchange.com |
26,520 | [
"https://mathoverflow.net/questions/26520",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3106/"
] | Skip Garibaldi asks if there is an elementary proof of the following fact that "accidentally" fell out of some high-powered machinery he was working on.
Say that two matrices $A$ and $B$ over the rationals are <i>rationally congruent</i> if
there exists a nonsingular matrix $S$ over the rationals such that $S^t A S = ... | Wadim, isn't that 95% of the proof? First let me correct your first displayed equation (thanks to fherzig for pointing this out): It is not sufficient for the proof, but
$$
\sum_{i=0}^{n-1}\binom{4n}{2i}P_i(t)P_i(s)
=\sum_{i=0}^{n-1}\binom{4n}{2i+1}\hat P_i(t)\hat P_i(s)
$$
is, where $t$ and $s$ are two independent var... | Expecting to be criticised, I nevertheless try to explain an approach to the problem
(for the first case). Assume that there exist two family of polynomials
$P_i(t)$ and $\hat P_i(t)$, $i=0,1,\dots,n-1$, each spanning the space of
polynomials of degree less than $n$ such that
$$
\sum_{i=0}^{n-1}\binom{4n}{2i}P_i(t)^2
=... | https://mathoverflow.net |
423,280 | [
"https://softwareengineering.stackexchange.com/questions/423280",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/74674/"
] | We have a project that loads metric data from various etls and services into an AWS SQS queue, where that data is processed and inserted into a metrics database, also running on AWS RDS.
When we initially designed the database schema, we chose postgres and enforced things like referential integrity via foreign keys. We... | So the foreign keys come from a source system (maybe an OLTP database) where they are immutable, and the metrics database (a kind of analytics DB) reuses them.
For such a situation, I would say it is perfectly find to drop all FK constraints in the metrics database, or at least the constraints where you expect the even... | It depends essentially on your business logic, on the use case that you need to implement.
If the use case first presents the list of files (1st table) to the user, user chooses some file, then the application looks up for the metrics (in the 2nd table) to present them to the user, then the orphaned records in the 2nd ... | https://softwareengineering.stackexchange.com |
1,263,688 | [
"https://math.stackexchange.com/questions/1263688",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/237329/"
] | I have 3 values; x, y, and z.
Each value can only be a single digit (0-9).
I know that x and y are different.
I don't know if y and z are different or the same.
I don't know if x and z are already different or the same.
I want to change the value of z (using x and/or y) in such a way that guarantees it is not the same... | It can't be done if you need to recover $z$. As you know that $x \neq y$ there are $900$ input triplets $(x,y,z)$ that are possible, $10$ choices for $x, 9$ choices for $y$ and $10$ for $z$. Even if you allow the new $z$ to equal $y$, there are only $810$ output triplets available, so there will be cases where more t... | It is impossible, how would you distinguish between the following cases (the values give $x,y,z$):
$0,1,0$
$0,1,1$
$0,1,2$
$0,1,3$
$0,1,4$
$0,1,5$
$0,1,6$
$0,1,7$
$0,1,8$
$0,1,9$
Each of these cases is going to have an output between:
$0,1,1$
$0,1,2$
$0,1,3$
$0,1,4$
$0,1,5$
$0,0,6$
$0,1,7$
$0,1,8$
... | https://math.stackexchange.com |
194,721 | [
"https://softwareengineering.stackexchange.com/questions/194721",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/60003/"
] | I am designing a flexible and extensible way to store configuration settings for users.
<strong>Database Table Design:</strong>
<pre><code>╔═════════════════════════════╗
║ ConfigurationItemDefinition ║
╠═════════════════════════════╣
║ ID ║
║ Name ║
║ Type ... | That solution looks altogether workable to me.
One nitpick: I find that when I have to store different types of things in a uniform way, and there are only a small, non-expandable number of types that can exist, I'd rather have separate methods <code>readInt()</code>, <code>readString()</code> etc. and live with a sm... | I have built solutions like this in the past, but I would argue that the proposed design is actually a relational database anti-pattern since you store data without (from the database perspective) enforceable typing. You are basically using a relational database like a key/value store.
In my opinion using regular tabl... | https://softwareengineering.stackexchange.com |
20,538 | [
"https://dba.stackexchange.com/questions/20538",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/9998/"
] | I'm working with <em>MS SQL Express 2008</em> and <em>Visual Studio 2010</em>.
If you are attached to a local <code>MDF</code> file how do you remove it from the Databases list without deleting the file? The reason is to purge the list of databases for old projects. The next time you run the project it will re-establi... | You could detach the database, that way the file isn't deleted and it won't display inside of SSMS.
| <ol>
<li>Right click the database in SSMS</li>
<li>Click Tasks</li>
<li>Click Detach</li>
</ol>
<img src="https://i.stack.imgur.com/aVwm3.jpg" alt="enter image description here">
To attach the database:
<ol>
<li>Right click the databases node</li>
<li>Select Attach</li>
<li>Add the MDF file. The LDF file will be add... | https://dba.stackexchange.com |
129,611 | [
"https://stats.stackexchange.com/questions/129611",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/52901/"
] | I'm studying for an exam and my study guide explained combinations, permutations, and binomial distributions, but didn't cover much how to recognize where each comes into play in problems. I'm having trouble formulating the following example problem:
<blockquote>
An operator is to operate three different switches fr... | By now, I think you have established that the probability distribution for the number of inoperable switches is not binomially distributed, because individual switches are not selected with replacement.
That said, we should look at the correct sample space over which the elementary outcomes are counted. This consists... | In case you want to sanity check your answer, you can write a little simulation like this:
<pre><code>got_two_bad <- function(objects=c(rep("good", 4), rep("bad", 3))) {
## Got exactly two bad when sampling 3 objects
my_sample <- sample(objects, size=3, replace=F) # Note the replace=F
return(sum(my_... | https://stats.stackexchange.com |
31,698 | [
"https://mechanics.stackexchange.com/questions/31698",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/16285/"
] | I know this isn't exactly a <em>Motor Vehicle Maintenance & Repair</em> related question but this seems the most appropriate StackExchange community to ask it. I apologize if I am being wrong in my assumption.
Given 2 cars that are identical in every aspect except torque produced by the engine ( identical amount o... | Torque doesn't matter. It's power. The difference is that diesel engines have their peak power at lower RPM compared to petrol engines. Same power at lower RPM means more torque.
(Think about: The motor of my car has max. torque of 95Nm. I torque the wheel lugs with 110Nm by hand. So why can the motor accelerate my ca... | Gas engines are capable of much higher rpm than diesels, so your top speed with gas would be higher. I don't think if it is possible to build equivalent gas and diesel engines that have similar weight and HP.
| https://mechanics.stackexchange.com |
636,175 | [
"https://physics.stackexchange.com/questions/636175",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/98822/"
] | If an observer accelerates through flat spacetime he observes a globally curved spacetime (as if gravity is present everywhere with a fixed and constant strength). If an observer accelerates in a curved spacetime (or, equivalently, if he follows a geodesic in the curved spacetime) he observes a locally flat spacetime. ... | <blockquote>
If an observer accelerates through flat spacetime he observes a globally curved spacetime
</blockquote>
This is incorrect. Curvature is a tensor property of the spacetime. If the curvature is 0 (flat) in one reference frame then it is necessarily 0 in all other reference frames also.
For example, both stan... | The observer can measure the curvature tensor. Actually, in the first case an acceleration just represents a change of the reference system. The observer might experience acceleration which is represented in General Relativity by the Christoffel-symbols (the local derivatives of the metric tensor) --- Christoffel-symb... | https://physics.stackexchange.com |
304,833 | [
"https://softwareengineering.stackexchange.com/questions/304833",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/157556/"
] | I have a task, which is to scramble a single word, whose size is greater than 3 letters.
The scrambled word must not be equal to the original, and the first and last letters of the word must remain the same.
For example, the word <code>stack</code>, could give the one of the following results:
<ul>
<li>satck</li>
<... | My guess is that by "reuse of inheritance" they mean <em>code reuse by means of inheritance</em>, as opposed to <em>code reuse by means of composition</em>. The are reusing code, not reusing inheritance. By internal reuse my guess is that they are talking about extending classes in the same package, whereas external is... | It is a bit unclear, but my educated guess (because no other hypothesis seems to make sense) is that:
<ul>
<li>By <strong>"inheritance for external [code] reuse"</strong> they mean cases where a subsystem exposes (makes publicly available) an abstract base class, which is to be extended by other classes either of this... | https://softwareengineering.stackexchange.com |
25,199 | [
"https://dba.stackexchange.com/questions/25199",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/-1/"
] | So the command I normally use to get a database sent to another server is:
mysqldump -u <em>user</em> -p --add-drop-tables <em>database</em> *file*
But I always have to go into the <em>file</em> and add a line at the top:
use <em>database</em>;
So that I use the file to import to a different server. Is there a flag i... | The flag is <strong>--databases</strong>
<pre><code>mysqldump -u user -p --add-drop-tables --databases database > *file*
</code></pre>
So if you have more than one schema names you need to set which databases with the <strong>--databases</strong> flag. Then it inserts which one is necessary to be used.
| We do use key <code>-B <db-name></code>, which adds command <code>USE <db-name>;</code>
| https://dba.stackexchange.com |
12,966 | [
"https://stats.stackexchange.com/questions/12966",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/4128/"
] | I'm looking to understand this from a managerial perspective. For example if I was explaining linear regression I would say it is a line of best fit through some data points and it can be used to predict a "y" value for some given value of "x". Is there an analogous explanation for VAR? I do not have a strong backgroun... | If purely from managerial perspective, VAR is practically the same as linear regression. The main difference is that in VAR you have several dependent variables instead of one. This means that instead of one linear regression you have several. Your interpretation of linear regression remains valid, since each VAR regre... | In Var models instead of using several dependent variable we use several independent variable and their effect on one dependent variable.
| https://stats.stackexchange.com |
359,381 | [
"https://electronics.stackexchange.com/questions/359381",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/18340/"
] | I am using an STM32F4 with the Rowley CrossStudio for ARM. It is not clear to me how to have the MCU start from int main() on reset (i.e. power up the device). I thought building it in release mode would have done this, but that seems not to be the case.
Looking online, I see some people saying that you somehow change... | On most (but perhaps not all) members of the STM32 family, to automatically boot an application from flash you must ground the BOOT0 pin.
This is essentially so that if you have a <em>bad</em> application in flash, or one that does not provide a means of entering the bootloader, you can force entry to the bootloader b... | If you define the macro STARTUP_FROM_RESET it should jump to the proper reset vector on startup.
The JTAG interface should still be able to gain control if you've built for debug.
| https://electronics.stackexchange.com |
260,256 | [
"https://softwareengineering.stackexchange.com/questions/260256",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/121297/"
] | Given that a method's name might change in time, is it a good idea to specify the name of the method whose return value I am asserting as a part of the Unit Test method's name? What about the message that will be output to the caller?
For example, I have a <code>Foo</code> object that has a <code>Bar</code> method. I ... | It's not generally needed. As @Telastyn says, if the test case fails, then it will become quickly and readily apparent what method failed.
The real need is to have the purpose of your test easily understood by those that
<ol>
<li>are adding, reviewing, or modifying tests after you (even if that person is also you), ... | <strong>No, you do not need to add messages to most assertions.</strong> Writing unit tests as you suggest would be needlessly tedious. Presumably the Assert.IsTrue method will throw an exception saying something like "Expected true, got false". The ensuing stack trace will pinpoint the cause of the failure.
N.B. I... | https://softwareengineering.stackexchange.com |
556,636 | [
"https://physics.stackexchange.com/questions/556636",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/265836/"
] | Let <span class="math-container">$|q\rangle$</span> be the eigenvectors of the position operator, let <span class="math-container">$|\psi\rangle$</span> be a state and let <span class="math-container">$\hat{p}$</span> be the momentum operator.
In my book it's stated that i can interprete the quantity:
<span class="math... | If your book says what you describe, it's a very confusing way to represent the subject, and the statement regarding <span class="math-container">$\langle q\vert\hat{p}\vert \psi\rangle$</span> is simply wrong.
<ul>
<li><span class="math-container">$\langle e_i \vert \hat{A} \vert e_j \rangle$</span> is the <span cla... | <span class="math-container">$\langle q|\hat{p}|\psi\rangle$</span> can be interpreted (purely formally!) as the element with label <span class="math-container">$q$</span> of a "continuous" column matrix representing the ket <span class="math-container">$\hat{p}|\psi\rangle$</span> in the basis <span class="math-contai... | https://physics.stackexchange.com |
280,361 | [
"https://softwareengineering.stackexchange.com/questions/280361",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/175746/"
] | I need to cross names from two lists, and find all occurrences of one name in the other. The lists are too big, one have 50k elements and the other 400k.
For a small list I would use two foreach cycles or Linq, but I can't be running the program for days.
What is your advice to perform a fast comparisons?
<strong>ED... | My suggestion would be to slurp the large list into a hash set, then use that to match items from the small list.
A hash set is a structure that stores elements in an indexable memory structure, like an array, where the position of the element is equal to some hash value calculated using the object. That means that l... | Sort both lists with an efficient sorting algorithm (or ensure that the lists are "pre-sorted" by whoever/whatever created them).
Then, if the first name in both lists is the same you've found a match, otherwise discard whichever name is "earlier"; and do that until one of the lists are empty.
Some crude pseudo-code:... | https://softwareengineering.stackexchange.com |
44,001 | [
"https://stats.stackexchange.com/questions/44001",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/4426/"
] | I've always wondered how good a 'fit' is the Poisson distribution to the events we observe in reality. Almost always I've seen it be used for modeling occurrence of events. (For example, arrival of cars in a parking garage or the number or messages sent/received by computers hosts on a network etc.)
We usually model s... | One example I can speak for is supermarket sales of Consumer Packaged Goods (CPG). These are also count events - the supermarket may sell 0 units a day, or 1, or 2 and so on, so the Poisson distribution seems like a good first fit.
However, the underlying binomial distribution @PeterEllis notes does not hold. Yes, we ... | As @Stephan says, the straight Poisson may not have enough variance to be a good model of real non-negative integer measurements governed by a hazard function.
So, often the negative binomial is used, which has an additional parameter $\alpha > 0$ determining the over-dispersion.
I've found it useful to parameterize... | https://stats.stackexchange.com |
227,938 | [
"https://physics.stackexchange.com/questions/227938",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/103125/"
] | I was thinking hypothetically, a ship traveling to a distant star system with something like food wants to get to the system as fast as possible. The trick is, we want to travel as fast as possible in relation to the people in the opposite star system. Is it really best to travel as close to the speed as light as possi... | You don't need a computer program to check this. Just think about it. Time dilation never comes into play. There is only one velocity that matters, as you said, and that is your velocity relative to the destination, particularly its projection onto the separation vector between you and the destination. No matter which ... | Moving faster will simply get you there faster...
Also, moving closer to the speed of light should make it feel as though it takes even less time (to the passengers) according to time dilation.
Time dilation won't really affect the view of an outsider, that is, they will continue to experience regular time and will s... | https://physics.stackexchange.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.