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 |
|---|---|---|---|---|---|
55,939 | [
"https://physics.stackexchange.com/questions/55939",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/8573/"
] | Imagine driving in a straight line on a ice lake, when you hit the brakes, if your goal is to stay in straight path with no spinout, which wheels would you choose to have locked: front or rear? Assuming the steering wheel is kept fixed in both cases, I learned that it's better to have front wheels locked in this case. ... | A wheel has traction in two component directions: both parallel and perpendicular to the direction of the movement of the car. The perpendicular components, by definition, won't do anything different for the direction of the car. But the parallel components will cause locked wheels to decelerate <em>less</em> in the pa... | As in Gugg's answer: Let's consider the car that has slightly rotated, and let's see if the forces that the road applies on each wheel will correct it, or make it worse:
<img src="https://i.stack.imgur.com/NgRBN.png" alt="enter image description here">
Decompose the friction of the road on the wheel in a parallel and... | https://physics.stackexchange.com |
48,720 | [
"https://mechanics.stackexchange.com/questions/48720",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/26792/"
] | I have a hyundai coupe 2006. Recently I started flooring the accelartor(push pedal right down to floor in an instant) to make car go faster.
When I accelerate smoothly and slowly I notice the car sounds nice and smooth while it picks up speed. However when I floor the accelerator it sounds dodgy and not smooth at al... | "Car damage" is not very descriptive, but I'm going to try and answer the question I <em>think</em> you're getting at, which is "Are there negative effects from constantly flooring it?" To which the answer is: yes.
In short, you are going to "wear through" everything faster. Some examples:
<ul>
<li>Tires will burn ... | Prolonged flooring as you put it may cause some harm. But driving/accelerating hard shouldn't cause an issue. If you do this with a cold engine (just started) then you might have a problem or if your engine has high mileage on it.
What do you mean by "dodgy"?
It will sound a little more noisy. Not smooth may be a mis... | https://mechanics.stackexchange.com |
111,564 | [
"https://dba.stackexchange.com/questions/111564",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/25098/"
] | I have 2 instances of SQL Server installed on one server: SQL002.
One instance is a default instance, SQL2008 R2, and the SQL service is generally not running except for specific tests.
The other instance is a named instance, SQL 2014 (so SQL002/SQL2014). This is generally running all the time.
Today I just had a de... | There can be three reasons:
<ul>
<li>SQL Aliases: either you or that dev has an alias</li>
<li>Named instance running on port 1433. Connecting to the default instance means just connecting with port 1433 instead of asking the sql browser first (only applies to tcp) </li>
<li>Explicit port inside the connection string... | Whilst this is an old question and has already been answered, I thought it might be prudent to add the following:
I was experiencing a similar issue- I have three named instances on one server (no default instance) but was able to connect to the server by connecting to MYSERVER (note no backlash to denote the instance... | https://dba.stackexchange.com |
2,595,768 | [
"https://math.stackexchange.com/questions/2595768",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/185549/"
] | Please help me to finish/validate my solution for the following problem:
<blockquote>
Three players $A,B,C$ play a game. A game is played between two
players. After a game the winner plays against player who did not play
last time. Everyone has equal winning chance of $\frac12$. To become a
champion a player h... | The game tree won't repeat itself after 3 games because even though the 4th game is between $A$ and $B$, one of them will be coming in with one win under her belt and will now win with probability $\frac{1}{2}$, not $\frac{1}{4}$.
However, your solution idea works with a little modification, now that we understand tha... | Since $A$ and $B$ obviously have equal chances, we can focus on $C$.
A little thought will show that $C$ can only win in rounds numbered in multiples of $3$: e.g. by $ACC$ or $BCC$, with probability $\frac14$,
or in round $6$, by $ACBACC$ or $BCABCC$, with probability $\frac1{32}$, and so on.
So P($C$ wins) is the su... | https://math.stackexchange.com |
141,033 | [
"https://electronics.stackexchange.com/questions/141033",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/26011/"
] | I got a quick friendly critic from someone in production for the below trace that I should not route the trace from the edge of a pad. What he said that it would create an extra force to the trace that might cause problem especially for smaller pad size in the production.
<img src="https://i.stack.imgur.com/nXKH6.png... | Keep in mind that the solder mask will be expanded by some mils (the exact number depending on the manufacturing process you're designing for) around the pad so you'll get an asymmetric pad shape that will tend to pull the package. Probably not a big deal, but it also looks ugly. If you had a bunch heading off in the s... | "Unusual" geometry (which is a relative term, of course), can result in less effective inspection by humans and machines -- since a 'false positive' may be created; the more of these you have, the less likely a real issue may be noticed.
| https://electronics.stackexchange.com |
30,337 | [
"https://dba.stackexchange.com/questions/30337",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/16161/"
] | We'll be having external auditors coming over to perform a review on our Oracle database. They will be running a tool to perform the review and for that, they require a user ID that can connect to the database and grab information from it.
We have an existing user in the database for this. However, it is a production ... | User creation:
<pre><code>select dbms_metadata.get_ddl( 'USER', 'PHIL' ) from dual;
</code></pre>
Default role:
<pre><code>select dbms_metadata.get_granted_ddl( 'DEFAULT_ROLE', 'PHIL' ) from dual;
</code></pre>
System grants:
<pre><code>select dbms_metadata.get_granted_ddl( 'SYSTEM_GRANT', 'PHIL' ) from dual;
</c... | SELECT DBMS_METADATA.get_ddl ('USER', 'SASIO') FROM DUAL
UNION ALL
SELECT DBMS_METADATA.get_granted_ddl ('DEFAULT_ROLE', 'SASIO') FROM DUAL
UNION ALL
SELECT DBMS_METADATA.get_granted_ddl ('SYSTEM_GRANT', 'SASIO') FROM DUAL
UNION ALL
SELECT DBMS_METADATA.get_granted_ddl ('OBJECT_GRANT', 'SASIO') FROM DUAL
UNION ALL
SELE... | https://dba.stackexchange.com |
3,429,183 | [
"https://math.stackexchange.com/questions/3429183",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/460999/"
] | Can I define a function as the set of these points as <span class="math-container">$k$</span> goes to infinity?
<span class="math-container">$$ \lim_{k\to \infty}\bigg (\frac{k}{k-n},\frac{k-n}{k}\bigg)$$</span>
Where <span class="math-container">$n$</span> is the ordered set of natural numbers less than <span class=... | The function <span class="math-container">$f(x)=1-\frac{1}{x}$</span> passes through all the desired points and therefore is the correct one.
| A function consists of two sets (the domain and the range) and a graph between them.
I think you have a certain relation between the points but the concept of a limit has nothing to do with this.
Examine the definition of a function until it is clear for you.
| https://math.stackexchange.com |
122,291 | [
"https://dba.stackexchange.com/questions/122291",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/81530/"
] | I am new to Database.
I have a database with a UserProfile Entity. I need to add a Country and Locality(City, Town, Village) to the UserProfile.
What is the most efficient way of doing so?
This is what I have:
<strong>Locality</strong>
<ul>
<li>PK UN LocalityID</li>
<li>UN LocalityName</li>
</ul>
<strong>Country<... | In Relational Database terms <em>efficiency</em> revolves around avoiding the duplication of data. The 3 tables that you show in your question seem reasonable provided:
<ul>
<li>You can have a <strong>Locality</strong> without having a <strong>Country</strong></li>
<li>You can have a <strong>Country</strong> without ... | You may be better off eliminating the ID columns from Locality and Country tables. Otherwise, you can have duplicate or incorrect names because the IDs are different. The Country table could have every country in the world filled in easily and be used for lookups, not data entry. Only the Locality table would need s... | https://dba.stackexchange.com |
9,229 | [
"https://mechanics.stackexchange.com/questions/9229",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/4692/"
] | I have read that, when you add electrolyte and acid to a new battery, it will then be at 80% of max charge. You can put the battery in your bike and it will turn. However, it's highly recommend to tend that battery and bring it up to 100% charge. Is it possible to drop the battery in and take her for a spin (because it... | The reason behind tending it to bring it to 100% vs. just riding it up to 100% is to save wear and tear on the alternator or generator. They're really designed to maintain a battery/do light charging, not do a major charge.
A secondary thing is that a severely discharged battery may vent a lot of hydrogen while charg... | Hi in my opinion you will be fine to use the battery with 80% charge, your bike will do the rest when you are out for a ride. Also it is a good idea to invest in one of the new SMART CHARGERS that are now on the market, these automatically top up the battery charge and are ideal for protecting your battery over the dor... | https://mechanics.stackexchange.com |
339,897 | [
"https://stats.stackexchange.com/questions/339897",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/55797/"
] | I am trying to learn Machine Learning and I am not exactly sure what these terms entail. I know the likelihood is a function in terms of the parameters to be learned and we want to maximize it, but I also know we fit a model using a loss function...
Can someone give examples of each under different modes (e.g. what is... | A loss function is a measurement of model misfit as a function of the model parameters. Loss functions are more general than solely MLE.
MLE is a specific type of probability model estimation, where the loss function is the (log) likelihood. To paraphrase Matthew Drury's comment, MLE is one way to justify loss functio... | <h1>Loss</h1>
In machine learning applications, such as neural networks, the loss function is used to assess the goodness of fit of a model. For instance, consider a simple neural net with one neuron and linear (identity) activation that has one input $x$ and one output $y$:
$$y=b+wx$$
We train this NN on the sample ... | https://stats.stackexchange.com |
20,247 | [
"https://cstheory.stackexchange.com/questions/20247",
"https://cstheory.stackexchange.com",
"https://cstheory.stackexchange.com/users/17147/"
] | I have a bipartite graph $G$ with two sets of vertices $X$ and $Y$, where the degree of each vertex in $X$ is exactly $M$.
I now must remove some of the edges to ensure that, after removal, no vertex in $Y$ will have a degree larger than $1$. I want to choose a way to remove the edges so that as many vertices in $X$ ... | This problem is NP-hard as 3DM (3-dimensional matching problem) reduces to it. Just pick M=N=3, Y to be the points of the underlying base set, and X to be the triples on them.
| When N<3, you may have polynomial time algorithms. For N=1, it is equivalent to the bipartite maximum matching problem.
| https://cstheory.stackexchange.com |
545,385 | [
"https://physics.stackexchange.com/questions/545385",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/81224/"
] | It is written in Binney and Skinner's <em>The Physics of Quantum Mechanics</em> that states of well defined energy evolve in the following manner. <span class="math-container">$$| E_n, t \rangle = | E_n, 0 \rangle \mathrm{e}^{- \mathrm{i} E_n t / \hbar},$$</span> where <span class="math-container">$E_n$</span> is the <... | First off, <span class="math-container">$|\Psi(0)\rangle \neq |\Psi(t)\rangle$</span>
While the <em>magnitude</em> of <span class="math-container">$e^{-iE_nt/\hbar}$</span> may be <span class="math-container">$1$</span>, <span class="math-container">$|\Psi\rangle$</span> is a complex vector - you don't take the magni... | As you already pointed out, these two vectors are not identical
<span class="math-container">$$ \tag{1}
| E_n, t \rangle = | E_n, 0 \rangle \mathrm{e}^{- \mathrm{i} E_n t / \hbar}
$$</span>
they simply differ by a phase factor. Vectors that differ (globaly) by a phase factor are really physically indistinguishable. Tha... | https://physics.stackexchange.com |
317,148 | [
"https://electronics.stackexchange.com/questions/317148",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/147045/"
] | I am feeding an arduino, presently through its Vin pin, with a 0.9V drop on its onboard regulatorZ I'd of course like to feed it via its 5V pin, which has a strict upper limit of 5.5V. I don't have any 7806/7808s, and already soldered the 7805 in place. I also have no 0.1uF caps, my nearest value is 1uF. The 7805 brief... | In theory, we want the output of a 7805 to be 5V, no matter what. The regulator surely does its best, but there are two things that it needs to react to:
<ul>
<li>output current demand</li>
<li>input voltage</li>
</ul>
Ignoring the output for now, when you switch on the input, the voltage rises with a certain speed, ... | <blockquote>
can I get by with a 1uF cap on the output?
</blockquote>
you have to find out the datasheet for your specific 7805 and see what requirements it has. while most of them are fairly "typical", there are differences and no one is more authoritative on your question than the datasheet for your device.
| https://electronics.stackexchange.com |
68,592 | [
"https://datascience.stackexchange.com/questions/68592",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/90140/"
] | How can I transfer two column features into pivot table on the following dataset
I have tried the <strong>aggfunc</strong> function but this fill the value either 0 or 1. I want to transfer the row as cell value.
Here is the dataset
<pre><code>content Users
22 1196
23 1196
23 1216
16 880
... | You can accomplish what you want by doing:
<blockquote>
df.groupby('Users')['content'].unique().apply(pd.Series)
</blockquote>
First, what you want is to groupby your values by users, to get all content values. Since you want unique ones, you can apply unique() built-in pandas function.
Then, since you will have a... | This would be a bit faster than using <code>apply</code>:
<pre><code>(df.assign(col=df.groupby('Users').cumcount())
.set_index(['Users','col'])['content'].unstack())
</code></pre>
Output:
<pre><code>col 0 1
Users
872 22.0 NaN
880 16.0 20.0
1122 23.0 NaN
1196 22.0 23.0
1216 2... | https://datascience.stackexchange.com |
3,154,219 | [
"https://math.stackexchange.com/questions/3154219",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/470983/"
] | I have simple questions about polynomials (when I say "polynomials", I mean "formal polynomials", not polynomial mappings).
It might be a little bit strange, but I don't really understand why if we have a polynomial <span class="math-container">$P = a_{0} + a_{1}X + a_{2}X^{2} + ... + a_{n}X^{n} \in \mathbb{R}[X]$</sp... | The polynomial <span class="math-container">$P$</span> has at most <span class="math-container">$n$</span> roots, unless it is equal to the <span class="math-container">$0_{\Bbb{R[X]}}$</span> . The last by definition means <span class="math-container">$a_i=0$</span>. That <span class="math-container">$P$</span> has in... | Do you know when are two polynomials the same? Say we have <span class="math-container">$$p(x)=a_nx^n+...+a_2x^2+a_1x+a_0$$</span> and
<span class="math-container">$$q(x)=b_mx^m+...+b_2x^2+b_1x+b_0$$</span>
then <span class="math-container">$p(x)= q(x) $</span> iff <span class="math-container">$m=n$</span> and <span ... | https://math.stackexchange.com |
814,500 | [
"https://math.stackexchange.com/questions/814500",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/17980/"
] | Let $\{x_n\}$ be a sequence. If $\lim_{k\to \infty}\frac {x_{k+1}}{x_k}=r$ holds, then is $\lim_{k \to \infty} x_k^{\frac 1k} = r$ true?
Thanks all your help.
| A general theorem is that if $a_n \rightarrow a$ then
$$\sqrt[n]{a_1a_2\cdots a_n} \rightarrow a.$$
Apply this with $a_n=\frac{x_{n}}{x_{n-1}}$ to get the desired result.
| Yes. The more general claim is that if $(x_n)_{n\geqslant 1}$ is a sequence of positive numbers,
$$\liminf_{n\to\infty} \frac{x_{n+1}}{x_n}\leqslant \liminf_{n\to\infty} x_n^{1/n}\leqslant \limsup_{n\to\infty} x_n^{1/n}\leqslant \limsup_{n\to\infty} \frac{x_{n+1}}{x_n}$$
In fact, to extend of Rene's answer, we can ... | https://math.stackexchange.com |
251,959 | [
"https://softwareengineering.stackexchange.com/questions/251959",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/88091/"
] | Once you create separate components that need to communicate with each other you enter the realm of systems programming where you have to assume that errors could originate at any step in the process. You throw <code>try-catch</code> blocks out the window and have to develop robust alternatives for error handling your... | From your question and the comments to other answers already given, I feel like you're working on two things: 1) eliminating the middleman, 2) converting your poll-mechanism to a push-mechanism. I'd say, those can be viewed separately. Let's start with the poll-to-push change.
In general, I'd say yes, pushing is super... | If the middleman is currently pulling data based on the time of the previous successful run, then, to cut out the middleman, each individual system could do the same in a push architecture. Yes, each system would need to keep track of this, but it's only a single timestamp, not a full blown message queue.
| https://softwareengineering.stackexchange.com |
80,570 | [
"https://cs.stackexchange.com/questions/80570",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/17264/"
] | According to the counting argument, most bitstrings are incompressible or only slightly compressible. However, the counting argument does not work in the opposite direction, since there are an infinite number of bitstrings that are longer. So, the counting argument does not tell us whether most bitstrings will or wil... | Both can happen.
The counting argument applies to all TMs that always halt.
In the partial world, you can construct Turing machines for both extreme cases (and everything in between) like so. Assume $T$ is a Turing machine. Construct
<pre><code>T<(x) = if |T(x)| < |x| then return T(x) else loop
</code></pre>
... | Well, ...
several (different!) scenarios:
I assume that U is a (fixed) UTM, you give it a string s = (TM,input),
U(s) = TM(input) = either a finite output "f" or else DIS, the TM does not halt. Additional difficulty: "DIS" vs. "f requires enormous time" can not be resolved by just looking while waiting (in many case... | https://cs.stackexchange.com |
19,633 | [
"https://mathoverflow.net/questions/19633",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4974/"
] | For each $d$, I have a matrix $M$ with values
$$
M_{ij} = \begin{cases}
\frac{4ij}{d} - \binom{2d}{d} & i \neq j & \\\\
\frac{4i^2}{d} - \binom{2d}{d} -
\frac{\binom{2d}{d}}{\binom{d}{i}^{2}} & i = j
\end{cases}
$$
I want to show that, for every $d=2,3,\ldots$, ... | It's easier to prove the result about the matrix without resorting to determinants. What we need is the inequality
$$
\left(\sum_{i=0}^d 2ix_i\right)^2\le d{2d\choose d}\left(\sum_{i=0}^d x_i\right)^2
+d\sum_{i=0}^d \frac{{2d\choose d}}{{d\choose i}^2}x_i^2
$$
Now recall that $\sum_{i=0}^d (2i-d)^2{d\choose i}^2=\frac{... | Here is a sketch of a solution; the details would be tedious, but doable by someone with enough patience I think.
The point is that the terms with $i$ and $j$ both of the form $d/2 + O(\sqrt{d})$ are so much larger than the others that they are the only ones that matter, unless of course $k$ is significantly less than... | https://mathoverflow.net |
4,200,467 | [
"https://math.stackexchange.com/questions/4200467",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Recently, I learned that <span class="math-container">$\lim_{k\to \infty} (1 + \frac{1}{k})^k = e$</span>, but I wasn't sure how that is the correct answer. If you plug <span class="math-container">$\infty$</span> into <span class="math-container">$f(x)$</span>, then it will get <span class="math-container">$\infty$</s... | Bearing in mind that this could be considered cyclic by some, here is an attempt:
<span class="math-container">$$L=\lim_{x\to\infty}\left(1+\frac1x\right)^x$$</span>
<span class="math-container">$$\ln L=\lim_{x\to\infty} x\ln\left(1+\frac1x\right)$$</span>
now this limit should be easy to calculate using L'Hopital's ru... | If you just consider integer <span class="math-container">$k$</span>,
you can show that
<span class="math-container">$(1+1/k)^k$</span> is increasing and
<span class="math-container">$(1+1/k)^{k+1}$</span> is decreasing
and they have a common limit
which is called <span class="math-container">$e$</span>.
If you define ... | https://math.stackexchange.com |
298,523 | [
"https://mathoverflow.net/questions/298523",
"https://mathoverflow.net",
"https://mathoverflow.net/users/52978/"
] | Suppose I have a two sided stationary sequence of random variables $\ldots,X_{-1},X_0,X_1,\ldots$ such that all finite dimensional joint densities $f(x_1,\ldots,x_n)$, $n\in\mathbb{N}$ exist. I want to ensure the following:
<blockquote>
Let $A$ and $B$ be events such that $P(\ldots,X_{-1},X_0\in A)>0$ and $P(X_1,... | No, this is not enough. Take $Y_n$ i.i.d. Gaussians, $r$ an independent Bernoulli taking values in $\{-1,1\}$, and set $X_n = r + Y_n$.
Then the events $A = \{X\,:\,\limsup_{n \to \infty} {1\over n}\sum_{k=1}^n X_k = 1\}$
and $B = \{X\,:\,\limsup_{n \to \infty} {1\over n}\sum_{k=1}^n X_{-k} = -1\}$ both have probabilit... | No, choose them to be iid N(-1, 1) with probability .5 and otherwise iid N(1,1), Let A be the set where $$\frac {X_1 + ... + X_n} n \rightarrow 1 $$ and B be the set where $$ \frac {X_{-1} + ... + X_{-n}} n \rightarrow -1$$
They are disjoint. The joint density of any finite number is a 50-50 mix of i.i.d. normal wi... | https://mathoverflow.net |
577,811 | [
"https://physics.stackexchange.com/questions/577811",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/268296/"
] | I'm quite confused with Laplace pressure. I know the formula is (at least considering a spherical surface)
<span class="math-container">$\Delta P = P_{in}-P_{out} = \frac{4\sigma}{d}$</span>. What exactly is the surface you have to consider? And I've heard and read that this is the pressure that occurs when two differe... | Think of a balloon.
The surface of the balloon has some tension which wants to make the balloon smaller. This surface tension necessarily means that the pressure inside the balloon is larger than the pressure outside the balloon. The issue is not which one has which substance, the issue is which side of the balloon is ... | The Laplace pressure reflects the energetic cost of creating additional interfacial area, as more surface area corresponds to additional unsatisfied bonds. (This is of course the origin of surface tension.) <span class="math-container">$P_\mathrm{in}$</span> is on the enclosed side of the curvature and is higher than <... | https://physics.stackexchange.com |
660,184 | [
"https://math.stackexchange.com/questions/660184",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/123386/"
] | Does $x \times \sqrt x = x$?
I thought it was correct because sqrt is the opposite of multiplying by a number, so I figured by multiplying by a number it would balance out and be that number normally, but when I tried it with my Python calculator using 3 I got:
<blockquote>
math.sqrt(3) * 3
<br>
5.196152422706... | In general, no. Since $\sqrt x$ is equal to $x^{1/2}$, your equation is the same as $x^{3/2} = x$, only $x = 0, 1$ work as solutions
| If you want to <em>solve</em> for the equation
$$
x\sqrt{x} = x
$$
then you have
$$
x (\sqrt{x}-1) =0 \Rightarrow x = 0, \text{ or } \sqrt{x}=1, \text{ i.e. } x = 1
$$
| https://math.stackexchange.com |
268,350 | [
"https://electronics.stackexchange.com/questions/268350",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/62210/"
] | When using film capacitors for high frequency (100's kHz) applications, is one type better then the other? Historically it seems like axial capacitors were used in audio etc. where frequency characteristics were important. I am assuming that is because axial was just easier to make back then vs now...
For instance, is... | Axial leaded capacitors are generally considered obsolete in this day and age -- their ESL is higher than even radial leaded parts. In other words, if you want high frequency performance, you're best off with a SMT part, with a radial leaded part second by quite a bit, and an axial leaded part a distant third.
The ... | In many cases <strong>radial</strong> is the <strong>only</strong> through-hole package offered in many brands and many styles of film, PU,PET,P,PP.
<ul>
<li>When it comes to choice, 1st define your voltage rating, capacitance, cost, tolerance d.f. V/us and ESR, SRF if given, then size, pitch choices.</li>
<li>In som... | https://electronics.stackexchange.com |
887,644 | [
"https://math.stackexchange.com/questions/887644",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/168019/"
] | Let's say that we have a set $S=\{(x,y,z)\in \mathbb{R^3};x=z^2\}$
To prove that S is a Vector Space I must prove the 8 properties of a Vector Space, such as:
$X,Y,Z \in S$
A1) $X+Y=Y+X$
A2)$(X+Y)+Z = X+(Y+Z)$
A3)$X+0 = X$
A4)$X + (-X) = 0$
M1)$r(sX) = (rs)X$ where $r,s \in \mathbb{R}$
M2)$(r+s)X = rX + sX$
M3)... | You are missing three important rules for it to be a vector space in its own right:
<ul>
<li>It has to be non-empty.</li>
<li>It has to be closed under vector addition.</li>
<li>It has to be closed under scalar multiplication.</li>
</ul>
All the other rules will actually be ok since it's already a subset of a larger ... | You have to also show that S is closed under vector addition. This means that if you take two arbitrary vectors from S and add them together, the resulting vector must still be in S. If we take $(z^{2}, y, z)$ and $(w^{2}, v, w)$ and add them we get $(z^{2} + w^{2}, y + v, z + w)$ and since $z^{2} + w^{2}$ is not equal... | https://math.stackexchange.com |
66,893 | [
"https://datascience.stackexchange.com/questions/66893",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/88782/"
] | I have an interesting problem that I am uncertain about how to even get started. I am working on a binary classifier that will take a chemical name, encoded as a string, and predict whether it is a 'good' or 'bad' name. I have had quite good success doing this by examining the structure of the chemical directly, but I ... | <ol>
<li>If you expect that all zeros is a result of error in the measuring of the features (i.e. the observations should not be all 0s but they are), then I would say: Keep all the data, but increase <code>k</code> (from <code>k</code>-means) by 1. This extra one will hopefully become the class of all these wrong obse... | It's a matter of data quality so it depends how the dataset was built:
<ul>
<li>Either these instances are meaningful, i.e. it makes sense that an observation would have zeros for all the features and that it would happen that often.</li>
<li>Or these are the result of an error, typically the complete absence of meas... | https://datascience.stackexchange.com |
706,625 | [
"https://physics.stackexchange.com/questions/706625",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | If the angular momentum is zero with respect to any point, surely the system is at rest. It is intuitive that this is the case but I would like to <em>prove</em> it. I guess supposing the opposite leads to contradiction, but why?
| Suppose we have two choices of origin point <span class="math-container">$\mathcal{O}$</span> and <span class="math-container">$\mathcal{O}'$</span>, where <span class="math-container">$\vec{R}$</span> is the vector pointing from <span class="math-container">$\mathcal{O}$</span> to <span class="math-container">$\mathca... | I wrote this before I saw the other answers by Michael Seifert and John Alexiou had been posted so there is some overlap, but I'll post it anyway.
The answer depends on what you mean by rest. Zero angular momentum about every point implies that the center of mass of is at rest, but the constituents of the system can st... | https://physics.stackexchange.com |
338,618 | [
"https://physics.stackexchange.com/questions/338618",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/151259/"
] | Should a black hole, in the absence of all external electromagnetic forces, generate its own magnetic field? Would all particles in the vicinity of the black hole by effected by this magnetic field--i.e., are there any particles that do <em>not</em> respond to some magnetic force?
| A non-rotating black hole can have an electric field, but the difference between electric and magnetic fields depends on the restframe. An electric field in motion generates a magnetic field and vice-versa. Hence, black holes can be said to have magnetic fields, in particular if they rotate. Electric and magnetic field... | The definition of a black hole describes a body that's information is hidden behind an event horizon if the black hole has a magnetic field the field must be limited to within the event horizon as otherwise the field could have a causal effect on events outside the horizon and violate the definition
| https://physics.stackexchange.com |
23,973 | [
"https://security.stackexchange.com/questions/23973",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/12757/"
] | We are a mobile application development company.
Due to the security of Source Code and other files, we need to restrict Skype file transfer outside of LAN.
How to restrict Skype file transfer outside of LAN?
| It's exceedingly difficult to block Skype file transfers at the network level. They've designed it to use common ports (80 / 443) and proprietary encryption (albeit an extension to SSL) along with UPnP NAT holepunching to ensure absolutely minimal conflicts and setup issues. Remote file transfers go through supernodes ... | As another suggestion, are you only using Skype internally? If so, there are other platforms available that you could use for an internal experience that is very similar. Depending on your size, Microsoft Lync can be a nice (I'll be it, not free) option that behaves very similarly to Skype. There are also a number o... | https://security.stackexchange.com |
436,279 | [
"https://physics.stackexchange.com/questions/436279",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/193941/"
] | This may seem like a redundant question but I was wondering why gradient calculations are preferred when calculating a value by experiment as opposed to just plugging in raw values me getting an Answer ? I know it's something to do with the fact that the gradient considers a greater number or points and this makes the ... | The first thing to note is that your question is in the realm of kinematics (the branch of mechanics concerned with the motion of objects without reference to the forces which cause the motion) so the fact that there is a gravitational force is totally irrelevant when answering the question.
Given the assumption tha... | <span class="math-container">$-24.5m/s^2$</span> is the total acceleration. If you make a force diagram, you will see that in addition to gravitational force, you would have to apply whatever else remaining to make total acceleration be <span class="math-container">$-24.5m/s^2$</span>. Since gravity is applying acceler... | https://physics.stackexchange.com |
134,270 | [
"https://electronics.stackexchange.com/questions/134270",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/24251/"
] | Once the signal rises to a certain level, my capacitor starts getting charged.
Once the signal falls back down to that same level, my capacitor stops charging.
This way, I am using the voltage of my capacitor as an indication of how long the signal stays above that level. I call this time duration as "hump duration"... | What you are doing is called a "Time over Threshold" measurement that is very common in particle detection applications (for example in Nuclear Science).
The problem you are having is called "pileup" and, as you noted, a direct consequence of not resetting the capacitor. You need to do what is called "baseline restor... | I'm using a similar technique to control a pump which sends water through a solar array, in response to the sun being "out or in". Maybe part of my circuit might help you. In my case, my "hump" is the sun shining or not shining, and naturally I don't want the pump toggling on or off continually. So first I have an op-a... | https://electronics.stackexchange.com |
1,791,035 | [
"https://math.stackexchange.com/questions/1791035",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/301198/"
] | If $(v_1,...,v_n)$ is a basis of a space V, and $(w_1,..,w_k)$ is l.i in $V$, is it true that the $w_i's$ must span at least k of the $v_j's$?
I've been struggling to find a proof, with no succes...
| The conclusion I want to jump to is that the infinite union is compact. But, that is not true.
Suppose $S_n = \{1,\frac1n\}$
and $\bar S = \{\frac1n: \forall n \in \mathbb N\} \cup \{0\}$
$\bar S$ is compact.
$\bigcap S_k = \{1\}$ i.e. non-empty.
There exists a sequence $\in\bigcup S_k$ that converges to $0.$
$0... | Hint: $S_k=[-k,k]$
[edit after the question was changed]
If you want $S_k\subset\tilde{S}$ for some compact $\tilde{S}$ then let $S_k$ be the unit line segment intersecting the origin of the plane at angle $\theta=2\pi/k$.
| https://math.stackexchange.com |
4,610,639 | [
"https://math.stackexchange.com/questions/4610639",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/924287/"
] | This seems like a simple question, but I can't solve it
Expand the fraction
<span class="math-container">$$\frac{s+1}{s+2}$$</span>
Mathematica says it is <span class="math-container">$1-\frac{1}{s+2}$</span>
But how?
Take
<span class="math-container">$$\frac{s+1}{s+2}=\frac{s}{s+2}+\frac{1}{s+2}$$</span>
But then, how... | <span class="math-container">$$\frac{s+1}{s+2} =\frac{(s+2)-1}{s+2}=\frac{s+2}{s+2}-\frac{1}{s+2}.$$</span>
You can also do long division of polynomials. The quotient is <span class="math-container">$1$</span> and the remainder is <span class="math-container">$1$</span>.
| The way to proceed is to add and subtract the same quantity at the numerator:
<span class="math-container">$\frac{s+1}{s+2}=\frac{s+1+(1-1)}{s+2}=\frac{s+2-1}{s+2}=\frac{s+2}{s+2}-\frac{1}{s+2}=1-\frac{1}{s+2}$</span>
The procedure is justified by the fact that the two addends (1 and -1) cancel each other out and there... | https://math.stackexchange.com |
131,318 | [
"https://mathoverflow.net/questions/131318",
"https://mathoverflow.net",
"https://mathoverflow.net/users/34217/"
] | Suppose we are given a commutative ring $R$ with a unit. Suppose that $R$ is the direct product of two rings $R\cong R_1\times R_2$. It's straightforward to show that any ideal $I\subset R$ maps to an ideal $I_1\times I_2\subset R_1\times R_2$ by the above isomorphism. It is, however, not straightforward at all to give... | There are several issues to address here, but let me first point out that the formula for $B_n$ at the top of p. 71 of our Memoir has a typo: it should say
$B_n = (Z/p^{j+1})^s \oplus (Z/p^j)^{p^2-p-s} $ where $0 < s \leq p^2-p$ and
$n = 2j(p^2-p)+2s+2p-3$. The point is that there should be $(p^2-1) - (p-1) = p^2... | Pardon me for not editing my previous answer, but this is really a different answer, not an improvement on my previous answer, which addresses different aspects of the (neighborhood of) the question.
The fact that $Z[x]/(fg) \longrightarrow Z[x]/(f) \times Z[x]/(g)$ is not iso here makes the attempt to replace $Z[x]/(... | https://mathoverflow.net |
1,704,230 | [
"https://math.stackexchange.com/questions/1704230",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/318493/"
] | What is the maximum number of the colors what can be used to color the vertices of a eight-dimensional hypercube, such that for every vertex of the cube, every color is used as the color of a neighbour vertex?
(Two vertices are neighbours if they are the endpoints of an edge).
I transformed it into a coding problem.... | <ul>
<li>$\mathbb{Q} \rightarrow \mathbb{Z}\times\mathbb{Z}$</li>
</ul>
Any $f: \mathbb{Q} \rightarrow \mathbb{Z}\times\mathbb{Z}$ is trivial since division by arbitrary integers is possible in $\mathbb{Q}$ but not in $\mathbb{Z} \times \mathbb{Z}$.
In details, for a group homomorphism $f: \mathbb{Q} \rightarrow \mat... | Let’s start with $\varrho$.
We need $\varrho(0) = (0, 0)$, and $\varrho(a + b) = \varrho(a) + \varrho(b)$.
Now, suppose we pick some element of $\mathbb Z \times \mathbb Z$ for $\varrho(1)$. Say, $(p, q)$.
Then $(p, q) = \varrho(1) = \varrho(\frac 12) + \varrho(\frac 12)$, so $p$ and $q$ must both be even...
And $(... | https://math.stackexchange.com |
15,113 | [
"https://datascience.stackexchange.com/questions/15113",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/8517/"
] | I have an event "whether an item sold will be returned or not" which I can predict with a certain probability based on information gathered at the time that the purchase occurs (product features, customer information, time and place, etc). So:
<pre><code>P(Return | transaction information) = x% for a specific unit so... | I had the same problem when I used TensorFlow to build a self driving car. The training error for my neural nets bounced around forever and never converged on a minimum. As a sanity check I couldn't even intentionally get my models to overfit, so I knew something was definitely wrong. What worked for me was scaling my ... | There are a lot of possible reasons why your setup might not work. However, one very good start is to <strong>try to overfit your model on a very small subsample</strong> of your entire dataset just to see if the problem is in the code.
| https://datascience.stackexchange.com |
94,387 | [
"https://mathoverflow.net/questions/94387",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23006/"
] | Let $\langle \mathbb{R}, 0, 1, +, \cdot, <\rangle$ be the standard model for $R$, and let $S$ be a countable model of $R$ (satisfying all true first-order statements in $R$). Is it true that the set $1,1+1,1+1+1,\ldots$ is bounded in $S$? My intuition says "no", but I am yet to find a counter example. I read somethi... | If $S$ is the set of real algebraic numbers then $1, 1+1, 1+1+1, \dots$ is unbounded in $S$. On the other hand, by compactness of first order logic (as Juris points out), there are models $S$ for which $1, 1+1, 1+1+1, \dots$ is bounded.
| Take for $S$ the field $F(t)$ with $F$ being the algebraic closure of $\mathbb Q$ inside $\mathbb R$. Equip it with the unique ordering for which $t-x>0$ for every integer $x$, and take a maximal ordered algebraic extension of $F(t)$. The field $S$ that you get is real-closed, i.e., it has the same first-order theor... | https://mathoverflow.net |
35,496 | [
"https://physics.stackexchange.com/questions/35496",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/11827/"
] | It is known that - When a star collapses during the formation of the black hole, the black hole obtains the spin of the star which it collapsed from...
What I'd like to know is, If this spin <em>accelerates</em> as a result of angular momentum (if any), What effects could this <em>rapid</em> rotation have on the black... | This is question is both open theoretically and experimentally, although there is some astrophysical data.
After a black hole forms, the matter is squeezed as it falls into an accretion disk, and the matter that is absorbed is rotating very fast by the time it falls in. The dynamics of the accretion disk are complicat... | The black hole gains the angular momentum of the matter that falls into it, minus the anglar momentum of the outgoing gravitational radiation. There are a lot of questions currently on the site regarding the effects of a spinning black hole. The primary one is that the black hole will cause the space around it to co-... | https://physics.stackexchange.com |
420,232 | [
"https://softwareengineering.stackexchange.com/questions/420232",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/280772/"
] | When I want to execute some code under the condition that a variable has one of two (or more) values I can use the OR operator:
<pre><code>if (var == x || var == y) {
DoSomething();
}
</code></pre>
But I'm not sure whether I should do this directly, when <code>var</code> is a <code>getXY()</code> function, that mig... | If you write down one call to <code>getXY()</code> in your code, and I read your code, then I know what happens: There is one call to <code>getXY()</code>, and if the result is either <code>x</code> or <code>y</code> then <code>DoSomething()</code> gets called.
If you write down two calls to <code>getXY()</code> in you... | I think it comes down to this: do you know (does it seem) like this specific action should be extremely costly?
If so, then maybe it is a good idea to move it out of your condition, maybe even wrap it into something asynchronous or exception-catching (depending on specific language and libraries used).
I think your pro... | https://softwareengineering.stackexchange.com |
554,706 | [
"https://electronics.stackexchange.com/questions/554706",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/277544/"
] | I am currently looking at a microcontroller, and I would like to use ADC on Arduino but found out that the Arduino has a limited sampling rate. Is it possible to us SPI communication with a separate ADC module to get higher sampling rate?
I don't have any circuitry right but I want to know if it is common to use SPI wi... | You could use an "Arduino" compatible module such as the STM32F103C8T6-based ones, which have claimed "12-bit" and "1us" ADC peripherals. Read the datasheet with a jaundiced eye to determine the actual performance. You can't expect to match the performance of a fast external ADC from a top... | <blockquote>
<em>I want to know if it is common to use SPI with a separate ADC module
to get high sampling rate</em>
</blockquote>
It's quite common and you'll find that an external ADC is usually much better than an internal ADC regarding performance and accuracy. Plus, if you use two external ADCs you can arrange for... | https://electronics.stackexchange.com |
328,496 | [
"https://softwareengineering.stackexchange.com/questions/328496",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/242317/"
] | Sometimes when you're coding you're on a problem which can be solved with some recursive method. What is for you the best way to detect when the recursion is a good way to solve a problem and how to implement it efficiently?
I mean, how do you visualize it? How do you convince yourself that it works?
| There is no <em>one</em> answer to wether you are better of with a recursion, loop, multiple function calls, ...
But there are some hints:
<ul>
<li>recursion depth can be limited by the size of the call stack (depends on the language). A value that pops into mind is a max of 1024.</li>
<li>if the data structure is re... | Depends on the problem. ! The factorial example is pretty artificial; it’s so
simple that it really doesn’t matter which version
you choose. Many ADTs (e.g., trees) are simpler & more natural if
methods are implemented recursively. Recursive isn’t always better.
! Solve a large problem by breaking it up into smal... | https://softwareengineering.stackexchange.com |
569,624 | [
"https://electronics.stackexchange.com/questions/569624",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/286933/"
] | I am powering a 12V 6W lightbulb with two 9V zinc-carbon batteries in series. The voltage should be high enough to power the lightbulb, but the light is only visible for around 40 seconds before it quickly dims out. Can you please help me understand this?
| The CD4046 phase comparators require a CMOS-level digital input.
If you convert the sine wave to a digital signal using a comparator you can use that signal.
Under some specific conditions you might be able to use a sine wave directly but it would not be ideal. The voltage levels would have to be strictly within the po... | The datasheet plot Fig 14? show the method to feed AC coupling sine wave inputs using Vdd/2 bias. You can fine tune this for a fixed circuit conditions but the duty cycle error must be taken into account for the error on input threshold. It shows the amplitude varying from 0.8Vp for Vdd=5V at 1MHz going down to the l... | https://electronics.stackexchange.com |
73,225 | [
"https://electronics.stackexchange.com/questions/73225",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/25391/"
] | Why don't these devices use Intel processors like laptops do? Why are they restricted to ARM?
Also for Windows 8, do they want ARM just for tablets and smartphones or is it also for laptops/desktops (is that even possible)?
| Today ARM processors have a big advantage in mobile devices: they need less energy in order to work. This is very important in smartphones and tablets because the technology of the batteries is always the same and so if you want to increase the autonomy of these devices you need components that use less power. For now,... | The main advantage to ARM is the power consumption. ARM is very efficient compared to other architectures. At the most basic level, the lower power consumption comes from the processor's instruction set: ARM devices use a RISC instruction set, which is a small but optimized set of instructions. This allows for fewer tr... | https://electronics.stackexchange.com |
2,198 | [
"https://stats.stackexchange.com/questions/2198",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/862/"
] | If given probability of $A$ is $a$ and probability of $B$ is $b$, how do I find min/max probability of intersection? Max value of intersection would be $\min(a,b)$, how do I find the min?
| if $a+b \le 1$, then presumably one can find disjoint sets $A$ and $B$ with ${\rm P}A = a$ and
${\rm P}B = b$. so in this case, the min is 0.
if $a+b > 1$, we get a smallest intersection by choosing $B$ to contain all of $A^C$, which has probability $1-a$ and then adding to that a piece of $A$ to bring ${\rm P}B$ up t... | The min is the smaller of two values: $\min(a,b) = a$ if $a < b$ and $b$ otherwise. Though I do not think this is what you are asking for...
| https://stats.stackexchange.com |
10,236 | [
"https://dsp.stackexchange.com/questions/10236",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/5184/"
] | I'm having some problems understanding the FFT. Is the frequency resolution in the spectrum calculated as
$\frac{\textrm{sampling rate}}{\textrm{number of FFT points}}$ or $\frac{\textrm{sampling rate}}{\textrm{0.5 * number of FFT points}}$?
Asking this because the spectrum is symmetric for real-valued inputs. So, s... | Suppose you have a signal $x[n]$, with $n \in {0, 1, ... N - 1} $. The <em>same-size</em> DFT is defined by:
$$
X[k] = \sum_{n = 0}^{N-1} x[n] e^{-j\frac{\Large{2 \ \pi n k}}{N}}
$$
The frequency <em>resolution</em> is going to be how many Hz each DFT <em>bin</em> represents. This is, as you have noted, given by $\fr... | The term "resolution" has multiple meanings. In optics, two lines are resolved only if you can see a gap between them. In graphics, resolution might be related to plot points per inch (or other linear measure).
In order to see, say, a 3 dB drop between two spectral peaks in an FFT result, they would have to be more ... | https://dsp.stackexchange.com |
245,853 | [
"https://softwareengineering.stackexchange.com/questions/245853",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/100669/"
] | FlashPunk is a third-party graphics API for simple game development in AS3, and they take what are effectively sprites or display objects of some sort and refer to them as "Entities". <code>Entity</code> is the actual class name, and it's the predominant class to use to animate something such as a character moving on ... | The primary problem I see with this is that talking about your code you're going to get a lot of "which Entity do you mean?" questions.
Most modern computer languages (and many older ones) provide name scoping to avoid this problem, but English is older than any of them and all it has is weak context hinting. Which me... | This problem was essentially solved decades ago.
If your language allows it, simply keep the third party API and your own code in separate namespaces (Packages in Ada, namespaces in C++, modules in Modula-2 etc).
Where it isn't obvious which Entity you are using, refer to all Entities using qualified names, e.g. <co... | https://softwareengineering.stackexchange.com |
7,631 | [
"https://stats.stackexchange.com/questions/7631",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/-1/"
] | Suppose we have random variable $X_1$ distributed as $U[0,1]$ and $X_2$ distributed as $U[0,X_1]$, where $U[a,b]$ means uniform distribution in interval $[a,b]$.
I was able to compute joint pdf of $(X_1,X_2)$ and marginal pdf of $X_1$.
$$ p(x_1,x_2) = \frac{1}{x_1}, \text{ for }\quad 0\le x_1\le 1, \quad 0\le x_2 \l... | In the "marginalisation" integral, the lower limit for $x_1$ is not $0$ but $x_2$ (because of the $0<x_2<x_1$ condition).
So the integral should be:
$$p(x_2)=\int p(x_1,x_2) dx_1=\int \frac{I(0\leq x_2\leq x_1\leq 1)}{x_1} dx_1=\int_{x_2}^{1} \frac{dx_1}{x_1}=log\big(\frac{1}{x_2}\big)$$
You have stumbled acro... | You should not have $X_1$ in the marginal distribution for $X_2$
I would expect you to get $P(X_2 \le x_2) = x_2 (1-\log(x_2))$ and so the derivative gives a marginal density of $-\log(x_2)$.
This comes from $P(X_2 \le x_2 |X_1=x_1) = 1$ if $x_1 \le x_2$, and $ P(X_2 \le x_2 |X_1=x_1) = \frac{x_2}{x_1}$ if $x_2 \le... | https://stats.stackexchange.com |
363,092 | [
"https://softwareengineering.stackexchange.com/questions/363092",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/235734/"
] | I'm writing a Linked List in <code>C</code>.
<hr>
<strong><code>list.h</code></strong>
<pre><code>typedef struct list_struct * List; /* Defined in list.c */
List create_list();
void destroy_list(List list);
void list_add(List list, void * item);
void list_remove(List list, int is_target(void *));
... /* Other han... | In general (and especially when writing library code) you should be discouraged to free memory that someone else has allocated. Namely, you don't know <em>which allocator they used</em> to allocate it in the first place. (It may be on the stack, after all!) You also don't know if they need any additional destruction be... | Another option is to separate out finding the node and removing it. If you have a <code>find_node()</code> function, then the caller first finds the node, then simply calls remove to take the pointer to the node out of the list. If they want to keep the thing in the list, it's up to them to do that before calling remov... | https://softwareengineering.stackexchange.com |
382,947 | [
"https://softwareengineering.stackexchange.com/questions/382947",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/322495/"
] | Basically we should depend on abstractions instead of concrete classes, that's the Dependency Inversion main principle.
<pre><code>interface ITest
{
void DoSomething();
}
class TestImpl : ITest
{
public void DoSomething()
{}
}
class UseTest
{
private ITest _test = null;
public UseTest(ITest tes... | This is an area where the type system of a language doesn't give you many safeguards. Without making the class a package level case in the case of Java, or an internal class in the case of C#, you can't control who creates instances of this class. A public class with a public constructor can be instantiated by anyone. ... | It depends on the DI framework / library you are using. There may be something in there which helps you prevent misuse of concrete implementations.
Without a DI library, you may consider seperating the classes which are used in a different assembly, apart from the classes which use them and then declare the implementi... | https://softwareengineering.stackexchange.com |
112,160 | [
"https://cs.stackexchange.com/questions/112160",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/69153/"
] | I'm working on a small query language in JSON. A query consists of a JSON array of JSON elements, such as strings, numbers, booleans, etc. Strings starting with a <code>'$'</code> or <code>'@'</code> represent postfix unary or binary operators, respectively.
I want to include some functional aspects to my query langua... |
The distinguishing quality of the postfix notation, a.k.a. reverse polish notation is that for its usual left-to-right evaluation strategy, just before an operator is feed from the notation, all of its operands (a.k.a as parameters or arguments) are on the top of the stack right next to each other in the expected ord... | I think that a “function”, meaning “a thing which applies <em>itself</em> to its arguments” and a “function”, meaning a thing which <em>something else</em> (eg. <code>map</code>) takes and applies to things” have to be two completely different things.
How about making <code>@add</code> by itself do nothing, other tha... | https://cs.stackexchange.com |
210,771 | [
"https://mathoverflow.net/questions/210771",
"https://mathoverflow.net",
"https://mathoverflow.net/users/-1/"
] | Is the importance of developing forking machinery in the way we set it up, or is it in the fact that it allows us to come up with a notion of independence via the properties of non-forking? I'm currently reading Baldwin's Fundamentals of Stability Theory and would like to know if I need to have a very deep understandin... | For stable theories, it's really enough to know that the forking machinery exists and what properties it has. However, there are an awful lot of properties being used all the time (in stable contexts), which may or may not be obvious depending on which characterisations you are familiar with. And there is an awful lot ... | There are people in this forum who are better qualified to address what is important or not. But I'll have a go.
At least in stable theories there are multiple ways of defining forking independence. E.g. from dividing, using definability or heir-coheir extensions. Actually the definition from dividing is applied very ... | https://mathoverflow.net |
102,041 | [
"https://softwareengineering.stackexchange.com/questions/102041",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/23010/"
] | I must confess that I was not so strong in data structures when I graduated out of college. Throughout the campus placements during my graduation, I've witnessed that most of the biggie tech companies like Amazon, Microsoft etc focused mainly on data structures. It appears as if data structures is the only thing that t... | <blockquote>
most of the biggie tech companies like Microsoft focus mainly on data structures. It appears as if data structures is the only thing that they expect from a graduate.
</blockquote>
No, there's more. For example, we <em>also</em> expect that you be a quick learner who can learn new frameworks, APIs or e... | One important point about data structures is that they are universal and timeless, at least for practical purposes. Anyone who's been a developer in the last 30 years should know basic data structures like single/double linked lists, binary trees or graphs. If you ask two developers about them, you can compare the deve... | https://softwareengineering.stackexchange.com |
541,241 | [
"https://physics.stackexchange.com/questions/541241",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | <strong>Can I change the order of tensors in an equation by changing their sign?</strong>
So for example if I have something like:
<span class="math-container">$$-x^2\partial_\nu \partial_\mu $$</span>
<strong>Can I do the following?</strong>
<span class="math-container">$$-x^2\partial_\nu \partial_\mu = -x_\rho x... | No, this rule does not exist. Furthermore, even if it was correct (it isn't) you have to remember that differential operators act on everything that they have on their right. You have to think of them applied to functions, so
<span class="math-container">$$
\partial_\mu x_\nu f = \eta_{\mu\nu}f + \boldsymbol{x_\nu\, \... | Perhaps you're looking for integration by parts. If you introduce some scalar field <span class="math-container">$\phi(x)$</span> (vanishing as <span class="math-container">$x \to \infty$</span>) that you act on with your derivatives, you can move a derivative <span class="math-container">$\partial_\nu$</span> off of t... | https://physics.stackexchange.com |
301,320 | [
"https://stats.stackexchange.com/questions/301320",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/34581/"
] | 10 balls in an urn, 6 Black and 4 White. Three are removed, color not noted. What is probability that a white ball will be chosen next?
The answer is 2/5, so my reasoning below must be faulty.
After the initial three balls are removed, there will be 4 possible configurations:
<pre><code>A: BBB___ WWWW
B: BBBB__ _W... | You calculated $P(A)$, $P(B)$, $P(C)$ and $P(D)$ incorrectly. A can happen in $\binom{6}{3} = 20$ ways, B in $\binom{6}{2} * \binom{4}{1} = 60$ ways, C can happen in $\binom{6}{1} * \binom{4}{2} = 36$ ways, D can happen in $4$ ways. To check, there are $20+60+36+4=120$ total ways of removing $3$ balls at random, which ... | Think of it this way:
Take the urn with 10 balls as it is.
Draw three, put them to the side. These are the removed ones. Now draw a fourth one.
It should have a probability of 40% to be white, because each ball has a 40% probability to be white and we do not look at the colors of the balls removed earlier.
You cou... | https://stats.stackexchange.com |
63,166 | [
"https://dsp.stackexchange.com/questions/63166",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/47095/"
] | My prof said that when a transfer function described by a z-transform is not polynomial, then i can't perform the anti-transformation.
But, what does it means to be not polynomial ?
Can you explain to me ?
| There are two things to consider here. First of all, a non-causal system can react to input that hasn't arrived yet. And, secondly, there could be non-zero initial conditions that would contribute to the output signal without any input signal.
So what you probably mean is a "causal system initially at rest" or "a caus... | This would be <em>dead time</em>. You could also call it <em>delay</em>, i think.
| https://dsp.stackexchange.com |
2,734,954 | [
"https://math.stackexchange.com/questions/2734954",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/551926/"
] | I have a function $f(n)$ that is defined when $n$ is a non-negative integer. $f(n)$ is always a real number such that $1<f(n)<2$. Because of how this function is definied, I cannot prove the limit directly, but I was able to prove that $$\lim_{n\to\infty}[f(n)-f(n-1)]=0$$It makes sense to me that this might prove... | HINT:
No. Let us think about a condition $0\leq f(n)\leq1$ (we can move and scale the values).
Then we start:
up: $f(1)=0$, $f(2)=1$,
down: $f(3)=1/2$, $f(4)=0$,
up: $f(5)=1/4$, $f(6)=2/4$, $f(7)=3/4$, $f(8)=4/4=1$,
down: $f(9)=7/8$, $f(10)=6/8$, $f(11)=5/8$, $\ldots$.
Can you see the pattern?
| Nope. Example:
$\sin(2\pi x)$.
| https://math.stackexchange.com |
3,794,703 | [
"https://math.stackexchange.com/questions/3794703",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/769226/"
] | Consider complex numbers <span class="math-container">$z,z^2,z^3,z^4$</span> in that order which form a cyclic quadrilateral . If <span class="math-container">$\arg z=\alpha$</span> and <span class="math-container">$\alpha$</span> lies in <span class="math-container">$[0,2\pi]$</span>.Find the values <span class="math... | Here is an alternative way to render <span class="math-container">$|z|=1$</span> -- by mathematical induction, of all things.
Suppose that <span class="math-container">$z,z^2,z^3,z^4$</span> lie on a circle for nonzero <span class="math-container">$z$</span>. Then through multiplying all elements by <span class="math-c... | By Ptolemy we obtain:
<span class="math-container">$$|z-z^2|\cdot|z^3-z^4|+|z-z^4|\cdot|z^2-z^3|=|z-z^3|\cdot|z^2-z^4|$$</span> or
<span class="math-container">$$|z|+|z^2+z+1|=|(z+1)^2|.$$</span>
Now, we can use a triangle inequality.
Id est, for <span class="math-container">$|z|=r$</span> we obtain:
<span class="math-... | https://math.stackexchange.com |
320,045 | [
"https://physics.stackexchange.com/questions/320045",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/145072/"
] | <blockquote>
I have a system where there is a particle placed in each of the minima of the potential $$U(x)=\beta(x^2-\alpha^2)^2.$$ The particles are also connected by a massless spring where the equilibrium length is the distance from one minimum to another.
</blockquote>
The potential about small oscillations at ... | Just write down the Lagrangian for the full $U(x)$ and spring system. For the second paragraph, I would advise giving those different names $U_{appr}$. You can write down the equations of motion without approximation. But solving them is a separate matter.
So
$$
\mathcal{L} = \frac{1}{2} m_1 \dot{x}_1^2 + \frac{1}{2}... | <strong>Revised Answer</strong>
This problem is simple enough that you can determine the frequencies of the normal modes quite easily. The Lagrange Method is not necessary.
The 2 minima are mirror images of each other. There will be 2 normal modes : the particles moving anti-symmetrically in the same direction, and s... | https://physics.stackexchange.com |
121,301 | [
"https://electronics.stackexchange.com/questions/121301",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/28175/"
] | I'm about to start using a chip that has one positive and two ground connections - I've only used chips with one positive and one ground before.
How should I attach the decoupling capacitor(s?) to this?
<img src="https://i.stack.imgur.com/9Fhoe.png" alt="enter image description here">
Should I just have one capacito... | If you are using something inferior to a PCB like a breadboard then the decoupler(s) should go across pins 19 and 20 with pin 8 connected to pin 19 using a short wire.
If using a single sided PCB then ditto what I said about the breadboard.
Anything with two layers or more use a ground plane and have the cap(s) close... | If your layout is done correctly, you have a Vss plane under the PIC, so a decoupling cap across the Vdd and Vss pins (19 & 20) is what you need. Depending on the value of the decoupling cap you might want some additional capacitance there too, like a 0.1uF and a .01uF. Of course read the datasheet to see if they... | https://electronics.stackexchange.com |
160,448 | [
"https://electronics.stackexchange.com/questions/160448",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/70264/"
] | Here is the circuit we used (BT169 thyristor):
<img src="https://i.stack.imgur.com/CCyih.jpg" alt="Circuit used">
And this is the output:
<img src="https://i.stack.imgur.com/OEVOG.jpg" alt="output">
In theory it should be a straight line when AC source goes negative.
The question is "<strong>Why does it go into th... | From memory, the GK junction of an SCR, in reverse mode, acts as a Zener diode of 7V or so (much like the BE junction of a transistor). A current flows through RL, this GK zener diode, and R1, creating the voltage across RL observed. The zener thresold explains why there are two periods with almost no current during a ... | Any non-ideal diode has some reverse current. If you look at the datasheet of your part you might find some charts of the reverse voltage/current dependency. The reverse current is inducing the negative voltage drop on \$R_L\$, and this is what you are observing.
| https://electronics.stackexchange.com |
167,365 | [
"https://softwareengineering.stackexchange.com/questions/167365",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29028/"
] | <h2>Preconditions</h2>
<ul>
<li>Team uses DVCS</li>
<li>IDE supports comments parsing (like TODO and etc.)</li>
<li>Tools like CodeCollaborator are expensive for budget</li>
<li>Tools like gerrit are too complex for install or not usable</li>
</ul>
<h2>Workflow</h2>
<ul>
<li>Author publishes somewhere on central rep... | The idea is actually very nice. Contrary to common workflows, <strong>you keep the review directly in code, so technically, you don't need anything but text editor</strong> to use this workflow. The support in the IDE is nice too, especially the ability to display the list of reviews in the bottom.
There are still a f... | I would supplement the comments in the code with a companion document. This would summarize the findings and live on after the comments were removed. The advantages of this would be:
<ul>
<li>compactness. If the person routinely fails to check that a pointer passed in isn't null (or some other common beginner error in... | https://softwareengineering.stackexchange.com |
3,512,164 | [
"https://math.stackexchange.com/questions/3512164",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/740571/"
] | I don't how to create a second equation without triggering circular reasoning.
| Hopefully you know that <span class="math-container">$$\text{speed}=\frac{\text{distance}}{\text{time}}$$</span>
So, when she was walking we can say that <span class="math-container">\begin{align}3\text{km/h}&=\frac{d_w}{45\text{ minutes}}\\
3\text{km/h}&=\frac{d_w}{0.75\text{ hours}}\\
d_w&=3\text{km/h}\t... | <strong>Hint:</strong>
Note that <span class="math-container">$45\,\mathrm{min} = 0.75\,\mathrm h$</span> and <span class="math-container">$30\,\mathrm{min} = 0.5\,\mathrm h$</span>.
Recall that <span class="math-container">$\mathrm{speed} = \dfrac{\mathrm{distance}}{\mathrm{time}}\implies \mathrm{distance} = \mathrm... | https://math.stackexchange.com |
149,846 | [
"https://electronics.stackexchange.com/questions/149846",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/40195/"
] | Is it ok to keep rechargeable batteries in an unplugged charger considering possibility of discharging the batteries via the charger's circuitry, etc.
| I'd expect it to be OK in many cases - BUT no guarantees as it depends on the charger designer. If the charger was powered you'd hope most designers would place the cell in a neutral mode. You'd hope. Unpowered it is not hard to draw almost zero current, should the designer care and 'know their stuff'.
<strong>An exp... | It depends on the charger circuit and on the battery type really. Usually there will be quiescent currents and a complete discharge of the reachargeable batteries may damage the battery due to remaining in the discharged state (for further details look into the chemical reactions). If you intend to store the batteries ... | https://electronics.stackexchange.com |
10,075 | [
"https://quantumcomputing.stackexchange.com/questions/10075",
"https://quantumcomputing.stackexchange.com",
"https://quantumcomputing.stackexchange.com/users/10270/"
] | As defined, CNOT should for the two input states <span class="math-container">$|0\rangle = \pmatrix{1 \\ 0}$</span> and <span class="math-container">$\pmatrix{\alpha \\ \beta}$</span> should result in the second state unchanged: <span class="math-container">$\pmatrix{\alpha \\ \beta}$</span>. However, to me it does not... | The problem is tensor product which you have calculated wrongly. A correct calculation is this:
<span class="math-container">$$
\begin{pmatrix} 1 \\ 0 \end{pmatrix}
\otimes
\begin{pmatrix} \alpha \\ \beta \end{pmatrix}
=
\begin{pmatrix} \alpha \\ \beta \\ 0 \\0 \end{pmatrix}
$$</span>
If you now apply CNOT gate you h... | Where you say "xor", you should mean (and, indeed, you're using the notation for) the tensor product. However, you have not calculated the tensor product correctly. You should be getting <span class="math-container">$[\alpha,\beta,0,0]^T$</span> before application of the cnot, and hence <span class="math-container">$[\... | https://quantumcomputing.stackexchange.com |
419,648 | [
"https://softwareengineering.stackexchange.com/questions/419648",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/96419/"
] | Lets say we have a class <code>Cat</code>:
<pre><code>class Cat{
public eat(String food){
if (food.contains("cat")){
burp();
}
}
private burp(){
System.out.println("burp!!");
}
}
</code></pre>
And we have the following code to test it (using Mocki... | I think your colleague's point is correct, but focusing on a detail that is much too fine-grained for what your test aims to achieve. But, in your colleague's defense, your code implies that it aims for these details, while I suspect it doesn't actually need it.
For example, if the amount of burping was variable, e.g. ... | <pre><code> return new Object[][] {
{"catfood", true},
{"birdfood", false},
{"dogfood", false},
{"food for cat", true}
};
</code></pre>
Have you considered using a richer language to describe your domain?
<pre><code> return new Object[][] {
... | https://softwareengineering.stackexchange.com |
36,674 | [
"https://electronics.stackexchange.com/questions/36674",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/1380/"
] | Most audio circuits are powered with large, heavy transformers and a small ripple after smoothing. SMPS are smaller and more efficient. EMI can be shielded by a metal enclosure and the output filtered for noise suppression.
Especially where the power is going to be further regulated. Why aren't switched-mode power sup... | Let me give you a little background on myself... I've been working professionally in the audio industry for more than 14 years. I've designed circuits for most of the major pro-audio companies, one audiophile company, and several consumer audio companies. The point is, I've been around and know a lot about how audio... | A class D amplifier <i>is</i> a switching power supply. Those are more common these days and can have quite good specs. Audiophools may wrinkle their noses when they are <i>told</i> a amplifier is class D or has a switching power supply inside, but such a thing is harder to detect in a proper double blind test. In t... | https://electronics.stackexchange.com |
251,340 | [
"https://physics.stackexchange.com/questions/251340",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/114939/"
] | <blockquote>
<strong>An insulating solid ball with radius $R$ has a uniform charge density $ρ$. Find the electric field vector inside and outside of the ball if it has dielectric constant $K$.</strong>
</blockquote>
Normally, I'd treat this as a Gauss' Law problem with the field of a uniformly charged ball but I'm u... | Simplify the equation to make it more convenient to you by using the definition of a mole. A mole , generally denoted by 'n' is the mass of the substance taken divided my its molecular weight.
On solving the only unknown in this equation , you get the mass of air contained in the volume you obtained.
Now , you can just... | The ideal gas law says you something about $p$, $V$ and $T$ in terms of <em>the number of particles</em>. That's nice, because it holds approximately for all gases. For a given $p$ and $T$ you know the number per volume - it is independent of the type of gas!
Then why is the density of gases different? - because the m... | https://physics.stackexchange.com |
57,278 | [
"https://electronics.stackexchange.com/questions/57278",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/17575/"
] | In my PCB layout I have a ground power connector and several pads where I would like thick traces to connect to the ground plane.
When I use the polygon pour feature, it will connect these with 4 traces. How do I increase this width? There is also an LED with an isolated thermal pad, which ideally would have no gap at... | <h1>Short Answer: Design Rules</h1>
Hit D-R (design rules):
<h2>"No Gap At All"</h2>
Set the polygon connect type to "Direct"
<h2>"Increase the width"</h2>
Set the spoke width in the polygon connect rule
| <img src="https://i.stack.imgur.com/VCycD.png" alt="enter image description here">
I believe the conductor width is what your trying to increase. It is in the Design Rules.
| https://electronics.stackexchange.com |
12,510 | [
"https://robotics.stackexchange.com/questions/12510",
"https://robotics.stackexchange.com",
"https://robotics.stackexchange.com/users/17146/"
] | Is there any possibility to have a robot with <strong>less than six degrees of freedom</strong> & still be able to achieve <strong>any position & orientation around end effector</strong>?
| Short answer: No.
Long answer: In how many dimensions you are defining 'any'?
The best way to understand it is actually through math.
Let's say you have a desired position $$p=\left[\begin{matrix}x\\y\\z\end{matrix}\right]$$ and an orientation $$\omega=\left[\begin{matrix}\chi\\\psi\\\zeta\end{matrix}\right]$$ in th... | In abstract theory, yes. You can have a body constrained to a path (1 Dof, forward and back along the path) and the path can loop through all possible orientations. Likewise you can constrain the body to a higher order manifold (a surface allows 2 or 3Dof depending on the physical mechanism of constraint).
Mechanisms ... | https://robotics.stackexchange.com |
144,787 | [
"https://security.stackexchange.com/questions/144787",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/86741/"
] | My company is planning to use a Greenbone appliance in the near future and wants to analyze the results with another tool. I have access to OpenVAS with GSA so I am able to test the analysis now with existing scans. But I'm not sure if I can continue to use my tool for analysis as soon I will only have access to the sc... | I just got an answer to this question from a salesperson working at Greenbone. The OpenVAS-reports and the Greenbone-reports have indeed the same structure. So if you are using a parser which works on OpenVAS-reports, it will also work on the reports generated by the Greenbone appliance. The only differences are - as t... | Not sure if this is helpful, but I've been using OMP to get XML reports remotely, and the reports differ from the Greenbone console's. Not sure why this is the case, it happens even after I have disabled the filters on greenbone.
| https://security.stackexchange.com |
15,279 | [
"https://engineering.stackexchange.com/questions/15279",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/7430/"
] | I've run across a term in some grinding manufacturing research papers called the <em>specific material removal rate</em>. The units given for this term are [mm$^3$/mm$\cdot$s] (I don't really like this style of formatting because it makes it unclear as to whether the [s] is in the numerator or denominator, but that is ... | Suppose Frame 1 is a world coordinate frame and Frame 2 local robot frame.
The thing that's a little confusing here is that when you transform from Frame 1 to Frame 2, you are saying that you want to... transform frame 1 to frame 2. You want to take all of frame 1's points, and put them in frame 2. You want measure w... | You have actually not done anything wrong. Its just that Matrix algebra, much to the chagrin of some, does not actually define how you need to pack your data into the matrix. Your choice.
So the question is do you consider that vectors inside your matrix to be columns or rows. This is called column major or row major.... | https://engineering.stackexchange.com |
607 | [
"https://scicomp.stackexchange.com/questions/607",
"https://scicomp.stackexchange.com",
"https://scicomp.stackexchange.com/users/529/"
] | I am currently researching on the viability of using KS methods for solving large dense systems. What I wish to prove (or disprove) is that methods like CG, BiCG and QMR are as good (if not better) than the generic LU or QR decomposition methods in place today.
Till now I have tried non-preconditioned versions of CG o... | I am extremely surprised that there is no mention of conditioning or the shape of the spectrum in your discussion, as it will be the decisive property in whether or not iterative methods can beat dense methods.
As an extreme example, suppose that your dense matrix is some small perturbation of the identity matrix. The... | CG was originally abandoned because of this loss of accuracy that you observed. It was revived when its use as an approximate solver was appreciated. So I don't think you want to revisit this problem. And preconditioning is very useful, diagonal preconditioning at the very least.
Iterative methods are very problem ... | https://scicomp.stackexchange.com |
174,027 | [
"https://physics.stackexchange.com/questions/174027",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/76917/"
] | I know that we are surrounded by <strong>dark matter</strong>, does the <strong>dark matter affects space time</strong> ???and I know the reason for gravity according to explanations in general relativity. But all the explanation about GR is explained in two dimension, where space is imagined as a fabric and placing an... | In the two-dimensional rubber sheet visualization, it is wrong to think that things fall towards the massive object because they are "rolling down the hill" of the curved spacetime. There is no perpendicular gravity pulling things down into the well. What happens is that you are moving along your world line at a consta... | Yes, photons are affected by those curves. They also curve space-time due to something called a stress-energy tensor. Remember that the energy of a photon is given by $$E = hf$$, so photons do have energy. This energy lets them be affected by gravity.
| https://physics.stackexchange.com |
3,030 | [
"https://engineering.stackexchange.com/questions/3030",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/1847/"
] | I have the utilization rates of several machines for each week over a year. These differ per week because of the occurrence of machine failures and changes of orders. Meaning that one week a machine could be a bottleneck and the other week not. I want to rank these machines based on the utilization and so determine the... | The problem is a multi-criteria decision analysis (MCDA), as I want to rank the machines based on several (available) criteria. With initially the following criteria: downtime costs and utilization. However with utilization there was the following problem: if the events are counted that surpasses a threshold or the ave... | I don't know of any mathematical or statistical techniques that would help you analyse machine utlization data.
From the additional information you've given in the comments, my understanding is that your aim is the minimize the cost of keeping spare parts for the machines based on machine usage.
The critical factor i... | https://engineering.stackexchange.com |
310,239 | [
"https://softwareengineering.stackexchange.com/questions/310239",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/8413/"
] | <strong>The task:</strong><br>
I have a database with 4 tables with 200 rows, 800 rows, 50 rows and 30 rows respectively.<br>
Just to simplify it, let's assume the tables are these sets:<br>
<strong>A</strong> = [Ar1, Ar2, Ar3], <strong>B</strong> = [Br1, Br2], <strong>C</strong> = [Cr1, Cr2, Cr3], <strong>D</strong> =... | <blockquote>
"Is it viable to copy contents ... into a program's memory"
</blockquote>
"Viable"? Of course, the technique is called caching and I am sure you have heard of it. However, you should invest some thoughts into things like
<ul>
<li>is the memory available in full, in the production environment, exclusive... | <blockquote>
For every combination of AB, ABC and ABCD, I'm required to check all rows of E to see if there is some information relevant to the combination, and store a count of the relevant info. The count will be eventually written into an SQL table.
</blockquote>
Actually, this sounds (to me) more like a job for... | https://softwareengineering.stackexchange.com |
387,556 | [
"https://physics.stackexchange.com/questions/387556",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/137202/"
] | Mobile phone signals seem to be interrupted very often when travelling by train. I have been wondering why exactly, and found two reoccuring explanations online:
<ul>
<li>The train acts as a faraday cage, and so blocks radio waves.</li>
<li>The train is moving too fast for a clear signal to be received.</li>
</ul>
Bo... | Could it be simply that there are a higher density of signals within a train carriage and fewer phone masts to service them at once?
That is, you often have a dense crowd of people in a small space, none of whom are occupied with driving, and who are more likely than the average car driver to be wishing to conduct bu... | Cell towers are much more frequently built near highways than near railways, largely because so many more people travel by car than by train.
The range of an average cell tower is much shorter than most people think. In populous areas it can be under a mile (the range is artificially <em>shortened</em> to keep the to... | https://physics.stackexchange.com |
130,732 | [
"https://security.stackexchange.com/questions/130732",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/69877/"
] | <strong>The scenario:</strong><br>
We have a login system for a web application that requires a plaintext password and 3 images (from a collection of images that the users select during registration, the images are provided by the site).
A keylogger will catch only the keystrokes and not the selected user images, righ... | Nope. Keyloggers can often also do screen-capturing and mouse-coordinate-logging. So the attacker can still see what image the user selects.
Another kind of two-factor authentication for which the user needs two devices (e.g. laptop and phone) would be more secure. Another good alternative is a Yubikey. A kind of devi... | Once the system is infected with malware it is compromised. Anything that is done on that system can be observed so there is no way to allow someone to log in securely from that system just using that system. Period. End of Story.
You might come up with some oddball scheme for something the user has to do as part of t... | https://security.stackexchange.com |
3,101 | [
"https://cs.stackexchange.com/questions/3101",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/1183/"
] | Let $F = \{⟨M⟩:\text{M is a TM which stops for every input in at most 50 steps}\}$. I need to decide whether <em>F</em> is decidable or recursively enumerable. I think it's decidable, but I don't know how to prove it.
<strong>My thoughts</strong>
This "50 steps" part immediate turns the <strong>R</strong> sign for me... | Let's consider the more general problem of machines which stop after at most $N$ steps, for some $N \geqslant 1$. (The following is a substantial simplifcation of a previous version of this answer, but is effectively equivalent.)
As swegi remarks in an earlier response, if the machine stops after at most $N$ steps, th... | If $M$ stops in no more than 50 steps, than the positions $M$ can reach on the normally infinite tape are limited. Thus the infinite tape can be simulated by a finite one. This means that the tape can be simulated by a finite automaton. It follows that a turing machine $M$ that stops in no more than 50 steps is bisimi... | https://cs.stackexchange.com |
83,060 | [
"https://mathoverflow.net/questions/83060",
"https://mathoverflow.net",
"https://mathoverflow.net/users/19844/"
] | In one of his letters to Frenicle, Fermat stated the proposition that no prime of the form $q^2+2$ can divide any number of the form $x^2-2$.
Is there a known proof of this statement?
If not, how would one go about proving it?
Many thanks!
| Following up on Noam's comment, here are two possibilities.
<ol>
<li>(Weil) If $p = a^2 + 2$ divides $x^2-2$, then $p \mid (a^2+2) + (x^2-2) = a^2 + x^2$.
Since $p = 4n-1$, this implies $p \mid a$ and $p \mid b$ by a result known to Fermat
(all odd prime divisors of a primitive sum of two squares have the form $4n+1$)... | It's not true: 2 is of the form $q^2+2$, and it divides $2^2-2 = 2$.
Assuming you mean an <em>odd</em> prime, it's an easy exercise in quadratic reciprocity: if $p$ divides $x^2 - 2$, then $x^2 \equiv 2 \pmod{p}$, so (by quadratic reciprocity) $p \equiv \pm 1 \pmod{8}$. But, if $p = q^2+2$, then $q$ must be odd, in w... | https://mathoverflow.net |
112,445 | [
"https://softwareengineering.stackexchange.com/questions/112445",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/38015/"
] | Boost has recently become available on the project on which I'm working, and I don't have much experience with it. The library has so many parts and features that it's hard to know where to get started in learning it - especially since I'll be trying to learn it while making production code (so it can't slow me down to... | <h3>If you are using a pre TR1 compiler then smart pointers</h3>
<pre><code>boost::shared_ptr
boost::weak_ptr
boost::scoped_ptr
boost::scoped_array
boost::shared_array
</code></pre>
If your compiler already has smart pointers use them.<br />
The reason is obvious C++ without smart pointers is basically not C++
<h3>Th... | Boost isn't a framework, nor a library. It is a quality-controlled, peer-reviewed library collection. You don't learn Boost. The libraries are individual- when you need something, you check to see if it's in Boost, if it is, then you learn that library. That's it. You can't get a grasp on boost::optional from getting a... | https://softwareengineering.stackexchange.com |
17,128 | [
"https://mathoverflow.net/questions/17128",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4011/"
] | Let $M$ be a topological monoid. How does the homology-formulation of the group completion theorem, namely (see McDuff, Segal: <em>Homology Fibrations and the "Group-Completion" Theorem</em>)
<blockquote>
If $\pi_0$ is in the centre of $H_*(M)$ then $H_*(M)[\pi_0^{-1}]\cong H_*(\Omega BM)$
</blockquote>
imply that ... | The statement that $M \to \Omega BM$ is a weak equivalence when $M$ is a group-like topological monoid is indeed easier: the map $EM = B(M \wr M) \to BM$ is then a quasi-fibration, has geometric fibre $M$ over the basepoint and homotopy fibre $\Omega BM$.
However the homological group-completion theorem also implies t... | Well, if $\pi_0=\pi_0(M)$ is already a group, then $H_*(M)\approx H_*(M)[\pi_0^{-1}]$. So $M$ and $\Omega B M$ have the same homology in this case. This isn't quite enough on its own, but if you can produce a map $M\to \Omega BM$ which induces this homology isomorphism, then the result follows using the Hurewicz theo... | https://mathoverflow.net |
381,387 | [
"https://physics.stackexchange.com/questions/381387",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/160598/"
] | Why do I sometimes see my reflection in a glass slab ? I mean I should not be seeing it as it is a transparent material only through which refraction can only happen (provided the incident angle is less than e critical angle). We can also sometimes see our reflection even if we look to the mirror with perpendicular ang... | Glass is a material with a higher refractive index $n_G=1.5$ than air $n_A=1.0$. Therefore light is reflected at the surface of the glass slab. Its reflectivity at normal incidence is $$R= |\frac{n_G-n_A}{n_G+n_A}|^2 =0.04$$ Therefore you can see the reflection of yourself in a slab of glass. The total reflection at th... | Yes, the other poster is correct, 4% of the light bounces back from the glass interface. That's the ghost of you that you see. If its dark on the other side, your image easier to see.
BTW, individual photons, emitted one at a time, will also bounce back 1/25 ratio. But how and when a particular photon bounces has nev... | https://physics.stackexchange.com |
135,401 | [
"https://math.stackexchange.com/questions/135401",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/27003/"
] | I am reading the book Kolmogorov A.N., Gnedenko B.V. <em>Limit distributions for sums of independent random variables.</em>
From the general theory there it is known that if $X_i$ are symmetric i.i.d r.v such that $P(|X_1|>x)=x^{-\alpha},\, x \geq 1$, then $(X_1+\ldots+X_n)n^{-1/\alpha}\to Y$, where c.f. of $Y$ e... | The problem is, in fact, not so hard as I thought.
Note, that it is enough to prove that $\varphi(t)=1-Ct^{\alpha}+o(t^{\alpha}),t \to 0+$. First, I make substitution $y=tx$ in $\int_{1}^{\infty}\cos(tx)\alpha x^{-\alpha-1}\,dx=t^{\alpha}\int_{t}^{\infty}\cos (y) \alpha y^{-\alpha-1}\,dy$. Integrating by parts gives me... | I yr integral make the change of variables $z = \frac y {n^{\frac 1 {\alpha}}}$. This brings a factor $\frac 1n$ out front. The write $cos(tz) = 1 + (cos(tz) -1)$. Integrate the 1 explicitly, and the integral invlving $cos(tz)-1$ converges because it is nice at zero.
| https://math.stackexchange.com |
660,065 | [
"https://physics.stackexchange.com/questions/660065",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/101257/"
] | The electric field at a distance <span class="math-container">$r$</span> from am infinite line uniformly charged is
<span class="math-container">$$\vec{E}=\frac{\lambda}{2\pi r}\hat r.$$</span>
This can be shown from Gauss's law.
If we want a potential whose negative gradient is <span class="math-container">$\vec{E}$</... | You can do this on condition of not imposing a zero potential at infinity. If you impose a zero potential on the distance <span class="math-container">$r_0$</span> of the wire, the elementary potential will be of the form <span class="math-container">$dV=\frac{\lambda}{4\pi\epsilon}\left(\frac{1}{\sqrt{x^2+r^2}}-\frac{... | This really is sensible. An infinite wire contains an infinite charge. It takes an infinite amount of energy to bring a charge from an infinite distance away up close to an infinite charge. The same idea might be clearer with an infinite plane, where the E field is constant all the way to infinity.
The force is never i... | https://physics.stackexchange.com |
138,030 | [
"https://security.stackexchange.com/questions/138030",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/125454/"
] | Is there any android architecture I can set my meterpreter reverse_http payload to that works on every android phone?
Basically, when I don't set any architecture it defaults to dalvik but that architecture does not seem to be working on every phone I try it on.
| The ART runtime/architecture was introduced in android 4.4.
It completely replaced the dalvik runtime in android 5.0.
So maybe you should use this knowledge to help you decide which architecture to target.
| The most common is the following:
msfvenom -p android/meterpreter/reverse_tcp LHOST= LPORT= R >/root/FILENAME.apk
• -p => Specify Payload
• LHOST => Your IP
• LPORT => Port You want to listen on
• R => Means RAW Format
• >/root/FILENAME.apk => Location for File
In Metasploit, you can use the following:
use exploit... | https://security.stackexchange.com |
481,666 | [
"https://electronics.stackexchange.com/questions/481666",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/218005/"
] | I'm designing a device with several ICs and they require so many different input supply voltages.
18V, 12V, 3.3V, 1.8V 1.3V.
18V will probably use around 80W out of 100W(20V, 5A) main supply budget and 3.3V~1.3V will probably use around 1A~2A.
So, I was thinking of using a couple of LDOs in parallel to relieve therma... | <blockquote>
But I'm not so sure if it's ok to directly connect buck converter and the LDO to a single 20V,5A power supply rail.
</blockquote>
It depends on the behavior of your supplies and of the rail, but in general that's not a problem.
What <em>could</em> be a problem even with just the one converter to 18V ... | To minimize the effect of switched current of the buck converter on other parallel things (your LDOs), it might be a good idea to put an EMI filter on the input of the buck. Be sure to design the filter to avoid buck controller instabilities by damping it properly.
| https://electronics.stackexchange.com |
244,354 | [
"https://mathoverflow.net/questions/244354",
"https://mathoverflow.net",
"https://mathoverflow.net/users/85579/"
] | Is there any analytical result on the following integral?
$$\int_{-\infty}^{\infty} \frac{e^{-x^2}}{1+e^{-(x-\mu)}}dx$$
Thanks a lot!
| So, under this generality, it seems to me that we can choose $A$ in a clever way: if we make $A$ smaller, then it gets "easier" to satisfy the condition. So why not take $A$ to be the scalar multiples of the identity-- then $D$ commutes with all of $A$ on the nose.
Now let $H=\ell^2$ and let $D$ be multiplication by ... | One can produce an operator in a less artificial way. Consider the Sturm-Liouville operator $Du=-u''+V(x)u$, where $V(x)$ grows at infinity as $\log\log|x|$.
The eigenvalues grow very slowly, also as $\log\log$, and therefore the exponent of the operator is not trace class (the details on the asymptotics of eigenvalue... | https://mathoverflow.net |
138,392 | [
"https://stats.stackexchange.com/questions/138392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/69321/"
] | I have a data set (24 x 1000) (hour x kwh) which contains 1000 time series of a buildings' power consumption, measured every hour. After applying k-means clustering using the dtw criterion I create 5 clusters as shown in the image below.
<img src="https://i.stack.imgur.com/95UXK.png" alt="https://github.com/Regg121/cl... | One option:
For each cluster, estimate a distribution over time series, using the data assigned to that cluster as training points. This gives $P(X_t \mid C)$, where $X_t$ is a time series from $0$ to $t$, and $C$ is the cluster. You'll need a separate distribution for every value of $t$. You could use a simple multiv... | For different reasons (financial time series) I had the same problem and I solved the issue as the collegue above explained.
The only weakness I see in this approach is that if you are studying a dynamic system also "the fraction of points assigned to each cluster in your original data set" changes over time, needing ... | https://stats.stackexchange.com |
111,049 | [
"https://physics.stackexchange.com/questions/111049",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/45467/"
] | I was trying to help a friend with this question:
<blockquote>
<em>A ball is shot horizontally off a cliff. What would happen to the horizontal distance it travels if the acceleration due to gravity were doubled and all other factors remain the same?</em>
</blockquote>
My initial reaction was to do
$-\frac{v_0}{g}... | Your friend is right. The time to travel the vertical distance is $t/\sqrt {2}$, which corresponds to the horizontal distance traveled as $D_h/\sqrt {2}$.
| 'Other factors' remaining the same are unclear.
Note that you cannot keep both the max height and the initial velocity same.
If the first is the case your solution is good, if the second your friend's.
| https://physics.stackexchange.com |
124,901 | [
"https://stats.stackexchange.com/questions/124901",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/26027/"
] | <strong>Problem 1</strong>
I am trying to implement Gibbs Sampling for the following problem:
There is a grid measuring 3 x 3 sites, each "site" can be designated in a state, $X$, of 1 or -1. The sites are numbered 1--9 and have corresponding observed values, $Y$. Similar to the Ising model, we can define the probabi... | Very clean and clear presentation of the issue! This is exactly a hidden Ising model.
Your probabilities $\mathbb{P}(X_i=1|X_{[-i]},Y_i)$ and $\mathbb{P}(X_i=-1|X_{[-i]},Y_i)$ give you the way to simulate $X_i$ conditional on the others and on the observations. That those probabilities are non-integer is not an issue.... | <strong>Answer to the follow-up question</strong>
Unfortunately, your intuition about the smoothing distribution $\mathbb{P}(x|y)$ is not correct as $\mathbb{P}(x|y)$ is <em>not</em> the product of the full conditionals:
$$
\prod_{i=1}^9 \mathbb{P}(x_i|x_{[-i]},y) \ne \mathbb{P}(x|y)
$$
even up to a proportionality co... | https://stats.stackexchange.com |
112,627 | [
"https://mathoverflow.net/questions/112627",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4054/"
] | Let $\pi : X \to B$ be a family of compact Kähler manifolds over a smooth base $B$. We then have a local system $\mathcal R^k \pi_* \mathbb Z$ (for your favorite $k$) of abelian groups over $B$, whose fiber over a point $b$ is the cohomology group $H^k(X_b, \mathbb Z)$.
We can tensor this system by $\mathcal O_B$ and ... | It's easy to show for any $M$ using your "worst method," though in the definition of $f(q)$ we need to replace $n$ with $m=\dim M$. Let $A\in\mathrm{sl}(n,C)$ and suppose that $M\cdot A$ has eigenvalues $\theta_1,\dots,\theta_m$. Then the trace of $A$ acting on $f(q)$ is $(1-\theta_1 q)\cdots (1-\theta_m q)$, while on ... | Let $SM$ be the symmetric algebra on $M$. There is an exact sequence
$$0\to SM\otimes\Lambda^nM\to SM\otimes\Lambda^{n-1}M\to\cdots SM\otimes\Lambda^2M\to SM\otimes M\to SM\to k$$ which is just the Koszul complex for $SM$. After appropriately shifting the degrees of the modules, this is an exact complex of $\mathbb Z$-... | https://mathoverflow.net |
210,056 | [
"https://softwareengineering.stackexchange.com/questions/210056",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/94136/"
] | It's the first RESTful web service and I am concerned about security issues. Is it safe to transmit my access token via HTTP headers? For example:
<pre><code>POST /v1/i/resource HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Api-key: 5cac3297f0d9f46e1gh3k83881ba0980215cd71e
Access_token: 080ab6bd49b138594ac9... | If you were to transmit access token header through HTTP, then it would be vulnerable to the man-in-the middle attack.
When you transmit access token header through HTTPS, then nobody apart from the client will be able to see this token as the request will be tunnelled through secure connection.
| There are no serious issue in transferring access token over http headers because transferred data is encrypted when SSL is used, means it can be understand only by particular client which made that request and server who responses for the request, in between there are no chances to understand the data by any third par... | https://softwareengineering.stackexchange.com |
136,267 | [
"https://softwareengineering.stackexchange.com/questions/136267",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/48234/"
] | I ask this to the pros out there - Is it feasible to build a new LOB(Line Of Business) application with VS Shell as an stand alone application.
There are some points that I thought needs to changed, but I'm unaware how, like -
There will be no document. Instead there will be windows with controls where people enter d... | Honestly, it doesn't matter how much experience you have with a technology, my advice is the same: <strong>Do not enforce technology decisions on those who will have to live with them while you are busy managing.</strong>
Be honest with yourself. I'll bet the reason you hated those prior managers was not because they ... | I've had some very good managers/team leaders who knew very little about the technology, and some of my worst managers have been those who thought they knew everything.
To be a leader, if you have reasonably competent people, the main thing is to be able to judge their competence and judgement, and give each as much l... | https://softwareengineering.stackexchange.com |
31,820 | [
"https://physics.stackexchange.com/questions/31820",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/10475/"
] | I was trying to find out the cause behind the Explosion at petrol pump due to the Mobile phones but eventually it turns out it is not Radio Frequency which may cause the explosion rather it is totally the static electricity which may cause serious explosion and ignition of vapors,
The other reason I found is, due to t... | There's absolutely no danger from the electromagnetic waves coming from the phone. They are nowhere near powerful enough to heat up the gasoline, much less cause it to explode. They also don't produce more static electricity than anything else.
If there's any part of the phone that's hypothetically "dangerous", it mig... | They're prohibited because of sensationalism. It's a classic case of something happening, some hasty person drawing a hasty correlation, then hasty action being taken with no regard to whether or not the correlation holds up against logic.
They're better off banning wool socks.
Cell phones don't produce any more sta... | https://physics.stackexchange.com |
150,652 | [
"https://physics.stackexchange.com/questions/150652",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/66078/"
] | <img src="https://i.stack.imgur.com/6j9xS.jpg" alt="enter image description here">
So the level of mercury on the left is being kept down by the pressure of the gas, correct? When the temperature rises, shouldn't the mercury level on the left go down? And when the mercury level go down, the volume filled with gas incr... | The answer is that when the temperature rises of the gas, the pressure goes up and it pushes the mercury down, but then the tube on the right is lifted up by the person operating the experiment to increase the pressure on the gas and return it to its original volume - so the height h increases.
The reason that there i... | <em>pv=constant, P/T=constant when the temperature increase in the tube so do the pressure and it pushes the flexible tube to move to the right and then up. This motion moves the mercury up the column thus the weight balances the pressure times the area (F) at column A so the volume remains constant.</em>
| https://physics.stackexchange.com |
226,279 | [
"https://physics.stackexchange.com/questions/226279",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/101812/"
] | I've done enough research before asking this question. The work done by a spring is defined as $$W_\mathrm{spring}=\left|\frac{1}{2}kx^2\right|$$
Where $ k$ is the spring constant and $x$ is the distance moved by the spring.
But when I tried to derive the eqñ I'm getting $|kx^2|$ and no half is present.
I took into co... | Say $W$ is:
$$W=\frac{1}{2}kx^2$$
Then:
$$\frac{dW}{dx}=\frac{1}{2} k \times (x^2)'=\frac{1}{2} k \times 2x=kx$$.
But is it was <em>restoring force</em> $F$ you were looking for, then:
$$F=-\frac{dW}{dx}=-kx$$
Inversely:
$$W=\int Fdx=\int(-kx)dx=-k\int xdx= -k\frac{1}{2}x^2=-\frac{1}{2}kx^2$$
(If integrated bet... | Any work done by a force is <strong>defined</strong> as $\int_i^f$ <strong>$F$</strong> <strong>$dx$</strong>, where $i$ and $f$ represent initial and final positions. And, for your case, remember Hooke's Law ($F=-kx$).
$$
\int_i^f{-kxdx}=-\frac{1}{2}kx_f^2-(-\frac{1}{2}kx_i^2)=\frac{1}{2}k(x_i^2-x_f^2)
$$
| https://physics.stackexchange.com |
83,889 | [
"https://cs.stackexchange.com/questions/83889",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/30866/"
] | I am interested in knowing what algorithmic paradigm are the usual recursive sudoku solvers. Can I consider it a local search? or are they Dynamic programming, greedy, divide and conquer, backtracking?
| Let us go over your paradigms one by one:
<ul>
<li>Local search: In this paradigm, we start with some solution and try to improve it by local changes. Local search can be applied to Sudoku in at least two ways:
<ol>
<li>Start with a non-legal solution (either not satisfying the Sudoku constraints or not conforming to... | You can ask the following 4 x 81 questions:
<pre><code>Where in column c does the number x go
Where in row r does the number x go
Where in 3x3 block b does the number x go
Which number goes into cell l
</code></pre>
Obviously you leave out those questions that are already forced by the filled out cells. Now if any o... | https://cs.stackexchange.com |
367,643 | [
"https://softwareengineering.stackexchange.com/questions/367643",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/223484/"
] | In my previous Java job, we tended to avoid defining interfaces for everything unless we genuinely had multiple implementations for it. This may just be my opinion, but if there is only one implementation, I don't see the value in an interface - we're not really writing generic code, that might be used as a library.
H... | There's no particular reason why Scala traits should be treated differently than Java interfaces, especially if the trait is interface-like and only requires certain methods.
One important difference is that traits can also provide method implementations (although Java 8 default methods can also kind of do that). This... | <blockquote>
Or is it the more generic "Code to interfaces" rule of thumb that's driving this, somewhat unnecessarily?
</blockquote>
Yes, this is just a "code to interfaces" rule.
<blockquote>
is there any Scala-specific reason why this style is common in our codebase?
</blockquote>
No, it is entirely orthogona... | https://softwareengineering.stackexchange.com |
33,334 | [
"https://mechanics.stackexchange.com/questions/33334",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/2080/"
] | I bought an imported (from Japan) Mazda Axela 2010 (i-stop, 1990cc, sedan) and the dealer asked me to use 95 octane petrol.
There are a lot of misconceptions about octane and I heard many dealers recommend higher octane fuel, just to be safe as they don't know the actual required fuel type. Also, it is more expensive ... | This turned out to be due to a bad alternator hurting the battery. I've replaced the alternator and it's working again.
| I'd suggest one of your relays has gone astray. You can test this fairly easily by swapping out relays, if they are the same. Just remember which order you have them in originally, and exchange them one for another. This will help you determine which relay is bad and should also allow you to get the top back up for the... | https://mechanics.stackexchange.com |
750,210 | [
"https://physics.stackexchange.com/questions/750210",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/206319/"
] | Suppose to have 3 heat reservoirs, the first at temperature <span class="math-container">$T_1$</span>, the second at temperature <span class="math-container">$T_1+dT$</span> and the third at temperature <span class="math-container">$T_2>T_1$</span>
Then, consider a system, which volume is constant, in thermal equili... | <blockquote>
Since the last relation holds only for reversible processes, the transformation is reversible.
</blockquote>
No, that process involving <span class="math-container">$T_2$</span> is not reversible, because it involves irreversible transfer of heat from body of temperature <span class="math-container">$T_2$<... | The equation dU=TdS-PdV holds for any pair of closely neighboring thermodynamic equilibrium states, even if they represent the starting and end points for an irreversible path. If you had devised a reversible path between the same two end points, you would have obtained the same entropy change, which is essentially wh... | https://physics.stackexchange.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.