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
414,672
[ "https://softwareengineering.stackexchange.com/questions/414672", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/220193/" ]
I'm currently writing some microservices, some of them communicating using RabbitMQ, RedisDB, Kafka and other communication streams. When any of those connections drop, I can't know for sure if a query already executed. For example, if I insert a new key into a database, and the connection drops, two scenarios can happ...
This is an area where you don't have canned patterns. So let's look at what your stated needs are: <ul> <li>You need to know if am insert was successful</li> <li>The update could come from any of 3 different sources</li> </ul> Ideally, we would need a means of generating a unique key that is derived from the data you ...
There's no perfect solution to exactly once messaging. But the impossiblity of the solution relies on the possibility of missing multiple messages, distributed processing and bad actors. For normal senarios you can reduce the probablity to virtually zero. <ol> <li>Generate an id before you send, query it afterwards and...
https://softwareengineering.stackexchange.com
2,815
[ "https://dba.stackexchange.com/questions/2815", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/1847/" ]
Running SQL Server 2008 instance on a Virtual Machine (Hyper-V) on a Windows 2008 R2 OS. Currently has a few production DBs. The whole VM itself is on RAID 5 volume (so are the DB files etc). We will be adding further development and production DBs onto this VM soon. The production DB's on average are 1.5Gig in size ...
There <strong>is</strong> an advantage to having separate SQL Server instances however do those advantages outweigh the cons? You'll have to look at how you would use those instances and decide for yourself. <h2>Advantages</h2> <ol> <li>Allocate/limit resources that each instance has access to, specifically you can ...
If I understand, you have a single VM running under Win 2008 Host OS on a single box? If so, there is no advantage is having multiple SQL Server instances. Data separation of dev vs prod doesn't matter because you'd only end up using resources for dev that should be on prod. And with a single server you have a single...
https://dba.stackexchange.com
33,667
[ "https://physics.stackexchange.com/questions/33667", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/11147/" ]
Suppose you fall from the top of a ladder straight down. You will hit the ground with an amount of force. Now suppose that you fall over while holding onto the ladder, tipping over in an arc instead of falling straight down. You will hit the ground with another amount of force. Neglecting the mass of the ladder a...
Both you and your ancestors are wrong. But I bet you would never guess the real answer! Assuming the base of the ladder doesn't slide you have a rotating system. Just like a freely falling man you convert potential energy to kinetic energy, but for a rotating system the kinetic energy is given by: $$ T = \frac{1}{2}I...
So the force you would feel is the $F = \frac{\Delta p}{\Delta t}$. Now, when you hit the ground, your momentum basically changes to zero in some sudden time $\Delta t$. Let us assume that the time it takes for the momentum the change to zero ($\Delta t$) is the same for both the cases (tipping over and falling down). ...
https://physics.stackexchange.com
480,877
[ "https://physics.stackexchange.com/questions/480877", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
<blockquote> Consider a situation where we have a frustum between 2 walls. We heat it , so it wants to expand but the walls prevent it from doing so. Does the stress in the frustum remain constant or not ?? </blockquote> <strong>Case 1</strong> Say we consider a small element of &quot;<span class="math-container">$dx$<...
Suppose that, rather than heating the frustum between two rigid walls, you did the process in two steps. In the first step, you heated it without any constraint on its ends so that it could expand freely. Here, the strain would be uniform (<span class="math-container">$\epsilon_1=\alpha\Delta T=\frac{du_1}{dx}$</span...
The force is constant. The stress is <span class="math-container">$\frac{F}{A}$</span>. Since the cross sectional area, <span class="math-container">$A$</span>, varies across the object, the stress also varies. Since the stress varies across the object, the strain also varies. The value <span class="math-container"...
https://physics.stackexchange.com
293,588
[ "https://softwareengineering.stackexchange.com/questions/293588", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/183293/" ]
I have noticed in java programs at least, that people tend to prefer to start their programs by creating and instance of the class that contains the main method, and activating a non-static method within it, like so <pre><code> class MainClass { void start() { //start the program flow } ...
Both approaches, can be considered fine. There are several causes for your question. <h3>The "I come from another Programming Language" approach</h3> Remember that some developers learnt other Object Oriented Programming Languages before learning Java, and keep some programming styles, while programming Java. C++ I...
Your first example seems to describe someone who perceives <code>public static void main(String[] args)</code> as merely an entry-point, a "punch-in" point for the operating system to call, and nothing more than that. It's a perfectly valid point of view. In my latter years as a Winforms developer, I began using for...
https://softwareengineering.stackexchange.com
351,094
[ "https://physics.stackexchange.com/questions/351094", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/165964/" ]
A body continues in its state of motion unless a force is applied to it. But how does an object stay in motion in the first place? A force must have caused it to move right?
While you know the statement of Newton's first law, Newton's second law can be used to answer your question. Newton's second law is stated mathematically as <span class="math-container">$$\vec{F} = m\vec{a}$$</span> This statement tells us that, for a given object of mass <span class="math-container">$m$</span>, the a...
The Physics term is Inertia, but I will try to explain in non-rigorous terms that I think may help you, and in the future may help you with concepts like relativity. To take an object at rest and put it into motion, that requires a force which accelerates that object and now it has velocity. Inertia says that velocit...
https://physics.stackexchange.com
28,100
[ "https://mechanics.stackexchange.com/questions/28100", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/16329/" ]
I recently bought a 2008 Silverado 5.3 with 77k on it. After a couple weeks I noticed that at idle the engine would stumble and my rpms would drop slightly. It eventually set off the check engine light with cylinder 1 misfire and random cylinder misfire. A couple days later the light went off but the issues remain. Si...
First of all, the 5.3l engine (could be all of the Vortec LS engines, don't know) is thirsty. It drinks a bit of oil. Be aware you could be looking at up to 2 quarts between oil changes. I don't know <em>exactly</em> what the issue is, but it does have a bit of an oil control issue whether it has to do with leakage or ...
Ok, blue smoke on startup most likely is caused by oil not draining properly in the valve cover and oil being sucked into the intake through the pcv on startup. I had this issue when I first bought my 2008 5.3 silverado. Truck has a brand new jasper engine in it and would blow a tremendous amount of smoke on startup. I...
https://mechanics.stackexchange.com
481,761
[ "https://physics.stackexchange.com/questions/481761", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/182004/" ]
Suppose there is an isobaric process whereby the volume of a gas decreases while the pressure of the gas remains constant. Work is done on the gas to compress it. Since the change in internal energy = Q + W from the first law, there's a +W so the internal energy of the gas should increase. However, this is inconsist...
What you're missing is that the temperature must necessarily be lower after the gas is compressed and the pressure is held constant. While the work done on the gas is positive, the heat transferred away from the gas is even greater than the work performed. The isobaric specific heat of a gas is always greater than the ...
Internal energy is directly proportional to the temperature of a given system. Consequently, a decrease in temperature (due to volume reduction in your case) will cause a net decrement in the internal energy. Using the fact that the temperature decreases and the following deduction that the internal energy decreases t...
https://physics.stackexchange.com
507,805
[ "https://physics.stackexchange.com/questions/507805", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/244598/" ]
I'm not really concerned with answering the question but more so what I'm trying to look for. The question is <blockquote> "Three resistors are connected as shown. What is the total resistance between <span class="math-container">$X$</span> and <span class="math-container">$Y$</span>?" </blockquote> Again, I don't...
From your question I assume <span class="math-container">$X$</span> and <span class="math-container">$Y$</span> are named points in a circuit. What the question really means is: If you applied a voltage <span class="math-container">$U$</span> between the points <span class="math-container">$X$</span> and <span class="...
No, you are supposed to find the effective resistance of the conducting paths between X and Y.
https://physics.stackexchange.com
1,078,163
[ "https://math.stackexchange.com/questions/1078163", "https://math.stackexchange.com", "https://math.stackexchange.com/users/60353/" ]
Question: Prove by induction that $ 1+r+r^2+\cdots+r^n = \dfrac {1-r^{n+1}} {1-r} $ where $ r \in \mathbb{R} $ When $n$ is odd, this is really easy as the right side breaks down to $\dfrac {(1-r^{n+1})(r+1)} {1-r}$ . Then you can fiddle with the first n variables on the left: put them into the same fraction and add; ...
Hint: $$r^{n+1} + \dfrac{1-r^{n+1}}{1-r} = \dfrac{(1-r)r^{n+1} + (1-r^{n+1})}{1-r}$$ Edit: What <em>N.F. Taussig</em> says is absolutely correct. If $r=1$, what is true is, $$n+1 = \lim\limits_{r\to 1} (1+r+\cdots + r^{n}) = \lim\limits_{r\to 1} \dfrac{1-r^{n+1}}{1-r}$$
You can easily prove it for all $n&gt;0$, even or not. But if you need the proof wnen $n$ is odd (and $r\ne1$, of course), here it is. The base step ($n=1$) is obvious, as $1-r^2=(1-r)(1+r)$. Suppose it holds for $n$ odd; then the next odd exponent is $n+2$ and \begin{align} 1+r+\dots+r^n+r^{n+1}+r^{n+2} &amp;=\frac{1...
https://math.stackexchange.com
56,014
[ "https://physics.stackexchange.com/questions/56014", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/21235/" ]
Let's say that there is a parallel circuit with two identical resistors in parallel with each other. If a third resistor, identical to the other two, is added in parallel with the first two, the overall resistance decreases. Why does this overall resistance decrease?
For resistors $R_1, R_2, \dots, R_N$ in parallel, the equivalent resistance $R_e$ is given by $$ \frac{1}{R_e} = \frac{1}{R_1} + \frac{1}{R_2} + \cdots + \frac{1}{R_N} $$ If two resistors with equal resistance $R_1 = R_2 = R$ are in parallel, then this gives $$ R_e^{(2)} = \frac{R_1R_2}{R_1+R_2} = \frac{R^2}{2R} = ...
<blockquote> Why does this overall resistance decrease? </blockquote> A more elegant, sophisticated way to see <em>why</em> is through the notion of <em>duality</em>. In electric circuit theory, conductance (the reciprocal of resistance) is <em>dual</em> to resistance. Other dual pairs are: voltage - current ser...
https://physics.stackexchange.com
284,099
[ "https://electronics.stackexchange.com/questions/284099", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/104018/" ]
For a approximately ideal transistor (η = 1) at an emitter current of = 1μA the Base emitter voltage is = 0.60V. How can I work out how much the base emitter voltage increases if the emitter current rises to 100μA? I am aware of the formulae relating the currents at the base, emitter and collector as well as relating ...
The problem comes when you try to switch the load off. You don't show a switch in your circuit, but if you had one say in the low side of the fan and you switched it off, without the diode there would be no path for the inductive current except for the parasitic capacitance at the switch node. Motors are inductiv...
<blockquote> Does anybody know/can explain if this is necessary/correct to use a diode in this way for a fan/motor circuit? </blockquote> you can think of a motor as an inductor. all inductors have one important attribute: current through an inductor cannot change suddenly, as just voltage across a capacitor cannot ...
https://electronics.stackexchange.com
215,043
[ "https://dba.stackexchange.com/questions/215043", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/158592/" ]
I'm using this code to get a mix of Date and Time to use it like a unique ID <pre><code>DateTime.Now.ToString("yyyyMMddHHmmssfffff") </code></pre> In SQL Server 2017 I'm confused as to which best smallest size of data type would be that I can use to store this string. What is the best smallest data type: <code>bigin...
For sure you don't want to use a <strong>varchar</strong>: you are trying to store a number, so storing it into a string is a non sense. Plus, regardless of what you are going to do it later, varchar is the field that allows you the less flexibility: really no point in using it. Your want to avoid <strong>timestamp</s...
<blockquote> I'm using this code to get a mix of Date and Time to use it <em>like a unique ID</em> </blockquote> Is this a small-scale or single-user application? Your code does not guarantee uniqueness. it is possible (albeit highly unlikely) that two computers running the application could generate the same valu...
https://dba.stackexchange.com
3,266
[ "https://security.stackexchange.com/questions/3266", "https://security.stackexchange.com", "https://security.stackexchange.com/users/2075/" ]
I'm self-studying for the CISSP exam and am having difficulty wrapping my mind around the practical side of the ★-property rule in the Bell-LaPadula Model. I understand the mechanics of it and that it protects against accidentally downgrading information. It makes sense for use-cases where a subject wants to write in...
Sure. Here's an example. Suppose we want to have a system log manager, which collects logs from all processes. We'll run the log manager at system HIGH. We want every process to be able to send log records to it. <ul> <li>With your proposed rule, processes running at LOW would not be able to send log entries to th...
This model makes very little sense in context of regular computer usage. It makes a lot more sense when you think of military style classifications, where it makes sense sometimes to write things to another level. For example, if you have a bunch of reports coming in to one analyzer, you want the singular report writ...
https://security.stackexchange.com
3,435,545
[ "https://math.stackexchange.com/questions/3435545", "https://math.stackexchange.com", "https://math.stackexchange.com/users/525089/" ]
<strong>Question:</strong> Find the equation of the plane passing through the point <span class="math-container">$(8\hat{i}+2\hat{j}-3\hat{k})$</span> and perpendicular to each of the planes <span class="math-container">$\vec{r}\cdot (2\hat{j}-\hat{j}+2\hat{k})=0$</span> and <span class="math-container">$\vec{r}\cdot (...
Next to obtain the vector <span class="math-container">$\vec{n}=\vec{n}_1\times\vec{n}_2$</span>, where <span class="math-container">$\vec{n}_1= (2,-1,2)$</span> and <span class="math-container">$\vec{n}_2 = (1,3,-5)$</span>. Thus, the equation of the plane is <span class="math-container">$$(\vec{r}-\vec{a})\cdot (\v...
Hint: The normal vector of the required plane is <em>perpendicular</em> to the normal vectors of the given two planes.
https://math.stackexchange.com
162,868
[ "https://security.stackexchange.com/questions/162868", "https://security.stackexchange.com", "https://security.stackexchange.com/users/151979/" ]
I am about to develop a REST API that will only have one "user" and I am curious about how I should implement security to make it as secure as possible(hopefully implementing some protocol that I am currently unaware of). So initially I thought about implementing openID connect, however I believe that this won't be po...
From personal experience it might be simpler to implement a keystone with a key that you only issue to the one user, vs. using the username/password authentication method, other than that I'm not sure what else you'd have to worry about. Maybe there is a way to combine both ways, but API's are usually set up so multipl...
You can use X.509 authentication and rely on mutual authentication (server authenticates you and you authenticate the server).
https://security.stackexchange.com
910,916
[ "https://math.stackexchange.com/questions/910916", "https://math.stackexchange.com", "https://math.stackexchange.com/users/85602/" ]
I have multiple questions about the $\pm$ sign, since it seems to confuse me in general... <strong>Question 1:</strong> Say I have $15=\pm(a+x)$, Can I use the distributive property so it becomes $15=\pm a \pm x$? Or does that mean I went from 2 to 4 solutions? I get very confused when I encounter this sign in equat...
If the $\pm$ sign is confusing you, get rid of it. If you have $$15 = \pm(a+x)$$ you can turn that into two equations: $$15 = a+x\\15 = -(a+x)$$ and then deal with the two equations separately, one at a time. That is exactly the meaning of the $\pm$ sign. <hr> The reason you're confused is because the notation is ...
<strong>1:</strong> Yes, you can distribute it. Well, it works for all cases. $$\pm(x + y) = \pm x \pm y \quad \forall x,y \in \mathbb R$$ The basic properties are: $$(-)\times (\pm) = (\mp)\\ (\pm)\times(\pm) = (+)\\ (\mp)\times(\mp) = (+)\\ (\pm)\times(\mp) = (-) $$ <hr> <strong>2:</strong> As you said, $\pm$ is ...
https://math.stackexchange.com
7,519
[ "https://stats.stackexchange.com/questions/7519", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/3347/" ]
Consider a Jeffreys prior where $p(\theta) \propto \sqrt{|i(\theta)|}$, where $i$ is the Fisher information. I keep seeing this prior being mentioned as a uninformative prior, but I never saw an argument why it is uninformative. After all, it is not a constant prior, so there has to be some other argument. I understa...
It's considered noninformative <em>because</em> of the parameterization invariance. You seem to have the impression that a uniform (constant) prior is noninformative. Sometimes it is, sometimes it isn't. What happens with Jeffreys' prior under a transformation is that the Jacobian from the transformation gets sucked i...
The Jeffreys prior coincides with the Bernardo reference prior for one-dimensional parameter space (and "regular" models). Roughly speaking, this is the prior for which the Kullback-Leibler divergence between the prior and the posterior is maximal. This quantity represents the amount of information brought by the data....
https://stats.stackexchange.com
289,918
[ "https://mathoverflow.net/questions/289918", "https://mathoverflow.net", "https://mathoverflow.net/users/100902/" ]
Starting from a problem in combinatorics, I ended up with a very simple problem about polynomials, which, unfortunately, I am not able to solve. Say we work over $\mathbb C$. Fix $d&gt;1$. Is it possible to find 3 homogenous polynomials $F_0,F_1$ and $F_2$ of degree $d$ in $\mathbb C[x,y,z]$ without any non-trivial...
This equation has no solutions when $d$ is odd. (EDIT: See below for the general case.) Actually, for $d$ odd, there are no triples $(F_0,F_1,F_2)$ with $F_1\cdot F_2-F_0^2$ a multiple of $x$, let alone $x^{d+1}$. One can see this in a completely hands-on way by setting $x=0$ and looking at the resulting triple of pol...
It is a comment which is too long for a comment. You probably tried this but here it is anyway. You can eliminate $x$ and the condition that $F_i$ are homogeneous by substitution $y'=y/x, z'=z/x$. So you want to prove that there are no polynomials in two variables $F_i(y',z'), i=1,2,3$ of degree $d$ without zeroes in c...
https://mathoverflow.net
181,193
[ "https://math.stackexchange.com/questions/181193", "https://math.stackexchange.com", "https://math.stackexchange.com/users/37028/" ]
As I understand the halting problem, it imply the fact that there doesn't exist one program which can answer the halting problem for every computable program and it rely on Cantor diagonalization to build the proof. However, Cantor diagonalization would not seem to be practicable on finite set of programs. If we are ...
If you get to <em>choose</em> which programs are in that finite set (e.g., all of the ones that halt) then it is trivial to create such a halting-detecting program (HDP). Otherwise, if the set of programs is arbitrary, it might as well be infinite. I.e., the set of programs being presented to your HDP is being chosen f...
If the question is 'for every specific finite set of programs, is there a program that solves the problem on this finite set?' then the answer, perhaps surprisingly, is <em>yes</em> &mdash; there is such a program! Unfortunately, the reasoning behind this is trivial: the 'answer key' for that finite set of (say) $N$ p...
https://math.stackexchange.com
253,985
[ "https://electronics.stackexchange.com/questions/253985", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/16993/" ]
I need to make some differential measurements on a device, but both nodes need to be floating from earth. I found out the hard way that the negative clip of my oscilloscope voltage probes are connected to the mains earth conductor, but I don't have access to a differential probe. I was wondering if there is an easy s...
The best answer is to isolate the equipment you are trying to measure. When it is isolated, you are free to ground any one point, which will be done thru the scope probe ground lead. That keeps the scope, its chassis, and anything it may be connected to or touching from becoming live. If isolating the circuit you ar...
The more common way I've seen "poor-man's" differential probes implemented is by using 2 channels, then using the math <code>A-B</code> mode. The two ground clips are attached to proper ground.
https://electronics.stackexchange.com
556,855
[ "https://math.stackexchange.com/questions/556855", "https://math.stackexchange.com", "https://math.stackexchange.com/users/106401/" ]
Given a $\triangle ABC$ with sides $AB=BC$ and $\angle B=100^\circ $, prove that $$a^3 + b^3 = 3a^2b$$ where $a=AB=BC$ and $b=AC$, I have tried to use simultaneously the sine and cosine rules as well as the Pythagorean Theorem with all my attempts failing to prove that $LHS =RHS$. I would greatly appreciate a hint on...
A straight forward application of cosine rule should tell you that $$ b = 2a\sin(50) $$ Consider $$ \begin{equation} \begin{split} a^3 + b^3 - 3a^2b &amp; = a^3(1+8\sin^350-6\sin50) \\ &amp; = a^3(1+8\frac{(3\sin50 - \sin 30)}{4}-6\sin50) \\ &amp; = a^3(1+6\sin50-2\sin30-6\sin50) \\ &amp; = 0 \end{split} \end{equati...
$a^3+b^3=3a^2b$ using cosine $b^2=a^2+a^2-2aa\cos \beta,\beta&lt;100$ $b^2=2a^2(1-\cos \beta)\\let \\(\frac{b}{a})^2=t^2=2(1-\cos \beta)$ $a^3+b^3=3a^2b\implies 1+t^3=3t\implies t^3-3t+1=0$ $t(t^2-3)=-1\implies t^2(t^2-3)^2=2(1-\cos \beta)(1-\cos\beta-3)^2\\=2(1-\cos \beta)(1+4\cos \beta+4\cos^2 \beta)\\=2(1+3\cos...
https://math.stackexchange.com
2,291
[ "https://physics.stackexchange.com/questions/2291", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/74/" ]
Suppose I do two experiments to find the triple point of water, one in zero-g and one on Earth. On Earth, water in the liquid or solid phase has less gravitational potential per unit mass than water in the gas phase. Therefore, the solid and liquid phases should be favored slightly more on Earth than in zero-g. In a...
This is perhaps similar to what mbq meant, but I will elaborate. The T-p phase diagram of water tells us, for a given temperature and pressure, what phase we will get if we have a bunch of that substance. If I apply different pressures to a bottle of water, I am moving around in the p-direction of the T-p plane. I am...
There is no difference; phase transitions does not change gravitational potential.
https://physics.stackexchange.com
329,726
[ "https://softwareengineering.stackexchange.com/questions/329726", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/186303/" ]
If some fields are required when inserting data, should I check if <code>null</code> when retrieving them (suppose I need to do something with this fields that may throw exception if <code>null</code>), or I shouldn't unless I changed my system and started to accept <code>null</code> for these fields ?
Your question can be understood in two way: <ol> <li>Should I trust that the database if enforcing the not null restriction? </li> <li>Should I trust that other code validated not to insert a null value (no database app or the database accepts null but somehow we want to enforce it ourselves)</li> </ol> <strong>In ca...
You should not depend on the data being previously validated. Even if it is coming from a database that you know does not allow null in that column, it is still conceivable that there could be some bug in the intermediary code that ends up passing you a null. That said, is there a reason for checking it instead of hand...
https://softwareengineering.stackexchange.com
34,096
[ "https://electronics.stackexchange.com/questions/34096", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/2574/" ]
Suppose I am using a 8051. I compiled a code which has a static variable. Where that Static Variable will be stored? In RAM? In Stack? On Heap?? In flash? Where? Also, Correct me if I am wrong: CONST are stored in ROM. And global variables are stored in Flash.(What if I don't have Flash?) I am expecting answers with ...
The following answer is based on my experience looking at mapfiles, if I'm wrong about sth. please correct me! Static vars are definitely not stored on the heap, since this is only for variables allocated during run time (and static vars are allocated during compile time). Static variables are stored in RAM, just li...
<blockquote> Suppose I am using a 8051. </blockquote> Then you are supposed to know about CODE, DATA, IDATA, XDATA and PDATA memory - 8051 is a multi Harvard architecture. <blockquote> Where that Static Variable will be stored? </blockquote> That is a good question. It will depend on the compiler settings - us...
https://electronics.stackexchange.com
247,431
[ "https://electronics.stackexchange.com/questions/247431", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/116550/" ]
I am a programmer and I need to send data to the machine, but I have to add checksum at the end of the data. Can someone show me an example how to do it so I could then write an program to calculate the checksum for me. The rules: Bitwise inversion of the 1 byte sum of bytes beginning with the most significant addres...
That's a current transformer. You may not disconnect the load on a secondary side. The circuit is for measuring the motor current, it does affect the DC voltage of the motor, but this voltage drop is neglible. If you want to eliminate it you have to short circuit points 3 and 4. You may never disconnect the secondary 1...
T1 is a current transformer, so the primary is normally one turn of a heavy gauge wire. It has no effect on the motor at all. The test point you mentioned indicates the current the motor is consuming, but without more information I do not know what the volts per amp reading is.
https://electronics.stackexchange.com
335,639
[ "https://softwareengineering.stackexchange.com/questions/335639", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/154934/" ]
Is it weird to have an identifier such as (_id) on a request which you send to the API, which "enriches" the request and sends back a response with the same identifier (but obviously more enriched data)? For example - you send request {_id: 1111} and get back a response {_id: 1111, occurence: new, etc}. The reason wh...
This is ok. Consider when you are asking "tell me everything about record X". Well everything about record X, includes its ID. It would seem a bit strange to ask about everything for a record, and NOT get its ID back. I'd generally prefer to pull this data back despite the slight additional overhead. In the case where...
It's not strictly necessary with a synchronous request. It has a really low cost and can be useful for troubleshooting. It can help you tie transactions together across systems. If one isn't supplied, I would recommend generating one (e.g. a UUID) and return it for the same reasons.
https://softwareengineering.stackexchange.com
179,817
[ "https://softwareengineering.stackexchange.com/questions/179817", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/44640/" ]
I have to read lines from a text file in sequential order. The file is a custom text format that contains sections. If some sections are out of order, I would like to look for the starting of the next valid section and continue processing. Currently, I have some code that looks like this: <pre><code>for (int currentL...
Well, since a code smell is something that makes you take a second look at it, which you yourself are doing, I'd say it definitely qualifies. However, code smells don't automatically need removing, just a hard look to make sure it's really the best way to solve the problem. In this particular case, the reason you don...
I think it is a code smell. The idiom in a for loop is to have it increment/decrement consistently. People reading your code are going to expect the increment expression (currentLineIndex++) to be the controlling logic. I think it would be better to do one of the following: <ol> <li>turn this code into a while loop...
https://softwareengineering.stackexchange.com
14,535
[ "https://dba.stackexchange.com/questions/14535", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/6622/" ]
I was requesting the conceptual schemas from a government agency's information system for my research. My request has been denied on the grounds of it being a security risk. I don't really have extensive database experience so I can't verify that claim. Is disclosing your schema really that big of a security risk? I m...
Agreed with gbn (so +1), but I think there are two other possibilities at play: <ol> <li>It is quite possible that their conceptual schema has a lot of overlap with their physical schema. Knowing table names gives you a decent head start in planning your SQL injection attacks.</li> <li>It is very likely they don't ha...
I'd suggest it is an Intellectual Property risk but they didn't want to say it
https://dba.stackexchange.com
157,130
[ "https://softwareengineering.stackexchange.com/questions/157130", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/41346/" ]
How do you name your iterators when you return a begin and an end iterator from a class? Without it sounding clunky, that is. Example: <pre><code>typedef std::vector&lt;Idea&gt; Ideas_Type; Ideas_Type::const_iterator GetIdeasBegin() const; Ideas_Type::const_iterator GetIdeasEnd() const; </code></pre> Should it be ...
It's unclear from your question, but if you are thinking of something like this: <pre><code>class Brain { typedef std::vector&lt;Idea&gt; Ideas; // Not "Ideas_Type". That's why it's capitalized. Ideas::const_iterator firstIdea(); Ideas::const_iterator lastIdea(); } </code></pre> There's no need for all that. ...
I would mimic the naming done in the STL. Now your classes work with many built-in functions. <hr> <ul> <li>begin</li> <li>end</li> </ul> <hr> <ul> <li>rbegin</li> <li>rend</li> </ul>
https://softwareengineering.stackexchange.com
128,713
[ "https://chemistry.stackexchange.com/questions/128713", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/89531/" ]
There is an extract in my book which i am not able to get. It says: Place strip of metallic zinc in aqueous solution of copper nitrate for about one hour. You may notice that the strip becomes coated with reddish metallic copper and the blue colour of the solution disappears. Formation of Zn2+ ions among the products c...
The final solution contains <span class="math-container">$\ce{Zn^{2+}}$</span> ions, which reacts with <span class="math-container">$\ce{H_2S}$</span> to produce white <span class="math-container">$\ce{ZnS}$</span>. But you may not avoid that maybe some of the initial <span class="math-container">$\ce{Cu^{2+}}$</span> ...
You are seeing the difference between a metal that can be precipitated by hydrogen sulfide in acidic solution and one that requires the sulfide bearing solution to be alkaline or at least not as acidic. In my student days (1970s-1980s) they were called Group II and Group III metals in qualitative analysis, although th...
https://chemistry.stackexchange.com
17,045
[ "https://electronics.stackexchange.com/questions/17045", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/10598/" ]
We need to carry high currents on a PCB (~30Amps sustained), so we are likely to order our PCBs with high copper thickness. So far we've only used 35 microns (1 oz) in our designs, so 'high thickness' for us means, 70 (2 oz) or 105 (3 oz). We do not know what are the things to watch out for with thickness copper. We'd...
I'm late to the game, but I'll give it a shot: <blockquote> 1- It appears that for a lot of manufacturing houses, 105 microns is as high as its gets. Is that correct or are higher thickness possible? </blockquote> Some fab shops can plate up internal layers. The tradeoff is usually larger tolerance in the overall t...
I think 105\$\mu\$ is the thickest you can get, but I can see no reason why you wouldn't get it on inner layers. A PCB is just a stackup of epoxy, copper and glass fiber. You can play with thickness at will. Thicker inner layers won't be as efficient, of course, since they <strong>can't give off their heat</strong> to ...
https://electronics.stackexchange.com
680,119
[ "https://physics.stackexchange.com/questions/680119", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/280779/" ]
During the proof of least action principle my prof used the equation <span class="math-container">$ \delta \frac{dx}{dt} = \frac{d \delta x}{dt} $</span>. We were not proved this equality. I was curious to know why this is true so I tried but I couldnt go any further neither did I find anything on the internet. Any hel...
You need to understand the definition of <span class="math-container">$\delta$</span>. First let <span class="math-container">$q(t)$</span> be given. A variation of <span class="math-container">$q(t)$</span> is by definition a one-parameter family of curves <span class="math-container">$\tilde{q}(t;\epsilon)$</span> wi...
We consider a change <span class="math-container">$$q(t) \rightarrow q'(t) = q(t) + \delta q(t),$$</span> where <span class="math-container">$\delta q(t)$</span> is some arbitrary function (maybe subject to some constraints, e.g. we might require that it vanishes at the boundaries of integration). The time derivative o...
https://physics.stackexchange.com
371,777
[ "https://electronics.stackexchange.com/questions/371777", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/187532/" ]
I've built a power supply with regulated +15v, +12v, +5v, -12v and -15v outputs and I'd like to build a voltage monitor to let me know if any of the rails are above or below their stated voltage. I have some tri-colour RGB LEDs (common cathode), the plan is that when the rail is at the correct voltage, the LED is gree...
Probably worse If the LEDs are only DC, and just as bad if AC in series which is non-linear. Now the 4W lights probably are enclosed so they get hotter and reduce life from 3000h by 50% for every 10’C rise above open ambient. A Triac dimmer could solve that as well as a tiny low speed fan. You could use 12V stripLED...
Instead of using 24V lamps I would use 28V lamps if you stick with incandescent. #1873 comes into mind. But yes you can get ac rated led bulbs. and i would use the ones with the built in current limiting if you go that direction. They will state a wide range of operation (6 Volt-28 Volt AC/DC I've seen) but they cost q...
https://electronics.stackexchange.com
64,795
[ "https://dsp.stackexchange.com/questions/64795", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/48306/" ]
I'm trying to make a program that catch and audio signal of a bass and show the notes that have been played. My program: <ul> <li>Gets the sound and put it in a double data type array. (48&nbsp;000Hz, 16bits) (1 frame in array per sample)</li> <li>Splits the array into many arrays, with 4~5 arrays in a second approx.<...
A good stringed instrument music pitch detection/estimation algorithm will do the opposite, e.g. it will not ignore overtones. Instead it will pay attention to the harmonics, specifically the harmonic train and its spacing, as this is a stronger indication of human perceived pitch than spectral content at the fundamen...
What kind of windowing/overlap scheme do you use? Did you look into cepstral processing, seeing as your bass should produce a harmonic series? Perhaps dynamic programming to pick a sensible «time-pitch-contour»? Fundamental pitch tracking is a long standing challenge. There should be many hints in the litterature.
https://dsp.stackexchange.com
2,160,616
[ "https://math.stackexchange.com/questions/2160616", "https://math.stackexchange.com", "https://math.stackexchange.com/users/245331/" ]
If we want for example to determine whether there is an $x \in \mathbb{Z}$ such that $x^2 \equiv 2 \mod 15$, it suffices to calculate $2^2=4,3^2=9,4^2=1,5^2=10,6^2=6,7^2=4$, because we have again $4$, we know that there is not such an $x$. Why is this true in particular? Why we know for sure that $8^2,9^2,...,14^2$ is ...
Modulo 15, $8=-7$ so $8^2=7^2$ etc.
You're argument is not right. You don't need to go through $8,\dotsc,14$ because they are the respective opposites (modulo $15$) of $7,\dotsc,1$, hence have the same squares.
https://math.stackexchange.com
1,907
[ "https://cs.stackexchange.com/questions/1907", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/2488/" ]
Grammars seem to be used for different purposes. In formal languages, they are used to describe sequences of symbols. In programming language theory, they are used to describe objects in a term algebra (possibly enriched with some implicit, extra structure such as variable scoping rules). My question is, are these t...
As Max said the modification is not difficult, I suggest that you do not read the rest of this answer and think about the problem a little bit more, there is only one part that needs modification and remembering the definition of when a $\mathsf{coNP}$ machine accepts will help you fix that part. I will explain the r...
You may also wish to consult the text <em>Computational Complexity</em> by Christos Papadimitriou. Specifically Chapter 14, Section 3 that delves into oracles. Proofs for $P^A = NP^A$ and $P^B \not= NP^B$ for some oracles $A$ and $B$ for instance are provided in detail, and may be helpful for your primary problem. Hope...
https://cs.stackexchange.com
56,424
[ "https://physics.stackexchange.com/questions/56424", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/21814/" ]
I'm working on a science fiction story that involves two spaceships engaged in combat while in orbit around a planetoid. My original idea called for spaceship A to trick spaceship B into firing a passive projectile such that it would orbit the planetoid and strike spaceship B. This was meant to happen within a matter o...
All the following is simply a simple application of math. If I'm wrong anywhere (and I'm bound to be), please feel free to point it out to me or just edit the post, if you like. The largest planetoid is Ceres, at almost 1000 km in diameter. If we assume that your planetoid was a bit larger than this, and that Ceres wa...
Your problem is that if the projectile is moving faster than the spaceships, which are in orbit round the planet, then the projectile velocity will be too great to be affected by the gravity of an asteroid. A large moon might do it, but then it wouldn't happen quickly. How about having a small (e.g. asteroid mass) bla...
https://physics.stackexchange.com
446,037
[ "https://electronics.stackexchange.com/questions/446037", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/163329/" ]
I need some confirmation on how to connect an 18m PNP diffuse photoelectric sensor to an Arduino. <ol> <li>I am power the unit via an external 12 volt power supply. The ground between the power supply and the Arduino is shared.</li> <li>The black wire is connected to pin 8 of the Arduino.</li> </ol> When I read th...
<blockquote> Brushless motors are more complicated in that it's the frequency of the input voltages that determine the speed/current/torque. </blockquote> This is true for stepper motors and PM synchronous motors powered by AC, but PM BLDC motors usually have their commutation controlled by Hall sensors or back-em...
yes it is possible. Brush commutation of the voltage source with some ESR from battery or voltage regulator causes dips in source voltage when Ra (aka DCR) approaches ESR of the battery which controls lock rotor or Isc or surge at full voltage start. BLDC drivers still have a ESR or Rs combined with an array of Caps ...
https://electronics.stackexchange.com
62,152
[ "https://electronics.stackexchange.com/questions/62152", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/20651/" ]
We plan to build a GPS device for our local community which will act like an electronic guide. The chip inside will contain GPS coordinates of important sites in our region as well audio guides. Now, copyright is <strong>not respected or punished</strong> in our country. We are scared that someone may take our produc...
If you're trying to protect the circuit itself, you might as well give up. It <em>is</em> possible to copy, but as m.Alin said, it's usually not worth the effort. It's much easier to design a similar device from scratch. If you're trying to protect the data in a flash chip, your best bet is to encrypt the on-chip data...
First step you need to make is to decide against who are you going to try to protect the device and to try to estimate potential impact on your business plan if protection is broken. Next you should determine how big impact various protection schemes will make on the normal use of the device and how much protection are...
https://electronics.stackexchange.com
553,633
[ "https://physics.stackexchange.com/questions/553633", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/257479/" ]
Let's say that a concave lens <span class="math-container">$A$</span> has a focal length of <span class="math-container">$-10$</span> <span class="math-container">$cm$</span> and another concave lens <span class="math-container">$B$</span> has a focal length of <span class="math-container">$-20$</span> <span class="mat...
<blockquote> Does it affect the image very much? </blockquote> Well, yes. With a <span class="math-container">$4f$</span> setup, at <span class="math-container">$+f_2$</span> you have <em>exactly</em> the same image you had at <span class="math-container">$-f_1$</span>, just (de)magnified by a factor <span class="m...
Another way to look at it is with Gaussian beam optics. For a 4f system with the waist of a Gaussian beam located in the front focal plane of the first lens there will be a waist for the output Gaussian beam in the back focal plane of the second lens. This is because the waist of the Gaussian beam between the two lense...
https://physics.stackexchange.com
38,107
[ "https://stats.stackexchange.com/questions/38107", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/11030/" ]
I have been asked by a journal reviewer to provide the my final trained SVM models so that others can try to replicate or make use of the models. Is there an accepted way to do this? I was thinking of providing a spreadsheet detailing the selected features, the support vectors, the hyperplane bias and he support vec...
The answer is No!! I have several comments. <strong>[1] WHAT VERSION OF DIXON'S RATIO TEST ARE YOU USING?</strong> There are different versions of Dixon's ratio test. The simplest form of the test is really designed for a single outlier. It uses the test statistic [X<span class="math-container">$_($$_n$$_)$$-X$...
What question are you trying to anwser with the overall analysis? What is the science behind the data? You really need to address the above 2 questions before thinking about other issues. Then you need to ask other questions (if the answers to the above questions warrent continuing) like: how robust is the Dixon tes...
https://stats.stackexchange.com
98,738
[ "https://physics.stackexchange.com/questions/98738", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31965/" ]
In eq. (22.20) on p. 135 in Srednicki he defines the functional integral <span class="math-container">$$Z(J) = \int\mathcal{D}\phi\,\exp\Big[\mathrm{i}\big(S+\int\mathrm{d^4}y \,J_a\phi_a\big)\Big], \tag{A}$$</span> where <span class="math-container">$S$</span> and <span class="math-container">$J_a$</span> are the ...
Let's consider a single scalar field for simplicity. The following step is a misapplication of the functional derivative: \begin{align} \delta Z(J) = \frac{\delta Z}{\delta\phi(x)}\delta\phi(x) \end{align} By definition, one can only take the functional derivative of a functional $F$ with respect to $\phi$ if $F$ is...
I) The mentioned integral $\color{Red}{\int \!\mathrm{d}^4x}$ on the right-hand side of eq. (B) should really be there. If we define the action as $$\tag{1}S_J[\phi]~:=~S[\phi]+\int \!\mathrm{d}^4x~ J_a(x) \phi^a(x),$$ then the infinitesimal variation of the action reads $$\tag{2}\delta S_J~=~ \color{Red}{\int \!\...
https://physics.stackexchange.com
32,239
[ "https://cs.stackexchange.com/questions/32239", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/22968/" ]
Imagine a program, executed by an interpreter to be a Turing Machine. Consider this code: <pre><code>x = read_input print x </code></pre> Does undecidability mean that there may possibly be an input to this program such that the program may never halt?
Short answer: <strong>No</strong>. Undecidability is a property of problems, not of programs. What is undecidable is however to check if some given program ever halts on any input. <em>This problem has the program as input.</em> If you fix a program, then it <em>may</em> be decidable to check if the program halts for...
Undecidability tells us that, given an arbitrary program and some input, there is no general computational procedure which tells us whether that program halts on that input. It says nothing about specific computational procedures which may be correct for specific (classes of) programs. That is, we can generate heuristi...
https://cs.stackexchange.com
2,589,131
[ "https://math.stackexchange.com/questions/2589131", "https://math.stackexchange.com", "https://math.stackexchange.com/users/476145/" ]
<blockquote> Show that the reflection of the line $ax+by+c=0$ on the line $x+y+1=0$ is the line $bx+ay+(a+b-c)=0$ </blockquote> Attempt: Consider a point $(h,k)$ on the line $ax+by+c=0$ Thus, $ah+bk+c=0 $ \\ $\mathbb{1}$ Now note that the image $(x_2,y_2)$ of a <em>point</em>$(x_1,y_1)$ with respect to a lin...
You’ve substituted for $a$ and $b$ in your formula for the image of a point, but not for $c$. Then, for some reason you didn’t multiply this extraneous $c$ (which should be $1$) by $b$ or $a$ in the expressions that you derived for $bx_2$ and $ay_2$. You should have $x_2+k+1=y_2+h+1=0$, from which $bx_2+ay_2+ah+bk+a...
HINTS: $$ ax +by+c=0$$ $$ px + q y+ r =0$$ have angle bisector $$ \dfrac{ ax +by+c}{\sqrt{a^2+b^2}}-\dfrac{ px +qy+r}{\sqrt{p^2+q^2}}=0$$ which is same as $$x+y+1 =0 $$ comparing coefficients of the straight line $$ \dfrac{a}{\sqrt{a^2+b^2}}-\dfrac{ p}{\sqrt{p^2+q^2}}=1$$ $$ \dfrac{b}{\sqrt{a^2+b^2}}-\dfrac{ q}{\...
https://math.stackexchange.com
163,138
[ "https://electronics.stackexchange.com/questions/163138", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/71507/" ]
Is is possible to transmit power using magnetic resonance coupling at 50Hz? Assuming I have no constraints on the minimum distance between the primary and the secondary coil. However, the coils are to be Air Cored. Most of the examples available use high frequencies such as 12KHz for the Primary coil, but can the sam...
Of course it is possible in theory. But very very inefficient in practice. Inductance of the primary coil (e.g.; A=10000mm\$^2\$ cross sectional area, \$\ell\$=100mm length, 10,000 turns) is $$ L = \dfrac{\mu A N^2}{\ell} = \dfrac{(4\pi 10^{-7} \text{H/m}) (0.01\text{m}^2) (10000)^2}{0.1\text{m}} = 4\pi \text{H} = 12...
One of the major drawbacks with using such a low frequency is that you will not be able to achieve much distance for the transmission but since distance is no constraint to you , so i think using 50 Hz in not going to be a problem. <strong>But i can assure you that with such low frequency you will not be able to achie...
https://electronics.stackexchange.com
262,323
[ "https://softwareengineering.stackexchange.com/questions/262323", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/146987/" ]
I know this seems like a weird question, since the point of two or more objects sharing the same class is that their behavior is the same, i.e. their methods are identical. However, I'm curious if there are any OOP languages that allow you to redefine the methods of objects in the same way that you can assign differen...
Methods in most (class-based) OOP languages are fixed by type. JavaScript is prototype-based, not class based and so you can override methods on a per-instances base because there is no hard distinction between "class" and object; in reality, a "class" in JavaScript is an object which is like a template for how the i...
You asked for any language that provide per-instance methods. There is already an answer for Javascript, so let's see how it is done in Common Lisp, where you can use EQL-specializers: <pre class="lang-lisp prettyprint-override"><code>;; define a class (defclass some-class () ()) ;; declare a generic method (defgener...
https://softwareengineering.stackexchange.com
1,132
[ "https://cstheory.stackexchange.com/questions/1132", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/657/" ]
It's well-known that a regular expression can be recognized by a nondeterministic finite automaton of size proportional to the regular expression, or by a deterministic FA which is potentially exponentially larger. Furthermore, given a string $s$ and a regular expression $r$, the NFA can test membership in time proport...
It's easy enough to trade off time for space, as follows. Convert the regular expression to an NFA — for concreteness in comparing algorithms, we'll assume that $r$ is the number of NFA states, so that your $O(rs)$ time bound for directly simulating the NFA is valid and your $O(2^r)$ space bound for running the conver...
This is not an answer, but too long for a comment. I'm trying to explain why the question, as posed, may be hard to understand. There are two ways to define computational complexity for a device <em>X</em>. The first and most natural way is <em>intrinsic</em>. One needs to say how the device <em>X</em> uses the input...
https://cstheory.stackexchange.com
51,124
[ "https://quant.stackexchange.com/questions/51124", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/36307/" ]
I am very new to finance, so I don't know if my question makes sense but I have seen that there are different methods to estimate the implied volatility of an American Option. One of them is the finite differences method (used in the RQuantlib package in R), but since it is a mathematical method, what financial theor...
Implied volatility is obtained by taking the observed market price of an option and solving for the necessary volatility in the Black Scholes formula to give that price. The finite difference method is just a numerical method to solve PDEs like the Black Scholes equation on a computer.
The BS implied vol is the vol parameter in the BS formula that makes it hit the observed price of an European option. To price an American option you need an assumption on the underlying dynamics, say geometric Brownian motion with constant diffusion coefficient (which happens to be also named BS dynamics). Then you ...
https://quant.stackexchange.com
201,462
[ "https://softwareengineering.stackexchange.com/questions/201462", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/93290/" ]
I'm currently working for a company on the engineering team of about 5-6 people and have been given the job of heading up the redesign of an embedded system tester. We've decided the general requirements and attributes that would be desirable in the system, and now I have to decide on a language to use for the system, ...
<ol> <li>Use it. Grab a tutorial, give it a spin. This will both give you an idea of what it's like to use the language, and, what kind community it has.</li> <li>Stack Overflow Question Counts: This is a rough indication of overall use and how likely you are to find an answer to your question</li> <li>Open Source libr...
I am not sure if you have the budget for this, but you can hire people who can evaluate products/technologies for you. Solution architects -normally give you sound advice backed with data. But if you dont have the budget for this or you are the solution architect, its better you learn about the languages you are eval...
https://softwareengineering.stackexchange.com
121,438
[ "https://softwareengineering.stackexchange.com/questions/121438", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/41099/" ]
I'm on the way developing an application which requires a kind of dynamic database, So this is what I want, <img src="https://i.stack.imgur.com/0fxbc.png" alt="enter image description here" /> This is the for reading the details of a class, the number of variables and methods will only be known at run-time, and I have ...
It would be very lengthy to give you a fully normalized db here. Hopefully this would get you started. <pre><code>tblClasses pk Name AnyOtherDataYouwanttostore tblAttributes fk ClassName &lt;-&gt; tblClasses.Name Name Visibility Type ... tblFunctions fk ClassName &lt;-&gt; tblClasses.Name ...
You may want to look into MongoDB. Its significantly different than MySQL as it is in the NoSQL group but seems like it might be a good fit for what you need. You can store the dynamic aspects in one table in an array which is something you can't do in a MySQL setup. If however you need/want to stick with the MySQL ...
https://softwareengineering.stackexchange.com
609,786
[ "https://physics.stackexchange.com/questions/609786", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/286608/" ]
How do scientists derive equations?<br /> For example, how do they know that: <em>Work done = Force × Displacement</em> And why is it always multiplication and not anything else? Why not addition?
&quot;How do scientists derive equations?&quot; is a huge question, whos answer spans thousands of years of history, and will differ based on who you ask. At its most basic level physicists use equations to come up with a general framework to describe the phenomena they observe. For instance consider <span class="math-...
<ol> <li>We derive equations of formulas depending on our needs to understand a system. Some systems are good to be understood with just working with force, some may require other quantities to properly describe what is going on in the system. </li> <li>Why only multiplication and not addition? Simply because you can m...
https://physics.stackexchange.com
95,819
[ "https://math.stackexchange.com/questions/95819", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I think I have solved a problem in <em>Topology</em> by Munkres, but there is a small detail that is bugging me. The problem is stated in this question's title. I will write down the proof and will highlight what is troubling me. We prove by contradiction: Assume $X$ is not Hausdorff. Then there exist points $x,y$ whe...
Your claim that $(U\times V)\cap \Delta=(U\cap X)\times(V\cap X)$ is incorrect. Since $U,V\subseteq X$, this is the same as claiming $(U\times V)\cap \Delta=U\times V$. If you use $(U\times V)\cap \Delta = \{(x,x); x\in U\cap V\}$ instead, the rest of your proof should work fine, but there are still several minor deta...
The definition of Hausdorff is that for all distinct pairs $x,y \in X$ there exist disjoint open $U \ni x$ and $V \ni y$. Hence the negative is that there <em>exist</em> $x,y \in X$ each of whose open neighbourhoods $U \ni x$, $V \ni y$ have nonempty intersection. You seem to have said that this is the case for <em>all...
https://math.stackexchange.com
3,771,317
[ "https://math.stackexchange.com/questions/3771317", "https://math.stackexchange.com", "https://math.stackexchange.com/users/34869/" ]
<blockquote> Let <span class="math-container">$X$</span> be a set and <span class="math-container">$\operatorname{Sym}(X)$</span> be the symmetric group on <span class="math-container">$X$</span>. If <span class="math-container">$x, y \in X$</span>, is there guaranteed to be an <span class="math-container">$f \in \oper...
Simply take the involution (transposition) <span class="math-container">$\;(x\,y)\;$</span>, meaning: the bijective map <span class="math-container">$$f:X\to X\;,\;\;f(a):=\begin{cases}y,&amp;a=x\\{}\\x,&amp;a=y\\{}\\a,&amp;a\neq x,y\;\end{cases}\;,\;\;\;\;x\neq y$$</span> If <span class="math-container">$\;x=y\;$</spa...
The underlying set of <span class="math-container">${\rm Sym}(X)$</span> is the set of all bijections from <span class="math-container">$X$</span> to <span class="math-container">$X$</span>. Thus, for a given pair <span class="math-container">$(x,y)\in X\times X$</span>, select a bijection <span class="math-container">...
https://math.stackexchange.com
133,618
[ "https://softwareengineering.stackexchange.com/questions/133618", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/46951/" ]
Consider the following JavaScript function: <pre><code>function Foo() { function getPreferences() { if ([there is an existing preferences object]) { return preferences; } return false; } } </code></pre> The calling code is: <pre><code>var foo = new Foo(); var prefs = foo.getPreferences(); if (p...
False seems like a strange choice. <code>null</code> seems more natural. Best of all, return default preferences and eliminate <code>if (prefs)</code>.
I'd much rather see code that returns an object for success and <code>null</code> for not success. Then, it at least feels like the function is behaving consistently. It's return either an object or the standard way of saying no object <code>null</code>. The same code: <pre><code>if (prefs) { // do something } ...
https://softwareengineering.stackexchange.com
155,893
[ "https://security.stackexchange.com/questions/155893", "https://security.stackexchange.com", "https://security.stackexchange.com/users/144173/" ]
I was wondering, to make a DOS attack you need to send something to the target you are DOS-ing. And to send something you need to use some protocol. My question is, are all protocols the same speed? And what are the protocols that DOS programms usually use? My guess the UDP because I saw online it was fatser, but I am ...
In principle a DDOS attack can send completely legitimate requests and thus overload the server. For example, just use a botnet to visit some persons blog and the server will potentially collapse under the load. There is no real way to protect against this because every request looks like a real request. However, the ...
A answer has been accepted here - and it does make some valid points, but did not mention reflected amplification attacks; with tcp only small amounts of data are exchanged (and must be exchanged between both the attacker and victim) before processing, memory and io resources can be consumed. A slowloris type attack as...
https://security.stackexchange.com
412,899
[ "https://mathoverflow.net/questions/412899", "https://mathoverflow.net", "https://mathoverflow.net/users/8435/" ]
I am investigating whether or not there exist <span class="math-container">$\epsilon &gt; 0$</span> such that <span class="math-container">$\zeta(s) \neq 0$</span> on the strip <span class="math-container">$1-\epsilon &lt; \Re(s) \leq 1$</span>. Suppose not. Then given <span class="math-container">$\delta &gt; 0$</spa...
There are, provably, very few zeros with real part close to <span class="math-container">$1$</span> (or bigger than <span class="math-container">$0.51$</span> for that matter). These theorems go under the name of &quot;zero density estimates&quot;, and they have a vast literature. See Chapter 11 in Ivić: The Riemann ze...
To add to GH from MO's answer, Chapter 10 of Iwaniec and Kowalski's &quot;Analytic Number Theory&quot; is another good reference. A few of the classical papers are <ol> <li>Ingham's &quot;On the Estimation of <span class="math-container">$N(\sigma,T)$</span>,&quot;</li> <li>Montgomery's &quot;Mean and Large Values of D...
https://mathoverflow.net
489,237
[ "https://stats.stackexchange.com/questions/489237", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/294894/" ]
Suppose we have two variables <span class="math-container">$X_2$</span> and <span class="math-container">$X_3$</span> and two regressions are run: <span class="math-container">$$X_2=a+bX_3+v_2$$</span> and <span class="math-container">$$X_3=c+dX_2+v_3$$</span> <span class="math-container">$v_2$</span> and <span class="...
As a hint, consider this simulation in R: <pre><code>rm(list=ls()) set.seed(42) n=1000 x3= rnorm(n) x2 = 1 + 2 * x3 + rnorm(n) lm(x2 ~ x3) Coefficients: (Intercept) x3 0.9949 2.0098 # let's store the residual v2: v2 = lm(x2~x3)$res # now let's consider the second model: lm(x3~x2) Coefficients: (Interc...
From the first regression, we have <span class="math-container">$$X_3 = -\frac{a}{b} + \frac{1}{b} X_2 - \frac{v_2}{b}$$</span> Comparing this with <span class="math-container">$$ X_3 = c + dX_2 + v_3$$</span> and assuming the two regressions are performed similarly, we have <span class="math-container">$$c = -\frac{a}...
https://stats.stackexchange.com
56,263
[ "https://datascience.stackexchange.com/questions/56263", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/69384/" ]
I'm reading Scikit-learn and I can't understand sample and feature. (n_samples, n_features)<br/> Can anybody describe those by example?
[x[1,2,3,4], x2[1,2,2,3], x[2,3,2,1]] The data above has 4 features. We can gives those features labels with a header. We'll just call them feature 1, feature 2, feature 3. For the first entry, feature 1 has a value of 1 and feature 2 has a value of 2 and so on. A sample, is a subset of data taken from your datas...
Sample is typically the number of items that you are training on. In the digits dataset, the number of samples are the number of digits written by all the writers. Each digit can then be represented in various ways, for instance, as coordinates in the XYZ space, maybe the pressure level to write each of the digits, and...
https://datascience.stackexchange.com
359,662
[ "https://physics.stackexchange.com/questions/359662", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/170485/" ]
It is obvious that the Earth is not flat. We know this from looking at NASA pictures other experiments. But, mathematically speaking, the Earth, along with other celestial bodies, are measured with mathematics and graphs that display information using a 2 dimensional point of reference. For example, suppose I want to ...
It sounds like you're curious about data representation. In the example you've given (temperature as a function of depth from the Earth's surface), you've actually compressed <em>three</em> spatial dimensions into one dimension and then plotted the temperature as a function of depth. Because of the rough spherical symm...
No. The Earth is not defined by a flat geometry. To see why this is the case, just look at what happens to two parallel geodesics. A geodesic is the general version of what we call a "straight line" in flat geometries. On a spherical surface, such geodesics are called "great circles"; common examples of great circles: ...
https://physics.stackexchange.com
91,485
[ "https://mathoverflow.net/questions/91485", "https://mathoverflow.net", "https://mathoverflow.net/users/20782/" ]
greetings . i've been trying to do this integral for many days now, with no clue on how to attack it . the integral is a mellin inverse of some kind, and appears in analytic number theory . $$I(x)=\lim_{T\rightarrow \infty}\frac{1}{2\pi i}\int_{2-iT}^{2+iT}\frac{x^{s}}{s}\left(\sum_{k=1}^{\infty}\frac{\zeta(ks)-1}{k}...
Let $n \ge 7$. If $V$ is an irreducible representation of $S_n$ such that $\mathbb{C}[V]^{S_n}$ is a polynomial algebra then either $V$ is the trivial representation, the sign representation or the $(n-1)$-dimensional standard representation. <i>Outline Proof</i>: Let $\rho : S_n \rightarrow \mathrm{GL}(V)$ be an irr...
I only concern myself with faithful representations of $S_n$ and for $n &gt;4$. The only way to get a polynomial algebra of invariants is to represent $S_n$ as a complex reflection group (so generated by pseudo-reflections, that is elements wih a fixed-point space of codimension $1$). A complex relfection group is easi...
https://mathoverflow.net
212,300
[ "https://dba.stackexchange.com/questions/212300", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/39718/" ]
I want to create an alias for a SELECT statement, but then I want to limit the resultset with a TOP clause. If the procedure TopCount parameter is bigger than 0, I want to put limit result set with TOP clause. But after the WITH clause, the IF statement is producing an error. Can I continue with IF or different than t...
No, you can't do that. Your best bet would be to give your top variable a very high default value. <pre><code>CREATE PROC dbo.if_branch (@top INT = 2147483647) AS BEGIN WITH d AS ( SELECT * FROM sys.databases AS ds WHERE ds.name = 'tempdb' ) SELECT TOP (@top) * FROM d; END </code></...
<code>WITH</code> declares a CTE, which is something you can use in just <strong>1 statement</strong> (like a <code>SELECT</code>, <code>INSERT</code>, <code>UPDATE</code>, etc.). An <code>IF</code> is a control flow mechanic that separates statements (or blocks of statements) so you can't declare a CTE and conditiona...
https://dba.stackexchange.com
64,624
[ "https://security.stackexchange.com/questions/64624", "https://security.stackexchange.com", "https://security.stackexchange.com/users/31802/" ]
First of all sorry if I am asking a trivial question. As far as I know, XML is used for representing document structures. Can entirely static sites accepting no user inputs at all be vulnerable to XML, DTD and entity attacks? If it happens, In what context is it possible ?
So XXE is usually seen in areas of a site which accept user input. If by static site, you mean a site that purely responds to HTTP GET requests for documents hosted on a server, then there's not really anywhere for XXE to occur. The only scenario I could think of would be if the site processed a section of the URL or...
XXE attacks are about processing malicious XML input from the user, so a static site cannot be vulnerable.
https://security.stackexchange.com
145,140
[ "https://electronics.stackexchange.com/questions/145140", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/39687/" ]
I was working on a bunch of PC PSU organ donors and noticed that on lots of them through all the wires that lead the power to the outside there were wires soldered, and lots of solder added. This is probably to increase current capability. I only today thought about it, so did not take any photos, but it looks simila...
Soldering wires onto a PCB like that definitely increases current capability. Whether that's good design we can't of course answer without knowing the design criteria. Downsides of this method are that it takes significant manual labor in production, therefore will reduce yield because people make mistakes, cause mor...
Adding solid copper bus wires to high current paths on a circuit board is more common than one would think. I've seen it done on power supply boards and even on a computer board or two. In the case of the computer board I believe it was done to solve a problem with too much voltage drop across an internal power plane s...
https://electronics.stackexchange.com
293,697
[ "https://softwareengineering.stackexchange.com/questions/293697", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/180881/" ]
I was thinking about pure functions especially in the context of C++, which of course is not a purely functional language, and was wondering if higher order functions in C++ can ever be considered pure? Take for example <code>std::find_if</code>: it would be very pure except it takes another function, which might not b...
You're right, this is an issue when one wants to reason about purity of functions in a language that permits impure functions. Technically almost all languages allow impurity, but the purely functional ones usually explicitly mark the impure ones in the type system, such that the Haskell function <code>map :: (a -&gt; ...
There is a constraint on the predicate, but it's textually enforced by standard text and may be enforced by a sufficiently capable compiler as Quality-of-Implementation. Many things are only guarded by phrasing in the standard. Some of the rationale is that while its possible to constrain the predicate to ones that ta...
https://softwareengineering.stackexchange.com
4,315
[ "https://earthscience.stackexchange.com/questions/4315", "https://earthscience.stackexchange.com", "https://earthscience.stackexchange.com/users/109/" ]
I know that at least twice in its history Earth was totally frozen. I also know that the last time it happened there were already life on Earth, and it survived. In deep water, under the ice, which was transparent enough for light to penetrate it and support life. My question is, why didn't all the water freeze? AFAI...
What makes you think Geothermal energy and underwater volcanoes are too weak? The mid-oceanic ridge system alone is 50000 miles long. The mean heat flow at the surface (91.6 mW/m<sup>2</sup>) has to be accommodated somewhere. Also the freezing point of brine at a depth of 5000 m is approx -40 °C.
At least four things combined to prevent solid freeze-up during Ice/Slush Ball Earth periods: <ul> <li>It takes a lower temperature to freeze water under pressure. Deep sea pressures are enormous. </li> <li>Ice floats. If it sank and new ice kept forming at surface, the seas <em>might</em> fill with ice. </li> ...
https://earthscience.stackexchange.com
28,175
[ "https://dba.stackexchange.com/questions/28175", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/9802/" ]
Currently after releasing a new major or minor version of our application, we take a copy of the production database and perform the below process: <ol> <li>Copy production database to test server</li> <li>Obfuscate the data and setup the test users</li> <li>Switch the old test database with the obfuscated new databas...
SSIS could certainly take care of this for you but as with many things there are several ways to complete the task. 1) You have several options within SSIS to complete the copy process, Copy Database is one of them. You could backup the database and restore it using a SQL Script. You may need to use the file system ta...
You could also use a SQL job with the SQL agent. <ul> <li>Backup</li> <li>Restore</li> <li>Obfuscate restored database</li> <li>Restore</li> </ul> Note: be careful with the backup database operation, use the "copy only" option otherwise you might break the backup chain when differential backups are used.
https://dba.stackexchange.com
81,974
[ "https://security.stackexchange.com/questions/81974", "https://security.stackexchange.com", "https://security.stackexchange.com/users/68589/" ]
Assuming I have created an email in hushmail through of tor, and if I use it as my official email in a site such as Github. Will it throw my anonymity away as I use github from a regular browser?
Yes. If you use an account on Tor and also use the same account not on Tor, your ownership of the account can be traced via the use not on Tor. If you link two accounts (e.g. by listing an email from Tor on a non-Tor account), someone could potentially find that link and then trace the non-Tor account. This is one of m...
To a large extent, yes, you will lose your anonymity. Github (and anyone monitoring Github) will be able to connect your email address to your IP address. A key element of anonymity (or more technically, <em>pseudo</em>nymity) is keeping your separate identities separate. Your Hushmail account accessed over Tor is o...
https://security.stackexchange.com
210,280
[ "https://stats.stackexchange.com/questions/210280", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/28774/" ]
This is probably a very basic question; I have a data-frame with a fake questionnaire with three sets of questions measuring three constructs. I'm currently reading some research papers which in order to create the construct aggregate the mean per country, the mean per job and the mean per individual. So in the case...
Is this what you are looking for? <pre><code>&gt; with(mydf, tapply((A1+A2+A3), countries, mean)) England France Germany Ireland Spain USA 12.18182 11.55556 11.47619 11.90909 12.35000 12.89474 &gt; with(mydf, tapply((B1+B2+B3), career, mean)) Director IT Project Manager SOCIAL ...
Also look at dplyr. It's really intuitive for these kids on questions. Once you get used to the syntax you will be hooked. you would do this: <pre><code>library(dplyr) mydf %&gt;% group_by(countires,career) %&gt;% summarize( sm=sum(B1+B2+B3 ) , mn=mean(B1+B2+B3), etc... ) </code></pre>
https://stats.stackexchange.com
33,876
[ "https://stats.stackexchange.com/questions/33876", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/12710/" ]
Identify the following models as linear or non-linear. In case of a non-linear model, reduce the model into a linear model by a suitable transformation. $$\eqalign{ (a)\quad&amp;y=\beta_0+\beta_1 x+\beta_2 x^2+e \\ (b)\quad&amp;y=\frac{x}{\beta_0+\beta_1 x}+e\\ (c)\quad&amp;y=\frac{\exp(\beta_0+\beta_1 x)}{1+\exp(\bet...
<strong>We try to find a re-expression $f$ for which $f(y)$ is a sum of two kinds of things.</strong> The first kind is a product of (1) something depending only on the data $x$ and (2) something depending only on the parameters $\beta_i$. The second kind of thing represents "random error." Typically we want the ran...
SHORT ANSWER: If (and only if) the statistical distribution of a model's noise (error) can be described using only linear combinations of observations, factors and/or predictors, that model is linear. Otherwise, it is not. People often hear someone in an academic setting state that linearity is "in the parameters," ...
https://stats.stackexchange.com
22,064
[ "https://dba.stackexchange.com/questions/22064", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/9777/" ]
I am trying to create a database to store information about a school. I need to store each department in the school. Each department then has a list of teachers. Each teacher has a list of classes and each class has a list of students. The department name will be unique. However, teachers may span across departments....
To your specific question of (easily satisfied) plausibility, the answer is yes. Since you seem to be looking for a broader critique. You seem to be mostly on the right track, but a few things are making your description overly complex. It looks like your Classes table is more like what I would consider a course to...
some critique: <ol> <li>I think one should try to describe the problem with proper words. if you tell us that something "has a list of" something then you do not describe the problem well. if you write that departments have a list of teachers I think that you want to say that teachers work as lecturer for some departm...
https://dba.stackexchange.com
7,479
[ "https://physics.stackexchange.com/questions/7479", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/2639/" ]
Why is it that if I'm sitting on a seat on a bus or train and its moving quite fast, I am able to throw something in the air and easily catch it? Why is it that I haven't moved 'past' the thing during the time its travelling up and down?
The thing you throw in the air is also traveling at the same speed you are, in the same direction. When you throw it up, it doesn't matter that the earth below is moving backwards at speed, nor that the moon is moving past even more quickly, nor that the earth itself is spinning and moving relative to the sun. The ba...
Barring the affects of air resistance and such, just think of the object as also "part" of the train moving at the same velocity as you. Essentially there is no way to distinguish between an object at rest or moving at a constant velocity.
https://physics.stackexchange.com
144,898
[ "https://security.stackexchange.com/questions/144898", "https://security.stackexchange.com", "https://security.stackexchange.com/users/106268/" ]
<strong>TL;DR: Is there any difference between an <em>authentic</em> and a <em>secured</em> website? More precisely, is there any security benefit to be connected to a website via HTTPS if the certificate isn't valid?</strong> Following a test I had today where we was asked if it was better to be on a <em>secured webs...
Generally speaking, you are corrct. You are still connecting via HTTPS, as you surmised. Authentication, however, is indeed a critical part of TLS and HTTPS security. Even though the data is protected by TLS, without a valid and correct certificate, you can't be certain who you're actually talking to on the other end....
Yes. Even though someone could be MitMing you, other people on the line still can't see what you're doing. You can also manually check the public key for self-issued certificates for example.
https://security.stackexchange.com
44,323
[ "https://mathoverflow.net/questions/44323", "https://mathoverflow.net", "https://mathoverflow.net/users/3233/" ]
I'm reading the book about moduli spaces by Huybrechts and Lehn, and i'm stuck understanding a proof, it is Theorem 6.1.8.: Given a K3-surface $X$ and a 2-dimensional space $M$, coherent and torsion free sheafs $F$ on $X$ and $E$ on $M\times X$. We have projections $p,q$ from $M\times X$ to $M$ and $X$ resp. They cla...
If you apply ${\mathcal H}om(-,E)$ to a resolution of a sheaf $G$, you obtain a complex, the cohomology of which are ${\mathcal E}xt^i(G,E)$, hence by additivity of the Chern character, the alternating sum of Chern characters of the terms of the complex equals the alternating sum of Chern characters of the Ext sheaves....
This was to long for a comment, so i post this as an answer: Using Sasha's answer i tried my best, and here are my computations. Feel free to report any mistakes. Take a locally free resolution $G_{\*} \rightarrow q^{\*}F$. Then we have $\mathcal{E}xt_p^i(q^{\*}F,E)=h^i(\mathcal{H}om_p(G_{\*},E))$, where $h^i = ker(d...
https://mathoverflow.net
35,262
[ "https://softwareengineering.stackexchange.com/questions/35262", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/6328/" ]
My company has recently switched to an Agile way of working and as a part of it we've started using SCRUM. While I'm very comfortable with it and feel that this way is superior to a traditional one, some of my teammates don't share the same opinion. In fact they are very skeptical about "all that agile stuff", and don'...
When faced with extreme skeptism I try a few things: 1.) I demonstrate techniques such as TDD, Continuous Deployment, Pair Programming, Requirements Gathering with your users, short iterations etc. I <em>don't</em> call those techniques Agile or harp on about the Agile Manifesto (I do harp on about Software Craftsman...
A typical case of wrongly implemented <strong>Scrum</strong>. <strong>Scrum</strong> has been imposed to the team. The (whole) team didn't choose it. When you want to implement it, you must have full support of both the team and management, or it is not going to work at all. <blockquote> Resistance to change is yo...
https://softwareengineering.stackexchange.com
3,797
[ "https://physics.stackexchange.com/questions/3797", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/1545/" ]
Whereas I can calculate the <strong>Chern number</strong> of a quantum state (or band) from the integration of the Berry curvature in all space. How can I infer the topology of the quantum state from this result? What is the physical meaning of a quantum state with non-zero Chern number?
I am in part trying to understand this myself. The Berry phase is computed from differential forms, such as the one-forms $\omega$ constructed from states $$ \omega~=~\langle\psi|d\psi\rangle $$ and with the covariant differential $D~=~d~+~\omega$ the two-forms $$ \Omega~=~D\omega~=~d\omega~+~\omega\wedge\omega $$...
It means the system has nonzero Hall conductance.
https://physics.stackexchange.com
109,317
[ "https://security.stackexchange.com/questions/109317", "https://security.stackexchange.com", "https://security.stackexchange.com/users/95670/" ]
We are using SSL to make our connection between clients and backbone servers safer. Does it really make sense if also we use another encryption mechanism to encrypt transmitted data twice? For example, encrypt data by AES and then transmit data on an SSL connection?
It really depends on what you're trying to protect. SSL only protects data in transit, and between the two set points. It doesn't protect data at rest, and it doesn't offer any guarantee that the data came from the person claimed. So if you need to protect the data while it's stored at either of the endpoints, then ...
Almost certainly, no, particularly if the client is a browser. One reason that SSL/TLS works, is that it is already embedded in clients. There's nothing to transmit in the clear that can be intercepted and modified by attackers in transit. If SSL itself is broken, then any encryption you send (such as JavaScript ba...
https://security.stackexchange.com
5,566
[ "https://mechanics.stackexchange.com/questions/5566", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/2868/" ]
The service manual that came with my vehicle recommends replacing the timing belt at 90,000 miles. It has a note at the bottom of the page though that this is for the 2uz-fe engine only. Apparently that's the 4.7 L, mine is the 5.7 L. I'm not a car guy so didn't really understand the difference between the timing be...
The 5.7L engine (3UR-FE) does have a timing chain, while the 4.7L engine (2UZ-FE) uses a belt. Generally, timing chains are designed to be maintenance free. If your service manual does not recommend a replacement interval, you don't need to plan on replacing the timing chain.
No, from the sound of it you have a knowledgable and trustworthy mechanic, and you should keep him around. Even that price seems low.
https://mechanics.stackexchange.com
108,201
[ "https://stats.stackexchange.com/questions/108201", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/29068/" ]
I am interested in building a model to predict the binary outcome, retention (1 - retained; 0 - not retained) with various potential predictor variables (either continuous or categorical). With that being said, I have a dataset containing multiple records (magazine subscriptions) for some subjects. For example, I hav...
A large part of the problem seems to be that the data structure is not amenable to analysis. Is there any reason you can't collapse the data into one record per person-year (e.g you're using more than just the variables from the subrecords)? The result may have a heck of a lot of indicator variables, but it would make ...
I'm not an expert on this but to me it looks like you should use a logistic mixed effects regression model (i.e., with a logit link). This lets you declare a random intercept (and slope if required) for every subject and thus account for the dependence of the observations. This way you can use all the records and prese...
https://stats.stackexchange.com
2,344,376
[ "https://math.stackexchange.com/questions/2344376", "https://math.stackexchange.com", "https://math.stackexchange.com/users/459197/" ]
I've been trying to figure out how do they get to the awnser and I realised I might have problems dealing with absolute value. Heres the question <strong>Express the following without the absolute values:</strong> $$|(|x|-1)|$$ And here is how I develop: If $ |x|-1 &gt; 0 \Rightarrow |x| &gt; 1$ then $|(|x|-1)|$ ...
Let's start from inside: $$||x|-1| = \begin{cases} |x-1| \quad \mathrm{if} \quad x &gt;0 \\|-x-1| \quad \mathrm{if} \quad x \leq0\end{cases}$$ $$= \begin{cases} |x-1| \quad \mathrm{if} \quad x &gt;0 \\ |x+1| \quad \mathrm{if} \quad x \leq0\end{cases}$$ $$= \begin{cases} x-1 \quad \mathrm{if} \quad x &gt;0 \quad \...
For the most part your work is correct. Your error lies here: If $0&gt;x \Rightarrow |(|x|-1)| = 1- |x| = 1 - (-x) = 1+x $ (since x&lt;0) $0 &gt; x$ doesn't imply that $|(|x|-1)| = 1- |x|$. For example if $x = -2$, $|(|x|-1)| = 1$ and $1- |x| = -1$. You need to break this into two cases, hence where your extra case ...
https://math.stackexchange.com
228,851
[ "https://softwareengineering.stackexchange.com/questions/228851", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/3912/" ]
I'm developing a language which I intend to replace both Javascript and PHP. (I can't see any problem with this. It's not like either of these languages have a large install base.) One of the things I wanted to change was to turn the assignment operator into an assignment command, removing the ability to make use of t...
Technically, some syntactic sugar can be worth keeping even if it can trivially be replaced, if it improves readability of some common operation. But assignment-as-expression does not fall under that. The danger of typo-ing it in place of a comparison means it's rarely used (sometimes even prohibited by style guides) a...
<blockquote> Are there any practical uses of the assignment operator's return value that could not be trivially rewritten? </blockquote> Generally speaking, no. The idea of having the value of an assignment expression be the value that was assigned means that we have an expression which may be used for both its <em>...
https://softwareengineering.stackexchange.com
74,618
[ "https://physics.stackexchange.com/questions/74618", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/27339/" ]
For a spinning top, the linearised equation in the angle $\theta$ when the top is spinning about its axis of symmetry, which is vertical, is of the form $$A\ddot\theta+\left(\frac{C^2n^2}{4A}-Mgh\right)\theta=0.$$ Why should we require that the bracket coefficient be positive if we want the top to be stable, i.e. if w...
Here's the math. Suppose you have an equation of the form $$ \ddot\theta +\alpha\theta = 0 $$ If $\alpha &lt;0$, then we can write $\alpha = -\omega^2$ for some $\omega &gt;0$ and the general solution becomes $$ \theta(t) = Ae^{\omega t} + Be^{-\omega t} $$ In particular, notice that these solutions are not oscill...
Think about it this way, if the acceleration is in the positive theta direction when theta is positive, then the system will run away and become unstable. If acceleration is in the opposite direction of the sign of theta then the system will be driven back to the origin and thus be stable.
https://physics.stackexchange.com
285,324
[ "https://electronics.stackexchange.com/questions/285324", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/71060/" ]
A parity bit lets a receiver know whether or not the an input is correct, given the number of 1's matches the logic behind the parity bit (be it even = 1, or odd =1). This seems very ineffective to me, and even 'corrupting' (not sure what the right word would be). What if the message is not corrupted, but the parity i...
You seem to understand parity generation/checking but it is only one technique out of many that are used. It is not in general used as the means of checking data within a message composed of many bytes. Parity was one of the earliest data checking techniques and has been traditionally used where the data is very limi...
The simple parity checking is really such simple as you state. But uneffective is probably not the right word for just one bit - it cannot take more information, than just 2 states 0/1. If your channel is basically reliable, then it can catch occasional glitch good for really low prize and simple computing. If you hav...
https://electronics.stackexchange.com
33,444
[ "https://datascience.stackexchange.com/questions/33444", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/53498/" ]
I am wondering, do we really need <code>&lt;unk&gt;</code> tokens? Why do we limit our vocabulary? Is it for speed? Accuracy? If we disable all limitations, what do you predict happens?
The <code>&lt;unk&gt;</code> tags can simply be used to tell the model that there is <em>stuff</em>, which is not semantically important to the output. This is a choice made via the selection of a dictionary. If the word is not in the dictionary we have chosen, then we are saying we have no valid representation for tha...
As it is already mentioned in the comments, in tokenizing and NLP when you see UNK token, it is to indicate unknown word with a hight chance. for example, if you want to predict a missing word in a sentence. how would you feed your data to it? you definitely need a token for showing that where is the missing word. so i...
https://datascience.stackexchange.com
234,657
[ "https://electronics.stackexchange.com/questions/234657", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/107023/" ]
I have a fuel level sensor that varies its resistance from 9.5 ohm(empty) to 155ohm(full). The sensor is powered using 12V battery connected to a 30kVA Generator. The problem is that the level that I get fluctuates,i.e, 47.57% for 30s and then 48.4 for 30s or so. The level is calculated using the equation level(%)=18...
The voltage difference needed to cause this difference in fuel level is (48.4-47-57)/187.41=4.4mV, so the measured fluctuation is indeed too low. But your ADC has 10Bit, i.e. gives 1024 different values. At an ADC range of 5V, one step is 5V/1024=4.883mV, which corresponds to 0.9% fuel level. This is the resolution ...
To improve the accuracy of your measurement, you can use the following simple techniques: <ul> <li>digital averaging: takes several measurement and display the average of them. The number of samples you can average will depend on the sample rate of your ADC and the frequency of the measurement you want. </li> <li>ana...
https://electronics.stackexchange.com
21,429
[ "https://stats.stackexchange.com/questions/21429", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/4127/" ]
It was mentioned very briefly in a lecture related to graphical models that two random variables $X_3$ and $X_4$ are both dependent on $X_2$. But even when conditioned on $X_2$, the two variables $X_3$ and $X_4$ could be dependent through some other means. I wasn't sure what the person meant by this, below is an exa...
This question and the OP's lecturer's claims seem to indicate misunderstanding of the notions of independence and conditional independence of random variables. Different sets of distributions for <em>Bernoulli random variables</em> $X$, $Y$, and $Z$ are presented here to illustrate the differences between various notio...
The following is a long and argumentative answer with the first part being somewhat philosophical and the second part being most relevant to the question asked here. In <em>probability theory,</em> independence is usually an <em>assumption</em> that is given as part of the problem statement as in "Let $A$ and $B$ den...
https://stats.stackexchange.com
85,813
[ "https://dsp.stackexchange.com/questions/85813", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/34817/" ]
Given the following transfer function, <span class="math-container">$$H(z) = \frac{6 + 4z^{-1}}{2 + 5z^{-1} - 3z^{-2}}$$</span> How do we find the zeros of the transfer function? We can write the above expression as <span class="math-container">$$\frac{3(1+\frac{2}{3}z^{-1})}{(1-\frac{1}{2}z^{-1})(1 + 3z^{-1})}$$</span...
Your first solution is just incomplete because you apparently find it harder to see the zero at <span class="math-container">$z=0$</span> if the transfer function is written in powers of <span class="math-container">$z^{-1}$</span>. But with a bit of practice you could see that as <span class="math-container">$z\to 0$<...
If you look at the part <span class="math-container">$f(z)=-3z^{-2}$</span> from your first formula and if that equals to <span class="math-container">$f(z)=\frac{-3}{z²}$</span> you got division by zero there for <span class="math-container">$z=0$</span>. When you move z up from denominator to numerator in your last f...
https://dsp.stackexchange.com
14,468
[ "https://quant.stackexchange.com/questions/14468", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/11874/" ]
I would like to hear other possible ways of classifying Stocks by the Volatility of their returns. Assuming that I want to characterize each stock as Low, Medium or High Volatility Stock and assuming that I know the Annualized Volatility for each of the stocks in my sample, what ways are there to do such classification...
There are a lot of ways of doing this and what a good way of doing this will be driven by your needs as well. Criteria such as whether the method needs to be (in)sensitive to outliers and whether or not your groups need to be of the same size will influence this. One way to do this would be sorting the volatilities an...
It really depends what you're trying to achieve! <strong>What is the ultimate goal?</strong> What are your constraints? Which stocks are you looking at? Without the answers to the above, any partition is just arbitrary: why choose 30th and 70 percentile, vs 10th and 90th? Why choose (-2)*Std.Dev and (+2)*Std.Dev vs j...
https://quant.stackexchange.com
482,031
[ "https://electronics.stackexchange.com/questions/482031", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/243079/" ]
So hello guys I am a first semester student in Computer Science. I have an exam coming up and I couldn't really find an answer whether bubbles affect the delay like inverters. The bubbles having no delay makes kinda no sense to me since they do basically what inverters do. So I always assumed that there was an invisib...
<strong>Not really.</strong> The "bubble" is a logical inversion. It doesn't necessarily correspond to a physical inverter. Delay is a property of the physical implementation of a circuit. There isn't really a "standard gate delay" which you can use for all gates at all times. Different logical implementations will h...
The'bubbles' or circles can be found on the inputs and outputs of logic gate symbols. They are used to indicate binary signal inversion - so a logic '0' becomes a logic '1' and vice-versa. Logic gate symbols are precisely that - symbols. They give no indication of how the logic gate is to be implemented, or what techn...
https://electronics.stackexchange.com
609,175
[ "https://math.stackexchange.com/questions/609175", "https://math.stackexchange.com", "https://math.stackexchange.com/users/43747/" ]
Let $G$ be a group which satisfies the maximal condition on subgroups. Now, let $H$ be a subgroup containing a non trivial conjugate (i.e. there exists an element $x\in G,\,\notin H $ such that $H^x\leq H$). Is it true that, in this case, $H$ is normal in $G$? How can we prove that? Is solvability of any help? <strong...
Observe that any <strong>finite</strong> nilpotent group $\;G\;$ both fulfills the maximal condition for subgroups and also for <em>any</em> proper subgroup $\;H\;$ we have that $\;H\lneqq N_G(H)\;$ which means there exists $\;x\in G\setminus H\;\;s.t.\;\;H^x\le H\;$ ...and this doesn't make the subgroup $\;H\;$ normal...
I may be missing something, but the maximal condition simply tells you that if $H^x \leq H$ then $H^x = H.$ In other words, $H$ has normalizer strictly containing $H.$ It does not seem to imply that $H$ is normal.
https://math.stackexchange.com
338,729
[ "https://mathoverflow.net/questions/338729", "https://mathoverflow.net", "https://mathoverflow.net/users/58635/" ]
Suppose you have the QR decomposition of a square matrix <span class="math-container">$A$</span> (of full rank) such that <span class="math-container">$A = QR$</span> where <span class="math-container">$Q$</span> is an orthogonal matrix and <span class="math-container">$R$</span> is upper triangular. Is there an effici...
No, the two are not obviously related. Transposing everything gives an LQ decomposition, which clearly is not the same, and as far as I know there is no simple trick to convert one into the other. If you want a decomposition that is "robust by transposition" and can be used to solve least squares problems and identify...
There is a way you can use a QR decomposition for a Matrix A to solxe a linear system using A transpose (A'). Ax = b Recognizing that: A'=(QR)'=R'Q' We can write R'Q'x=b inv(R') is something you can calculate by hand so you can multiply both sides by inv(R') on the left to get: inv(R')R'Q'x=inv(R')b -> Q'x = inv(R...
https://mathoverflow.net
606,703
[ "https://electronics.stackexchange.com/questions/606703", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/181254/" ]
I am reviewing bode plots and s-plane (pole-zero plots). I seem to have some confusion about them and how they relate to each other. I believe one is for closed-loop systems, the other is for open-loop. <strong>My question is</strong> : If I have a first order, single pole system and the pole lies on the imaginary axis...
A single-pole system is first-order system which can only have a real pole. I suppose you mean a single <strong>pair</strong> of poles? More than that - I am afraid you are mixing open-loop and closed-loop analyses. For example, the mentioned magnitude peak can be observed for a closed-loop system at the stability limi...
You are confusing the open-loop Bode plot with the closed-loop Bode plot. Putting aside the fact that a system with a single complex or imaginary pole is unrealizable, if you have a <strong>control loop</strong> whose <strong>open-loop gain</strong> is <span class="math-container">$$H_o(s) = \frac{k}{s + j\omega},$$</s...
https://electronics.stackexchange.com
75,740
[ "https://dsp.stackexchange.com/questions/75740", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/54239/" ]
I need to find the contours for each of the instances of microscopic cells in a binary image mask of dimensions 256 x 256 shown below. <img src="https://i.stack.imgur.com/bU9LE.png" alt="Microscopic image mask" /> My approach involves thresholding the image to get a binary mask (foreground = 1,background = 0) as follow...
well you discard that information the moment you convert to binary (your input is <em>not</em> binary – it has more than 2 values). So, don't do that.
I assume you threshold the image in order to be able to run <code>cv.findContours</code> on it. Here it would be better to use <code>cv.split</code>. <code>split</code> gives you three channels(one for every color) and thus the edges should be maintained (in most cases). You could then either discard two of the channe...
https://dsp.stackexchange.com
1,021,661
[ "https://math.stackexchange.com/questions/1021661", "https://math.stackexchange.com", "https://math.stackexchange.com/users/54670/" ]
Is it possible to have a function $f: X \mapsto Y $ such that $f$ is measurable with respect to a toplogy $\tau _A $ on $Y $ but not with respect to a finer topology $\tau _B $? For instance if $f $ is measurable with respect to the standard topology in $Y $ and the Borel-sigma algebra generated by to open sets in $X ...
\begin{align} \mathcal{I}=&amp;\int^1_0x\tan(\pi x)\ln(\sin(\pi x))\ {\rm d}x\\ =&amp;\left(\int^{1/2}_0+\int_{1/2}^1\right)x\tan(\pi x)\ln(\sin(\pi x))\ {\rm d}x\tag1\\ =&amp;\int^{1/2}_0(2x-1)\tan(\pi x)\ln(\sin(\pi x))\ {\rm d}x\tag2\\ =&amp;-\frac{2}{\pi^2}\int^{\pi/2}_0x\cot{x}\ln(\cos{x})\ {\rm d}x\tag3\\ =&amp;-...
Integrating by parts, we get $$ \begin{align} &amp;\int_0^1x\tan(\pi x)\log(\sin(\pi x))\,\mathrm{d}x\\ &amp;=\int_0^{1/2}(2x-1)\tan(\pi x)\log(\sin(\pi x))\,\mathrm{d}x\tag{1a} \\ &amp;=-\frac1\pi\int_0^{1/2}(2x-1)\log(\sin(\pi x))\,\mathrm{d}\log(\cos(\pi x))\tag{1b}\\ &amp;=\small\frac2\pi\int_0^{1/2}\log(\sin(\pi x...
https://math.stackexchange.com
460,696
[ "https://math.stackexchange.com/questions/460696", "https://math.stackexchange.com", "https://math.stackexchange.com/users/79894/" ]
I wanted to know, how can I find the value of $a$ for which the inequality $\tan^2x + (a+1)\tan x-(a-3)&lt;0$ is true for at least one $x\in(0,\pi/2)$. I don't know how to proceed, any help is appreciated.
Set $\tan x = y$. Note that $y$ can take only positive values since $x\in (0,\dfrac{\pi}{2})$. Then $$y^2 + (a+1)y - (a-3) &lt;0$$ $$\iff\left(y+\dfrac{a+1}2 \right)^2 - \dfrac{(a+1)^2}4- (a-3) &lt;0\quad \text{(completing the square)}$$ $$\iff \left(y+\dfrac{a+1}2 \right)^2 &lt; \dfrac{a^2+6a-11}4 = \dfrac{(a+3)^2-...
To get you started, try letting $(\tan x) = y$, and determine first the values of $a$ and $y = \tan x$ at which the corresponding quadratic equation is equal to zero: $$\tan^2x + (a+1)\tan x-(a-3)&lt;0\tag{given}$$ $$y^2 + (a+1) y - (a - 3) = 0\tag{2}$$
https://math.stackexchange.com
455,043
[ "https://electronics.stackexchange.com/questions/455043", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/103430/" ]
When I put my IR remote near any AM radio and push any button on the remote, I can hear a sound from the radio speaker (like beeping). This phenomenon is very weird for me because the radio has no IR receiver inside. On the other hand, the frequency of the AM radio is more than 530 kHz but the frequency of the IR remo...
This IR signal is indeed ignored by the AM radio. However, an AM radio is very sensitive the <strong>radio waves</strong> (yeah, DUH! ;-) ) When the IR remote operates (you push a button) the chip in the remote will switch on a clock resonator circuit which it needs to generate the IR signals. I have seen most IR remo...
Most likely, your radio is picking up unintended EM radiation from the remote's circuitry. You mention that it operates between 30 and 38KHz, but the IR probably uses square wave modulation, so you'll still pick up the harmonics. Of course, it could be some other signal than the LED drive getting picked up. Once you...
https://electronics.stackexchange.com
17,629
[ "https://dba.stackexchange.com/questions/17629", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/9110/" ]
I have a fairly high-throughput application that occasionally decides to collapse on me. It's not very often - about once every ~3 weeks or so. When it does, if I check out perfmon, I see 100% "Avg. Disk Queue Length" pegging the server. During these times, I also see lots of nice connection failed messages from SQL S...
OK, so, from what I can tell, it was related to a bunch of things: <ol> <li>resizing files (data and log both) </li> <li>large number of inserts happening while 1. was going on</li> <li>one particularly heavy query running while 1. was going on</li> <li>a hard drive with some pretty high i/o times in general</li> <li...
Wait for a moment where the disk queue depth is high and find all currently running queries (scripts available on the web). It is likely that some expensive query is running. Examples: Data warehouse style queries, index operations, DBCC CHECKDB, shrinking, ... All of these are designed to drive the IO system with all ...
https://dba.stackexchange.com
120,244
[ "https://cs.stackexchange.com/questions/120244", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/115104/" ]
I'm really struggling with the following exercise and I would really appreciate your help: I have to calculate the expected runtime of a sort Algorithm with the following variants: <pre><code>Variant Runtime Behavior 1 n(n-1) 2 n 3 n log(n) </code></pre> Given is, that the runtime...
A unary language (i.e., a subset of <span class="math-container">$0^*$</span>) <span class="math-container">$L$</span> is regular iff the set <span class="math-container">$S = \{ n : 0^n \in L \}$</span> is eventually periodic. In particular, if <span class="math-container">$L$</span> is regular then either <span class...
Suppose for contradiction that <span class="math-container">$L = \{0^{2n \choose n} : n \in \mathbb{N}\}$</span> is a regular language. Then by the definition of a regular language there exists a deterministic finite automaton (DFA) that recognizes <span class="math-container">$L$</span>. Let <span class="math-containe...
https://cs.stackexchange.com
5,772
[ "https://mathoverflow.net/questions/5772", "https://mathoverflow.net", "https://mathoverflow.net/users/1648/" ]
What is the exact relationship between principal bundles, representations, and vector bundles?
Let G be an algebraic group (or, since the question was tagged as differential geometry, a Lie group). Then if we're given a principal G-bundle $E_G$ and a representation V of G, we get a vector bundle out of this through the associated bundle construction: $(E_G \times V)/G$ is a vector bundle with generic fiber V. ...
From a $G$-principal bundle $E\to B$ and a representation $V$ of $G$ you can construct a vector bundle $E\times_GV\to B$. A vector bundle $\mathcal E$ with fiber $V$, on the other hand, gives you a $GL(V)$-principal bundle by taking the bundle $F(\mathcal E)$ of frames in $\mathcal E$, and you can reconstruct $\mathcal...
https://mathoverflow.net
8,447
[ "https://cardano.stackexchange.com/questions/8447", "https://cardano.stackexchange.com", "https://cardano.stackexchange.com/users/5844/" ]
So I started using my Daedalus Node as the node (instead of the direct build) for the cardano-cli, but it always takes forever to sync and I am wondering if I misconfigured something or if there's a better setup. Can you please share your Daedalus optimisations/Configs? Thanks
As Erik mentioned, Daedalus is a full node and thus requires downloading the chain from peers and validating it locally on your machine. <strong>However, if you already have a trusted copy of the chain (either from previously syncing a full node or some other source), you can manually copy it into Daedalus' state direc...
Define &quot;forever&quot;. Sorry, but there are no tweaks to make it faster. If there were, they would be the default. Please remember that Daedalus is a &quot;full node&quot;. That means it downloads and stores the complete blockchain history, which on my full synced Linux machine uses disk store of 67 Gig for mainne...
https://cardano.stackexchange.com