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 |
|---|---|---|---|---|---|
518,283 | [
"https://stats.stackexchange.com/questions/518283",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/317657/"
] | I've just finished a module where we covered the different approaches to statistical problems – mainly Bayesian vs frequentist. The lecturer also announced that she is a frequentist. We covered some paradoxes and generally the quirks of each approach (long run frequencies, prior specification, etc). This has got me thi... | I think that the main takeaway here is this: the mere fact that there are these different philosophies of statistics and disagreement over them implies that translating the "hard numbers" that one gets from applying statistical formulae into "real world" decisions is a non-trivial problem and is fra... | <em><strong>A preliminary note on my nomenclature:</strong> As a preliminary matter, I note that I have never liked the terms "frequentist school" for the philosophy and set of methods it designates, and so I instead refer to this school of thought as "classical". Both Bayesians and classical stati... | https://stats.stackexchange.com |
128,440 | [
"https://mathoverflow.net/questions/128440",
"https://mathoverflow.net",
"https://mathoverflow.net/users/19582/"
] | Let $\Lambda_{n}$ be the set of all Lagrangian subspaces of $C^{n}$, and $P\in\Lambda_{n}$. Put $U_{P}= ( Q\in\Lambda_{n} : Q\cap (iP)=0 )$. There is an assertion that the set $U_{P}$ is homeomorphic to the real vector space of all symmetric endomorphisms of $P$. And then in the proof of it there is a fact that the sub... | By Lambek's theorem, any initial algebra for an endofunctor $F$ has the property that its structural morphism $\alpha : F A \to A$ is an isomorphism. So we seek an object $A$ such that $P P A = \Omega^{\Omega^A} \cong A$.
However:
<strong>Proposition.</strong> If a topos $\mathcal{E}$ contains an object $A$ such tha... | I don't know any examples with $\Omega$, but $x\mapsto 2^{2^x}$ has an initial algebra in the effective topos. The object $2^{2^x}$ is a quotient of a subobject of the natural number object for any object $x$. The category of quotients of subobjects of the natural number object is `weakly complete' (see Hyland 1988 'A ... | https://mathoverflow.net |
164,819 | [
"https://electronics.stackexchange.com/questions/164819",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/70923/"
] | I'm trying to get my head wrapped around transformer operation and in the process regretting the times I snoozed in my Electromagnetics class as a EE student back when I was a lad :)
I'm looking for an intuitive understanding, but not just an analogous one. I'd like it to be grounded in the actual physics of what's ha... | The answer has been totally rewritten to fulfill the request of a mathematical, format treatment, as asked for by StainlessSteelRat. The bold-face part in the center of this answer is the actual answer to your question. The remaining part is to show how I get to that formula and to connect your two facts (which I consi... | From what I know, the delta in primary coil current (as per an AC system) is what builds up energy inside the metal core of the transformer, which in turn generates a magnetic field in the opposite direction of the current flow (so it is in effect resisting the current flow). But, at the same time, in the secondary coi... | https://electronics.stackexchange.com |
24,585 | [
"https://dsp.stackexchange.com/questions/24585",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/16548/"
] | So I'm apply the median filter to an image, but at the output, there's blue semi-dots appearing. What are they?
This is the output
<img src="https://i.stack.imgur.com/YIhNh.png" alt="enter image description here">
And the python code for anyone interested
<pre><code>from scipy.ndimage.filters import median_filter
f... | Convert the image to gray scale before applying the median filter.
| Instead of converting this image to gray and then apply median filter, an alternative is to use the vector median filter. In this context, a vector median filter considers each pixel as a 3D-vector composed by R, G, and B channel intensities, and finds a median w.r.t. to this vector instead one median for each channel.... | https://dsp.stackexchange.com |
543,479 | [
"https://physics.stackexchange.com/questions/543479",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/245502/"
] | For a while, I had difficulty understanding the differences between an expectation value and the state-vector derived from the Schrodinger equation. My understanding is that the Schrodinger equation returns a state-vector <span class="math-container">$\mid\Psi(t)\rangle$</span> that can be used to calculate probabiliti... | <span class="math-container">$|\Psi(t)\rangle$</span> contains the time evolution of a <em>superposition of states</em> describing the probability amplitude of each state of the system - it is not a physical entity but an abstract vector representation of the probability amplitude of <em>measurable</em> states (energy,... | The expectaion value of quantity <span class="math-container">$A$</span> is given by
<span class="math-container">$$\langle A\rangle = \langle\Psi|\hat{A}|\Psi\rangle,$$</span>
where <span class="math-container">$\hat{A}$</span> is the operator for this quantity, whereas <span class="math-container">$|\Psi\rangle$</spa... | https://physics.stackexchange.com |
16,061 | [
"https://biology.stackexchange.com/questions/16061",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/6128/"
] | I thought of this question yesterday and it turns out it's surprisingly hard to Google.
| Hibernating bears have an ingeneous way of recycling their urine (urea) while they hibernate. Also turtles and frogs in the bottom of ponds deal in unique ways during hibernation.. This should get you started.
recycling waste externally is done by rabbits who will pass pellets through their system twice, the firsttime ... | <strong>All</strong> organisms recycle their waste internally. Every cell of every living organisms is constantly breaking things down and re-using the components so produced. But you're presumably wondering about things such as carbon dioxide, urine and faeces? These are not recycled because the benefits of doing so a... | https://biology.stackexchange.com |
52,389 | [
"https://engineering.stackexchange.com/questions/52389",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/39179/"
] | This question is related to a 5 bedroom property, with a radiator in each room. Whereby heating is turned on/off in bursts of 2 hours (2 hours on, 2 hours off). 3 rooms are used constantly and 2 (smaller) are not. Assume the house is well insulated.
A DIY family member believes that heating the whole house is the bette... | The "problem" is that you are solving a problem in the stationary regime, where dynamic effects are neglected.
You are thinking on the transient regime. And in any case, if you consider even the most basic damping for the set-up, it will very quickly converge to the stationary answer.
| Yes if you attach the bar to the ceiling and release it very suddenly, then what you assume will happen and the bar will start to vibrate.
You need to use stiffness tensor, mass tensor, and continuum mechanics. which is going to be a research project.
For a rough quick estimate, I would replace the bar with a trapezoid... | https://engineering.stackexchange.com |
62,561 | [
"https://cs.stackexchange.com/questions/62561",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/55388/"
] | I'm quite new to understanding persistent data structures, so bear with me.
Consider some database with data of the form $(\text{id}, d_1, d_2)$. The last two could e.g. mean production data and sales date, respectively. The database is constant, i.e. we will not be adding or removing data points.
Let $n$ be the num... | Yes, you can do this in $O(\log n)$ time. Use a sweep-line algorithm together with a persistent tree data structure.
Imagine the point $(d_1,d_2)$ as being on a grid, with $d_1$ as the value of the $x$-coordinate and $d_2$ as the value of the $y$-coordinate. Your sweep line is a horizontal line, namely, at time $t$,... | If your data are constant, most data structures are persistent. (Not self-adjusting ones like splay trees or the union-find structure of Tarjan)
You can do "three-sided range queries" with a priority search tree in $O(k + \log n)$ time, where $k$ is the number of items returned.
| https://cs.stackexchange.com |
399,026 | [
"https://softwareengineering.stackexchange.com/questions/399026",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/127478/"
] | The first language that I truly learned was Java. In it, it is very syntactically easy to nest classes in an essentially arbitrarily complex package hierarchy, which keeps the code organized. It is easy because the syntactic clutter of a deeply nested hierarchy is all placed neatly at the top of the file with import an... | <blockquote>
this creates an entirely new issue where there are two separate hierarchies — one for namespaces, and another for the file system.
</blockquote>
That's not an issue at all though, it's perfectly normal.
Coupling the namespace and filesystem structures is (so far as I know) unique to Java. Trying to i... | One way to handle it: Don't do it.
In your example, you could have a namespace game_name::server and leave it at that. Don't reuse names for top level objects obviously. But they are confusing anyway. They change their meaning totally if you change a namespace.
Ask yourself if you actually gain anything from the us... | https://softwareengineering.stackexchange.com |
553,048 | [
"https://stats.stackexchange.com/questions/553048",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/154534/"
] | I want to understand if there is any difference between performing multinomial distribution with 1 trial, 10000 times and performing multinomial distribution with 10000 trials, 1 time.
Here is the code of what I am talking about. Notice that the outputs in both cases are almost similar.
<pre class="lang-py prettyprint-... | There is no difference. That you get slightly different results, even with the same random seed, must be because somewhat different algorithms are used in the two cases.
As an illustration, think about throwing coins (well, three-sided coins ...). Throwing 10000 coins once, or throwing one coin 10000 times, you will e... | There is a difference. If we denote the probability vector <span class="math-container">$\pi$</span>, then the first case of 10,000 repetitions of <span class="math-container">$X \sim \text{Mult}(1, \pi)$</span> retains information about the <span class="math-container">$X_i$</span> in each of the 10,000 repetitions.
T... | https://stats.stackexchange.com |
78,905 | [
"https://mathoverflow.net/questions/78905",
"https://mathoverflow.net",
"https://mathoverflow.net/users/16321/"
] | As the title says, let $k \geq 2$ be a positive integer and let $G$ be a $(k-1)$-edge-connected $k$-regular graph with an even number of vertices. Then, for every edge $e$ of the graph there is a perfect matching of $G$ containing $e$.
First, I was wondering if this is new and if there are approaches different from m... | If you look at the math review of the following:
MR0317999 (47 #6548)
Plesník, Ján
Connectivity of regular graphs and the existence of 1-factors.
Mat. Časopis Sloven. Akad. Vied 22 (1972), 310–318.
You will see that this result was already known in 1972, and if you look at the actual paper (available for free on t... | Ugh I just lost my post but the short version is that on top of Igor's answer, it is easy to prove this using Edmonds' characterization of the perfect matching polytope, which implies putting weight 1/k on every edge will give you a vector in the polytope. From this fact the matching-coveredness is straightforward.
E... | https://mathoverflow.net |
526,206 | [
"https://physics.stackexchange.com/questions/526206",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/243488/"
] | We know the Nernst Planck equation is
<span class="math-container">$$ \frac{\partial c}{\partial t} = - \nabla \cdot J \quad | \quad J = -\left[ D \nabla c - u c + \frac{Dze}{k_\mathrm{B} T}c\left(\nabla \phi+\frac{\partial \mathbf A}{\partial t}\right) \right] $$</span> <span class="math-container">$$\iff\frac{\partia... | Ok, so I think I got it. The fact that our eyes don't have an infinite resolution might be the reason we don't get blinded by stars even if dynamic range is expressed in terms of luminance.
If you can resolve the solar disk, then it will lay its light on several of your retina cells, which are getting the same luminan... | The luminance of an object is not a constant. It depends on how far you are from the object. The luminance of the light from the Sun <em>at earth</em> is <span class="math-container">$10^9 \text{cd/m}^2$</span> but the luminance of the sun closer to the Sun is more and less further from the Sun.
This is because lumina... | https://physics.stackexchange.com |
25,123 | [
"https://mathoverflow.net/questions/25123",
"https://mathoverflow.net",
"https://mathoverflow.net/users/-1/"
] | Long ago, manifolds were embedded subsets of euclidean space defined by polynomials. Later, using the gluing of open sets, people realized they could define manifolds intrinsically. And in certain cases, this lead to new manifolds which could not be realized as subsets of euclidean spaces. Eg non-orientable surfaces ca... | Topological dimension (say, covering dimension) $\dim_\mathrm{T}$ and Hausdorff dimension $\dim_\mathrm{H}$ both make sense for metric spaces. <strong>Benoit Mandelbrot</strong> defined $A$ to be a <em>fractal</em> iff $\dim_\mathrm{T} A < \dim_\mathrm{H} A$. The packing dimension $\dim_\mathrm{P}$ also makes sens... | To the best of my knowledge there is no universally agreed upon precise definition of the word "fractal", so it's not clear to me exactly what would or would not constitute an example of a fractal that is not embedded in Euclidean space.
However, the various quantities referred to as "fractal dimension" -- Hausdorff... | https://mathoverflow.net |
375,546 | [
"https://mathoverflow.net/questions/375546",
"https://mathoverflow.net",
"https://mathoverflow.net/users/-1/"
] | Let <span class="math-container">$k$</span> be commutative ring and <span class="math-container">$(C, \Delta)$</span> be a coalgebra over <span class="math-container">$k$</span>. Let <span class="math-container">$D$</span> be a <span class="math-container">$k$</span>-submodule of <span class="math-container">$C$</span>... | Recall that you have a map <span class="math-container">$f^* \colon f^{-1} \Omega_X \to \Omega_Y$</span> (pull-back of differentials). Consider the composition <span class="math-container">$$ \nabla' \colon f^{-1} E \xrightarrow{f^{-1} \nabla} f^{-1} E\otimes_{f^{-1} \mathcal{O}_X} f^{-1}\Omega_X \xrightarrow{{\rm id}\... | Another option is to proceed as follows : show that there exists a unique connection <span class="math-container">$f^*\nabla$</span> on <span class="math-container">$f^*\mathcal F$</span> verifying :
<span class="math-container">$$ (f^*\nabla)(f^*s) = f^*(\nabla(s))$$</span>
where on the right-hand side you use the ca... | https://mathoverflow.net |
14,951 | [
"https://stats.stackexchange.com/questions/14951",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1261/"
] | I need to calculate matrix inverse and have been using <code>solve</code> function. While it works well on small matrices, <code>solve</code> tends to be very slow on large matrices. I was wondering if there is any other function or combination of functions (through SVD, QR, LU, or other decomposition functions) that c... | Have you tried what cardinal suggested and explored some of the alternative methods for computing the inverse? Let's consider a specific example:
<pre><code>library(MASS)
k <- 2000
rho <- .3
S <- matrix(rep(rho, k*k), nrow=k)
diag(S) <- 1
dat <- mvrnorm(10000, mu=rep(0,k), Sigma=S) ### be pat... | If you are working with covariance matrix or any positive definite matrix you can use <code>pd.solve</code> is faster.
Following the Wolfgang example:
<pre><code>library(MASS)
library(mnormt)
k <- 2000
rho <- .3
S <- matrix(rep(rho, k*k), nrow=k)
diag(S) <- 1
dat <- mvrnorm(10000, mu=rep(0,k... | https://stats.stackexchange.com |
172,062 | [
"https://security.stackexchange.com/questions/172062",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/61940/"
] | I am being recommended to setup a VPN on the router that will connect a DVR to the internet so that I can monitor it remotely. The idea is that by doing this VPN setup it would be harder for an unauthorized party to gain access to the DVR. However I couldn't find any explanation as to why - what does a VPN router do to... | As SmokeDispenser already explained, most consumer-grade and enterprise routers and firewalls have such default settings (UPNP disabled, no port on the Internet interface forwarded to a LAN IP address, etc) that will not allow devices connected on the LAN side to be accessed from the Internet side.
So, which options ... | Your question is rather broad, as it does not explain your setup sufficiently.
Usually, COTS-Routers offer Internet access to devices by means of network address translation, as Mark mentioned in the comments. If ports are not directly forwarded and upnp is disabled, your device should be well enough protected against... | https://security.stackexchange.com |
219,672 | [
"https://mathoverflow.net/questions/219672",
"https://mathoverflow.net",
"https://mathoverflow.net/users/36688/"
] | The category of $C^{*}$ algebras is denoted by $\mathcal{A}$.
Is there a functor $\mathcal{F}$ on $\mathcal{A}$ which send each object $A\in \mathcal{A}$ to its center $Z(A)$. In the other words, can we extend the maping $A\mapsto Z(A)$ on objects to a functor on this category?
| Firstly, notice that you may apply your condition to the triangles $ABM$ and $A_1B_1M_1$ and iterate this process. So, e.g.. for every points $X$ and $X_1$ on $BC$ and $B_1C_2$ with $BX/BC=B_1X_1/B_1C_1=k/2^n$ with integer $k,n$ we obtain $AX=A_1X_1$. Since the binary rationals are dense on $[0,1]$, the same holds for ... | In dimension 2, your condition implies existence of rotation by arbitrary small angle. Simply apply your condition recurcevely to a sequence of points on the unit circle $\dots,A_0,A_1,A_2,\dots$ such that the midpoint of $[A_{i-1}A_{i+1}]$ lies on $[OA_i)$.
The later implies that the metric is Euclidean.
Now in your ... | https://mathoverflow.net |
145,946 | [
"https://cs.stackexchange.com/questions/145946",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/145481/"
] | <blockquote>
<strong>Definition</strong>: Problem A is reducible to problem B if an algorithm for solving
problem B efficiently (if it existed) could also be used as a
subroutine to solve problem A efficiently. When this is true, solving
A cannot be harder than solving B. In these reductions, a YES instance
of A maps t... | It depends on the exact definition of reduction that you are using. What you describe is not a many-one reduction, but (assuming that your reduction is computable) it is a Turing reduction.
Whether that's useful of not depends on what you're trying to prove. For example polynomial-time Turing reductions (called Cook re... | <blockquote>
What I did was that I mapped the YES-instances of A to the NO-instances of B, (and the NO-instances of A to the YES-instances of B).
</blockquote>
I was actually looking into this recently! This is a common type of reduction, but to my knowledge, there isn't a standard separate name for it. Instead, comple... | https://cs.stackexchange.com |
1,084 | [
"https://earthscience.stackexchange.com/questions/1084",
"https://earthscience.stackexchange.com",
"https://earthscience.stackexchange.com/users/26/"
] | Taste can be used to distinguish halite (ordinary salt) from sylvite (which has some bitterness) and siltstone from mudstone (the latter has a creamy texture while the grains of the former can be felt). Are there other uses of taste for identification?
| You are correct about halite and sylvite. I might add that carnallite also has an extremely bitter taste. These three minerals are chlorides and dissolve very easily, so that may be a part of the issue here.
Differentiating mudstone (clay) from siltstone is actually not about taste, but rather about texture. Note that ... | Tasting rocks is done only if we already known that tasting would give us an answer about the rock type. We do not taste siltstones or sandstones because siltstone (and mudstone too) have no visible grains. On the contrary, sandstone has visible grains of sand. In most cases, when we try to identify a rock specimen in ... | https://earthscience.stackexchange.com |
246,612 | [
"https://softwareengineering.stackexchange.com/questions/246612",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/82084/"
] | Moinsen,
I am somehow stucked in a design problem. Language is ANSI-C.
Lets assume we have a tinkerbox of software-modules:
<ul>
<li>one module for the logic <strong>Logic</strong></li>
<li>(at least) one module doing some logging <strong>Logger</strong></li>
<li>two modules, both giving a "frame" to let the program... | In your current design, the <strong>Logic</strong> module already has a dependency on the <strong>Logger</strong> module, but that dependency is hidden.
The dependency lies in the fact that both <strong>Logic</strong> and <strong>Logger</strong> must agree on the set of functions used for logging (one function) and th... | <code>Logic.h</code> declares a function to set the logger function: <code>Logic_SetLogger()</code>, in order to use it.
Therefore, <code>Logic.h</code> must know the prototype of the logger function, whatever <code>Logger.h</code> is, i.e., in the most generic way possible.
This is already the case with the first ar... | https://softwareengineering.stackexchange.com |
112,633 | [
"https://security.stackexchange.com/questions/112633",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/93860/"
] | Why dont we use our mobile phone tho hash a password and then enter the hash on a website as the password ?
This way the password for the website would be much more complex.
Would this even increase security ?
Example
<ol>
<li>Mobile phone: p4ssword --hashing--> 527fcfb9b03f2813eadd840a2ae0fb56</li>
<li>Website: En... | This is essentially identical to simply generating a password that isn't hashed, in security terms. Whether you use your first name for a password or the checksum of the current time doesn't matter; if the thing you send over the Internet is compared with a string directly stored in a list on the server side, then the ... | I guess it depends on what the server does, but it doesn't add much protection either way (or is even worse). (Also, does the average user know how to compute a hash on mobile? Sounds quite a hassle to me.)
<h3>1. Server stores hashed password</h3>
This means client sends <code>H = hash(password)</code> to the server, ... | https://security.stackexchange.com |
125,399 | [
"https://softwareengineering.stackexchange.com/questions/125399",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/43116/"
] | Could Designing by Contract (DbC) be a way to program defensively?
Is one way of programming better in some cases than the other?
| Design by Contract and defensive programming are in some sense opposites of each other: in DbC, you define contracts between collaborators and you program under the assumption that the collaborators honor their contracts. In defensive programming, you program under the assumption that your collaborators <em>violate</em... | <blockquote>
Could Designing by Contract (DbC) be a way to program defensively?
</blockquote>
Yes.
"Defensive Programming" is often an excuse to waste time. It often wastes time checking for things that will cause ordinary exceptions. Instead of the exceptions, extra IF statements are written instead of exception... | https://softwareengineering.stackexchange.com |
651 | [
"https://mechanics.stackexchange.com/questions/651",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/91/"
] | My brother-in-law's car has just failed inspection. One of the items listed was a "cat-back." Since the bill is astronomical, I was wondering how much of the exhaust system is encompassed in this term and what is the relative ease to change this on a 97 Pontiac sedan?
| The cat back is just that the exhaust pipe including the muffler from the catalytic converter to the end of the tail pipe. Seems odd to me, not impossible just odd that you would need to replace the entire exhaust system from the cat back to pass inspection. I see from your profile that you are from PA and road salt ca... | Go around to some local shops and put their estimates against each other (openly) to drive the price down. There are a lot of "universal" pieces that can be used in exhaust repairs. I had everything (converter to the tail) replaced in my old Corsica (10 years ago maybe) for around $100. Of course this was no high end e... | https://mechanics.stackexchange.com |
123,150 | [
"https://physics.stackexchange.com/questions/123150",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/51970/"
] | In my laboratory, I have already obtained a polarization-entangled photon source. It was created via the Spontaneous Parametric Downconversion process of 2 BBO crystals. The next question is that would I be able to use this source to create qubits? If so, how?
Thank you in advance.
| Any photon (pure) state may be described by a q-bit formalism:
$$|photon\rangle = \alpha |0\rangle + \beta|1\rangle$$
where $|0\rangle$ and $|1\rangle$ represent the two possible polarizations of the photon.
So, any photon "is" a q-bit. You don't have to "create" q-bits. Just prepare photons is some state.
An entang... | As Trimok says, every photon - and for that matter, any physical two-level system - is immediately a qubit. In other words, qubits are abundant in nature and not very interesting by themselves. Also, a qubit alone is not entangled.
The interesting part is, what you can do with your qubit: Can you create a qubit in alw... | https://physics.stackexchange.com |
561,198 | [
"https://physics.stackexchange.com/questions/561198",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/254920/"
] | This question came up as an exercise in my quantum text?
I typically find these "word" questions quite difficult. I want to answer:
"What is meant by the stationary states?" as concisely as possible.
I would say something along the lines of " Normalizable/(sufficiently smooth) solutions to the ... | Stationary states are eigenstates of the Hamiltonian, since they time evolve by just a phase. If <span class="math-container">$H|n\rangle= E_n |n \rangle$</span>, then the time evolution of the state is given by
<span class="math-container">$$e^{i H t} | n \rangle= e^{i E_n t} | n \rangle, $$</span>
which is just a pha... | The stationary states are those states which do not evolve as time passes - in this sense they are stationary. One needs to be careful however, and not forget that what we mean here is that the states do not have any observable changes over time. Thus, if a state evolves by just a global phase factor over time, this ch... | https://physics.stackexchange.com |
98,640 | [
"https://dba.stackexchange.com/questions/98640",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/62626/"
] | I have a server running Apache and MySQL. Connections to MySQL work fine when using <code>localhost</code> in the connection settings.
Now I'd like to force our developers to use a FQDN instead of localhost. This is because we're planning to move the MySQL servers from the application servers to a MySQL cluster. Then ... | As always, a few minutes after posting a question, I found the answer myself. The issue was SELinux. It was set on enforced; permissive made it work instantly. Now I'll have to figure out a way to make it work with the enforced mode.
The following appeared in the audit.log:
<blockquote>
type=AVC msg=audit(142978175... | Be sure <code>skip_name_resolve</code> is <code>OFF</code>.
<code>GRANT</code> access for the users from their hosts.
Remove non-root grants for <code>localhost</code> (when you want to really force them to convert).
I assume you have user(s) that are <code>GRANTed</code> access only to the application database(s).
| https://dba.stackexchange.com |
558,244 | [
"https://stats.stackexchange.com/questions/558244",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/245680/"
] | I want to compare differences between two independent groups (female and male) when dependent variables are continuous. However, my sample size is very small (N=6). I have done a Mann-Whitney U Test and I am not sure if the results are meaningful given the small sample.
| This has been discussed at length on this site. Briefly, the test is valid. But no test is especially helpful because of our inability to interpret large p-values, which do not indicate "no difference". Instead I would replace a test with a confidence interval or Bayesian credible interval. These have int... | Frank's advice is useful; I don't wish my answer to suggest any disagreement with that answer.
The Wilcoxon-Mann-Whitney test "works as it should" in small samples. There's a few things to note:
<ol>
<li>You will have the usual issues with trying to use hypothesis tests in small samples, like low power agains... | https://stats.stackexchange.com |
250,208 | [
"https://softwareengineering.stackexchange.com/questions/250208",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/124792/"
] | I'm writing a program that goes into a loop and keeps changing the state of some models (similar to a game). Naturally, many things are mutable. However, I'm also writing some classes that are immutable because they're inherently treated like values (for example: vectors, matrices, etc.)
However, these values change o... | There are two things of note here: you seem to know quite a bit about good practices and the project is meant to disappear "soon" (though not right after you leave).
As Telastyn mentions, make the most out of this experience to learn what works and what doesn't and how to apply best practices in a real-world environme... | The point of an internship is to learn. I would refactor the code to be better and ignore the assumed limitations of people you don't know. For all you know, the company will move that project to an internal team rather than interns soon.
| https://softwareengineering.stackexchange.com |
254,647 | [
"https://physics.stackexchange.com/questions/254647",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/89734/"
] | If we have 2 charged particles which are a certain distance away from each other, they either attract of repel due to the electric field created by both of them. But I don't understand the mechanism of the force creation. What framework should I follow to visualise it?
Edit: Sorry for any confusions. There are 2 parti... | <blockquote>
But I don't understand the mechanism of the force creation
</blockquote>
But the concept of electric charge and electric field <em>is</em>, by definition, the mechanism of the force creation - <em>that humans have invented to model that which has been observed</em>.
Never forget that the observed is th... | In this situation, I just want to quote what Richard P Feynman once said in an interview. "If you hold two like poles of a magnet together, they repel apart, which means there is some force existing in between them avoiding them to have a contact. That's an experimental truth. But if you ask me why there is a force in ... | https://physics.stackexchange.com |
196,540 | [
"https://dba.stackexchange.com/questions/196540",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/73245/"
] | I am trying to write a query that displays all unique columns that are allowed to be null in Oracle.
The information I need is in these 3 tables:
<ul>
<li>ALL_TAB_COLUMNS</li>
<li>ALL_IND_COLUMNS</li>
<li>ALL_INDEXES</li>
</ul>
I am having difficulty joining these tables to display the information I'm looking for. ... | Try this one:
<pre><code>SELECT ind.OWNER AS INDEX_OWNER, ind.INDEX_NAME,
tab.OWNER AS TABLE_OWNER, tab.table_name,
tab.column_Name,
UNIQUENESS, NULLABLE
FROM ALL_INDEXES ind
JOIN ALL_IND_COLUMNS col
ON ind.OWNER = INDEX_OWNER
AND ind.INDEX_NAME = col.INDEX_NAME
JOIN ALL_TAB_C... | If the only output you're looking for is the one that you described, you could get away with using a different set of tables. As you're displaying the column name I added the position for the column in case of an multi column index.
<pre><code>select
i.owner as ind_owner,
i.table_owner as tab_owner... | https://dba.stackexchange.com |
63,250 | [
"https://softwareengineering.stackexchange.com/questions/63250",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/4779/"
] | I consider myself a high level software developer. I enjoy reading a lot, and it's helped me over the course of my career. I think I am doing well.
Right now, I spend a lot of time learning new things. I don't suck when it comes to writing code right now, but I'm about to start a family, and I regularly see many senio... | Something you said stood out: "I regularly see many seniors with an experience of 14-15 years... they now suck at programming". That's a pretty broad brush stroke you are using to paint people with experience. I'd like to point out a couple things to consider:
<ul>
<li>Younger/less experienced practitioners love to ... | It's hard to predict the future. But one thing is the most valuable for sure regardless technology.
It’s a developer’s <strong>ability to solve problems</strong>.
Many of a developer quality are technology independent. For example <strong>analytical ability</strong> is the most important quality I know about.
It's li... | https://softwareengineering.stackexchange.com |
19,732 | [
"https://physics.stackexchange.com/questions/19732",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/7217/"
] | Surely the temperature of the molecules is the same throughout the water. Using $p = \rho g h$ seems to assume a constant density as well. But then how is it that the force per unit area on an object placed at the bottom of the lake will be higher than that on an object near the surface? My first thought is that the in... | First of all, the temperature and pressure of a liquid are two independent intensive variables. Either of them may be lower or higher at the bottom of a lake, independently of the other. So let's focus on the pressure.
You are totally right that the incompressibility fails and this is the reason why the lake "knows" a... | In a hard-gas model, if you make the atoms spheres, there are indeed lots more bombardments low down in the lake than high up, since hard sphere collisions are the only source of force, and the temperature (hence the mean velocity) is the same. The reason this is violating your intuition is because you are approaching ... | https://physics.stackexchange.com |
1,794,146 | [
"https://math.stackexchange.com/questions/1794146",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/333066/"
] | Suppose I have the number <code>0.342543</code> and I want to round it to the 2 places after the radix point using <code>round to the nearest</code> algorithm. In school I was taught that I should look at the next digit and if it's less than 5, I should just truncate the digits. If it's greater than 5, then I should i... | The opposite is true. If $\sum a_n$ converges conditionally but not absolutely, then there exists infinite $X$ such that $\sum_{n \in X} a_n$ converges absolutely.
To see this: sequence $a_n$ goes to zero, but is not eventually zero. So we may choose $n_1$ such that $0<|a_{n_1}| < 1/2$, then choose $n_2 >... | Consider the alternating harmonic series
$$
\sum_{k = 1}^\infty \frac{(-1)^{k-1}}{k} = \ln2;
$$
it converges however not absolutely. However, with $X = \{$square integers$\}$ the series converges absolutely. This is a counterexample.
| https://math.stackexchange.com |
85,718 | [
"https://electronics.stackexchange.com/questions/85718",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/9215/"
] | I am using the Arduino shield pin component and I cant flip it, because it goes out of the area bounds...
Is there a way to force it to flip and then go into move mode so I can place it within the bounds? or force it to flip and then snap to the in bounds? or ? I spent 2 hours trying to get it positioned right using ... | The EAGLE mirror command mirrors a part on its origin (or selection on its center) and moves it to the other side of the board. If the origin is not in the center the mirror will result in X or Y translation, which is causing it to go out of bounds for you.
Edit the part and move its origin to its center. Then any mi... | Instead of just mirroring it, can you move it, and while moving it mirror it with the middle mouse button?
| https://electronics.stackexchange.com |
9,458 | [
"https://dba.stackexchange.com/questions/9458",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/746/"
] | I have a problem with a SPFILE as shown below.How can I get rid of that problem?Any suggestions?
<pre><code> SQL> startup
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2182592 bytes
Var... | Well, you can hack around with an SPFILE easily enough:
<pre><code>SQL> create pfile='/tmp/initSID.ora' from spfile;
</code></pre>
Now edit that ordinary text file, then
<pre><code>SQL> create spfile from pfile='/tmp/initSID.ora';
</code></pre>
And you can play with the temporary one with
<pre><code>SQL> ... | <blockquote>
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
</blockquote>
<strong>this error mainly occurs when you have used a parameter or changed the dynamic parameter which is not anymore used in that current version of oracle.</strong> In my case, I change the <code>background_dump... | https://dba.stackexchange.com |
462,200 | [
"https://physics.stackexchange.com/questions/462200",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/222172/"
] | I have a loudspeaker that is facing into a long cylindrical piece of PVC pipe of length <em>L</em>. The loudspeaker is sealed in so that no air can escape around the edges. The pipe is open at the other end.
The loudspeaker is attached to a signal generator and made to vibrate at frequency <em>f</em>.
In this configu... | I decided to test this using approx 1m long PVC pipe from Bunnings and a small loudspeaker.
I had two pieces of light milk-carton plastic which I placed over the front of the loudspeaker - one with a small hole in the center, and one with a large hole. Then for each of the pieces of plastic, I placed the PVC pipe on t... | You are right, a tube driven at its closed end and open at the other will resonate like a tube with one closed end. Putting a punched disc in front of the speaker will cause the hole in its center to radiate as a point source, which will excite the same resonance in the tube and introduce a helmholtz resonance in which... | https://physics.stackexchange.com |
2,788,099 | [
"https://math.stackexchange.com/questions/2788099",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/494652/"
] | Suppose you have a single linear equation like so:
ax + by + cxy = d
Where x and y are independent variables and a, b, c, and d are constants.
Is there an approach that can be taken to find x and y given just this single equation?
I am interested in integer solutions.
| The general component-wise formula for a cross product is a bit more complicated than I like,
making computational errors all too likely.
But in this case it is possible to work with much simpler pieces.
A convenient fact about the cross product is that it distributes over the components of its input vectors like mul... | Indeed your approach is quite slow and cumbersome, which sometimes causes errors.
A definition of cross product is
$r\times F=||r||\cdot||F||\sin\theta \cdot\hat{n}$
where $\theta$ is the angle between the vectors, and $\hat{n}$ is a unit vector perpendicular to the plane of the original vectors(direction determined b... | https://math.stackexchange.com |
370,861 | [
"https://stats.stackexchange.com/questions/370861",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/20563/"
] | When we train a classifier, we use cross entropy as a loss function and, for example, an F-Score as an evaluation metric, but why?
<strong>Why not use cross entropy on the test set to evaluate the model performance?</strong>
Especially in a scenario where we care about the confidence of the model, it would give us a... | I always use (test) cross-entropy under cross-validation to assess the performance of a classification model. It's far more robust than accuracy on small datasets (because accuracy isn't "smooth"), and far more meaningful than accuracy (although perhaps not than precision and recall) when classes are imbalanced.
How... | Cross entropy value might range from 0 to infinity depending on the dataset.
It is not ancored between 0 and 1.
I guess comparing peformance between diferent models and datasets might therefore be a problem.
| https://stats.stackexchange.com |
47,740 | [
"https://dsp.stackexchange.com/questions/47740",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/31046/"
] | I have been told that for deterministic signals, it makes sense to look at their respective Fourier transforms/spectra.
For stochastic processes on the other hand, I am supposed to work with power spectral density in terms of qualitative analysis.
Why?
| Because a stochastic process itself doesn't <em>have</em> a Fourier transform.
That's really all there is to it.
You can only transform signals (i.e. functions over a body isomorphic to $\mathbb R$, for example, functions of time). You can't transform a random variable whose individual realizations are such functions... | As @Marcus Müller mentions a stochastic process does not have a Fourier transform.
From a practical point of view, assume you have $N$ realizations of a signal, either deterministic or stochastic. Then, in order to estimate the power spectral density, it is common practice to average the power spectral densities of t... | https://dsp.stackexchange.com |
267,948 | [
"https://stats.stackexchange.com/questions/267948",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/108018/"
] | If <span class="math-container">$X$</span> is full rank, the inverse of <span class="math-container">$X^TX$</span> exists and we
get the least squares estimate: <span class="math-container">$$\hat\beta = (X^TX)^{-1}XY$$</span>
and <span class="math-container">$$\operatorname{Var}(\hat\beta) = \sigma^2(X^TX)^{-1}$$</spa... | Consider a simple regression without a constant term, and where the single regressor is centered on its sample mean. Then $X'X$ is ($n$ times) its sample variance, and $(X'X)^{-1}$ its recirpocal. So the higher the variance = variability in the regressor, the lower the variance of the coefficient estimator: the more v... | A simple way of viewing $\sigma^2 \left(\mathbf{X}^{T} \mathbf{X} \right)^{-1}$ is as the matrix (multivariate) analogue of $\frac{\sigma^2}{\sum_{i=1}^n \left(X_i-\bar{X}\right)^2}$, which is the variance of the slope coefficient in simple OLS regression. One can even get $\frac{\sigma^2}{\sum_{i=1}^n X_i^2}$ for that... | https://stats.stackexchange.com |
217,567 | [
"https://physics.stackexchange.com/questions/217567",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/81146/"
] | Why is it that in non-equilibrium hydrodynamic modelling, e.g. when the solution is time dependent, people use equations of state that are derived from equilibrium considerations (i.e. the ideal gas law, or an ideal fermi gas EoS etc.)?
| I think that the key requirement is that the material be in local thermodynamic equilibrium. Even if it is a dynamic situation with mass flow or shock waves running through the material under consideration, if the material is in local thermodynamic equilibrium at every instant in time, then equilibrium thermodynamic co... | You seem to only have a blurry idea of the hydrodynamic approach, so I will add a tad more about the whole idea, mainly to give you a better intuition. Hopefully this will be a useful addition to Samuel Weir's wonderful answer.
A hydrodynamic state is described by the variables: mass density field, energy density fiel... | https://physics.stackexchange.com |
15,178 | [
"https://mathoverflow.net/questions/15178",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3380/"
] | Let $K$ be a field, $V$ an $n-$dimensional $K$-vector space and $q: V \to K$ a quadratic form of Witt index $r$. Let $G:=SO(q)$ denote the special orthogonal group associated to $q$.
Then $G$ is an algebraic $K$-group of $K-$rank $r$.
If $q'$ is isometric to $q$, clearly $G':=SO(q')$ is isomorphic to $G$. But this is... | As a matter of fact, it isn't hard to construct a multiplicative sequence $a_n$ such that $f(z)$ is an entire function without zeroes. Unfortunately, it is completely useless for the questions that you brought up as "motivation".
Here is the construction.
Claim 1: Let $\lambda_j\in [0,1]$ ($j=0,\dots,M$). Assume that... | The (not completely) multiplicative sequence $a_n=(-1)^{n-1}$ is such that the corresponding $f(s)$ is entire : $f(s)=(1-2/2^s)\zeta(s)$.
| https://mathoverflow.net |
6,694 | [
"https://chemistry.stackexchange.com/questions/6694",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/1018/"
] | We know that intermolecular hydrogen bonding is seen in hydrogen peroxide $(\ce{H2O2})$. But is intramolecular H-bonding, i.e. hydrogen bond between an oxygen atom and a hydrogen atom attached to the adjacent oxygen atom possible? How strong will it be, compared to intermolecular H-bonding and why?
| <strong>Preamble:</strong>
I will conveniently avoid entering into a debate as to what a hydrogen bond is, given the numerous theories which attempt to do so from various perspectives.
I will, however, attempt to use the relatively cheap and easy natural-bond orbital (NBO) analysis method to examine the possible exist... | My molecular models set has led me to believe that hydrogen peroxide can conform to form 2 bent hydrogen bonds and one bent covalent bond between the $\ce{OH}$ groups.
This means that there can be a triple bond between the 2 oxygen atoms. The triple bent bond (i.e., 3 banana bonds) of which 2 are of the hydrogen bond... | https://chemistry.stackexchange.com |
526,243 | [
"https://stats.stackexchange.com/questions/526243",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/183800/"
] | Suppose I observe binary data for two samples (hopefully the notation below is obvious) and I wish to test the hypotheses:
<span class="math-container">$$H_0: p_1 = p_2$$</span>
<span class="math-container">$$H_A: p_1 \neq p_2$$</span>
I know there is a <span class="math-container">$z$</span>-test for doing this but su... | A common approach is to have the neural network output <span class="math-container">$u, v$</span> representing the angle <span class="math-container">$\hat \theta$</span> such that <span class="math-container">$\cos(\hat \theta) = \frac{u}{u^2+v^2}$</span>, <span class="math-container">$\sin(\hat \theta) = \frac{v}{u^2... | In circular statistics, your suggestion <span class="math-container">$\min((y−\hat{y})^2,(y−\hat{y}−2π)^2,(\hat{y}−y+2π)^2), $</span> which we could call arc distance loss, is actually one of the known loss functions that can be used. It works, and intuitively it is certainly more sensible than the categorical approach... | https://stats.stackexchange.com |
2,779,441 | [
"https://math.stackexchange.com/questions/2779441",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/366312/"
] | <blockquote>
If $f(x)$ is defined for all $x>-2$ as the square root of the number that is $2$ more than $x$, what is the value of $f(7) - f(-1)$?
</blockquote>
<strong>My attempted solution:</strong>
$f(x) = \sqrt{x + 2}$
Now, $f(7) = \sqrt{7 + 2} = \pm3$
and,
$f(-1) = \sqrt{-1 + 2} = \pm1$.
So, $f(7) - f(... | The given answer is taking what is referred to as the <em>principal square root</em>, rather like $x=\frac{\pi}{6}^c$ or $x=30^0$ is the principal root of $\sin(x)=\frac{1}{2}$, there are many other solutions, but this is the one that is most commonly used, and given by calculatorss.
In this question, it is standard ... | It is a convention that for $a>0$, if
$$b=\sqrt a$$, then $b>0$.
In some articles, $b$ is called the <strong>principal value</strong> of square root, distinguishing it from the other possible value, $-b$.
| https://math.stackexchange.com |
448,974 | [
"https://physics.stackexchange.com/questions/448974",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/208153/"
] | I'm having a hard time trying to understand why Kirchhoff's Voltage Law is true. I looked for an answer on the forum but I couldn't find a convincing one.
So my question is :
How to "physically" understand Kirchhoff's Voltage Law, with a precise microscopical interpretation and if possible without analogies (with gra... | Fundamentally, it's because of the conservation of energy. Voltage is the same as electrical potential; an electron moving through a potential difference of 1 V gains or loses precisely 1 eV = <span class="math-container">$1.6\times 10^{-19} J$</span> of energy. We know that if an electron travels all the way around ... | It is because of how voltage is defined: as difference of electric potential. Electric potential is a number for each point of space.
Choose two points in space, say, on terminals of a resistor you mentioned. At each of these two points, electric potential has some value. Voltage between them is defined uniquely as di... | https://physics.stackexchange.com |
23,829 | [
"https://electronics.stackexchange.com/questions/23829",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/7008/"
] | I am writing an Assembly Program function for 89C51 which can create one hour delay. I can't use any other micro controller as only 89c51/52 is available locally. So I am stuck here because even when I set <code>R5 to #255</code> the maximum delay I can create this way is only 2 minutes. As my knowledge is somehow wea... | What's the problem you are having? Did you write this code or have you copied it from somewhere else and are trying to make it work?
Considering the code below. Does it work when you run it? (This should be identical to your code.)
<img src="https://i.stack.imgur.com/M3GAv.jpg" alt="enter image description here">
Th... | First, lots of micros are available anywhere in the world. Most distributors will ship anywhere. I'm in Massachussetts, but when I buy Microchip PICs the get shipped to me from Thailand.
Second, regardless of the microcontroller, any amount of delay can be created by nesting loops. You have already said you can cre... | https://electronics.stackexchange.com |
303,007 | [
"https://dba.stackexchange.com/questions/303007",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/242649/"
] | I'm new to SQL so this might be easy. I'm trying to join two tables where the first has a standard incremented primary key, but the second table has a column with values like "Ref:36736", where 36736 is the primary key from the first table but it's prefixed with "Ref:".
How do I formulate the JOIN? ... | You can join on an expression:
<pre><code>select *
from first_table ft
join second_table st on ft.id = replace(st.the_column, 'Ref:', '')::int
</code></pre>
However the better solution would be to fix your broken data model.
| <blockquote>
... two tables ... the first has a standard incremented primary key, but the second table has a column with values like "Ref:36736", where 36736 is the primary key from the first table but it's prefixed with "Ref:".
</blockquote>
You've embedded a <em>Presentational</em> aspect of your ... | https://dba.stackexchange.com |
64,633 | [
"https://physics.stackexchange.com/questions/64633",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | Looking at diagrams of Electromagnetic Waves, it would appear to me that at certain times the waves have zero amplitude, and consequently zero energy. Indeed, substituting in the sinusoidal terms into the Poynting Vector equation, It would seem that at certain times the energy disappears. Why is this not the case?
| At certain <em>positions</em> in the waves, the EM field is zero and thus zero energy is stored at those positions. But at other positions, the EM field is at a maximum, and those points are local maxima of energy. That pattern of oscillation between zero energy and maximum energy moves in the direction of propagation ... | "Looking at diagrams of Electromagnetic Waves, it b would appear to me that at certain times the waves have zero amplitude, and consequently zero energy. Indeed, substituting in the sinusoidal terms into the Poynting Vector equation, It would seem that at certain times the energy disappears. Why is this not the case?" ... | https://physics.stackexchange.com |
232,004 | [
"https://physics.stackexchange.com/questions/232004",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/105192/"
] | As you guys know that we see at the speed of light, it means that we see the past of stars and galaxies. So say a star went supernova right now, how are we able to know current state of that star that is thousands of light years away or is it possible!!!
| We wouldn't be able to see it if a star went supernova right now because the light wouldn't have reached us yet. If a star 100 light years away from us went supernova 100 years ago we would see it now because the light would have had enough time to travel to us.
| While some galaxies are billions of light years away, there are hundreds of galaxies withing just a few dozen million light years away. Astronomically speaking, a few dozen million years is pretty brief. We can be fairly certain that the galaxy hasn't changed much in this time.
| https://physics.stackexchange.com |
7,181 | [
"https://cardano.stackexchange.com/questions/7181",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/5866/"
] | what API's is Cardano RealFi going to use and how do we also integrate local languages on the Plutus platform
| Usually you don't see <code>>>=</code> (bind) and <code>>></code> (then) inside <code>do</code> blocks--<code>do</code> gives you a more flexible interface with monads and lets you weave in other logic, as you can see in the function you're referring to:
<pre><code>payContract :: Contract () PaySchema Text ... | There are no benefits of using one over the other. They are equivalent and its simply a matter of choice.
| https://cardano.stackexchange.com |
404,706 | [
"https://mathoverflow.net/questions/404706",
"https://mathoverflow.net",
"https://mathoverflow.net/users/131975/"
] | For the sake of this question, we'll model a six functor formalism in the following way. Let <span class="math-container">$\mathsf{C}$</span> be a category <em>of spaces</em> (be it the category of schemes, or topological spaces) and consider a triangulated closed symmetric monoidal category <span class="math-container... | Your description of the six functors does not mention any relations between the <span class="math-container">$!$</span>-functors and the <span class="math-container">$*$</span>-functors or the tensor product, which is where these dualities are hiding.
Poincaré duality is a relation between the <span class="math-contain... | @MarcHoyois It would help to have a further comparison between <span class="math-container">$\mathrm{hom}(1_S, f_!f^!M[m])$</span> and a naive definition of homology such as <span class="math-container">$H^{m}(X, M)^\lor$</span> in the case of field coefficients.
| https://mathoverflow.net |
19,961 | [
"https://physics.stackexchange.com/questions/19961",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/7299/"
] | Basically, I need to conceptually understand why the work a gas does is the integral $\int p_\mathrm{external}dv$ and is 0 when pressure external is 0. I understand why $\mathrm{d}w = - p_\mathrm{externa } \mathrm{d}v$ and so obviously I understand why the math says the work is 0; I need to conceptually understand it.
... | You can indeed think of expansion in a vacuum as the top disappearing when the gas is released.
Imagine you take a powerful microscope and watch the gas molecules hitting the lid of your cylinder. If the lid isn't moving the gas molecules will bounce off with the same speed as they hit i.e. no energy is lost, so no wo... | Treat your cylinder as being on it's side.[+] If it is vertical that the weight of the piston <em>does</em> contribute to the pressure. In that event the pressure can't be zero unless the mass of the stopper vanishes (which is also a way to imagine the situation if you prefer).
<hr>
[+] Even at that we need to assume... | https://physics.stackexchange.com |
289,458 | [
"https://physics.stackexchange.com/questions/289458",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/117014/"
] | My question has to do with the justification for the assertion that <span class="math-container">$\partial x^{i}/\partial\dot{q}^{j}=0$</span> when working with generalized coordinates. The following is an example of where this appears, and why it is confusing to me. Summation on like, upper and lower index pairs is as... | <blockquote>
So what happens when the mass M and the distance are set so that $2M/r=1$? If you are at $r=2M$ distance from a $M$ mass black hole then $(1-2M/r)=0$ and what will that mean? This will be zero $−(1−2Mr)dt^2$.
</blockquote>
The correspondence between the Schwarzchild metric and the flat scale metric impl... | <blockquote>
What does that mean?
</blockquote>
It <em>means</em> that for $r \gt 2M$, an infinitesimal displacement $\mathrm{d}r$ is <em>space-like</em> while for $r \lt 2M$, an infinitesimal displacement $\mathrm{d}r$ is <em>time-like</em>. The horizon is the boundary.
Put another way, inside the horizon, moving... | https://physics.stackexchange.com |
425,783 | [
"https://softwareengineering.stackexchange.com/questions/425783",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/282285/"
] | I'm working on a project in which I have a clear separation between domain logic and the logic that exposes these features using an API (or whatever). For this I'm using the Onion Architecture.
Now I want to implement authorization. E.g.: If the user is the manager of an employee, he can update their salary. But not fo... | Assuming you have a DI container, my preferred approach here is to create a <code>ICurrentUserService</code> (or similar) which fetches the information for you.
The interface:
<pre><code>public interface ICurrentUserService
{
string GetUserName();
}
</code></pre>
Then your Web project can implement it:
<pre><code>p... | <blockquote>
Are there any patterns for this?
</blockquote>
The usual answer would be that your outer layers extract the information that you need from, for instance, the authorization token, and then pass that information to the domain model as an argument.
<pre><code>bob.updateSalary(20000, alice, orgChart)
</code></... | https://softwareengineering.stackexchange.com |
438,011 | [
"https://softwareengineering.stackexchange.com/questions/438011",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/359583/"
] | I currently have a monolithic web application.
Some API calls need a lot of processing resources and I would like to take that part out of my "backend" monolith and put it in its own service.
I use Docker Compose to develop my application. My database is a MongoDB replica set, to simulate what I have in produ... | <blockquote>
But now, I'm wondering how my development setup would look like. Would I need "mongo-heavy0", "mongo-heavy1" and "mongo-heavy2" for my "backend-heavy" service, like this?
</blockquote>
The essence of the microservices approach is that each service can be developed, t... | Microservices require that you dont share databases.. You can still use the same 3 mongo instances to hold multiple databases
| https://softwareengineering.stackexchange.com |
13,266 | [
"https://quantumcomputing.stackexchange.com/questions/13266",
"https://quantumcomputing.stackexchange.com",
"https://quantumcomputing.stackexchange.com/users/7598/"
] | I know I can make a <code>random_circuit</code>, but I see that Qiskit has <code>random_statevector</code>. I'd like to optimize computation time by initializing a state by that instead of putting a random circuit at the beginning. Is it possible and how do I do it? Thank you!
| here is an example of how to initialize the random statevector then send it to the quantum circuit:
<pre><code>from qiskit.quantum_info import random_statevector, Statevector
from qiskit import QuantumCircuit
# import numpy as np
vec = random_statevector(2)
# vec = Statevector([1, 0])
print('before circuit: {}'.format... | How about using the data attribute, like this:
<pre><code>qc = QuantumCircuit(1)
initial_state = qc.initialize(random_statevector(2).data, 0)
</code></pre>
| https://quantumcomputing.stackexchange.com |
80,076 | [
"https://cs.stackexchange.com/questions/80076",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/63873/"
] | I am trying to solve the following recurrence relation :-
<span class="math-container">$T(n) = T(\sqrt{n}) + n$</span> using masters theorem.
We can substitute <span class="math-container">$n = 2 ^ m$</span>
<span class="math-container">$T(2^m) = T(2 ^ {\frac{m}{2}}) + 2^m$</span>
Now we can rewrite it as
<span cl... | The answer cannot be <span class="math-container">$O(\log\log n)$</span>. Already without applying any recursion we have the inequality <span class="math-container">$T(n) = T(\sqrt{n}) + n \ge n$</span>. So the complexity cannot be smaller than <span class="math-container">$O(n)$</span>.
<hr>
But now to your computa... | The transformation:
You define <span class="math-container">$S(m) = T(2^m)$</span> which is absolutely fine.
<span class="math-container">$T(m) = T(m^{1/2}) + m$</span>, so <span class="math-container">$T(2^m) = T(2^{m/2}) + 2^m$</span>.
Therefore <span class="math-container">$S(m) = T(2^m) = T(2^{m/2}) + 2^m = S... | https://cs.stackexchange.com |
119,923 | [
"https://physics.stackexchange.com/questions/119923",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/23517/"
] | I was wondering about the following:
If you have the time-dependent Schrödinger equation such that
$$i \hbar \frac{\partial\psi(x,t)}{\partial t} = - \frac{\hbar^2}{2m} \frac{\partial^2\psi(x,t)}{\partial x^2} + V(x,t) \psi(x,t),$$
where the potential is also time dependent. What is the general strategy to solve th... | Firstly, there are a few issues with a time-dependent potential, $V(x,t)$. Namely, if we apply Noether's theorem, the conservation of energy may not apply. Specifically, if under a translation,
$$t\to t +t'$$
the Lagrangian $\mathcal{L}=T-V(x,t)$ changes by no more than a total derivative, then conservation of energy... | I'm aware of no general recipe. If the time-dependent part of $V$ is weak, one can apply time-dependent perturbation theory (TDPT) to calculate corrections to the unperturbed, time-independent solution. This should be contained in any book on quantum mechanics. This way, one can also calculate the transition probabilit... | https://physics.stackexchange.com |
517,099 | [
"https://physics.stackexchange.com/questions/517099",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/248586/"
] | Consider a ball kept on man's head (mass <span class="math-container">$M$</span>) on the Earth. Now supposing I throw the ball from height <span class="math-container">$h$</span> of tall building then why does he gets more hurt? Isn't the force still mg?
I would like to know what happens in ideal case (no air resistanc... | <blockquote>
Now supposing I throw the ball from height ℎ of tall building then why
does he gets more hurt? Isn't the force still mg?
</blockquote>
The impact force of the ball falling on the man's head is not the same as the weight of the ball on the persons head. This is because it takes a force to perform work ... | mg is the force that the earth does on the ball, it is not the force between the head and the ball. This last force will be a function of the contact speed when they collide
| https://physics.stackexchange.com |
701,110 | [
"https://math.stackexchange.com/questions/701110",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/30481/"
] | A particular combinatorial sequence I was looking at turned out to obey the following pair of recurrence relations:
$$N_{2n+1}=\sum^n_{k=0}N_{2k}$$
$$N_{2n}=\left(\sum^{n-1}_{k=0}N_{2k+1}\right)+1=\sum^n_{k=0}N_{2k-1}$$
For the second form of the second equation, I'm using the convention $N_{-1}=1$.
The even terms d... | Sure, if $Q$ is a rotation matrix ($Q^T Q = I$), then with the Euclidean norm we have
$\|x\|^2 = \langle x , x \rangle = \langle x , Q^T Qx \rangle = \langle Qx , Qx \rangle = \|Qx\|^2$.
| Yes, this is preserved as we go to higher dimensions as long as the number of terms is the same as the dimension of the space. The Pythagorean theorem (iterated) says this sum of squares is the square of the distance from the origin to the point.
| https://math.stackexchange.com |
386,513 | [
"https://physics.stackexchange.com/questions/386513",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/148764/"
] | My book says that all interaction of light and matter can be reduced to the photoelectric effect, the Compton scattering and pair production. How true is this?
What about reflection and absorption and emission and blackbody radiation and all that stuff?
| Your book's claim is correct: <strong>all</strong> light-matter interactions can be reduced, when expressed as QED perturbative expansions, to a small set of Feynman diagrams. (I'll leave it to a QED expert to validate the specific set in your book's claim, but it looks correct to me.) This is true for the processes yo... | There are many interaction processes of light with matter that are not included in the three interactions named Compton effect, photoelectric effect, pair production, to which all interactions can supposedly be reduced. For example, Rayleigh scattering, Mie scattering, Raman scattering, stimulated light emission, atomi... | https://physics.stackexchange.com |
111,439 | [
"https://cs.stackexchange.com/questions/111439",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/106305/"
] | What is the intuition behind EXPTIME being inside EXPSPACE?
When space complexity is usually smaller than time complexity or in the worse case, they are equal
| As Yuval Filmus states in the comments, any TM (with one tape and one read-write head) whose time complexity is bounded by a function <span class="math-container">$t$</span> also has its space complexity bounded by <span class="math-container">$t$</span> since, in <span class="math-container">$t$</span> steps, the TM c... | Think about it this way: Consider an algorithm that executes <span class="math-container">$n$</span> steps, and then stops. To make that happen - to execute exactly those <span class="math-container">$n$</span> steps - you first need some way to store the number <span class="math-container">$n$</span>, <em>and</em> you... | https://cs.stackexchange.com |
81,832 | [
"https://security.stackexchange.com/questions/81832",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/68475/"
] | When I am logged into the Google and prints document.cookie I could see following cookies. My doubt is what all an attacker can do if attacker could steal these cookies of the victim using exploiting some vulnerabilities like XSS? Is this can be considered as privacy breach? (I think they can get browsing history of th... | Well, even if Google <em>was</em> vulnerable to XSS, this still wouldn't be a breach.
Why? Because of the <code>HTTPOnly</code> flag. It is the big reason for XSS's downfall.
You can say there are two kinds of cookies:
<ol>
<li>those that your browser gets when it recieves an HTTP response from a remote server (lik... | They can log in pretending to be you, your cookie is basically the token that the server gave you so that you can stay logged. So that means accessing all the google services logged in with your account. If those are your real cookie values, you should log out from you google account as soon as possible..
EDIT: I didn... | https://security.stackexchange.com |
43,166 | [
"https://datascience.stackexchange.com/questions/43166",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/64594/"
] | I am learning about the LSTM network. The input needs to be 3D. So I have a CSV file which has 9999 data with one feature only. So it is only one file.
So usually it is <code>(9999,1)</code> then I reshape with time steps 20 steps
<pre><code>timesteps = 20
dim = data.shape[1]
data.reshape(len(data),timesteps,dim)
<... | (9999,1) has 9999*1 elements = 9999. However, (9999,20,1) will have 9999*20*1 elements, which are not available. Break your data into a batch/sequence length of say 99.
Then reshape it into (101,99,1)
| RNN input shape is batch_size x sequence_length x nbr_features.
Believe you need to pre-process and setup your training data properly. You need to generate multiple training examples from the available data.
I am not sure what is your data looking like. From available info, it appears you have 9999 data points for a ... | https://datascience.stackexchange.com |
777,863 | [
"https://math.stackexchange.com/questions/777863",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/117757/"
] | Does there exists an $f:\mathbb{R}\rightarrow \mathbb{R}$ differentiable everywhere with $f'$ discontinuous at some point?
| Yes there does exist such a function, for example
$$f(x)=\cases{x^2\sin(1/x)&if $x\ne0$\cr 0&if $x=0$.\cr}$$
By normal differentiation rules we have
$$f'(x)=2x\sin(1/x)-\cos(1/x)$$
if $x\ne0$, and for $x=0$ we use the definition:
$$f'(0)=\lim_{h\to0}\frac{f(h)-f(0)}{h-0}=\lim_{h\to0}h\sin(1/h)=0\ .$$
So $f$ is ... | Yes. Do you know an example of a continuous function that is not differentiable at some point? (Hint: think of a corner) If you integrate it....
| https://math.stackexchange.com |
61,445 | [
"https://physics.stackexchange.com/questions/61445",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/20633/"
] | Given that everything else is equal (model of fridge, temperature settings, external temperature, altitude), over a given duration of having the door closed, does it require more electricity to cool an empty refrigerator AND maintain that temperature, than a full one?
| The two "no" answers you've already received are correct for all practical purposes.
In real-world cases there can be a difference though. The difference depends on when the refrigerator decides to cycle on and cool. If the fridge cycles on a timer or based on heat energy then there will be a difference due to the a... | No. The rate of cooling must simply match the rate of heating, and heating rate depends only on the temperature difference you want to establish and on the thermal conductivity and surface area of the walls.
More stuff in the refrigerator would give it a higher heat capacity, so that it wouldn't warm up so much when t... | https://physics.stackexchange.com |
101,114 | [
"https://softwareengineering.stackexchange.com/questions/101114",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/587/"
] | Recently my boss suggested that we post logs of our service that is hosted on Windows Azure into twitter. His idea is that it's conveniently readable and if Azure cloud fails logs persist. He also said, <em>lots of people do this</em>, I Googled and couldn't find any data about this.
Currenly my concerns are the follo... | No. Watch the Twitter engineering talks they openly admit that they can accept some failure in some case loss of messages and no-notifications without incident. Also I would be concerned about the account being auto-blocked for what looks like abuse (breaking a certain rate-limit trigger etc..) Not a good idea,
Altho... | Personally I don't like being dependent on external services when it isn't absolutely necessary. As you say, if one day the EULA changes, APIs change, anonymous hacks twitter or twitter stops its services entirely, then you'll have to deal with it. It could essentially boil down to higher costs in support and in mainte... | https://softwareengineering.stackexchange.com |
300,975 | [
"https://dba.stackexchange.com/questions/300975",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/240267/"
] | I need to store objects in a PostgreSQL database version 13.
Each object has an ID, a name, occupies a level and belongs to a parent object, relation denoted by belongs_to.
The values for the levels are stored in the levels table:
<pre><code>CREATE TABLE public.levels (
id integer NOT NULL,
name character varyi... | That is as expected. Since updating a row will write a new row version while leaving the old one in place, updating all rows of a table will double its size.
If you run several updates without giving autovacuum time in between to free the dead row version, the size can increase even more.
After your updates are done, r... | In stead of adding and updating the columns when table2 has been created, add the new columns to the select when you create table2.
<pre><code>CREATE TABLE table2 AS
SELECT t1.*,
... new_real1,
... new_real2,
... new_int
FROM table1 t1;
</code></pre>
| https://dba.stackexchange.com |
265,026 | [
"https://physics.stackexchange.com/questions/265026",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/26665/"
] | Continuum expression of first law of thermodynamics:
$$\frac{D E_t}{D t}=\nabla\cdot({\bf \sigma\cdot v}) - \nabla\cdot{\bf q}$$
(I've seen it in my physics book)
How this equation is derived?
<hr>
Where the $\bf q$ is Heat flux vector, $\sigma$ is stress tensor and $\bf v$ is velocity vector field.
(First law of... | The starting point for the development of this equation is an energy balance on a fixed control volume of fluid:
$$\int{\frac{\partial E}{\partial t}dV}=-\int{E(\vec{v}\cdot \vec{n})dA}+\int{(\vec{v}\cdot \vec{\sigma} \cdot \vec{n})dA}-\int{\vec{q}\cdot\vec{n}}dA$$
where dV is differential volume, dA is differential su... | Ok, let's take the 1st law (in any reference frame) as
$$\frac{D}{Dt}E_t(V) = P + Q $$
where $V$ is a part of the body, $P$ is the work rate by mechanical processes and $Q$ is the change of heat content. They will hopefully become more clear when I say how they can be calculated:
$$P= \int_V dV \rho \vec{v} \vec{b} + \... | https://physics.stackexchange.com |
81,947 | [
"https://physics.stackexchange.com/questions/81947",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/28246/"
] | In my syllabus about electromagnetism, they state:
"This surface charge density will not always be present, e.g. when considering two non-conducting dielectrics such surface charge density remains absent. However, at a perfect conductor, a surface charge density will be present. If one of the media (or both) carry a c... | The following relation describes the total electric flux density in a medium:
<img src="https://i.stack.imgur.com/RcF57.png" alt="enter image description here">
In the previous equation, D is the total electric flux density, epsilon is the free space permittivity . E is the external applied electric field, and P is t... | A simple line is as follows:
<ol>
<li><strong>Conductor is an equipotential volume.</strong> If there were potential difference between any two points, free charges would flow to compensate for this difference, hence produce currents. If there is a current, it produces heat. However, due to energy conservation the he... | https://physics.stackexchange.com |
75,954 | [
"https://dba.stackexchange.com/questions/75954",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/47012/"
] | I am logging live data to a database where it is then selected by a php script and posted to a graph on a webpage.
A new datapoint is added every second and I have been graphing the most recent 300 points for a 5 minute history on the graph using the following:
<pre><code>SELECT * FROM table_name ORDER BY timestamp D... | something like
<pre><code>select * from table where MOD(UNIX_TIMESTAMP(timestamp),300)) = 0;
</code></pre>
should do the job. But I am not sure if this is correct. The idea is to try to modulo divide the minute part evenly. Be aware, that this may cause in a full table scan
| is your query1 and query2 are query from 1 table only?
try to use this if you want to get query2 = query1 value + 5mins
<code>SELECT * FROM table_name where timestamp = query1 + INTERVAL 5 MINUTE;</code>
| https://dba.stackexchange.com |
1,170,723 | [
"https://math.stackexchange.com/questions/1170723",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/180834/"
] | Let $(G, *) $ be a monoid . Let $g \in G$ and $ g = g * g $. Can I assume, that $g$ must be neutral element? Why?
| No, and here's a more complex example: let $\Bbb N$ be the natural numbers, i.e. $\Bbb N = \{ 0, 1, 2, 3, \ldots \}$; note I am allowing $0 \in \Bbb N$. For any $n \in \Bbb N$, $n \ge 2$, let $M_n(\Bbb N)$ be the set of $n \times n$
matrices with entries taken from $\Bbb N$. It is clear that $M_n(\Bbb N)$, with the... | No, you cannot. $\mathbb{N}^{\geq 0}$ is a monoid under multiplication, but $g=0$ is not the identity element even though it satisfies your condition.
| https://math.stackexchange.com |
260,256 | [
"https://stats.stackexchange.com/questions/260256",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/105511/"
] | <blockquote>
I need to evaluate this integral with importance sampling method
$$\int_{0}^{\pi}\frac{1}{\cos(x)^2+x^2}dx$$
using this weight function (exponential)
$$f(x)=\lambda\exp\{-\lambda x\}$$
</blockquote>
This is my attempt
<pre><code>set.seed(1)
f <- function(x){
1 / (cos(x)^2+x^2)
}
mc <- f... | I think there is a fundamental mistake in your code:
<pre><code>mc <- function(lambda, f, B){
x <- rexp(B, lambda)
f(x[x<pi]) / dexp(x[x<pi], lambda)
}
</code></pre>
since it produces a sample of an exponential truncated to $(0,\pi)$, with a random size. Therefore, the importance weight should be ... | Your mean and standard deviation are random. You will never have exactly the right mean (with probability one). Notice how if you run the last portion again, all the numbers change. Maybe you would like a confidence interval: "mean" $\pm$ $2\sqrt{\text{"var"}}$.
Also, disregard my comment, because that applies to self... | https://stats.stackexchange.com |
93,052 | [
"https://math.stackexchange.com/questions/93052",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/17475/"
] | Sorry I have to ask such a simple question, my brain is fried after today.
After substituting with a system of equation, I end up with this "simple" logarithmic problem.
$$5 - \log_2 (x - 3) = \log_2(x+1)$$
What property of logs am I looking for to solve this? I know the solution is $x = 7$. Properties of log... | Put all log terms on one side:
$$5=\log_2(x-3)+\log_2(x+1).$$ Then, write the log terms using only one logarithm (use the law $\log_2 a+\log_2 b=\log_2(ab)$:
$$5=\log_2( (x-3)(x+1) ).$$
To get rid of the log, recall, $\log_a x=y\iff a^y=x$, so the above equation can be written as $$2^5=(x-3)(x+1).$$ Can you take i... | Use 5 log2 to the base 2.
as same 5(1)=5log2 to the base 2
You get 25=(x-3)(x+1) as when log with same bases then if log is subtracted to convert logs with same bases the subtracted is divided and if for instance logs are added then to convert then they are multiplied
NOTE: for this the bases have
Hope it helps go... | https://math.stackexchange.com |
139,187 | [
"https://softwareengineering.stackexchange.com/questions/139187",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2327/"
] | I'm considering the reengineering of my web development ecosystem. We use Git very successfully to deploy new changes to our Production, Staging, and Development servers. Traditionally, I've always had a copy of Apache on my local machine - in the interest of keeping my local machine as lean as possible, I'm considerin... | It does not really matter if your server is local or on a separate machine; what matters is if you can test any changes to your code fast enough. For example, you should not have to wait not even a minute for a cron job to pull your code changes to the server. And typically you should test any changes to your code firs... | Have you tried simply exporting the version on the development server as a network share and developing that way?
I'm in the reverse situation. I have a workstation with limited storage, but plenty of grunt. I've got a NAS with a NFS export that I use as <code>/home</code> with little problems over gigabit ethernet. A... | https://softwareengineering.stackexchange.com |
97,824 | [
"https://softwareengineering.stackexchange.com/questions/97824",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/33135/"
] | I am a software engineer with a couple of years of experience. However I feel my problem solving skills need to be improved. To put in crude terms given facts A and fact B I have difficulty in reaching conclusion X ? Some people seem to have the ability to reach conclusion X given facts A and B and and also remembering... | Generally when I'm solving problems via analysis I do the following:
<ul>
<li>locate in a system, the sub-components that are the focus of the problem</li>
<li>State the initial assumptions for the components state</li>
<li>given a set of initial state(s), predict what you believe will be the outcome.</li>
<li>If the ... | There is a book called Analysis Patterns by Marin Fowler. It is about object models and not about any algorithmic analysis, but learning about this patterns, helped me recognizing patterns in various domains and thus being able to analyze it more thoroughly.
| https://softwareengineering.stackexchange.com |
3,176,434 | [
"https://math.stackexchange.com/questions/3176434",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/273514/"
] | I was going through some of the earlier answers for the license plate problems and one of the comment was as follows.
<blockquote>
Does a plate consist of 3 letters and 3 digits in any order, like
7C99XK, or is it 3 letters followed* by 3 digits? The answers will be
different.
</blockquote>
I understand the pro... | The number of <em>arrangements</em> of three letters followed by three digits is <span class="math-container">$26^3\cdot 10^3$</span>, seen by direct application of the rule of product using the following steps:
<ul>
<li>Pick what the letter is in the first spot (26 choices)</li>
<li>Pick what the letter is in the sec... | The probability of a certain combination out of those consisting of 3 letters and 3 digits in any order is
<span class="math-container">$$
\frac{3!3!}{6!}\frac1{26^3 10^3},
$$</span>
since there are <span class="math-container">$\frac{6!}{3!3!}$</span> ways to choose a specific order of letters and digits.
| https://math.stackexchange.com |
438,772 | [
"https://softwareengineering.stackexchange.com/questions/438772",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/255602/"
] | I have the following problem - I write the code for object data manager, and one of requirements is being able to save/load data into some persistent data storage. I want to make it as the following:
<ul>
<li>there is an interface, IPersistentDataService.</li>
<li>if user uses an option to save/load from file, they can... | Legacy just means something from the past. In this sort of context it means something from the past that is now disliked and should not be copied.
<code>implode(array $array, string $separator): string</code> is the legacy signature of the PHP implode function, because it was created in the past but the people in contr... | As mentioned already, legacy refers to remnants of the past. It has a generally negative connotation.
Signature refers to a method signature (which you'll find a lot of google hits for). In this case, they're referring to a particular's methods's combination of input parameters; which is part of that method's signature... | https://softwareengineering.stackexchange.com |
209,795 | [
"https://electronics.stackexchange.com/questions/209795",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/50937/"
] | I read information about fluorescent lamp and compact fluorescent lamp (CFL) but I still don't understand why CFL saves energy and produce the same amount of light?
Maybe the electronic ballast consume less reactive power than the traditional ballast?
| You question is not so clear but is seems that you're asking why is a modern compact CFL lamp more efficient that the old fashioned CFL tubes ?
This is easy to answer if you just sit down and think about it for a moment.
What happens when something is inefficient ? Energy is lost, well not lost but it is converted int... | Flouro lamps are actually more efficient at say 30KHz than 50Hz .The efficiency curve doesnt keep increasing ,it kind of limits out .This is why you tend to not see stuff in the MHz range despite it being technicaly feasible .The electronic ballast makes the tube itself more efficient .Even if you use rubbish for the e... | https://electronics.stackexchange.com |
92,622 | [
"https://security.stackexchange.com/questions/92622",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/79578/"
] | I am preparing for a technical interview for an AppSec pen-testing position. For those of you that have had AppSec positions, what sharp-shooter questions do you think I can expect? What questions would you ask a candidate if you were doing the interview? Thank you for your insight!
| What different types of XSS are there?
How are they exploited?
How would you remediate them?
Also answer the above 3 questions for SQL injection and Cross site request forgery.
What type of vulnerabilities are hard to detect with automated scanners?
How would you manually test these vulnerabilities?
It would be diff... | <ul>
<li>What are some strategies to detect and prevent vulnerabilities
introduced by third party libraries?</li>
<li>How would you demonstrate to a customer why it is important to fix
reflective cross-site scripting flaws?</li>
<li>How would you demonstrate to a customer why MD5 is not appropriate
algorithm to use whe... | https://security.stackexchange.com |
87,430 | [
"https://mechanics.stackexchange.com/questions/87430",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/2618/"
] | I just lapped my valves on a cylinder because they were leaking and reused the stem seals. Should I put new stem seals or is it okay to reuse them?
| Well, if you believe the seals are in good shape, there's nothing saying you can't reuse them. However, considering you have it all apart and the seals are relatively cheap considering the amount of time it would take to tear it all apart to replace these specifically, it only makes sense to replace them while you're i... | As inexpensive as those seals are, and as hard as they are to get to, you should absolutely replace them.
Do not reuse them.
| https://mechanics.stackexchange.com |
732,425 | [
"https://math.stackexchange.com/questions/732425",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/89679/"
] | Let $0\,^{\circ}\mathrm{} < A < 45\,^{\circ}\mathrm{}$. If $$420(\tan A + \cot A) = 841$$ then find the value of $$(116 \cos A −
58 \sin A)$$
One way to solve this is by usual method , that is putting $\cot A = 1/\tan A$ in first equation then finding angle A and then calculating the answer.
But here I cannot... | Observe that as $\displaystyle0< A<45^\circ, 0<\tan A<\tan45^\circ=1$
So,we have $\displaystyle\tan A+\frac1{\tan A}=\frac{841}{420}$
$\displaystyle\iff420\tan^2A-841\tan A+420=0$
So, the discriminant will be $\displaystyle841^2-4\cdot420\cdot420=841^2-840^2=841+840=41^2$
Solve the Quadratic Equation ... | All MPA trig questions are meant to be solved using quadratics. That's why the give angle is smaller that 45.
<img src="https://i.stack.imgur.com/ew1w2.jpg" alt="enter image description here">
<img src="https://i.stack.imgur.com/E5HJ1.jpg" alt="enter image description here">
| https://math.stackexchange.com |
3,125,661 | [
"https://math.stackexchange.com/questions/3125661",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/484248/"
] | I am working on my homework and have come into a problem. I am relying on this fact to prove the statement:
"Let <span class="math-container">$a$</span> have order <span class="math-container">$n$</span> modulo <span class="math-container">$m$</span> and let <span class="math-container">$i$</span> denote an integer. ... | The easy way is to show that if the order of <span class="math-container">$a^i$</span> is <span class="math-container">$n$</span>, then <span class="math-container">$\gcd(i,n)=1$</span>. We see this since <span class="math-container">$(a^i)^{n/\gcd(i,n)}=1$</span>.
For the other direction, we want to show that <span c... | let <span class="math-container">$(i,n)=k$</span> where <span class="math-container">$k>1$</span>
Then <span class="math-container">$n|i\cdot \frac{n}{k}$</span> because <span class="math-container">$\frac ik$</span> is an integer.
The other direction: assume <span class="math-container">$(n,i)=1$</span> and <span... | https://math.stackexchange.com |
284,336 | [
"https://dba.stackexchange.com/questions/284336",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/222090/"
] | I'm building a database for daily sales report. For example:
29/01/2021 -> 50 apples were sold<br>
30/01/2021 -> 46 apples were sold
I have these tables:
<code>products</code>
<ul>
<li>id INT AUTO_INCREMENT PRIMARY KEY</li>
<li>name VARCHAR(100) NOT NULL</li>
<li>price FLOAT NOT NULL</li>
<li>deleted_at DATETIME ... | What you really should do (and is how a lot of similar type systems architect their schema) is have two normalized tables that store sales information.
One table is the <code>SalesHeader</code> (or sometimes just called <code>SalesOrder</code>) and the other table is the <code>SalesLine</code>. <code>SalesHeader</code>... | Your problem is with the semantic meaning of the SALES table. It looks like you expect it to contain one row that represents the <strong>total sales</strong> on a given day for a given product.
It seems to me like a better definition is for the SALES table to record individual sales during the day. Then it makes sense ... | https://dba.stackexchange.com |
4,820 | [
"https://mechanics.stackexchange.com/questions/4820",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/2455/"
] | This is a pretty common question and I get a lot of conflicting responses from "Extremely dangerous could blow out at any minute" to "I've driven on it for a month". A mechanic at midas told me I could drive on it for a week and be fine.
I'm driving a 1993 Grand Am thats actually in fairly good condition. One of my ti... | First, the critical caveat:
<strong>You are the driver. You have to make the decision.</strong> It ultimately doesn't matter what we say.
Given, that, I would say <strong>NO</strong>, it is not safe to drive until the weekend. Get the broken tire fixed or replaced as soon as possible.
You have two problems:
<ol... | And, to just add my two bits, make sure that donut spare is properly inflated while you're driving on it! Most spares have a much higher inflation pressure that people do not know about. The spare on my Accord has a max. pressure of 60 PSI. And to significantly decrease the chances of your tire exploding, or wearing... | https://mechanics.stackexchange.com |
30,185 | [
"https://security.stackexchange.com/questions/30185",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/9499/"
] | I am looking to test/demonstrate things like: when the supplied wordlist contains "abc123" and pw="abc123" then John cracks the pw in 1/2 a second... but if word list does not contain "abc123" John takes 5000 seconds to crack the pw.
<code>John --test myPwFile</code> does not seem to do what I want it to do.
| The important thing to understand is that password cracking time is an <em>average</em>. The attacker will try a lot of passwords, and may be lucky... or not. John the Ripper will use the provided word list, and then try "variants" of the said words, in some order which may or may not be representative of what an attac... | <strong>No</strong>.<br>
It is not possible to find the time to crack the password. Because if your password is in the dictionary provided by John The Ripper then it will crack the password very quickly. But if the password is not in the dictionary it will do brute force against the password trying all possible combina... | https://security.stackexchange.com |
71,608 | [
"https://mathoverflow.net/questions/71608",
"https://mathoverflow.net",
"https://mathoverflow.net/users/13694/"
] | Consider the following question:
Is there a family $\mathcal{F}$ of subsets of $\aleph_\omega$ that satisfies the following properties?
(1) $|\mathcal{F}|=\aleph_\omega$
(2) For all $A\in \mathcal{F}$, $|A|<\aleph_\omega$
(3) For all $B\subset \aleph_\omega$, if $|B|<\aleph_\omega$, then there exists some $B... | I think the following diagonalization will show that there is no such set $\mathcal{F}$.
Suppose there were such an $\mathcal{F}$. Then we could split it up into $\omega$ many chunks $( \mathcal{F}_i ) _{i \in \omega} $ such that each $\mathcal{F} _i$ had exactly the sets of size $\aleph_i $ or smaller that were in $... | There is no such family $\mathcal F$. Suppose, toward a contradiction, that you had such an $\mathcal F$ and list it in a sequence of order-type $\aleph_\omega$. For each $n\in\omega$, let $\mathcal F_n$ consist of the first $\aleph_n$ members of the sequence that have cardinality at most $\aleph_n$. Notice that $\m... | https://mathoverflow.net |
600,989 | [
"https://physics.stackexchange.com/questions/600989",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/281193/"
] | Suppose an object is travelling at a velocity it strikes another object of a different mass and comes to rest and the other object starts moving, would the two objects have the same kinetic energy before the first object came to rest
| For perfectly elastic collision both momentum and kinetic energy is conserved. That is how the final velocities of two masses are calculated. If the first body comes to rest after collision then either both masses are same or there will be loss in kinetic energy ( maybe in the form of heat, etc.)
| Let's prove it
By using conservation of momentum
M<span class="math-container">$v_{A}$</span>=m<span class="math-container">$v_{B}$</span>+M<span class="math-container">$v_{A'}$</span>........ 1...since a comes to rest <span class="math-container">$v_{A'}$</span>=0
To find kinetic energy
E<span class="math-container">$... | https://physics.stackexchange.com |
152,255 | [
"https://softwareengineering.stackexchange.com/questions/152255",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/55555/"
] | When the concepts of Object Oriented Programming were introduced to programmers years back it looks interesting and programming was cleaner. OOP was like this
<pre><code>Stock stock = new Stock();
stock.addItem(item);
stock.removeItem(item);
</code></pre>
That was easier to understand with self-descriptive name.
But... | OOP itself hasn't changed much since its inception. A few new angles to it have been explored, but the core principles are still the same. If anything, the collective knowledge gathered over the years makes the programmer's life easier rather than harder. Design patterns are not a hindrance; they provide a toolbox of s... | No, it's becoming more over-engineered. And you're right- in the SO C++ chat we frequently joke about the AbstractSingletonFactoryProxyBeanBridgeAdapterManagers we see in Java code.
But good code does not exhibit this property. In good code, you can still say
<pre><code>std::stack<int> s;
s.push(5);
s.pop();
<... | https://softwareengineering.stackexchange.com |
848 | [
"https://robotics.stackexchange.com/questions/848",
"https://robotics.stackexchange.com",
"https://robotics.stackexchange.com/users/803/"
] | I am learning about I2C on the Arduino. I was looking at a sample program to scan for I2C devices and saw this:
<pre><code>// This sketch tests the standard 7-bit addresses
// from 0 to 127. Devices with higher bit address
// might not be seen properly.
</code></pre>
With the following code.
<pre><code> for(addr... | If I understood your question correctly, you have a problem understanding binary numbers, right?
Think of a decimal digit. A digit is only either of 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9, right? But a 7-digit number can be between 0000000 and 9999999. I presume you do understand this.
Now a decimal number, for example 2569 ... | "7-bit" is like saying "7-digit", but implies base two instead of base ten. So, a 7-bit number can represent $2^7=128$ values in the same way that a "conventional" 7-digit number can represent $10^7=10000000$ values.
| https://robotics.stackexchange.com |
603,510 | [
"https://physics.stackexchange.com/questions/603510",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/213658/"
] | I know that a non linear optical medium is a medium in which the optical response for example polarisation vector varies as
<span class="math-container">\begin{equation}
\vec{P}=\epsilon_0\chi^{(1)}\vec{E}+\epsilon_0\chi^{(2)}\vec{E}^2+.......
\end{equation}</span>
But I am not aware of reason behind this equation. ... | Imagine an electron in a parabolic effective potential
<span class="math-container">$$V(\vec{\bar{x}}) = \tfrac{1}{2}k |\vec{\bar{x}}|^2 \\
\vec{F}(\vec{\bar{x}}) = \vec{\nabla} V(\vec{\bar{x}}) = k \vec{\bar{x}}\text{.}$$</span>
A force <span class="math-container">$-e \vec{E}$</span> will displace it from the equilib... | The equation is just a Taylor expansion of an arbitrary function: by plugging in different values for the coefficients, you can construct practically any function. The real question should be "Why are the coefficients for the higher terms typically very small?"
The answer is that Nature seems to be well-beha... | https://physics.stackexchange.com |
124,211 | [
"https://electronics.stackexchange.com/questions/124211",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/18442/"
] | I'm looking to add a Peltier element to one of my projects. However, I want to sometimes heat and sometimes cool, depending on the ambient temperatures on both sides of the element.
<blockquote>
<img src="https://i.stack.imgur.com/4tmV0.png" alt="" />
<em>Image from Wikimedia commons.</em>
</blockquote>
My first though... | A TEC is polarized in the sense that how it is connected matters. If you want to be able to heat and cool an element then a full Hbridge will work. This will allow you to pump current both directions across a TEC's terminals.
If you apply a positive voltage to a TEC in one polarization then side A will get warm and s... | They are polarized, but the only "bad" thing about reversing the polarity is, the hot side gets cold and vice-versa. So you can use one side of a peltier as a heater or cooler by simply reversing the polarity. So if you were using it to cool a CPU, and have the polarity wrong, you will be heating the CPU side instead ... | https://electronics.stackexchange.com |
556,964 | [
"https://physics.stackexchange.com/questions/556964",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/119091/"
] | I'm reading Shankar's quantum mechanics textbook and I am on the part about ladder operators. The portion where he explains the function of the annihilation operator goes as follows:
<span class="math-container">$$\hat{H}a|\epsilon\rangle = (a\hat{H} - [a, \hat{H}])|\epsilon\rangle = (a\hat{H} - a)|\epsilon\rangle = (... | whi;e <span class="math-container">$|\epsilon\rangle$</span> and <span class="math-container">$|\epsilon-1\rangle$</span> are normalized, there is no reason to expect <span class="math-container">$a|\epsilon\rangle$</span> to be normalized. So <span class="math-container">$C_\epsilon$</span> is there to give the normal... | Both <span class="math-container">$a|\epsilon\rangle$</span> and <span class="math-container">$|\epsilon-1\rangle$</span> are evidently <span class="math-container">$H$</span> eigenstates with eigenvalues <span class="math-container">$(\epsilon-1)$</span>. (The latter, by definition; the former you just proved).
Ther... | https://physics.stackexchange.com |
66,954 | [
"https://cs.stackexchange.com/questions/66954",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/62390/"
] | <h2>Need to prove equivalence for (or disprove equivalence for):</h2>
$
\hspace{1cm}\square ϕ → \lozenge ψ ≡ ϕ\textsf{ U }(ψ ∨ ¬ϕ) \\
$
My current attempt using the LTL equivalnce rules to determine equivalence:
$
\square ϕ → \lozenge ψ \\
≡\
¬\square ϕ \lor \lozenge ψ \hspace{1cm}(\textsf{"Mutual implication"} ϕ →ψ... | In order to prove the equivalence of two formulas $\phi,\psi$, it is enough to show that for every computation $\pi$, it holds that $\pi\models \phi$ iff $\pi\models \psi$. This is <em>semantic equivalence</em>.
Let's look at (1). You got to the formula $true{\bf U} (\psi\vee \neg \phi)$. Now, this holds in a computat... | \begin{alignat*}{2}
\Box \varphi \to \Diamond q
&\equiv \neg \Box \varphi \lor \Diamond \psi &&\text{($\to$ elim)}\\
&\equiv \Diamond \neg \varphi \lor \Diamond \psi &&\text{(neg near var)}\\
&\equiv \Diamond (\neg \varphi \lor \psi) &&\text{(grouping $\Diamond$)}\\
&\equiv \neg ... | https://cs.stackexchange.com |
2,317,562 | [
"https://math.stackexchange.com/questions/2317562",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/446658/"
] | Here is what I have so far for proof by induction:
Base case:
Suppose n = 3
$$\sum_{i=1}^{n}(F_{2n-1} - F_{2n}) = 1 - F_{2n-1}$$
$$\sum_{i=1}^{3}(F_{2n-1} - F_{2n}) = 1 - F_{2*3-1}$$
$$F_{1} - F_{2} + F_{3} - F_{4} + F_{5} - F_{6} = 1 - F_{5}$$
$$1 - 1 + 2 - 3 + 5 - 8 = 1 - 5$$
$$-4 = -4$$
Inductive hypothesis:
$$... | Why do you have $n=3$ as your base case? Why not just $n=1$?
Also, make sure to use the running index $i$ as your variable in the formula inside the summation (you are using $n$ and $k$, which is not right!)
So I would do:
Claim: for all $n \ge 1$:
$$\sum_{i=1}^{n}(F_{2i-1}-F_{2i})=1-F_{2n-1}$$
Base: $n=1$
$$F_1-... | Note that the sum "telescopes" using the Fibonacci recursion $F_{2n}=F_{2n-1}+F_{2n-2}$, so that
$$
\sum_{i=1}^n(F_{2i-1}-F_{2i})=-\left(\sum_{i=0}^{n-1}F_{2i}\right).
$$
Thus it suffices to show
$$
\sum_{i=0}^{n-1}F_{2i}=F_{2n-1}-1;
$$
this is much easier to induct with, as if
$$
F_0+\dots+F_{2n-2}=F_{2n-1}-1,
$$
t... | https://math.stackexchange.com |
99,760 | [
"https://electronics.stackexchange.com/questions/99760",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/7038/"
] | I have a few external input probes on a device I'm making which are connected to an ADC. Is there an electrical (i.e. non-mechanical) method of detecting whether the ADC input is floating/disconnected/tristate or actually connected to a signal source, without altering the input signal? The signal should be considered a... | If the ADC is part of a typical microcontroller (MSP430, the AVR in an Arduino for example) you will probably find there are optional pullup and pulldown resistors with high values (50kilohms for example).
If you enable the pullup only, read the ADC, enable the pulldown only, read the ADC again, and the two readings ... | Usually with "probes", a pull-up or pull-down can be added that would put the ADC input reliably into what would be unreasonable territory for a working connection (and reasonably quickly). For example, a thermocouple probe might have a pullup of a few tens or hundreds of nA to +3.3V and the ADC going overrange would b... | https://electronics.stackexchange.com |
2,089,028 | [
"https://math.stackexchange.com/questions/2089028",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/405154/"
] | What I got figured out is that I should pair up $\frac{(-1)^{n}}{3^{n}}$ giving me $\sum_{n=1}^{\infty} (\frac{1}{3})^{n}(-2n-1)$. I know that the first part converges to $\frac{3}{4}$, but the other part is divergent. How should I proceed?
| <strong>Hint</strong>: $$\sum_{k\geq1}\left(-1\right)^{k}x^{2k}=-\frac{x^{2}}{1+x^{2}}\Rightarrow\sum_{k\geq1}\left(-1\right)^{k}x^{2k+1}=-\frac{x^{3}}{1+x^{2}}
$$ $$\Rightarrow\sum_{k\geq1}\left(-1\right)^{k}\left(2k+1\right)x^{2k}=\frac{d}{dx}\left(-\frac{x^{3}}{1-x^{2}}\right)
$$ then take $x=1/\sqrt{3}$.
| prove by induction that your finite sum $$\sum_{n=1}^k\frac{(-1)^{n+1}(2n+1)}{3^n}=3/8\, \left( -1/3 \right) ^{k+1}+3/2\, \left( -1/3 \right) ^{k+1}
\left( k+1 \right) +5/8
$$ and compute then the limit for $k$ tends to $\infty$
| https://math.stackexchange.com |
45,297 | [
"https://security.stackexchange.com/questions/45297",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/34097/"
] | I'm starting my first website for a doctor's office and I'm wondering if the website needs to be on a HIPAA compliant server, even if no patient health information is collected or stored on the server? There would be no storing or even collecting of any patient health information.
| An ordinary website, such as one advertising office hours, contact information and related media should be fine, so long as it is completely separate from the HIPAA-compliant network & systems that serve the doctor's office.
This also means that you cannot use this webserver for any remote-access services (ie: VP... | To add some additional info. I would post a warning on the contact us section that no medical information is to be transmitted and provide a safe method if one exists. Also, the practice's Notice of Privacy Practices has to be posted on the site per HIPAA requirements.
| https://security.stackexchange.com |
105,578 | [
"https://dba.stackexchange.com/questions/105578",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/8227/"
] | I'm trying to run this query in <code>mysql Ver 15.1 Distrib 5.5.44-MariaDB, for Linux (x86_64) using readline 5.1</code> but got this error all the time:
<pre><code>CREATE TRIGGER trig_companies_table_insert BEFORE INSERT ON `companies`
FOR EACH ROW SET NEW.createdAt = NOW();
[Err] 1235 - This version of MariaDB... | This error means you already have an <code>BEFORE INSERT</code> trigger on <code>companies</code> table.
If it is the same trigger (meaning <code>trig_companies_table_insert</code>) that you created earlier and now you want to replace it then you need to drop it first:
<pre><code>DROP TRIGGER trig_companies_table_ins... | It means you already have a trigger for <code>BEFORE INSERT ON companies</code>.<br>
(action time = <code>BEFORE</code>, event = <code>INSERT</code>)<br>
You can't have two of them for the same event and action time.
You can fix it by editing the existing <code>BEFORE INSERT</code> trigger.
| https://dba.stackexchange.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.