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 |
|---|---|---|---|---|---|
402,497 | [
"https://mathoverflow.net/questions/402497",
"https://mathoverflow.net",
"https://mathoverflow.net/users/56524/"
] | In so-called 'natural unit', it is said that physical quantities are measured in the dimension of 'mass'. For example, <span class="math-container">$\text{[length]=[mass]}^{-1}$</span> and so on.
In quantum field theory, the dimension of coupling constant is very important because it determines renormalizability of the... | Mathematically, the concept of a physical dimension is expressed using one-dimensional vector spaces and their tensor products.
For example, consider mass.
You can add masses together and you know how to multiply a mass by a real number.
Thus, masses should form a one-dimensional real vector space <span class="math-con... | <ol>
<li>The action appears in an exponent, so it must be dimensionless. That then fixes the dimension of each term which appears in the action and "forbids you from proclaiming that <span class="math-container">$\phi$</span> is dimensionless".</li>
</ol>
<sub>To find the mass dimension of the field <span cla... | https://mathoverflow.net |
168,863 | [
"https://dba.stackexchange.com/questions/168863",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/20259/"
] | Using MariaDB 10.1. The default encoding is utf8mb4, but I have an existing database that uses utf8.
So in order to re-use the same DB, I would have to keep using utf8 for now. So I set the server variables to the following in my <code>/etc/mysql/my.cnf</code>:
<pre><code>[client-server]
# Import all .cnf files fro... | So it looks like when the server variables are set, they don't change the database that had already been created before. So what I did was to:
<ol>
<li>Set the server variables as shown in the question.</li>
<li>Verify that they are now as expected as shown in the question.</li>
<li>Recreate the database again, and ch... | These options should allow your server to use longer utf8mb4 indexes:-
Added to the <code>[mysqld]</code> section of the <code>my.cnf</code> file.
<pre><code># Make sure we can handle UTF8mb4 indexes
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_compression_algorithm = zlib
innodb_large_prefix = 1
<... | https://dba.stackexchange.com |
61,245 | [
"https://mathoverflow.net/questions/61245",
"https://mathoverflow.net",
"https://mathoverflow.net/users/12064/"
] | Let $A$ be $p\times p$ symmetric positive definite with distinct eigenvalues and $x_p\in \mathbb{R}^p$ and consider the problem
Minimize $x'Ax + b'x$
Subject to $x'x=1$
Most of the information I've found is is either very general/theoretical or specific to linear constraints, although I'm largely flitting around opt... | Your problem has been studied extensively in the context of trust region methods for optimization, and there are a number of algorithms that have been developed.
See for example:
W. W. Hager, Minimizing a quadratic over a sphere. SIAM Journal on Optimization, 12:188-208, 2001.
Hager's paper gives a lemma that c... | This is not an answer, but it was getting too long to be a comment. Also, I'm not familiar with such problems, so hopefully someone will be able to give you a complete and more satisfying answer and some references. Here are some general remarks. It's a bit messy and mostly guesswork :S
If $|A^{-1}b|<1$ there might... | https://mathoverflow.net |
254,376 | [
"https://physics.stackexchange.com/questions/254376",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/116599/"
] | <ol>
<li>Can a rotational flow take place if there is no viscosity? </li>
<li>If yes then will it always be rotational or will it become irrotational after some time?</li>
</ol>
| If by rotational flow you mean
$$
\vec{\omega} := \nabla \times \vec{u} \ne 0
$$
everywhere, then the answer to your question is
<ol>
<li>Yes, vorticity can be introduced through the fluid boundaries (see Klein's Kafeeloffel experiment)</li>
<li>No, conservation of total vorticity means any vorticity in the fluid stay... | 1) Yes. The rotational flow of a rigidly rotating fluid (in a rotating cylinder, for example) is a perfectly good solution of the Euler equation.
2) No. For one, the rigidly rotating flow described in 1) is perfectly stable, even if viscosity is taken into account. Furthermore, the main phenomenon described by the Nav... | https://physics.stackexchange.com |
54,906 | [
"https://softwareengineering.stackexchange.com/questions/54906",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/1157/"
] | A common complaint I hear about Facebook, Twitter, Ning and other social sites is that once a comment or post is made, it can't be edited.
I think this goes against one of the key goals of user experience: giving the user <strong>agency</strong>, or the ability to control what he does in the software.
Even on Stacke... | Imagine this. I post a status update:
<blockquote>
I finally finished our renovations!
</blockquote>
Your comment is:
<blockquote>
Great stuff! Congrats! I want to do
that too.
</blockquote>
And then I changed my original post:
<blockquote>
I just kicked old lady.
</blockquote>
Would you still stand by yo... | I think one of the technical answers is that it's easier to have read only data at large scale.
It's easier to have data that can only be added, that way you never have to worry about who has an old copy of the data. If you have to worry about editing then you get into different modes of data replication and either... | https://softwareengineering.stackexchange.com |
263,105 | [
"https://physics.stackexchange.com/questions/263105",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/121317/"
] | Does Glass feel warmer during winter when you keep your feet on it or Wood?
| Materials at the same temperature "feel" differently warm because of their different heat conductivity. The higher the conductivity is, the faster the material drives the heat away from your skin, and the faster it moves the temperature of your skin towards the surrounding temperature (which is lower than your body tem... | I would like to add to @Lubos Motl's answer that when you put your feet on wood due to its low conductivity your feet makes the upper layer of the wood warmer whereas other part of wood remain at low temperature, whereas in the case of glass, or metals due to their larger conductivity, the heat given by your feet is co... | https://physics.stackexchange.com |
485,214 | [
"https://physics.stackexchange.com/questions/485214",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/194034/"
] | The dynamics of a galaxy are driven by gravity. And dark matter experiences the same gravitational forces as normal matter. The effects of other forces are very small in comparison. So why is the distribution of dark and normal matter so different?
I am not asking <strong>whether</strong> the DM distribution is differ... | In the case of conventional matter, particles, atoms and molecules of it can interact electromagnetically and share energy, and they can do so in response to the effects of gravity. For example, in a (gravity-driven) accretion disc, the infalling matter particles interact strongly amongst themselves and get hot; then t... | Three scenarios come to mind that could cause this. The first is an unstable or inconsistent gravitational pull from dark matter that could act as a kind of slingshot to the matter it pulled on. The second would be that the dark matter was dragged/blown away to some new location perhaps by neutrinos. The third would be... | https://physics.stackexchange.com |
400,336 | [
"https://softwareengineering.stackexchange.com/questions/400336",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/349887/"
] | I have spent two full days now trying to understand the difference between unit testing and handling exception, but I can't get it.
<strong>Things I have understood (or I think I have)</strong>:
<ul>
<li>Unit testing tests functions and classes</li>
<li>can be done with the unittest module in Python</li>
<li>exceptio... | Let's look at your <code>get_turn</code> method:
<pre><code>def get_turn(self):
try:
assert self.turn >= 0
except ValueError:
print('turn number must be positive')
</code></pre>
There are a couple problems here:
<ul>
<li>In most languages, assertions only execute in debug mode. If you run ... | Exception handling and unit testing solve different problems:
<ul>
<li><strong>Exception Handling:</strong> Allows a running program to recover from an exceptional condition (like expecting to be able to open a file but it is open in another program).</li>
<li><strong>Unit Tests:</strong> Tests the behavior of small p... | https://softwareengineering.stackexchange.com |
60,831 | [
"https://electronics.stackexchange.com/questions/60831",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/19397/"
] | I just discovered an app for mac that uses the Audio Input of the computer and the AD-converter in the sound card as an Oscilloscope.
First, I was thinking this can't work... but theoretically, it's a great idea! I know it can only measure for frequencies starting from ~20 kHz, but if you need to measure MHz, then it'... | Generally speaking, the audio inputs of a PC are terrible. Lots of noise, terrible frequency response, etc.
For example, the frequency response of a PC audio input is typically 20Hz to 20 KHz, but could be much worse. Some audio inputs are only really designed for voice, which has a frequency band of about 300 Hz ... | I think you have your understanding of the frequencies backwards. If it's a standard audio input, it's probably being sampled at 44.1KHz, which means you can only measure frequencies <strong>up to</strong> approximately 20KHz. If you need to measure MHz, this technique should be useless.
Other than that, the techn... | https://electronics.stackexchange.com |
6,684 | [
"https://electronics.stackexchange.com/questions/6684",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/1471/"
] | What should be the DC resistance of an external Wi-Fi antenna (when measured between center and shield of the SMA connector)?
In case of:
<ol>
<li>DIY "Pringles" antenna </li>
<li>Consumer grade antenna, connected to external USB WiFi adapter</li>
</ol>
I believe there should be no difference between #1 and #2, r... | Do you mean the resistance across the coaxial connector, from the center pin to the ground?
Depending on the type of antenna, it should either be infinite (Most antennas, including pringles cantenna, which uses a simple 1/4 wave antenna), or a dead short (Some odd types, like a folded dipole).
| Agree with the answers above. Just wanted to add that the zero-ohm type is not so uncommon these days. This could be a very popular PIFA antenna.
You will not measure exactly zero ohm with PIFAs, loops or folded dipoles, the DC resistance would be a couple of ohms.
| https://electronics.stackexchange.com |
352,229 | [
"https://softwareengineering.stackexchange.com/questions/352229",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/110860/"
] | In my current software engineering course, my team is working on a library management system that is essentially a command-line/REPL environment with a half dozen commands, e.g. <code>checkout</code>, <code>search</code>, etc. We've elected to use the command pattern for this, so each command will be represented as a c... | The problem with the Open/Closed Principle is that its name implies that it is some overarching guide that must always be followed or else bad things happen. This isn't true.
The OCP is a <em>guideline</em>: useful in some situations, and somewhere between a distraction and outright counterproductive in others. It'... | <pre><code>Command cmd = commandFactory.create(input, args);
</code></pre>
Now which implementation did I use?
Can't tell? That's right, <em>because it doesn't matter</em>. At least, it doesn't matter so long as you have an abstraction that is responsible for creating the command. Hide that logic behind this interfac... | https://softwareengineering.stackexchange.com |
114,446 | [
"https://mathoverflow.net/questions/114446",
"https://mathoverflow.net",
"https://mathoverflow.net/users/29394/"
] | Two questions:
1) (ALREADY ANSWERED) This is likely to be a very basic question for you folks.
Carathéodory's theorem gives us an upper bound for the minimum number of convex hull vertices that can be used in a nonzero convex combination to yield an inner point of the convex hull (d+ 1 in $\mathbb{R}^d$). Is there a... | This is indeed easy. Let $p$ be a point that you want to represent, $m$ the barycenter of all vertices and $\varepsilon>0$ so small that the point $q=(1+\varepsilon)p-\varepsilon m=p+\varepsilon(p-m)$ is still in the convex hull. Represent $q$ as a convex combination of some vertices, add $\varepsilon m$ with $m$ r... | The following is not a proof (you'll see why in a moment), but is the basis for my belief that there are
points which are interior to the convex hull and are nontrivial linear combinations of all the vertices
of the convex hull.
Take V, the set all vertices of the convex hull in d dimensions, and do your best to parti... | https://mathoverflow.net |
398,807 | [
"https://softwareengineering.stackexchange.com/questions/398807",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/347318/"
] | I notice the GPU, like latest Nvidia/AMD cards, have an output that goes to your monitor but I want to know if we can also use that GPU output feed into some kind of image recorder HARDWARE? If yes, what kind of hardware would I be looking for specifically?
I'm currently trying to create an AI algorithm based on some ... | Sounds like you're looking for a capture card. Modern ones based on PCIe or USB3 are capable of capturing HDMI output at 60fps in real time. On the software side, the captured images are exposed as a virtual camera.
If you can make your program or algorithm work of a video file or camera input, you should be able to u... | A capture card is probably overkill. If you’re looking to capture video frames you could simply dump said video frames with one of many video editing software.
If you’re looking to capture video <em>game</em> frames there’s also a lot of software for this, and Nvidia even provides ShadowPlay which will capture 60 FPS.... | https://softwareengineering.stackexchange.com |
11,070 | [
"https://dsp.stackexchange.com/questions/11070",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/7676/"
] | What is the minimum period P (in samples) of the signal <span class="math-container">$e^{j(\frac{M}{N} )*2πn}$</span> for the following values of M and N?
<blockquote>
M=1,N=3
M=5,N=7
M=35,N=15
</blockquote>
I have got the answer for the first pair of values, which is 3. But I could not get the other two correct. Pleas... | It's already answered in the comments so just to close it out: the answers are 3, 7 and 3. The periodicity is basically given by the denominator of the fraction in front of 2*pi*n after the fraction has been simplified (no common divisors between nominator and denominator). The simplified fractions for the cases are 1... | I cannot ask a question in the comment section therefore I decided to add my question here.
The website provided by Yicheng Ye somehow gives something and I believe people who know this stuff understand all of it but I still find it confusing. I don't understand how to work out the fundamental frequency or minimum per... | https://dsp.stackexchange.com |
24,622 | [
"https://mathoverflow.net/questions/24622",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3248/"
] | My general question concerns what we can learn about an arbitrary, three-dimensional convex polytope (or convex hull of an arbitrary polytope) strictly from the surface areas of its two-dimensional projections on a plane as it 'tumbles' in 3-space (i.e. as it rotates along an arbitrary, shifting axis).
If it's helpf... | You cannot recover a convex polytope from its projection areas, even if you know the whole function (unit vector) $\mapsto$ (area of projection along this vector). There exist two different polytopes $P_1$ and $P_2$ such that for every unit vector $v\in\mathbb R^3$, the areas of the two projections along $v$ are equal.... | Hej,
there seem to be a number of variations of the original question out there.
Let me tell you what is known (to me):
Let us assume that an (unknown) convex polytope $P$ in $R^3$ is given.
I assume that we can observe orthogonal projections onto planes (think of shadows
that we see on a screen that is orthogona... | https://mathoverflow.net |
74,484 | [
"https://chemistry.stackexchange.com/questions/74484",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/-1/"
] | "The slope of a given straight line graph with constant temperature is found to be 0.2 l atm at 5 atmospheric pressure." What is l atm here? It is the unit of what?<img src="https://i.stack.imgur.com/md4bB.jpg" alt="enter image description here">
| $\pu{L atm}$ is a unit of (pressure)(volume). As $\pu{atm}$ is a multiple of $\pu{N//m^2}$ and $\pu{L}$ is a multiple of $\pu{m^3}$, then $\pu{L atm}$ is a measure of joules, the unit of energy, which is $\pu{kg m^2//s^2}$ in base SI units.
| <span class="math-container">$\pu{L atm}$</span> is a unit of pressure (<span class="math-container">$P$</span>) times volume (<span class="math-container">$V$</span>). As <span class="math-container">$\pu{atm}$</span> is the multiple of <span class="math-container">$\pu{N m-2}$</span>. <span class="math-container">$\p... | https://chemistry.stackexchange.com |
290,232 | [
"https://softwareengineering.stackexchange.com/questions/290232",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63566/"
] | The company I work at is initializing all of their data structures through an initialize function like so:
<pre><code>//the structure
typedef struct{
int a,b,c;
} Foo;
//the initialize function
InitializeFoo(Foo* const foo){
foo->a = x; //derived here based on other data
foo->b = y; //derived here b... | In the 2nd approach you will never have a half-initialised Foo. Putting all the construction in one place seems a more sensible, and obvious place.
But... the 1st way isn't so bad, and is often used in many areas (there's even a discussion of the best way to dependency-inject, either property-injection like your 1st w... | Both approaches bundle the initialization code into a single function call. So far, so good.
However, there are two issues with the second approach:
<ol>
<li>The second one does not actually construct the resulting object, it initializes another object on the stack, which is then copied over to the final object. This... | https://softwareengineering.stackexchange.com |
325,247 | [
"https://electronics.stackexchange.com/questions/325247",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/160167/"
] | For context, I am using a component from Altium's Vault Explorer and I want to make a few edits to it. Thus I downloaded the component SCH, but the parameters did not copy over.
Is there an easy method to copy the parameters from a Vault Explorer component and paste them into a component in the SCH Library?
| You can insert the component into any schematic, copy it, then open the target library SCH and paste the part in. All the parameters will be preserved.
| Thanks to @Spehro for answering the question in the comments.
To copy the parameters from a Vault Explorer component into your SCH Library:
<ol>
<li>Place the Vault Explorer component onto your schematic.</li>
<li>Copy the component (ctrl+c)</li>
<li>Paste the component into your SCH Library (ctrl+v)</li>
<li>Double-... | https://electronics.stackexchange.com |
15,773 | [
"https://quant.stackexchange.com/questions/15773",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/13714/"
] | So there are two assets with return rates $r_1$ and $r_2$ which have identical variances and a correlation coefficient $p$. The risk free rate is $r_f$.
I need to find an expression for the optimal Markowitz weights for the two assets.
The books says that the answer is ($s_1 - p s_2$)/[($s_1-s_2$)*($1-p$)], but I'm... | Let $s_1 = r_1 -r_f$ and $s_2 =r_2-r_f$. Then, this is the maximization problem:
\begin{align*}
& \ \max_{w_1, w_2} SR = \frac{\mu_p}{\sigma_p}, \, \mbox{ subject to}\\
\mu_p = & \ w_1 s_1 + w_2 s_2,\\
\sigma_p^2 = & \ \sigma^2\big(w_1^2 + w_2^2 + 2 w_1 w_2 \rho\big),\\
1 = & \ w_1+w_2.
\end{align*}
By ... | I'm sorry for the late answer. I hope you passed the exam anyway!
TO answer your question, $s_2 = r_2-r_f$, that is the excess return over the risk free rate/asset.
However, there seems to be a typo in your formula, I believe it should be
$w_1 = \frac{s_1-ps_2}{(s_1+s_2)(1-p)}$, i.e. plus in the denominator.
$w_1$... | https://quant.stackexchange.com |
137,994 | [
"https://softwareengineering.stackexchange.com/questions/137994",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/1343/"
] | I've seen it commonly repeated the object-oriented programming is based on modeling the real world but is it?
It seems to me that is not true of anything outside of the business layer. My GUI classes/data access classes aren't modeling anything in the real world. Even in my business layer, I've got classes like observ... | <strong>No, not at all.</strong>
However it's a methodology that does allow to create a nice abstraction to hold complex data structures along with some methods that act on the data structures.
| Models, of any kind, do not model the real world, not entirely.
They model <em>selected</em> portions, those that are relevant to the application at hand.
What you are talking about (observers, managers, factories etc...) is infrastructure that is there to help you with getting the abstraction right and support requi... | https://softwareengineering.stackexchange.com |
85,969 | [
"https://electronics.stackexchange.com/questions/85969",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/17608/"
] | I recently acquired a used riding mower. I figured it was dead, so hooked it up to a trickle charge overnight. Next morning, still totally dead.
I stuck my voltmeter on it, and measured -11.8V. Check the leads on the meter, and checked the meter against a AAA alkaline. No, the meter is working fine...the battery has a... | Actually it is possible, but this will ruin the battery irreversibly. The trick is that the fully discharged Pb-acid battery has both electrodes the same composition \$PbSO_4\$. When the battery is charged, the negative plate contains pure \$Pb\$ and the positive - \$PbO_2\$ .
This way, if you fully discharge the bat... | All the chemistry/physics here is right, but yes it is possible, when somebody at the factory welds the top on the battery the wrong way round, which is possible with certain geometries. I had two identical batteries, new and dry. Added the H2SO4 and one powers up reversed polarity. Identical capacity to the other, but... | https://electronics.stackexchange.com |
387,192 | [
"https://softwareengineering.stackexchange.com/questions/387192",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/-1/"
] | Currently I have something like the following
<pre><code>def writeThis(fileHandle, name):
fileHandle.write('Hello ' + name)
writeThis(fh, 'Alice')
</code></pre>
Something about this doesn't feel right however, it feels like I should try to minimize side effects and have something like the following
<pre><code... | A function which returns a greeting as a string (your 2nd option) is a better practice. That way, the function has a single responsibility. Your code will be easier to maintain. In the future, you may need to change the file format (say you want to switch from XML to JSON). In the future, your customers may want to... | Returning a string has the disadvantage that you need to concatenate all the output into a string first, which can be inefficient if that string gets large. It might be better to write chunks separately, as soon as they are available.
In contrast, directly writing to a file has the disadvantage that the function is no... | https://softwareengineering.stackexchange.com |
27,134 | [
"https://electronics.stackexchange.com/questions/27134",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/8301/"
] | I have seen examples of repurposing cd-r/w or dvd-r/w lasers to use for laser pointers or even 'burning' lasers. I have a project in mind, and I am hoping to make holes in a pingpong ball that range from .3 mm to 5 mm in size. Could those type of lasers do this kind of task? I reailze that there are many other problems... | I've used the laser from a DVD burner and let me say that it doesn't burn much of anything!
I got several lasers from a couple of DVD burners and combined them with an adjustable focus lens that was specifically made for laser diodes. I then shot it at anything and everything. Here's what I can tell you about what... | You should have no trouble finding regular drills down to 1.6 mm (1/16 inch) in your local hardware store. And PCB manufacturers routinely drill holes down to 0.2 mm (0.008 inch) using mechanical drills, so those sizes must be available somewhere, though you might have to find a specialist supplier.
If you nonetheless... | https://electronics.stackexchange.com |
950,493 | [
"https://math.stackexchange.com/questions/950493",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/175181/"
] | I'm currently studying for my real analysis 1 midterm Thursday and I'm trying to learn epsilon-delta proofs. Unfortunately, my instructor has decided to use a custom textbook that has no examples in it and he uses class time for group discussions instead of actually lecturing. I'm trying to solve delta-epsilon proofs I... | Let $\epsilon >0$. Choose $\delta =\min{(1,\epsilon/3)}$. Suppose that
$0 < |x-1| < \delta$. What we need to show is that under these conditions,
$| (x^2+3)-4 | < \epsilon $. In other words if we show $ |x^2-1| < \epsilon $ we are done. Well, we have that,
\begin{align}
|x^2-1| & =|(x-1)(x+1)| \\
&am... | I think it would do benefit you to look at this alternative approach instead, and see how it works for you. What you need to prove is that <span class="math-container">$$\forall{\epsilon\gt0},\exists{\delta\gt0},\forall{x\in\mathbb{R}},\left[0\lt|x-1|\lt\delta\implies|(x^2+3)-4|\lt\epsilon\right].$$</span> Notice that ... | https://math.stackexchange.com |
428,525 | [
"https://physics.stackexchange.com/questions/428525",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/206547/"
] | So the formula for work is$$
\left[\text{work}\right] ~=~ \left[\text{force}\right] \, \times \, \left[\text{distance}\right]
\,.
$$
I'm trying to get an understanding of how this represents energy.
If I'm in a vacuum, and I push a block with a force of $1 \, \mathrm{N},$ it will move forwards infinitely. So as long... | You have to put in the distance on which the force acts. If you release the force, there will be no work done since there is no force acting on the body.
| Often it is important to know if a given formula is a simplification of a more general equation and, when you encounter a conceptual problem, check the general formula. In this case it is a simplification of this formula:
$$W=\int_S F\cdot ds $$
Where $S$ is the path over which we are interested in the work and $ds$ is... | https://physics.stackexchange.com |
474,749 | [
"https://electronics.stackexchange.com/questions/474749",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/239518/"
] | I'm learning VHDL, and there are a lot of exercises where they give you an entity and you have to write the architecture, where a lot of the inputs are separate:
<pre><code>entity m is port (
A, B, C: in std_logic;
Y: out std_logic);
end m;
</code></pre>
Now I could try to come up with some combination of ope... | <h1>Style</h1>
I'd never let this pass through code review, but not because you want to write a lookup table. Combinatorial logic definition using signals was relevant in the 1980s, but we're 4 decades later now.
The whole concatenation/lookup really belongs in a process, like so:
<pre><code>p_main: process(a, b, c)
... | First of all it's not bad at all to build <code>std_logic_vectors</code> out of <code>std_logic</code>. Whether I'd prefer lookup tables over normal logic is another question because usally you wouldn't name your signals <code>a, b and c</code> but give them some meaningful names. If you enpack your logic into a lookup... | https://electronics.stackexchange.com |
264,739 | [
"https://physics.stackexchange.com/questions/264739",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/121988/"
] | Suppose a rod is moving at speed $v$ relative to me along its length.
$L_0 = {}$length of the rod in the frame in which the rod is at rest
$L = {}$length of the rod in my frame
Then $$L = L_0 \sqrt{1-\frac{v^2}{c^2}} $$
Let us now consider another scenario. I am moving towards a star at speed $v$. Then the distance be... | There is no frame in which "space" is at rest.
Using the length contraction formula
$$
L = L_0 \sqrt{1 - \frac{v^2}{c^2}}
$$
for the distance to the star is slightly misleading. The distance $L$ in your frame corresponds to two points, $x_0 = 0$ for you and $x_1 = L$ for the star, that you are observing simultaneously... | First: You've chosen to express "the distance from me to the star" as some formula involving a quantity called $L_0$ --- and then you've asked <b>us</b> to tell <b>you</b> what $L_0$ means. But you're the person who wrote down this expression, so only you can know what you meant by it.
Second: It's very hard to tel... | https://physics.stackexchange.com |
50,055 | [
"https://mechanics.stackexchange.com/questions/50055",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/34050/"
] | I just had a pad whose wear indicator broke off and so damaged the inside face of the rotor along the outer edge. I'm definitely going to get this rotor resurfaced, but should I resurface the drivers side? I don't think its necessary, since the calipers will apply individual pressure and I don't think a rotor on one si... | A newly resurfaced rotor may brake differently than a bedded in rotor. If different enough, you may find that the vehicle pulls to one side during braking. This would diminish over time, but could lead to the vehicle veering off, especially in a panic situation. I recommend having both rotors turned.
| The difference is so minimal that it's not going to make a difference; however, many modern cars these days have rotors that are so thin that resurfacing isn't possible.
If you do end up replacing the rotor, consider doing the pair just so you know that both sides are of the same make, model, wear etc.
| https://mechanics.stackexchange.com |
383,510 | [
"https://stats.stackexchange.com/questions/383510",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/229639/"
] | In the second edition of the book "Reinforcement Learning: an introduction" by Sutton and Bato page 323 (Policy gradient chapter) it says that:
"Perhaps the simplest advantage that policy parameterization may have over action-value parameterization is that the policy may be a simpler function to approximate."
Can any... | Consider a game on the positive half of the number line, where you start at some integer <span class="math-container">$k$</span>, and can move down by 1 or up by 1 each turn. The reward function is <span class="math-container">$f(x)$</span> for some monotonically decreasing function <span class="math-container">$f$</sp... | Simple rule, action-value would be a mapping to the discrete function while policy network would be mapping to the continuous field. A continuous function is simpler to approximate.
| https://stats.stackexchange.com |
21,657 | [
"https://dsp.stackexchange.com/questions/21657",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/1894/"
] | How can I measure the frequency response range of a piezoelectric disc below.
<img src="https://i.stack.imgur.com/4OETN.jpg" alt="piezoelectric disc">
I don't have an oscilloscope but I do know how to program in matlab / octave I was thinking of creating a swept signal in matlab and playing it through my laptop or ta... | I am afraid that it is rather impossible without a proper hardware. Sweep sine is ok as a general method, but you would either need:
<ul>
<li>Reference transducer with known (preferably) linear frequency response. Then you can find the difference between those two.</li>
<li>Signal actuator with known frequency respons... | You can do it with sound. You just need a flat response speaker which is very common in music production studios or even in houses where a DJ resides. These speakers ensure a flat response, that is, they do not deviate +/3dbs from the 100% flat reference. You also have to know that these speakers are usually flat in th... | https://dsp.stackexchange.com |
1,950,673 | [
"https://math.stackexchange.com/questions/1950673",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/366525/"
] | Bag A has $3$ white and $2$ black marbles. Bag B has $4$ white and $3$ black marbles.
Suppose we draw a marble at random from Bag A and put it in Bag B. After doing this, we draw a marble at random from Bag B, which turns out to be white. Given this information, what is the probability that the marble we moved from Ba... | <strong>HINT</strong>
Try working the problem a second time, replacing the exponential distributions with uniform distributions on $[0,1]$. (call these variables $Y$ instead of $X$). Stare at
$$
P(Y_{(2)}-Y_{(1)} > \alpha | Y{(1)} = y)
$$
and see if that expression contains a $y$.
Now with your exponential $X$s,... | The joint probability density function is: $$\quad f_{[X_{(1)}, X_{(2)}-X_{(1)}]}(y,z)
\\ = f_{[X_{(1)},X_{(2)}]}(y,z+y)~~
\\ = 2~f_X(y)~f_X(z+y)
$$
If we have independence this will be equal to the product: $$f_{X_{(1)}}(y)~f_{[X_{(2)}-X_{(1)}]}(z)$$
Is it?
| https://math.stackexchange.com |
29,653 | [
"https://stats.stackexchange.com/questions/29653",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1583/"
] | The likelihood ratio (a.k.a. deviance) $G^2$ statistic and lack-of-fit (or goodness-of-fit) test is fairly straightforward to obtain for a logistic regression model (fit using the <code>glm(..., family = binomial)</code> function) in R. However, it can be easy to have some cell counts end up low enough that the test is... | The sum of the squared Pearson residuals is exactly equal to the Pearson $\chi^2$ test statistic for lack of fit. So if your fitted model (i.e., the <code>glm</code> object) is called <code>logistic.fit</code>, the following code would return the test statistic:
<pre><code>sum(residuals(logistic.fit, type = "pearson")... | The Pearson statistic has a degenerate distribution so is not recommended in general for logistic model goodness-of-fit. I prefer structured tests (linearity, additivity). If you want an omnibus test see the single degree of freedom le Cessie - van Houwelingen - Copas - Hosmer unweighted sum of squares test as implem... | https://stats.stackexchange.com |
142,888 | [
"https://physics.stackexchange.com/questions/142888",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/60509/"
] | The variation with distance x along a wave of its displacement d at a particular
time.
<img src="https://i.stack.imgur.com/MyHpl.png" alt="enter image description here" />
A second wave has the same frequency and speed as the wave shown in Fig. 2.1 but
has double the intensity. The phase difference between the two wave... | This wave displacement (the y-axis of your graph) is tracing out a simple harmonic motion, i.e. oscillating between -A and +A in a sinusoidal fashion. A more illuminating way (which is more natural in fact) of imagining this would be to consider a wave in general any sinusoidal wave and look at the motion of any specif... | It means that the second wave is horizontally shifted by a half cycle (a 360 shift would not have any effect because it will be a full cycle). So in a 180 shift the peaks are in the positions of the troughs and viceversa
| https://physics.stackexchange.com |
123,965 | [
"https://chemistry.stackexchange.com/questions/123965",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/86060/"
] | I would like to ask how we can see entropy as an intrinsic property of molecules, namely as something depending also on their geometry (and not only as gross disorder). Is this what is called the "shape entropy" or there's no relation between the two concepts? Which are the parameters that determine this "geometric" or... | Chemical equilibrium is a type of dynamic equilibrium, but not every dynamic equilibrium is a chemical equilibrium.
In a chemical equilibrium there is no change on the macroscopic scale. That means that if you look at the system it seems like nothing is happening, but at molecular scale there are reactions going on an... | A <strong>chemical equilibrium</strong> concerns chemical reactions. There should be at least a forward- and backward reaction between two species but more complex systems with multiple individual reactions may occur. The important observation is that there is no macroscopic change to the chemical constituents of the s... | https://chemistry.stackexchange.com |
565,810 | [
"https://physics.stackexchange.com/questions/565810",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/148087/"
] | I am trying to understand why Taylor says in his Classical Mechanics text, "we can always subtract a constant from the potential without effecting any physics."
I assume "doesn't effect any physics" means the equations of motion are unaltered — as is the result of adding a total time derivative to a... | Yes, indeed the equations of motion are unaltered; clearly we consider potentials of the form <span class="math-container">$V(\mathbf q)$</span>, Hence, the only contribution to the Euler Lagrange equations done by the potential is in the term <span class="math-container">$\frac{\partial L}{\partial q}$</span>, since a... | You can add <span class="math-container">$\dot q=\frac{dq}{dt}$</span> to the Lagrangian without harm, and this has nothing to do with a potential.
Since the EOM are obtained from derivatives of the Lagrangian, adding any constant (to the potential energy or otherwise) will have no effect.
| https://physics.stackexchange.com |
3,769,694 | [
"https://math.stackexchange.com/questions/3769694",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/359649/"
] | Let <span class="math-container">$z=x+i y$</span> and <span class="math-container">$$ u(x,y) = Re \left(e^{-\frac{1}{z^{4}}}\right) ,~ \text{for}~ (x,y) \ne (0,0)$$</span> and <span class="math-container">$0$</span> otherwise. Then is there any short way to check that <span class="math-container">$u$</span> satisfies ... | That function is holomorphic and the real part of a holomorphic functions is always harmonic.
| function is not holomorphic at <span class="math-container">$z=0$</span>.
<span class="math-container">$z=0$</span> is a point of essential singularity.
| https://math.stackexchange.com |
224,583 | [
"https://softwareengineering.stackexchange.com/questions/224583",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/114968/"
] | I've been asked a theoretical design question with an eye upon the GoF patterns.:
"Given a design for a tree using a standard visitor pattern, how would your design look to allow a user to choose between om pre-order, in-order or post-order traversals?"
I'm thinkin of just letting the visitor be, but give the travers... | One thing about Visitor Patterns is misconception, that it is somehow tied to tree-like structure. Which is quite wrong. The question sounds as if it was doing just that. So first thing would be fixing this misconception. And then I would exactly like you said. Create 3 different iterators one for each type of traversa... | Maybe I'm missing something but don't you simply need different visitors for each of the traversal types, PreOrderTreeVisitor, InOrderTreeVisitor, PostOrderTreeVisitor with the visit method specific to the type of traversal. Probably you want them to take some action that could be applied to a node so that they, in ef... | https://softwareengineering.stackexchange.com |
87,842 | [
"https://mathoverflow.net/questions/87842",
"https://mathoverflow.net",
"https://mathoverflow.net/users/21202/"
] | hallo,
i have the following question. let $M$ be a Riemann surface and $R \subset M$ be a compact totally real manifold (1 dimensional real). Furthermore assume there is a holomorphic 2-form $\alpha$ on $M$. Can one find a solution $\varphi$ of the equation $\partial \bar{\partial} \varphi = \alpha$ in a neighbourhoo... | Because you are only interested in a neighborhood of $R$, you might assume that $M$ is (connected and) noncompact. A function $f$ satisfies $\partial \bar{\partial} f=0$ iff it is harmonic. Now pick an open cover $(U_i)$ of $M$ and local solutions $\phi_i$ of your problem.
The differences $\phi_{ij}:=\phi_i - \phi_j$ a... | In a comment above, marco asks whether this is true for larger $n$: That is to say, $M$ a complex $n$-fold, $R$ a totally real sub-real-$n$-fold and $\alpha$ a $(1,1)$-form on $R$. The answer is no for $n=2$.
Basic reason: Suppose that $\alpha = \partial \bar{\partial} f$. Then $\alpha = d ( \bar{\partial} f)$, so $\a... | https://mathoverflow.net |
2,360,272 | [
"https://math.stackexchange.com/questions/2360272",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/463841/"
] | How many words can be formed from all the letters of the word 'INITIAL' such that all words must have started and ended with letter 'I'?
| Just fix two $I's$ in front and last $$\{I,\_,\_,\_,\_,\_,I\}$$
Now you have five objects
$$\{N,I,T,A,L\}$$
And their permutation is $$5!=120$$
| 'INITIAL' has 7 letters.
You know that 2 of them have to stay at the beginning and at the end of the word, so 2 (<em>I</em>) letters and 2 (<em>start</em> and <em>end</em>) position are "blocked".
You need to think to the middle positions.
Middle positions are <code>5</code> and you have <code>5</code> letters.
So, yo... | https://math.stackexchange.com |
419,468 | [
"https://softwareengineering.stackexchange.com/questions/419468",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/222174/"
] | A problem been thinking on...
I'm on an application that involves two web maps, both showing the same data but in slightly different situations basically (say a different basemap or projection, etc)...
They both need to be in sync, so if I add some data to one the other should update. If I remove data from one, the oth... | I've encountered a similar problem in a project. Basically, having multiple views (on different devices) that relate in part to the same data, and in part data and actions specific to that view but are still connected via shared business logic.
Now, the exact solution for your problem depends heavily on what kind of ar... | It sounds like there is some canonical format for the data ("same data"), and then each of the map front-ends has its own in-memory representation for the purposes of interaction.
If you're able to use microservices in your application, you can separate the persistent storage of the map data into a separate s... | https://softwareengineering.stackexchange.com |
135,976 | [
"https://dba.stackexchange.com/questions/135976",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/92639/"
] | My office uses accountant programs which run on SQL Server 2008 R2. The SQL Server engine must be installed on one of the laptops (called "server") and the other laptops (called "clients") connect to it via local network. Database files are stored in the same place as the SQL Server engine, so on the "server" laptop. F... | To be honest, I wouldn't want my database on a NAS as it is most likely accessed throughout the office and it is also very vulnerable as everyone connects to it. Ideally, your SQL database should be hidden in the deepest parts of your network.
However, I seeing how this doesn't sound like a high end operation, I woul... | SQL doesn't support database files on SMB prior to 2012. Otherwise it would be possible but not recommended.
Your priority should be regular backups of system and user databases, which can be done to an SMB share (best way to do it actually!)
| https://dba.stackexchange.com |
61,683 | [
"https://softwareengineering.stackexchange.com/questions/61683",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/19454/"
] | I searched for a standard format for using a date/time as part of a file name and was unable to come up with anything.
My question is two parts:
<strong>Is using time stamps <del>to enforce unique</del> in file names a poor practice?</strong>
I could get the time from the creation date and serialize the file names ... | You should consider ISO 8601 format (2013-04-01T13:01:02). Yes there are standards for these things. The colons and hyphens may be omitted.
The format string I usually use is <code>%Y%m%dT%H%M%S</code> yielding 20130401T130102. Depending on requirements I omit values from the left. In a bash script I get the date w... | The format you are using is fine but if you want uniqueness and the time has no other meaning you may have concurrency problem in your application if the application is used by multiple users in the same time and they all cause files to be created in the same folder. If you just want uniqueness you may consider generat... | https://softwareengineering.stackexchange.com |
25,131 | [
"https://physics.stackexchange.com/questions/25131",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/3395/"
] | I have heard multiple estimates on the quantity of stars within our galaxy, anything from 100 to 400 billion of them. The estimates seem to be increasing for the time being. What are the main methods that are used to make these estimates, and why are there such large discrepancies between them?
| The estimates I've read are similar to yours: 200 to 400 billion stars. Counting the stars in the galaxy is inherently difficult because, well, we can't <em>see</em> all of them.
We don't really count the stars, though. That would take ages: instead we measure the orbit of the stars we can see. By doing this, we find ... | I've added this because I don't think the accepted answer is very clear. Estimating the number of stars in the Galaxy does not require any dynamical information for the stars, though that can then help to check the consistency of any Galaxy model.
Estimating the number of stars in the Galaxy relies mostly on two thing... | https://physics.stackexchange.com |
240,901 | [
"https://softwareengineering.stackexchange.com/questions/240901",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/98046/"
] | Sometimes while I'm editing something I see some useless code added by other developers, probably due to habit.
Editing this code will not make any difference, so is it appropriate?
In my specific case I'm talking about Java private fields like this:
<pre><code>private int aSimpleInt = 0;
private boolean myBool = fa... | Declaring values that would already have been assigned by the compiler is useless <em>for the behaviour of the program</em>. However, that isn't what you should be optimizing as a professional developer. Instead, you should maintain your code base in the state that <em>best supports ongoing development</em>.
If code ... | The purpose of code is not so much communicating with the machine, but with fellow developers, so that a program can be maintained and effort is not wasted. To me, redundant code is bad in the sense that it obscures the purpose of the program. The compiler does not get tired to read lines, but a human reader does.
L... | https://softwareengineering.stackexchange.com |
178,577 | [
"https://stats.stackexchange.com/questions/178577",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/28650/"
] | How can I get <code>p,d and q</code> values in <code>ARIMA(p,d,q)</code> model estimated by <code>auto.arima(mytimeseries)</code>?
<blockquote>
arima_model <- auto.arima(mytimeseries,ic='bic')
</blockquote>
If we look at the output of
<blockquote>
arima_model$arma
</blockquote>
we get,
<blockquote>
[1] 1 ... | Try this:
<pre><code>fit <- auto.arima(WWWusage)
arimaorder(fit)
</code></pre>
| If you look at the help file of <code>auto.arima</code> and navigate to the section "Value", you are directed to the help file of <code>arima</code> function and there you find the following (under the section "Value") regarding the <code>arma</code> slot:
<blockquote>
A compact form of the specification, as a vecto... | https://stats.stackexchange.com |
403,523 | [
"https://physics.stackexchange.com/questions/403523",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/92058/"
] | Like any manifold, the pseudo-Riemannian manifold of spacetime in special or general relativity is a topological space, so there is a notion of open sets (or equivalently, neighborhoods) that allows us to talk about continuity, connectedness, etc. We implicitly use this structure whenever we frame the equivalence princ... | There's no need to define the topology of the manifold from the metric. While a nice feature, the topology of the manifold is defined primarily by its atlas, which, from a physical perspective, correspond to the coordinates. A spacetime with a set of coordinates $\{ x^i \}$ will have a topology defined by the mapping o... | I don't know about "physically" what defines open sets since open sets are a (afaik) purely mathematical construction, but what defines the open sets on the spacetime manifold is simply the open sets in $\mathbb{R}^4$. Open sets in $\mathbb{R}^4$ gets mapped to open sets in the manifold by definition. The topology of m... | https://physics.stackexchange.com |
4,306 | [
"https://mechanics.stackexchange.com/questions/4306",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/2095/"
] | So after tightening my chain the other day I noticed a creaking noise - its seems there is a tight spot in the links. I have sprayed this with chain oil and let soak. I know I will need to replace the chain soon but is it ok to ride a few times? Will the stiffness 'iron out'?
Thanks!
| If you can get some penetrating lube similar to what you would on rusty bolts spray the offening link. This should help but only if the stiff link is due to rust or lack of lubrication. If the link was damaged it won't get better. In the U.S. we have Liquid wrench,SeaFoam, PB Blaster etc. you want something that is thi... | <strong>Your Question</strong>
<blockquote>
Motorcycle: stiff chain links - able to repair?
</blockquote>
<strong>The Answer</strong>
<strong><em>NO, this is not really repairable. Throw it away.</em></strong>
The reason why I say this is that the pins inside the castors or rollers are more than likely rusted to... | https://mechanics.stackexchange.com |
171,168 | [
"https://physics.stackexchange.com/questions/171168",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/7787/"
] | In one of my old notebooks, I found a problem which was basically about finding out resistance of a 100W light bulb (In my country electricity voltage is 220V). Then our teacher had used the equation $P=\large\frac{V^2}{R}$ as solution. He had substituted $P=100W$, and $V=220V$ and found $R=484\Omega$.
But isn't this ... | The thing to watch out for here is that it is easy to get into the habit of using sloppy language and/or notion for these things.
I'll try to be precise here.
It is <em>correct</em> to use the above relationship for the <em>instantaneous</em> power developed by a resistive component in a AC circuit
$$ P(t) = \frac{(... | <blockquote>
But isn't this solution wrong? I think it should be wrong, because we
are talking about AC here; That is, <strong>220V is peak voltage</strong>, not mean
voltage. I think that mean voltage is something below 220V, thus
resistance is going to be below 484 Ohms.
</blockquote>
If you do not live in c... | https://physics.stackexchange.com |
63,107 | [
"https://physics.stackexchange.com/questions/63107",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/21817/"
] | I'm stuck in an equation derivation of Ryder's QFT book.
Starting with Dirac's equation:
$$(i\gamma^\mu\partial_\mu-m)\psi=0$$
If I multiply by $i\gamma^\nu\partial_\nu$, I get:
$$((\gamma^\nu\partial_\nu)(\gamma^\mu\partial_\mu)+i\gamma^\nu\partial_\nu m)\psi=0$$
I should get:
$$(\gamma^\nu\gamma^\mu\partial_\nu... | First, to get the equation you want apply $(i\gamma^\nu\partial_\nu + m)$ to both sides, then on the left hand side you'll get
\begin{align}
(i\gamma^\nu\partial_\nu + m)(i\gamma^\mu\partial_\mu - m)\psi
&= (-\gamma^\nu\gamma^\mu\partial_\nu\partial_\mu-m^2)\psi
\end{align}
which, when set to zero, gives
$$
(\g... | Once you have shown,
$$
(\gamma^\nu\gamma^\mu\partial_\nu\partial_\mu + m^2)\psi = 0
$$
You can replace $\gamma^\nu\gamma^\mu$ with its symmetric part - because $\partial_\nu\partial_\mu$ is symmetric in $\mu\nu$, the antisymmetric part of $\gamma^\nu\gamma^\mu$ does not contribute.
$$
(1/2\{\gamma^\nu,\gamma^\mu\}\pa... | https://physics.stackexchange.com |
190,660 | [
"https://softwareengineering.stackexchange.com/questions/190660",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/84441/"
] | What is a :
<blockquote>
<strong>Key-Event Dispatcher ?</strong>
</blockquote>
in keyboard-interactive apps.
What does it really do ?
| Without more context it is hard to be sure, but usually that would be the small piece of code that receives the information "A key of the type X was just pressed/released/kept down for certain time" and then does whatever the program is supposed to to in response. (For instance, in emacs most letter keys trigger the ap... | it listens to all keyboard events and dispatches the events to those listeners that want it (characters to the text box, tab to the focus manager, shortcuts to the respective handler...)
this can be more efficient that everything listening to the keyboard and doing an if test, if the dispatcher uses (for example) a ha... | https://softwareengineering.stackexchange.com |
4,207,489 | [
"https://math.stackexchange.com/questions/4207489",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/772517/"
] | In my multivariable calculus class notes my teacher wrote the following:
<blockquote>
Let <span class="math-container">$f: \mathbb R^n \to \Bbb R$</span> be a function differentiable at <span class="math-container">$p \in \Bbb R^n$</span>, and let <span class="math-container">$v \in \Bbb R^n$</span>. Then:
<span class=... | Fix the point <span class="math-container">$p \in \mathbb{R}^n$</span>. Since <span class="math-container">$-1 \leq \cos(\theta) \leq 1$</span>, we have
<span class="math-container">$$-\Vert \nabla f(p) \Vert \leq \Vert \nabla f(p) \Vert \cos(\theta) \leq \Vert \nabla f(p) \Vert.$$</span>
Since <span class="math-conta... | The cosine maximum value is 1, attained when <span class="math-container">$\theta$</span> is an integer multiple of <span class="math-container">$2\pi$</span>, i.e. when <span class="math-container">$v$</span> points in the same direction as the gradient. If you move in that direction with unit speed the directional de... | https://math.stackexchange.com |
1,202,302 | [
"https://math.stackexchange.com/questions/1202302",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/185360/"
] | (=>) Suppose I - xx* is singular if and only there is a y such that (I−xx*)y=0, i.e. xx* y=y. Now set λ=x* y. Then y=λx, i.e. xx* λx=λx
Thus λx(x* x) = λx => x* x = 1
(<=) Suppose x*x = 1
Please help
| This doesn't require much more than Chebyshev's inequality. If $f \ge 0$ on a set $A$ and $\displaystyle \int_A f \, dx = 0$, then $f = 0$ almost everywhere on $A$, because
$$ m(A \cap \{f > 0\} ) \le \sum_{n=1}^\infty m(A \cap \{f > \tfrac 1n\})$$ and $$m(A \cap \{f > \tfrac 1n\}) \le n \int_A f \, dx = 0$$... | If you can use that $\{1, x, x^2, \cdots\}$ is $C_0$ dense in $C[0,2\pi]$ and $C[0, 2\pi]$ is $L^2$ dense in $L^2[0,2\pi]$, then
$$\int_E x^n \cos x dx = 0 \Rightarrow \int_0^{2\pi} x^n \chi_E \cos x dx = 0\Rightarrow \chi_E \cos x =0$$
almost everywhere. Thus $m(E) = 0$.
| https://math.stackexchange.com |
406,627 | [
"https://physics.stackexchange.com/questions/406627",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/101386/"
] | If I have 2 gases <span class="math-container">$A$</span> and <span class="math-container">$B$</span> which are at an initial state (<span class="math-container">$P_1$</span>,<span class="math-container">$V_1$</span>,<span class="math-container">$T_1$</span>), and one gas say <span class="math-container">$A$</span> is ... | The irreversible externally applied pressure does not have to be below the pressure for the reversible path over the entire process in order for the irreversible work to be less. The pressure for the irreversible process will typically start out lower (for example, you suddenly drop the externally imposed pressure to ... | In a reversible adiabatic expansion the gas does work against a piston, loses internal energy and therefore experiences a decrease in temperature. Therefore its pressure falls more than in an isothermal expansion between the same initial and final volumes. ($p=\frac{nRT}{V}$ in which not only $V$ increases, but $T$ dec... | https://physics.stackexchange.com |
141,052 | [
"https://softwareengineering.stackexchange.com/questions/141052",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/47989/"
] | I have a table with about 37 indexes. Would that be considered too many? What are some best practices regarding indexing?
EDIT: It is warehousing data, updated daily with new transactions. There are 47 million rows. 3 of the indexes are very necessary. The other 34~ are 'where' clause indexes intended to speed up qu... | One more index than you need is too many. One less is too little.
<blockquote>
I've tried searching for a case where having too many indexes was a
problem and couldn't really find anything
</blockquote>
You <strong>KNOW</strong> you have too many if your inserts are too slow, and the index used for reading are ... | there is no 'magic number'. Every index after 0 slows down insert/updates a bit, but that shouldn't stop you from creating needed indexes. 37 does sound like a lot, make sure you're not using unnecessary indexes. For example, usually if you have an index on columns A, B you don't need a separate index on A. Or if yo... | https://softwareengineering.stackexchange.com |
129,147 | [
"https://electronics.stackexchange.com/questions/129147",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/30934/"
] | I am designing an energy meter for electricity billing purposes by converting an analogue energy meter and counting the number of pulses given by the analogue meter's LED. Since power may be cut off any time, the number of pulses has to be stored in non-volatile memory. I saw the data sheets of Atmel EEPROM AT24C0X and... | I would not write every event to EEPROM. Most of the time you will have power, so keep the live count in RAM.
The amount of energy it takes to save the live value from RAM to EEPROM is pretty minimal. Use a capacitor to store enough energy to run the micro long enough after power fail is detected to copy the live da... | The solution to the problem is relatively simple. You accumulate the pulse count to a regular RAM location. Then once each 10 minutes you the copy the current value of the RAM based counter to EEPROM. Using this strategy an EEPROM with a one million cycle count endurance will last about 19 years. For most products this... | https://electronics.stackexchange.com |
184,932 | [
"https://stats.stackexchange.com/questions/184932",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/-1/"
] | This question is an aside from another question here on CV.
We know that the expectation of the product of two independent random variables is the product of expectations, i.e.,
$$\mathbb{E}[XY]=\mathbb{E}[X]\mathbb{E}[Y]$$
However, is there a conditionally equivalent version of this statement? For example, could ... | Your second equality is certainly untrue unless $X$ and $Y$ are independent.
An easy way to view it is that the left side of the equality is a number while the right side of the equality is in general a random variable. Keep in mind that the conditional expectations are random variables.
| A consequence of conditional independence is
$$E \left[ X Y | Z \right] = E \left[X|Z \right] E\left[Y|Z \right]$$
and the idea is often encountered in hierarchical models. Is that perhaps what you had in mind?
| https://stats.stackexchange.com |
470,192 | [
"https://physics.stackexchange.com/questions/470192",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/106070/"
] | In Mission Impossible Fallout, they're dealing with 3 plutonium cores. If one of those cores was thrown against a wall by Ethan Hunt, could it start a chain reaction and explode? For that matter, could any blunt force cause the nuclear reaction to initiate or would it require a radio active trigger?
| <strong>Yes</strong> <em>and</em> <strong>no</strong>. <em>Yes</em> to "phyisical force" construed generally, <em>no</em> to "thrown by a human".
The movie <em>is</em> referencing something legitimate, assuming that it has been relayed accurately here in that the core of the weapon is plutonium, and... | Blunt force over a limited area of fissionable material does not cause a nuclear explosion. Over the years there have been two main ways to detonate a fission bomb, neither of which requires a radioactive trigger.
The first way is to bring two sub-critical masses together to form a single critical mass, and that's al... | https://physics.stackexchange.com |
80,957 | [
"https://security.stackexchange.com/questions/80957",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/60935/"
] | The other day I was talking with a service provider (MSSP) who has experience with operating SOC (security operations centre) 24x7. Their price was rather steep (in the millions range). I don't understand why it would be so steep. My impression of a SOC is:
<ol>
<li>getting a log collector such as HP ArcSight</li>
<li>... | A tool like HP ArcSight can be customized very deeply, and just writing the right use cases and rules to correlate relevant events and alert on meaningful incidents, is super hard. Many organizations fail miserably implementing ArcSight.
Just getting raw logs through connectors to logger and then to ESM, and then wri... | I wish setting up a SOC was that simple. I have experience setting up an MSSP where we provided SOC as a Service to numerous clients and helped some of the clients to set up their own SOC.
The questions you are asking look great but they are mostly covering just the technical part of the SOC setup. Secondly, it is goin... | https://security.stackexchange.com |
34,574 | [
"https://physics.stackexchange.com/questions/34574",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/11527/"
] | I have just a little confusion on some formalism in QM. I have a Hamiltonian density function, $h(x)$, where the regular Hamiltonian is given by
$$
H(x) = \int d^{3} \vec{x} \ h(x)
$$
I'm wondering, if I am in a situation where I need to act the Hamiltonian on some function, would this function go inside the integra... | I think you are just mislabeling things and getting yourself confused. You wouldn't ever write anything like
$ H(x) = \int d^3 x h(x)$
since you are performing a definite integral on the RHS of the equation with limits of $\pm \infty$ (an integral over all of space).
What you might be thinking of for the Hamilton... | Adding on to what DJ wrote, the proper way to write the Hamiltonian acting on something else would be:
$$H(t)\phi(x) = \int d^3y\; h(y,t) \phi(x) $$
That is, we can still write it in terms of an integral, we just have to be careful about what is a dummy variable and what is a free variable.
| https://physics.stackexchange.com |
308,972 | [
"https://physics.stackexchange.com/questions/308972",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/139880/"
] | I do not see how such a process is possible, given that the volume of an ideal gas is supposed to depend solely upon its pressure and temperature. However, one of the problems I recently tried talked about the change in entropy of a system undergoing exactly such a process. What am I missing?
| I think the process you are talking about is free expansion of ideal gas in vaccum.
Consider a cylinder mounted with piston, at t=0 it is put in vaccum and set into motion.
Now since the external pressure is zero, the gas expands freely. Here the process is isobaric since <strong>external</strong> pressure is const =... | Your question can be generalized to any kind of system, not only pure gas but also multicomponent real systems, which have a fixed composition. For all these systems, imposing two variables such as pressure and temperature leads to unique values of all other system's properties, including its volume. Therefore, an isot... | https://physics.stackexchange.com |
9,109 | [
"https://dsp.stackexchange.com/questions/9109",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/4553/"
] | I have these values,
m2 = 1 -1 -1 1
w2 =-1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1
Im about to multiply m2 with w2
Should i multiply m2 with all of w2
(1 * -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1)
(-1 * -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1)
(-1 * -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -... | I agree with @MattL when he says that the OP could have given more detail.
There are two different ways of interpreting what the OP has said, and the first,
which is the one chosen by Matt, is that the spreading code $w2$ is actually just
$$-1\ -1\ +1\ +1$$ and what is happening is that the spreading code or its com... | You could have given a bit more background and explanation in your question, but as far as I understand your question, $m2$ is your data and $w2$ is the spreading code. The spreading ratio is 4 because the length of the spreading sequence is four times the data length. So you have to stretch out your data by a factor o... | https://dsp.stackexchange.com |
52,116 | [
"https://cs.stackexchange.com/questions/52116",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/44463/"
] | I am programming <strong>CPU cache simulator</strong> and I am supposed to implement removing of entries. I will not use LRU but just random.
I am not really clear, when should I call the removing function? When cache <em>(2 or 4 caches)</em> are full and CPU wants to write into cache where all <em>(data and tag)</em>... | Cache lines are evicted :
<ul>
<li>When the OS requests it, it may occur for example in non cache-coherent systems when a peripheral does a DMA transfer (direct transfer from a peripheral to main memory), or if the CPU is shut down to save its state to RAM...</li>
<li>When all the ways of the cache are already used fo... | The simple (possibly, overly simplified) answer is that you need to remove entries whenever a new entry is to be written to the cache, but the cache is full.
That is, if there is a memory access which is a miss and the record is brought to the cache from the main memory, but there is no place to put the new record (al... | https://cs.stackexchange.com |
2,114 | [
"https://engineering.stackexchange.com/questions/2114",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/941/"
] | We have a simple class 1 lever:
$$\begin {array}{c}
\text {5,000 kg} \\
\downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarrow \, \downarro... | Since the mass is 5k kg and the lever is 5m, this makes it quite easy to simplify because it is exactly 1k kg per m.
The leftmost 2k kg (2m) of the mass has its center of mass exactly above the fulcrum so can be ignored as it provides no contribution to the moment. This leaves 3k kg (3m) spread from 1m to 4m on the ri... | In any continuous situation, you simply use integration. The linear mass density of your block is $\lambda=\frac{m}{\ell}=$1000 kg/m. Now you can express the torque due to an infinitesimal slice of the rod of width $dx$ at position $x$ as
$$
d\tau=(\lambda dx) * x * g
$$
where $x$ is measured from the fulcrum. Final... | https://engineering.stackexchange.com |
316,190 | [
"https://math.stackexchange.com/questions/316190",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/63888/"
] | I'm going through the introduction to Apostol's Calculus and am trying to prove the theorems that he gives.
Would this be an example of an acceptable proof?
<blockquote>
THM 1.9 If $a\neq (0)$ then $b/a = b \cdot a^{-1}$
</blockquote>
Proof:
<blockquote>
=$\frac ba = b\cdot a^{-1}$
<blockquote>
Multip... | Three complete sentences in one paragraph.
<blockquote>
By definition, we have $a\cdot a^{-1}=1$. If we multiply by $b$ both sides of this equation, we see that $(a\cdot a^{-1})\cdot b=1\cdot b=b$ and then, associating differently the first member of this last equality, that $a\cdot (a^{-1}\cdot b)=b$. It follows t... | Once you have <em>proved</em> that $\rm\: a(ba^{-1}) = b,\:$ then you can conclude by saying: by the <em>uniqueness theorem 1.8,</em> for solutions of $\rm\:a x = b,\:$ we deduce that $\rm\:ba^{-1}\! = b/a.\:$ The proof should <em>explicitly</em> say that it invokes a uniqueness theorem (a standard and powerful way of... | https://math.stackexchange.com |
3,546,071 | [
"https://math.stackexchange.com/questions/3546071",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/726051/"
] | This question seems simple but it's been eating me for 20 mins. on a book I seen something like this :
<span class="math-container">$$
\sum_{k=8}^{\infty}\left(\frac{5}{6}\right)^{k-1}\frac{1}{6} = \frac{1}{6}\left(\frac{5}{6}\right)^{7}\sum_{j=0}^{\infty}\left(\frac{5}{6}\right)^{j}
$$</span>
Could anyone tell me why ... | If in doubt, write the terms out explicitly ... lets leave the <span class="math-container">$1/6$</span> out
<span class="math-container">\begin{eqnarray*}
\sum_{k=8}^{\infty}\left(\frac{5}{6}\right)^{k-1} &=& \left(\frac{5}{6}\right)^{7} + \left(\frac{5}{6}\right)^{8} + \left(\frac{5}{6}\right)^{9} + \cdots \... | Breaking it down to simpler steps.
<span class="math-container">$$\begin{align}
\sum_{k=8}^{\infty}\left(\frac{5}{6}\right)^{k-1}\frac{1}{6} ~&=~ \frac{1}{6}\left(\frac{5}{6}\right)^{7}\sum_{k=8}^{\infty}\left(\frac{5}{6}\right)^{k-8}&&\text{distributing out constant factors}
\\[1ex]&=~ \frac{1}{6}\lef... | https://math.stackexchange.com |
396,622 | [
"https://softwareengineering.stackexchange.com/questions/396622",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/319425/"
] | I have a simple service that fetches an article from the repository. If it finds it then it returns it otherwise throws an exception. In short the function is totally dependent on the database interactions.
<pre><code>public class ArticleService {
private ArticleRepository articleRepo;
public Article getArti... | <blockquote>
Here even the unit tests seem to be dependent on the stubs. A part of my brain says that this is an <code>integration test</code> rather than <code>unit test</code>.
</blockquote>
<code>ArticleService</code> is dependent on an instance of <code>ArticleRepository</code>. Whether a test involving <code>Ar... | If you are unit testing ArticleService you should inject a mock ArticleRepository. No need for a database.
But, as you say, you have almost zero logic in ArticleService. So the test doesnt test much.
If you are testing ArticleRepository on the other hand, mocking the database probably isn't something you want to do. ... | https://softwareengineering.stackexchange.com |
70,582 | [
"https://physics.stackexchange.com/questions/70582",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/26828/"
] | Since most light sources in games are point-like, it's pretty difficult to approximate area light sources with point sources. As triangles are a universal form to represent 3D models (thus area light sources too), I stumbled upon a task consisting in finding the total illuminance at some point in 3D space from a unifor... | As Prahar says, you just calculate the Ricci scalar $R'$ following the usual definition – the double contraction of the Riemann tensor – which is calculated from the Christoffel symbols and its derivatives where the metric $\gamma'$ expressed as $\exp(2\omega)\gamma$ is substituted everywhere. It will probably not fit ... | I realise that this answer comes many years after the question was first asked and answered, but as I am probably not the last one struggling with this, I thought it might be worthwhile giving it anyway.
Building on Luboš explanation that by covariance the result needs to be of the form <span class="math-container">$g... | https://physics.stackexchange.com |
640,458 | [
"https://physics.stackexchange.com/questions/640458",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/300458/"
] | I really want to know that how does battery create a potential difference across the circuit. When we cross the battery from its negative terminal to positive terminal the potential rises by the voltage mentioned on the battery . So what exactly happens between the terminals so that the potential rises ?I know that the... | This is dealt with in the field of <em>electrochemistry</em>. Here is a simplified explanation:
Chemical reactions involve the outermost electrons of the reactant atoms and some of those reactions can be modeled as one atom "giving" an electron to another.
There are certain types of such chemical reactions in... | On top of the enlightening question already given above, let me state how I imagined the fact that electrons are held in one place (at the negative pole). The electrons are pushed through a one-way exit, of which the door opens only in one direction (to the outside). If they are out they can't get back in anymore. If t... | https://physics.stackexchange.com |
218,994 | [
"https://dba.stackexchange.com/questions/218994",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/161951/"
] | I am trying to write a cursor. I have created a table for capturing login name and time from sys.dm_exec_sessions. Now, I need to write a cursor to update the login time to last login time if the login already exists and insert a row in case login does not exists in my table. I have come up with following, but unfortun... | I think that error is being generated because of this line
<pre><code>If (Select Login from [dbo].[LoginsForDBUserList]) = @log
</code></pre>
Multiple rows are being returned from the left side of the equal sign and is attempting to be compared to the single value <code>@log</code>.
I've made some adjustments to yo... | @Scott has already given the answer to your question. But I hope you can ditch that cursor and use a SET based code here.
<pre><code>UPDATE a
SET LastLoginTime = b.login_time
FROM [dbo].[LoginsForDBUserList] a
JOIN sys.dm_exec_sessions b
ON a.login = b.login_name;
IF EXISTS ( SELECT 1
... | https://dba.stackexchange.com |
210,456 | [
"https://stats.stackexchange.com/questions/210456",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/114271/"
] | I have a study which provides the mean difference for two groups (alongside 95%CI, SE, n and p-value). I would like to extrapolate the raw means to use in Revman to perform a random-effect SMD meta-analysis. Can I extrapolate the raw means from the MD?
| This is tantamount to asking whether, if you knew $x + y = 20$, can you identify $x$ and $y$ uniquely. The answer is, of course, no. There are infinitely many possible solutions.
| If RevMan is computing the mean difference internally then it may be that you can supply any two means which have the required mean difference. Try it and see. More specifically if the mean difference you have is 10 then run it with 0 and 10 and then again with 990 and 1000. If RevMan gives you the same answer then you... | https://stats.stackexchange.com |
490,847 | [
"https://math.stackexchange.com/questions/490847",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/41672/"
] | I am trying to understand a statement in Brown's <em>Topology and Groupoids</em>, 7.2.5 (Corollary 1), page 270.
Let's first have some preliminary remarks
Let $X,Y$ be topological spaces. The <em>track groupoid</em> $\pi Y^X$ is defined as the groupoid whose objects are the maps $f:X\to Y$ and morphism in $\pi Y^X(f... | Let $i:A\rightarrow X$ be a cofibration and $Y$ a topological space.
With 7.2.5 (Lemma) on page 269 we
find:
<blockquote>
$\text{cls }H\left(i\times1\right)=\left\{ H'\left(i\times1\right)\mid H'\in\text{cls }H\right\} $
for every homotopy $H:X\times\mathbb{I}\rightarrow Y$.
</blockquote>
Let $F:u\simeq v$
fo... | The lemma 3 is deeper than it looks : in there you have to prove that if there is an homotopy $G : f \to g$ such that $i^*(G) = F : u \to u$ is homotopic to $id_u$, then there is an homotopy $G' : f \to g$ that is above $i$ and $u$.
From an homotopy $H : F \to id_u$ and a pullback $G : f \to g$ of $F$, you can pullbac... | https://math.stackexchange.com |
1,603 | [
"https://scicomp.stackexchange.com/questions/1603",
"https://scicomp.stackexchange.com",
"https://scicomp.stackexchange.com/users/1136/"
] | I hope this is the right stackexchange for this question; if not, please direct me there!
I'm on Linux. I've installed IPOPT and AMPL, and all the third-party stuff required: ASL, HSL, Lapack, Metis, Mumps.
When I run the solver from AMPL with binary or integer variables, IPOPT converts them to continuous. Does anyon... | IPOPT is <strong>not</strong> for integer programs so this is the rigth thing to do as far as IPOPT is concerned.
If you really have a MINLP problem at hand then try a MINLP solver. IPOPT is an NLP solver.
Since I do not solve MINLP (Mixed Integer NonLinear Programming) problems I could only Google too. Hopefully, so... | I think the above answer (by Ali) is correct, so I am trying to offer some alternatives.
Mixed Integer, non linear, Problems are difficult to solve. While the terms "non linear" covers a wide view of problems in general, mixed integer linear problems are better researched (as far as I know).
Open source software you... | https://scicomp.stackexchange.com |
58,264 | [
"https://cs.stackexchange.com/questions/58264",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/29312/"
] | <em>In this question, we abuse the mathematical notation to express bitwise operations in the following way:</em>
<ul>
<li><em>$\ll$ is a binary left shift</em></li>
<li><em>$\oplus$ is a bitwise XOR</em></li>
<li><em>$0b1, 0b110, 0b10 \ldots$ are used to denote raw bits</em></li>
<li><em>$repr$ is a function associat... | Yes, bit shifts distribute over all bitwise logical operations $\odot$ for which $0 \odot 0 = 0$,* in the sense that: $$(a \odot b) \ll n = (a \ll n) \odot (b \ll n)$$ and: $$(a \odot b) \gg n = (a \gg n) \odot (b \gg n).$$ In particular, these identities hold true for bitwise AND, OR and XOR.
To show this, let $x_k$... | Shift is right-distributive over XOR, and over many other operations as well (AND, OR, addition, min, max)
As for why, informally for the bitwise operations I'd explain it as: bitwise operations are like pointwise operations (if you view a number as a function from bit index to the bit at that index), translating (or ... | https://cs.stackexchange.com |
376,431 | [
"https://mathoverflow.net/questions/376431",
"https://mathoverflow.net",
"https://mathoverflow.net/users/8628/"
] | Let <span class="math-container">$\beta\omega$</span> be collection of all ultrafilters on <span class="math-container">$\omega$</span> (principal and non-principal). We endow <span class="math-container">$\beta\omega$</span> with an operation <span class="math-container">$+$</span> in the following way. For <span clas... | No. Kunen proved that there are many weak P-points in <span class="math-container">$\beta\omega-\omega$</span>, which means they are nonprincipal ultrafilters that are not in the closure of any countable set of other nonprincipal ultrafilters. In particular, a weak P-point is never a sum of nonprincipal ultrafilters be... | Write <span class="math-container">$(\alpha x)\ P(x)$</span> for the statement <span class="math-container">$\{x:P(x)\}\in\alpha$</span>. Now suppose that the set <span class="math-container">$\{1,2,4,8,\dots\}\in\alpha$</span>. If <span class="math-container">$\beta+\gamma=\alpha$</span>, then <span class="math-contai... | https://mathoverflow.net |
178,053 | [
"https://electronics.stackexchange.com/questions/178053",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/79276/"
] | I am writing data to eeprom AT24C16 using PIC microcontroller pic18f4520. Every address of this eeprom can hold 8-bits while I am using long int's to store data that are 16-bit in size. How to break long int into 2 8-bit parts to write them and how to get them back together after reading from eeprom??
| In C, you can use bit-shift and masking to extract each byte of a longer number:
<pre><code>lower_8bits = value & 0xff;
upper_8bits = (value >> 8) & 0xff;
</code></pre>
And you can 'reassemble' the number from bytes by doing the reverse:
<pre><code>value = (upper_8bits << 8) | lower_8bits;
</code... | <pre><code>long int my16bitdata = 0xEA51;
int MSB, LSB;
MSB = (my16bitdata>>8) & 0xFF;
LSB = my16bitdata & 0xFF;
</code></pre>
In this case the outcome would be:
<pre><code>MSB = 0xEA
</code></pre>
and
<pre><code>LSB = 0x51
</code></pre>
Explaination:
By perfoming a bit shift(>>) operation on the... | https://electronics.stackexchange.com |
338,124 | [
"https://softwareengineering.stackexchange.com/questions/338124",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/256827/"
] | We have an enterprise application. Maven build, about 20 submodules with more submodules. We have a dedicated Ops (operations) which deploys our application to 10 clusters. Installations are running different versions, about 5 customers total. Language Java. We are actively developing all parts of the application so ev... | Use a tiered approach (not all tiers are necessary):
<ol>
<li>Load base properties from classpath.</li>
<li>Override with properties from <code>/opt/app/conf</code>, IFF such a file exists.</li>
<li>Override with properties from <code>$HOME/app/conf</code>, IFF such a file exists.</li>
<li>Override with properties spe... | One thing you might want to consider is moving away from war files and running Tomcat as an embedded application. Once you've done this, you can easily solve this problem by making the path to the global config an optional argument to the program. Ops won't need to worry about it and the developers have a simple dire... | https://softwareengineering.stackexchange.com |
4,015,828 | [
"https://math.stackexchange.com/questions/4015828",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/784963/"
] | There are two bags A and B. Bag A has 2 green marbles and 3 red marbles. Bag B has 2 green marbles and 3 blue marbles. Two marbles are drawn without replacement from bag A and put in bag B. Then two marbles are drawn without replacement from bag B and put in bag A. Let X be the number of green marbles in bag A after th... | I would chose a different substitution:
<span class="math-container">$$I =\int \big(x^3 +\frac{1}{x^3} \big)^{\frac{1}{3}}dx$$</span>
<span class="math-container">$$=\int \frac{(x^6 +1)^{\frac{1}{3}}}{x} dx $$</span>
Let: <span class="math-container">$ u=(x^6+1)^{\frac{1}{3}} $</span>, then:
<span class="math-container... | Continue with
<span class="math-container">$$I=-\frac 1 6 \int(v-1)^{-\frac 4 3}v^{\frac 1 3} dv
= -\frac 1 6 \int \frac1{v-1} \sqrt[3]{\frac v{v-1} } dv
$$</span>
and let <span class="math-container">$t^3 = \frac v{v-1}$</span>. Then, the integral becomes
<span class="math-container">\begin{align}
I &= \frac12 \in... | https://math.stackexchange.com |
451,297 | [
"https://physics.stackexchange.com/questions/451297",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | While listening to an FM radio station (frequencies between 88 and 108 MHz) in my car, I've noticed that as I pull up to a red light, there's an increase in the amount of noise. It's very noticeable when I'm listening to a station that's somewhat far away, so I'm at the edge of the region in which reasonably noise-free... | At those intersections there are sensors buried in the asphalt which detect the presence of cars waiting for the light to change. The sensor is a large circular coil of wire which is fed a high-frequency AC signal at which the coil is resonant. When a car is situated above the coil, the iron in its frame and engine blo... | I am not convinced by @Niels' answer - at least as far as the UK is concerned. I worked as a software engineer for a UK traffic-signals company 1976 - 2008. The signals certainly had sensors which worked by detecting the de-tuning of the loops in the road; but the detecting circuits remained active all the time (and du... | https://physics.stackexchange.com |
119,717 | [
"https://stats.stackexchange.com/questions/119717",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/58436/"
] | I'm working on this question and it's stumping me.
<blockquote>
Let $S_n = X_1 + \ldots + X_n$ (with $n>=1$) be a random walk with $X_1, \ldots, X_n$ be iid RV's.<br>
$$
E(X_k)=\mu,\,{\rm Var}(X_k)=\sigma^2.
$$
Find the covariance of $S_n$ and $S_m$
</blockquote>
Can anyone help out? I am trying to use the ... | The trick is to use the <strong>bilinearity of the covariance function</strong>. For <em>any collection</em> of random variables $X_i$, $i=1,\ldots,n$ and $Y_j$, $j=1,\ldots,m$:
$$
\mathrm{Cov}\left(\sum_{i=1}^n X_i,\sum_{j=1}^m Y_j\right)=\sum_{i=1}^n\sum_{j=1}^m\mathrm{Cov}\left(X_i, Y_j\right).
$$
Now, for your case... | For a direct derivation using ${\rm Cov}[S_n, S_m] = E[S_nS_m] - E[S_n]E[S_m]$
we have
$$E[S_n]E[S_m] = n\mu\cdot m\mu = nm\mu^2$$
and
$$S_nS_m = \left(\sum_{i=1}^n X_i\right)\left(\sum_{i=1}^m X_i\right) = \sum_{i=1}^{\text{min}(m,n)} X_i^2 + \sum_{i\neq j} X_iX_j$$
where the number of terms in $\sum_{i\neq j} X... | https://stats.stackexchange.com |
596,409 | [
"https://stats.stackexchange.com/questions/596409",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/373088/"
] | Let <span class="math-container">$X_1,X_2,...,X_n$</span> and <span class="math-container">$Y$</span> be random variables. I know that:
<span class="math-container">$$\label{aaa}\tag{I}
E\left[\sum_{j=1}^n X_j \Bigg | Y \right]=\sum_{j=1}^n E\left[ X_j \Big | Y \right] $$</span>
Now, suppose that <span class="math-c... | Because <span class="math-container">$\sum_{j = 1}^Y E[X_j|Y]$</span> is <span class="math-container">$\sigma(Y)$</span>-measurable, to show it is the conditional expectation as desired, it is sufficient to show for any <span class="math-container">$n \in \{1, 2, \ldots\}$</span>, it holds that (this is because any <sp... | The most immediate is to apply the formula: <span class="math-container">$E[f(X,Y)|Y=y]=E[f(X,y)|Y=y]$</span>. So: <span class="math-container">$$E\left[\sum_{1}^{Y}X_i\bigg|Y=y\right]=E\left[\sum_{1}^{y}X_i\bigg|Y=y\right]=\sum_{1}^{y}E\left[X_i\bigg|Y=y\right]$$</span>
| https://stats.stackexchange.com |
1,246,694 | [
"https://math.stackexchange.com/questions/1246694",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/185308/"
] | This is the solution provided:
$$C(k+n-1,n) \times n!$$
I know that $C(k+n-1,n)$ denotes the number of ways n indistinguishable books can be placed on k distinguishable shelves. But I'm not too sure how multiplying that by $n!$ will give us the solution to the question :/
On a side note, when we are given a questio... | There are $n!$ ways to choose an order for the books. Once chosen this order, we have to place $k-1$ bars between the books to determine where ends a shelf and begins the next one. This is like rearrange a set of $n$ books and $k-1$ bars, and there are $\binom{n+k-1}{n}$ ways to do this.
| As an incentive to further study here is an answer using species. The species under consideration is
$$\mathfrak{S}_{=k}(\mathfrak{S}(\mathcal{Z}))$$ which yields the exponential generating function $$\frac{1}{(1-z)^k}$$ for an answer of
$$n! [z^n] \frac{1}{(1-z)^k}$$
which is
$$n!\times {n+k-1\choose n}.$$
| https://math.stackexchange.com |
33,627 | [
"https://physics.stackexchange.com/questions/33627",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/11059/"
] | Okay. I have two ways of working out the height of the atmosphere from pressure, and they give different answers. Could someone please explain which one is wrong and why? (assuming the density is constant throughout the atmosphere)
1) $P=h \rho g$, $\frac{P}{\rho g} = h = \frac{1.01\times 10^5}{1.2\times9.81} = 8600m$... | This is really the same as Adam's answer but phrased differently.
Suppose you have a single wire and you connect it to a battery. Electrons start to flow, but as they do so the resistance to their flow (i.e. the resistance of the wire) generates a potential difference. The electron flow rate, i.e. the current, builds ... | They don't. Electrons follow the path of least resistance in the same way that water flows downhill. The electrons do not act collectively, each individual electron is driven away from other electrons, and driven toward positive charges. The collective result is well described by the statement that they follow the p... | https://physics.stackexchange.com |
290,194 | [
"https://softwareengineering.stackexchange.com/questions/290194",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/143947/"
] | Just curious, from a syntax parsing perspective, why does Scala actually require parentheses around the condition of an <code>if</code> statement, given that the only thing allowed after <code>if</code> is <code>(</code>?
| The parentheses don't only delimit where the condition starts; they also indicate where it <em>ends</em>.
You're right that technically, only the right parenthesis is necessary to resolve ambiguity. But language designers are aesthetically motivated, and having only one of a matched pair of characters would look just... | Scala is designed not only to be interoperable with its host platform technically, but also socially, i.e. it is designed to be familiar to existing programmers of the host platform. And on almost all the host platforms that the Scala community could potentially be interested in (JVM, CLI, ECMAScript, Objective-C/Core ... | https://softwareengineering.stackexchange.com |
154,735 | [
"https://stats.stackexchange.com/questions/154735",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/78461/"
] | I have been trying to figure out the following question:
<blockquote>
A private company has submitted bids on two separate federal government contracts. The company president believes that there is a 45% probability of winning the first contract. If the win the first contract, the probability of the winning the seco... | $P((A\cap B^c) \cup (A^c\cap B))=\\
P(A)P(B^c|A)+P(A^c)P(B|A^c)=\\
0.45(1-0.7)+(1-0.45)0.5\\=0.41$
To justify the transition from first line to second line remember that
$(A\cap B^c) \cap (A^c\cap B)=\\
(A\cap A^c) \cap (B\cap B^c)=\emptyset$
| <blockquote>
I know $P(A \cap$$ B^c)=P(A) \times P(A|B^c)$
</blockquote>
I think you got it wrong :
$P(A \cap$$ B^c)=P(A) \times P(B^c|A)$ is the formula you want (and the formula that you need as you know the value of each component).
<blockquote>
$P(A|B^c)$which is the same as $P(B^c|A)$
</blockquote>
This a... | https://stats.stackexchange.com |
541,754 | [
"https://physics.stackexchange.com/questions/541754",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/1011/"
] | If we increase voltage, we are increasing energy per coulomb. How does it increase the number of coulombs per second (current)?
| <blockquote>
If we increase voltage, we are increasing energy per coulomb.
</blockquote>
Consider another way of looking at voltage, as a summary of the electric field along a path between two points
<span class="math-container">$$V_{ab}=-\int_a^b {\bf E}\cdot d{\bf\ell}$$</span>
This means if you have two fixed p... | <em>In short:</em>
Think of voltage as an "electric pressure" on the charges. The higher the voltage, the higher the "pressure" that pushes them - so naturally, the higher is their speed, which is what we call current.
<hr>
<em>Longer version:</em>
<ul>
<li>We all know that a ball wants to fall down from a shelf. T... | https://physics.stackexchange.com |
595,719 | [
"https://physics.stackexchange.com/questions/595719",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/275227/"
] | Lets say I have ice of mass <span class="math-container">$m_i$</span> and initial temperature <span class="math-container">$T_i$</span> and specific heat <span class="math-container">$s_i$</span> . And I have water of mass <span class="math-container">$m_w$</span> and initial temperature <span class="math-container">$T... | You actually have to consider all 3 cases: all the ice melts, all the water freezes, or you end up with a mixture of ice and water. Also, it is much more convenient to work with the first law of thermodynamics in solving this. Because we are assuming that this system is isolated, it tells us that the change in inter... | Assume the end-temperature to be <span class="math-container">$T$</span>. Your expression for <span class="math-container">$Q_1$</span> is then wrong.
The ice will heat from <span class="math-container">$T_i$</span> to <span class="math-container">$0$</span>, then absorb latent heat of melting, then the melted water wi... | https://physics.stackexchange.com |
566,141 | [
"https://physics.stackexchange.com/questions/566141",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/234445/"
] | We know that Electric field or electric force acts on charges at rest and magnetic force acts on charges in motion. But when we combine these two we get what we call as <em><strong>Lorentz force.</strong></em> So I want to know that how can these two forces act on the same charge. Either it should be that <strong>E.F a... | There should be no "should" in
<blockquote>
<blockquote>
Either it should be that E.F acts on the charge (if at rest) or M.F (if in motion).
</blockquote>
</blockquote>
Namely as mentioned in the comments, any particle which is electrically charged feels a force due to an electric field <span class="math-cont... | Lorentz Force is given as:
<span class="math-container">$$\vec{F}=q\vec{E}+q\vec{v}×\vec{B}$$</span>
The magnetic force will only act on the charge when <span class="math-container">$\vec{v} \neq 0$</span> and the angle between velocity and Magnetic field is not the integral multiple of <span class="math-container">$\p... | https://physics.stackexchange.com |
54,950 | [
"https://mechanics.stackexchange.com/questions/54950",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/38155/"
] | I need to replace one rim on my ford focus the tires I have on it currently are 195/60R15, I have another tire on a rim the numbers on the tire are 195/65R15 can I mount the 195/60R15 tire onto the rim that has the 195/65R15 tire.
To put it simply does the R15 mean 15 inch rims?
Any help would be greatly appreciate... | Will it mount? Yes.<br>
Are they the same? Maybe.<br>
There are a few other specification to the rim other than the diameter.<br>
Width<br>
Backspacing<br>
Number of lug holes<br>
Lug hole spacing<br>
Center bore diameter
You should be quickly see if they are the same lug pattern measuring the distance between the... | 195 is the with of the tire in millimeters(mm). 60 or 65 is the percent of the sidewall height relative to the width also in mm. At 60 the sidewall height is 117 mm, at 65 the sidewall is 126.75mm. A difference of 9.75 mm. A change of diameter of 19.5 mm or a hair over 3/4 ". Change in circumference of tire 2.355 " . 1... | https://mechanics.stackexchange.com |
72,823 | [
"https://security.stackexchange.com/questions/72823",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/60699/"
] | Before launch of a project, I reset the server's mysql root password. The colo that is hosting project wants the server's root database password stored in the .my.cnf file, in plain text, with the permissions set to 400. I just can't see how that is good security practice, but he said that it was something that was bei... | Of course any password that is stored in plain text is a bad idea but the location of the file is in /etc/my.cnf so if a remote user had access to that file I think there would be more things to worry about than having your mysql password stolen. On the other hand if you are not the only one who has physical access to ... | I am sorry but if they told me they wanted me to plain text my database password I would say "nope". Now I have heard on cPanel servers running phpMyAdmin use that file to install and uninstall Site Software, which I sorta understand, still think it can be done better. I have never placed my DB password in the .my.cnf ... | https://security.stackexchange.com |
44,507 | [
"https://dba.stackexchange.com/questions/44507",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/10681/"
] | We have an <code>.exe</code> file on a server, say <em>Server1</em> which should be run from a SQL Server job that exists on a different server, e.g.: <em>Server2</em>. How can it be done?
I know if it's a local file, I can use <code>xp_cmdshell</code> in the Job step and run the <code>.exe</code> file, but in our cas... | You could do this with an OLAP system - some of the benefits of SSAS for this type of application include:
<ul>
<li>SSAS can readily scale out - especially as this is a read-only application with no requirements for cube writeback.</li>
<li>Aggregations can be tuned to minimise the I/O allowing the cubes to be tuned f... | SSAS is a <em>very</em> meaty topic. Almost none of what you know about the database engine can be applied to Analysis Services. If the only goal would be to provide a back-end for this report, then getting up to speed on Analysis Services and implementing the OLAP database would be a pretty substantial overhead compar... | https://dba.stackexchange.com |
261,696 | [
"https://physics.stackexchange.com/questions/261696",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/120647/"
] | It is my understanding that clouds are largely made up of water, which is known to split white light into its frequency components, and that's why we see rainbows sometimes. My question is, with sunlight being practically constant throughout the day, why aren't there rainbows all over, all the time? I mean, we can see ... | Light is multiply scattered in clouds, i.e. it is refracted by one water droplet or ice crystal, then refracted again by the next, then again by the next and so on. By the time the light reaches you eyes it will have been scattered many times. This means all the light hitting the cloud gets thoroughly mixed up and all ... | When you see a rainbow is when the incoming white light comes from a very small bright source, like when the sky is very clear in one direction and the sun shines in from that direction to the rain under the clouds on the opposite side from where you are looking.
If the light source is diffuse, then you get lots of rai... | https://physics.stackexchange.com |
49,550 | [
"https://security.stackexchange.com/questions/49550",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/3595/"
] | I want to know if it's dangerous in any way to store the current logged user session id on the page generated source code.
<h2>Why I wanted to do that?</h2>
I'm trying to share the user session between two applications, one (the main) in PHP and another in Node.js. The Node.js one is used just for real-time data, but... | <strong>YES</strong> there is a risk introduced by including the session identifier the HTML code as it will make it easier to exploit XSS vulnerabilities to hijack sessions.
First, accessing session id from JavaScript is <strong>BAD PRACTICE</strong>, cookies should have the HTTPONLY flag to prevent that.
In your ca... | As long as your code is bug free and not susceptible to session fixation or XSS and is accessed via HTTPS with secure cookies then its probably OK - but that is a very tall order to achieve and maintain. When it does break it will be really hard to detect/test/fix any problems. The solution you propose is very fragile.... | https://security.stackexchange.com |
266,447 | [
"https://security.stackexchange.com/questions/266447",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/285659/"
] | I work on a service that handles user authentication & authorization. I recently added 2FA support (email, sms, TOTP) and while it works great, I was wondering about the security of the one-time codes during transit (client->server request).
Assuming everything is going through HTTPS, does it make sense to encry... | If we assume TLS is not broken, then it doesn't really make sense to add obfuscation to transmit the OTP codes.
If we assume TLS is broken, it doesn't really make sense, as the Javascript transmitted to the client can be replaced by a MITM attack.
| It is a simple way of knowing that the browser that initiated the login process is the one that actually logged in.
Imagine that while the OTP is travelling to reach your phone, an adversary intercepts it and uses it to login to the target system.
If the OTP is associated with a random value that is sent to the browser... | https://security.stackexchange.com |
92,964 | [
"https://stats.stackexchange.com/questions/92964",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/43273/"
] | I am trying to derive the expression for the variance of $\hat{\beta_0}$ in simple linear regression. I substitute $\bar{y} - \hat{\beta_1} \bar{x}$ for $\hat \beta_0$, but in the intermediate steps the covariance term $\text{Cov}(\bar{y}, \hat{\beta_1})$ comes up and I don't know how to deal with it. Any help would be... | $$
{\rm Cov}\bigg[\frac 1 n \sum y_i,\ \frac{\sum(x_i - \bar x)y_i}{\sum(x_i-\bar x)^2}\bigg] = \frac 1 n \times \frac{\sum(x_i-\bar x)\sigma^2}{\sum(x_i - \bar x)^2} = 1$$ it does not equal zero this way I believe
| I was trying to prove the same
and struggled a bit but finally got to a solution. I know this was asked long back but there might be other people interested.
$$Cov (\bar{Y}, \hat{\beta_1}) = E[(\bar{Y} - E(\bar{Y}))(\hat{\beta}_1 - \beta_1)]\\
= E[(\beta_0 + \bar{X}\beta_1 + \bar{\epsilon} - \beta_0 - \bar{X} \beta_1... | https://stats.stackexchange.com |
314,185 | [
"https://physics.stackexchange.com/questions/314185",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/138785/"
] | When an object falls through vacuum, gravitational potential energy is converted to kinetic energy. Is there some way to get electrical energy out of the equation <strong>by itself</strong> (i.e. somehow convert the gravitational potential energy to electrical energy)? Is this physically possible? If so, what proper... | A sufficiently large object will experience differential gravity ("tidal force") - this could be converted into a small amount of electrical energy by having two heavy spheres separated by a long rope; as they fall there will be a tension on the rope and you could let that tension do work on a generator / dynamo ("comp... | Floris posted an answer that assumes the object is large enough for different parts of it to experience noticeably different gravitational forces. This is one way to accomplish it and written rather well, so I won't discuss that case further.
<em>If</em> you require that the object is small enough that all parts of it... | https://physics.stackexchange.com |
209,603 | [
"https://mathoverflow.net/questions/209603",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23310/"
] | I like the following version of SvKT. If $\Pi_1$ is the functor of fundamental groupoid and $(X_i)_{i\in I}$ is a diagram of spaces then
$$\Pi_1({\sf hocolim}\: X_i)\simeq {\sf hocolim}\: \Pi_1(X_i).$$
<strong>Question:</strong> Is there a similar statement for higher homotopy? For example, if we replace $\Pi_1$ by so... | The higher version of this statement is the following: taking the fundamental $n$-groupoid $\Pi_{\le n}(-)$, or equivalently $n$-truncating, is (higher) left adjoint to the inclusion of $n$-truncated spaces into spaces. Hence it sends homotopy colimits to homotopy colimits. This implies, for example, that if you want t... | The subtlety of the classical SvK theorem can be interpreted as being the passage from spaces to simplicial sets. Beyond that it relates more to behaviour of colimits under adjoint functors. In this I would disagree with Fernando as to identify the space and the corresponding infinity groupoid misses the main point. ... | https://mathoverflow.net |
156,820 | [
"https://dba.stackexchange.com/questions/156820",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/111807/"
] | I am curious about something, I was trying to find any long running queries currently running on my Oracle database.
The Query:
<pre><code>SELECT username,sid, serial#,
TO_CHAR(CURRENT_TIMESTAMP,'HH24:MI:SS') AS curr,
TO_CHAR(start_time,'HH24:MI:SS') AS logon,
(sysdate - start_time)*24*60 AS mins
FROM ... | In the query you have it appears as though you are grabbing the first two hundred rows, and then sorting those by dbms_random.value.
This would be due to Oracle's query precedence which performs the query and then sorts the results. You would want to randomly sort the results first and then return the first two hundr... | Oracle classic. The <code>ORDER BY</code> occurs after the <code>WHERE rownum <= 200</code>
| https://dba.stackexchange.com |
515,699 | [
"https://stats.stackexchange.com/questions/515699",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/315640/"
] | I have a 2x2 table with two independent groups of people that replied Yes or No in the survey:
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;"></th>
<th style="text-align: left;">Yes</th>
<th style="text-align: left;">No</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text... | BruceET provides one way of analyzing this table. There are several tests for 2 by 2 tables which are all asymptotically equivalent, meaning that with enough data all tests are going to give you the same anwer. I present them here with R code for posterity.
In my answer, I'm going to transpose the table since I find i... | Two ways to do this in R:
Test of two binomial proportions (declining continuity correction on
account of large sample sizes.) Highly significant result with P-value nearly <span class="math-container">$0 < 0.05 = 5\%.$</span>
<pre><code>prop.test(c(350, 1250), c(2050, 4050), cor=F)
2-sample test for equali... | https://stats.stackexchange.com |
363,928 | [
"https://stats.stackexchange.com/questions/363928",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/218388/"
] | I have paired binary responses from same subjects under 9 different conditions. I conducted Cochran's Q which indicated that there significantly different pairs exist. I want to follow up but NOT with post-hoc comparisons: I am not interested in the 36 possible comparisons of these 9 conditions.
I have selected a... | When a particular predictor is statistically significant doesn't really mean that it also considerably improves the predictive performance of a model. Predictive performance is more related to the effect size. As an example, the function below simulates data from a linear regression model with two predictors <code>x1</... | This is a fairly normal thing to happen in multiple regression. The most common reason is that your predictors are related to one another. In other words, you can infer X from the values of the other predictors. Therefore, while it's useful for predictions if it's the only predictor you have, once you have all the othe... | https://stats.stackexchange.com |
36,539 | [
"https://electronics.stackexchange.com/questions/36539",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/5156/"
] | Does the dielectric in a capacitor when subjected rapid charge/discharge cycles heat up?
| Yes, but only to the extent it is not a perfect capacitor. A perfect capacitor is not capable of dissipating energy, which means it can't be heated by the current thru it since that would represent a loss.
Real capacitors have a spec called <i>equivalent series resistance</i>, or <b>ESR</b>. That is various physical... | A theorethical pure capacitive load should not heat up since it only stores energy and than releases it.
However real capacitors do have some resistence and that will cause part of the energy to be dissipated as heat.
Keep in mind that capacitors are used as Low Pass Filters so if signal frequency on the capacitor is... | https://electronics.stackexchange.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.