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
13,698
[ "https://astronomy.stackexchange.com/questions/13698", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/10766/" ]
This might be a silly question but if light travels at the speed of light and time is frozen in that speed then why the stars we see could be dead already and not just instantly disappearing from the sky the moment it explodes/dies?
Because we are not moving at the speed of light. From our point of view, light travels at the speed of light, and so events on a distant star are not visible until the light reaches us. From the point of view of the photon, the universe is 2 dimensional (it is flattened by infinite Lorentz contraction) and there is n...
It is the same reason for why we see the Moon. If the moon exploded, we would see the entire thing happen. Objects in space don't 'instantly' disappear and even when far away, light always gets sent in the same order and we see what happened.
https://astronomy.stackexchange.com
365,151
[ "https://softwareengineering.stackexchange.com/questions/365151", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/136188/" ]
I have an API server, and it's SPA client (node+ react, but it's unrelated). All the API endpoints are under <code>/api</code> namespaces, and the SPA just keep make REST calls to perform operations. We're working on a feature which require our users to link their <em>Foo Service</em> 3rd party account through OAuth 2...
For security reasons the 302 should come from a non-AJAX, full-page refresh HTTP request from your server. Make sure your server, not SPA, generates the state parameter that will be passed as part of the OAuth flow.
To expand a litte on the answer from @RibaldEddie: make your API completely independent of user interactions. User should not access any API endpoint by browser. In this particular case you should get OAuth token inside your SPA and pass it to your API.
https://softwareengineering.stackexchange.com
64,107
[ "https://biology.stackexchange.com/questions/64107", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/35290/" ]
I have always wondered why flowers reproduce with the same species naturally. Why can't the pollen grains get to a different species flower through via the wind, water, or insects?
The pollen from a given species of flower <em>does</em> get transmitted to other flowers of different species (like you said, through air, insects, etc.)..the problem though is that those two species of flowers are just that!: they are <strong>two different species</strong>, and by definition, <strong>aren't able to re...
To complement what Charles (Darwin is it you? :)) said, and JM97 hinted at the comments, there is also another factor impeding the cross pollination between different species, that is the pollen-pistil interaction. Basically whichever pollen can come in contact with the flower but only pollens carrying specific recogn...
https://biology.stackexchange.com
236,792
[ "https://softwareengineering.stackexchange.com/questions/236792", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/111863/" ]
I'm just starting on a new little pet project of mine. I started the project using a familiar pattern for using objects as "filters" in SQL Queries. I've never been much happy about its easy of use, but eventually more or less accepted it after having it drilled into my head by colleagues. The example below hopefully...
I'd start by building your filter SQL String within the <code>filter</code> object itself (i.e. writing a <code>GetSqlFilter()</code> method on the <code>Filter</code> class), so that you have access to <code>Filter</code>'s internal members, without having to call all those member functions.
You can use reflection to get the various properties and fields into a list, cycle through the list, and determine the correct output for your filter statement. Reflection is slow compared to directly retrieving a property, accessing the internal members of your class, or accessing fields.
https://softwareengineering.stackexchange.com
223,989
[ "https://dba.stackexchange.com/questions/223989", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/124279/" ]
We have a user table : <pre><code> CREATE TABLE `User` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(60) NOT NULL, `created_At` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `status` tinyint(4) NOT NULL DEFAULT '0', ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8m...
<pre><code>SELECT status_list.status, COUNT(User.status) FROM ( SELECT 0 status UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 ) status_list LEFT JOIN User ON User.status = status_list.status GROUP BY status_list.status </code></pre>
Try this: <code>SELECT name, counter FROM (SELECT name, count(status) as counter FROM (SELECT name, status FROM user GROUP BY by name, status)) WHERE counter &gt; 1;</code> First sub query should satisfy the reasoning behind multiple statuses per user the second should count the number of different statu...
https://dba.stackexchange.com
178,898
[ "https://physics.stackexchange.com/questions/178898", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/78788/" ]
Why is it said that the kinetic energy acquired by a body after traveling a fixed distance from rest under the action of constant force is independent of mass? Yes, the mass of the body is constant.
The work done on a body of mass $m$ by a constant force $F$ across a distance $s$ is $Fs$ and that must equal the change in the kinetic energy of the body. Since the body started from rest, the change in its kinetic energy is $mv^2/2$ where $v$ is the body's speed at the end of the track of length $s$. So, $Fs = \frac...
Simple example: the force, F, on a body on a frictionless surface, starting from rest, over a distance d where d and F are in the same direction the work done is W=F*d. if F= 2 Newtons and d= 8 meters the work done is 16 Joules. Assuming no potential energy containing elements then all the work goes into increasing th...
https://physics.stackexchange.com
341,108
[ "https://softwareengineering.stackexchange.com/questions/341108", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/124597/" ]
what does it mean when some technical guy asks did you work on cloud ? I have worked primarily java based web applications. But sometime in discussion/interviews technical folks asks Have you worked on cloud . To me cloud looks very broad term and I can think of below three related work related to cloud <pre><code>...
There are a number of things that go into the term "cloud development". I'm focusing on AWS because it's the platform I know, but this should be generalizable. I include the AWS terminology to give you somewhere to start searching. There are three things that AWS or other cloud providers can provide: <h2>Infrastructur...
A cloud application can simply be an application that looks, feels and programs just like any other application you run on a dedicated server (After all, this might be responsible for a large part of why "cloud" seems to work at all). "The cloud" is entirely transparent to such applications. Developing such an applicat...
https://softwareengineering.stackexchange.com
285,850
[ "https://softwareengineering.stackexchange.com/questions/285850", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/81495/" ]
A little over a year ago I was fortunate enough to be able to take a 9 month break from work. I decided that in that time time I would hone my C# skills. I started working on a bunch of projects and forced myself to follow TDD. It was a fairly enlightening process. It was tough at first, but over time I learned how...
To make the process work in the long term I would write the tests when the code is being written. Which may seem to contradict your approach. However you've posed the question so I'll give you my take: You don't have to write the tests before the code. forget that purity. However you want to write the tests <stron...
Although TDD is tough to implement 100% there is a flaw in your approach <ol> <li>Implement a working vertical slice of work 1.1 1 year passes.... 1.2 A new dev starts work on the project</li> <li>If that slice needs modification 2.3 Parse 'Clean Coding' style method names and parameters 'GetUnicorn(colourOfUnicorn...
https://softwareengineering.stackexchange.com
424,331
[ "https://physics.stackexchange.com/questions/424331", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/202743/" ]
I am reading heat transfer and I get confused between these terms. I know they are very basic terms but I can't relate them with heat. Any help is appreciated.
Heat IS radiation in the sence that it is infrared electromagnetic radiation. Emission is how much energy (heat) one radiates outwards due to ones internal energy. Normally this behaviour is modelled as a blackbody radiator with an emissivity and absorbtivity (spelling please). Reflection is the part of incoming ra...
Speaking as an architect and engineer I am familiar with three forms of heat emission or transfer: <ul> <li><strong>Conduction</strong> in which thermal motion of particles is transferred from a hot body to a cold one in contact with it.</li> <li><strong>Convection</strong> in which heat is similarly transferred to a ...
https://physics.stackexchange.com
44,379
[ "https://security.stackexchange.com/questions/44379", "https://security.stackexchange.com", "https://security.stackexchange.com/users/7497/" ]
So, I saw this on a page: <img src="https://i.stack.imgur.com/P5dAp.png" alt="enter image description here"> (The redacted part says the name of the entity that owns the domain) The page recently got SSL certs verified by GeoTrust. The image is on <code>https://smarticon.geotrust.com/smarticon?ref=hostname</code> an...
Generally the point is that if you click the link, it will do some additional validation of the site by confirming with the CA that the certificate is the correct one that they issued, but really, it shouldn't matter and could easily be faked by going to some random website that says "yep, they're secure." It's one ...
Personally I completely disagree with any form of security assertion on a webpage. I'm writing a blog at the moment about exactly this. Many financial institutions features things like "Log In Securely Here" links and pictures of padlocks dotted all around the place. A simple SSLstrip attack and the user is browsing ...
https://security.stackexchange.com
482,114
[ "https://electronics.stackexchange.com/questions/482114", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/216328/" ]
I am currently in the design phase of building a digital clock (about 2ft by 4ft in size.) It should be fairly visible from a considerable distance (about 100 ft) and visible during the day. I am using through hole LEDs for the segments of the digits. My problem is I am not able to gauge the brightness of the LEDs fr...
The problem was in the initialization. I have used libopencm3 APIs for initialization and the code didn't hang after generating START bit. It's possible I have not initialized RCC propertly (for GPIOB), and the I2C therefore got stuck waiting for SB which was never going to be generated. Just for a reference, I am post...
<blockquote> <blockquote> It's possible I have not initialized RCC properly (for GPIOB), and the I2C therefore got stuck waiting for SB which was never going to be generated </blockquote> </blockquote> No, the reason it works is &quot;i2c_set_own_7bit_slave_address(I2C2, 0x32)&quot;!! Without setting ANY address for se...
https://electronics.stackexchange.com
497,189
[ "https://physics.stackexchange.com/questions/497189", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/152558/" ]
I have come across leaky SAWs and I'm not sure what the difference is, and why some substrate cuts are listed as leaky SAW design. Trying to search for diagrams so I could see what the differences maybe, I typically find this one where a SAW reaches a fluid/gas medium in contact with the surface of the substrate and t...
While I know next to nothing about piezoelectrics and crystal cuts, I hope that I can help you a bit with the difference between non-leaky and leaky waves. The basic solutions that you'll find in textbooks for Rayleigh waves assume that your solid medium is bounded by a vacuum on one side. That way, the boundary condi...
Sorry I did not see your post sooner, but this interpretation is incorrect. Leaky SAW devices suffer from radiation of energy into other wave modes within the substrate material - typically slow shear bulk acoustic waves. This leakage can be controlled on certain substrates through control of electrode thicknesses. See...
https://physics.stackexchange.com
6,584
[ "https://mechanics.stackexchange.com/questions/6584", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/2336/" ]
I've got a 1991 Honda Accord with three brake lights, one on each side and one in the rear window. For reasons I have yet to discover, I can't get the right brake light and the window brake light to work. I checked the brake light fuse ( and I doubted it was a fuse issue any way since at least one brake light still wo...
Break out the multimeter. Start at the bulbs. Verify the ground is good and then and work your way back towards the fuse box looking for an open as long as the wiring is accessible (Have a friend / brick depress the pedal). Assuming you haven't found the trouble spot, move to the fuse box and go the other way. If you'r...
I had the same problem, turned out to be the green / white wire on the right rear cluster. Simple easy fix.
https://mechanics.stackexchange.com
284,883
[ "https://mathoverflow.net/questions/284883", "https://mathoverflow.net", "https://mathoverflow.net/users/105002/" ]
Suppose $x(t)$ is differentiable on $(0,T)$ and continuous on $[0,T]$. How to find the minimum and the minimal value of the integral $$\int_0^T\|\dot x(t)+x(t)\|^2dt$$ such that $m\le x(t)\le M$ on $[0,T]$?
Consider the quadratic functional $J_T$ on the Hilbert space $H^1(0,T)$ $$J_T(u):=\int_0^T(\dot u+u)^2dt\ ,$$ and let $0&lt;m&lt; M$ be given. The complete picture for the minimization problem of $J_T$ on $\{u\in H^1(0,T)\ :\ m\le u\le M\}$, as $T$ varies, is as follows: <blockquote> <ul> <li>For $0\le T \le T_0:...
Set $x(0)=x_0$ and $x(T)=x_T$, with $x_0,x_T\in[m,M]$. I will first allow for excursions outside of this interval, and then later add the constraint that $m\leq x(t)\leq M$ for all $0\leq t\leq T$. Minimize $$I=\int_0^TL(x,\dot{x})\,dt\;\;\text{with}\;\;L=(\dot{x}+x)^2$$ by solving the Euler-Lagrange equation, $$\fr...
https://mathoverflow.net
32,275
[ "https://electronics.stackexchange.com/questions/32275", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/9589/" ]
I have programmed the PIC18F4520 with MPLAB, MCC18 and Pickit2. My code is pasted below: <pre><code>#include &lt;p18f4520.h&gt; #include &lt;math.h&gt; #include &lt;adc.h&gt; #include &lt;delays.h&gt; #pragma config OSC = INTIO67 //HSPLL #pragma config WDT = OFF #pragma config LVP = OFF #pragma config ...
Whenever you have a resistor in series with an (ideal) inductor, if the current is sinusoidal, their voltages will be 90º apart. The total voltage \$V_T\$ is the vector sum of \$V_R\$ and \$V_L\$. Since \$V_R\$ and \$V_L\$ are orthogonal (due to the 90º phase difference), the module of \$V_T\$ can be easily computed as...
The right answer is 5V as the others already explained. I'll assume you have a sinusoidal signal applied (otherwise you would have got a different result). Impedance of the resistor is \$R\$, which is a real value. Impedance of the inductor is \$j\omega L\$, which is complex. While multiplying by a real value scal...
https://electronics.stackexchange.com
638,728
[ "https://electronics.stackexchange.com/questions/638728", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/293726/" ]
In Electroboom's &quot;How to turn an LED On&quot; video he mentions that (ideal) capacitors do not consume real power. I was trying to reason through this and would like to gauge the accuracy of my mental model. Preface: I am not an engineer For an AC power source connected to a resistor, the resistor will get hot and...
Yes - charging a capacitor (or inductor) consumes energy; conversely discharging it delivers energy from the component to the rest of the circuit. In an AC circuit or analysis, this cyclic exchange of energy (power) is called 'apparent power'.
Considering the situation where an ideal capacitor is connected to an ideal AC source, I think the most intuitive way to look at it is that a charged capacitor temporarily stores energy. With an AC source, during part of the cycle energy is transferred into the capacitor where it is stored. During the other part of the...
https://electronics.stackexchange.com
588,519
[ "https://electronics.stackexchange.com/questions/588519", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/143503/" ]
I am replacing a reed switch in a device that failed open, I can only assume due to lack of use; is it worth putting two in parallel as a failsafe, or is that just a pointless pre-optimisation and they're likely to fail together anyway? If it matters, the device is a fully watertight light that uses a movable magnet on...
To answer this question, one would need detailed information about the application. You should consider the potential failure modes (failing open / failing closed / both switches failing together), what the effects of these failures would be, and the potential consequences of the failures. Wether they are likely to fai...
Just replace one, I don't think you need redundancy, as you say maybe the previuous one fail for lack of use. In a theoretical way I will not put two of them in parallel because they never switch at the same time and depending of the electronic you are switching the switch signal will be a double bounce. Note: As soon ...
https://electronics.stackexchange.com
130,135
[ "https://cs.stackexchange.com/questions/130135", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/11796/" ]
We know [Ben-Or 1983] that deciding whether all elements in an array are distinct requires <span class="math-container">$\Theta(n \log(n))$</span> time; and this problem reduces to finding the most frequent element, so it takes <span class="math-container">$\Theta(n \log(n))$</span> time to find the most frequent eleme...
Here is an algorithm for all <span class="math-container">$0&lt;\alpha\leq 1$</span>. I'm assuming your data can be ordered and that comparing two elements is done in constant time. Run a few levels of the quick-sort recursion (choosing the pivot optimally in linear time with the Median of Medians algorithm) until you ...
Very partial answer: At least for <span class="math-container">$\alpha &gt; 0.5$</span>, yes. <ol> <li><span class="math-container">$\text{candidate}$</span> &lt;- (null value), <span class="math-container">$\text{count}$</span> &lt;- 0 </li> <li>For each element <span class="math-container">$x$</span> in the array <ol...
https://cs.stackexchange.com
13,444
[ "https://physics.stackexchange.com/questions/13444", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/4715/" ]
Does the theory on paper provide a way for hypothetical travelers to get back out of the bubble that has gotten them close to their distant destination by compressing all the space in front of them and expanding the space behind it? I was picturing space as a sheet of rubber and my warp bubble as the space of rubber u...
The interior of the bubble is causally disconnected. It's not possible for the bubble to be turned off or steered from the inside. But there is no reason it cannot be affected from an outside agency at a pre-planned points, or even simply have a finite lifetime, naturally deteriorating to stop at the intended destinati...
Pete, please elaborate your question, the original paper by Miguel describes how one can travel back and to a destination using the warp drive. The space in front is contracted to get closer to the destination, and the space behind is expanded. For getting out of the bubble, let's use the picture below: <img src="ht...
https://physics.stackexchange.com
252,123
[ "https://dba.stackexchange.com/questions/252123", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/105581/" ]
I have rebuilt all indexes in my database setting fill-factor of 95 (5% free space) using a maintenance plan. After the reindex the database is almost doubled in size - reported free space is 42%. <strong><em>How is calculated fill-factor related to the size of the database?</em></strong> Maybe something is wrong wit...
What you see is correct. When you <code>rebuild</code> an <code>index</code> first the new <code>index</code> is built and only then the old <code>index</code> is dropped. And if you don't use <pre><code>SORT_IN_TEMPDB = ON </code></pre> <strong>the space that server needs to make a <code>sort</code> is allocated w...
<blockquote> How is calculated fill-factor related to the size of the database? </blockquote> This is due to the fact that the database is accumulated value of following and all their size counted/stored in pages. <ol> <li>Heap </li> <li>Clustered Index</li> <li>Non Clustered Index</li> <li>Un-allocated space </l...
https://dba.stackexchange.com
45,133
[ "https://datascience.stackexchange.com/questions/45133", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/57237/" ]
I have a column in my dataframe in which there are sentences which are too long. I want to see them as a whole but every time I perform even a simple iloc operation i get output like 'i am going to...'. How can I remove the ... and see the whole sentence ?
At first, here is the Data. <pre><code>data = { 'Capacity' : [ "qsfjvanzicgbaefzrkrsdvjcfhnefzraezsufchnezsuvgcfnezefzrdfchnzefzreicfjnefzrzekcrghzebefzrkcfjfzbefzrfkjhnvezkqcfhaze", "qsfjvanzicgbaefzrkrsdvjcfhnefzraezsufchnezsuvgcfnezefzrdfchnzefzreicfjnefzrzekcrghzebefzrkcfjfzbefzrfkjhnvezkqcfhaz...
Try it like this: <pre><code>import pandas as pd pd.set_option('display.max_rows', 500) pd.set_option('display.max_columns', 500) print(df) </code></pre>
https://datascience.stackexchange.com
189,974
[ "https://physics.stackexchange.com/questions/189974", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/83906/" ]
Let's say a vehicle that weighs 20t is hauling along at 50m/s and we want to brake it down to a full stop. The kinetic energy we need to dissipate into heating up the brakes is <pre><code>0.5 * 20.000kg * 50m/s * 50m/s=25MJ </code></pre> Now let's say we first brake down to 25m/s and then to 0. We dissipate <pre><...
The formula for kinetic energy is $\frac12mv^2$. If your initial velocity is $v_i$ and your final velocity is $v_f$, then your initial kinetic energy is $KE_i = \frac12 m v_i^2$ and your final kinetic energy is $KE_f = \frac12 mv_f^2$. The difference is $\Delta KE = KE_f - KE_i = \frac12 m(v_f^2 - v_i^2)$ It appears ...
The energy difference between two arbitrary speeds $v$ and $v'$ cannot be found by $\frac{m(v'-v)^2}{2}$ except for the case where $v=0$. So your calculation about the energy change between $50m/s$ and $25m/s$ is incorrect. You instead have to calculate the initial and final energy states and subtract directly. $$E(...
https://physics.stackexchange.com
140,907
[ "https://electronics.stackexchange.com/questions/140907", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/54410/" ]
I know that I can set digital output pins as high and low like this in c: <pre><code>OUTPUT_PIN = 1; OUTPUT_PIN = 0; </code></pre> Is there any way to set that said pin as tristate or high impedance output, as some external chips (I'll be using sram chip) require tristated/high impedance inputs to them? I'm using xc...
Page 29 of the Microchip 41213D.pdf document has figure 6-1: <img src="https://i.stack.imgur.com/T8eJI.png" alt="enter image description here"> The D FF labelled (TRIS LATCH) means that is the TRS-state latch. It controls (Gates) the signals from the data latch to turn off the P AND N transistors. The input to the T...
The standard way to deal with pins that need to act as tri-state is to change the pin configuration register to so that the pin switches from being an output to being an input. On some microcontrollers the pin configuration may be done via a register called a data direction register. On others it may be called a pin ...
https://electronics.stackexchange.com
212,451
[ "https://physics.stackexchange.com/questions/212451", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/94109/" ]
I am having trouble understanding why in an isothermal process, the change in internal energy is zero. I know that $\Delta U$ or $\Delta E=q+w$, and so in isothermal process $q=0$. But how does one show that $w =0$? Or is it necessary that if we are talking of isothermal process, we are not doing work on the system; wh...
<em>Isothermal</em> means <em>constant temperature</em>, which in turn often means <em>constant internal energy</em> <span class="math-container">$\Delta U=0$</span>. The reason is that temperature often "governs" the energy content or at least is a measure of it. Changes in internal energy very often (that is, very of...
The quick answer is $\Delta U \neq 0$. Let's look at some details. In the special case where you are dealing with <strong>ideal gas.</strong> $$U = \frac{3}{2} nRT$$ Thus $$\Delta U = \frac{3}{2}nR\Delta T $$ Since the process is isothermal, $\Delta T$ is <strong>zero</strong>. Therefore $\Delta U = 0$. So it is not ...
https://physics.stackexchange.com
17,472
[ "https://mathoverflow.net/questions/17472", "https://mathoverflow.net", "https://mathoverflow.net/users/2841/" ]
Consider $\mathbb{R}^n$ as measurable space with the Borel algebra. If $\mathbb{R}^n$ and $\mathbb{R}^m$ are isomorphic (in the category of measurable spaces, i.e. there are measurable maps in both directions, which are inverse to each other), can we conclude $n=m$? Note that this statement is stronger than the invaria...
All uncountable standard Borel spaces are Borel isomorphic (see A. S. Kechris, Classical Descriptive Set Theory, page 90, Theorem 15.6).
If you use $2^\mathbb{N}$ instead of $\mathbb{R}$, then isomorphism of $n$ and $m$-fold products is easy. And since the Cantor set $2^\mathbb{N}$ measurably embeds in $\mathbb{R}$, the construction in the Schroder-Bernstein theorem lets you soup this up to the genuine $\mathbb{R}$ without need of Axiom of Choice.
https://mathoverflow.net
324,107
[ "https://dba.stackexchange.com/questions/324107", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/220647/" ]
I have the following table (simplified non-sense example): <pre><code>table fruits: +-----+---------+-------------+ | id | fruit | customer_id | +-----+---------+-------------+ | 1 | apple | 1 | | 2 | pear | 2 | | 3 | kiwi | null | | 4 | mango | 1 | | 5 | guav...
Two problematic constructs: <code>OR</code> and <code>NOT IN ( SELECT ... )</code>. This addresses both: <pre><code> ( SELECT * FROM fruits WHERE customer_id = 1 ) UNION ALL ( SELECT * FROM fruits AS f1 WHERE customer_id IS NULL AND NOT EXISTS ( ...
There is a way to solve this with a single logical hit on the table, keeping the <code>OR</code> condition though. It may or may not work faster. The solution requires MySQL 8+ as it uses a CTE and the <code>ROW_NUMBER</code> function – features introduced in MySQL 8. <pre><code>WITH enumerated AS ( SELECT ...
https://dba.stackexchange.com
71,578
[ "https://electronics.stackexchange.com/questions/71578", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/24768/" ]
I want to understand the concept of open-drain ports like port P0 of the 8051 microcontroller. Why do we need to connect pull up resistors to the port P0? I have basic knowledge of MOSFETs and other electronic devices.
Ignoring the ins and outs of how mosfets work. The output acts like a switch to ground. <strong>It cannot produce a high (+5V) signal by itself.</strong> The pull up resistor is used so that when the switch is open the output will be high. When the switch is closed the output will be low (0V) <img src="https://i.stack...
There are two common applications of open-drain (or open-collector, in the case of BJTs): 1) Connecting more than one output to the same line. This is called a wired-OR. For example, you may have a normally high reset pin on a device, which is reset from both a microcontroller pin and another source, say a pushbutto...
https://electronics.stackexchange.com
433,828
[ "https://physics.stackexchange.com/questions/433828", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/195622/" ]
I have a doubt in understanding about the degrees of freedom (dof) ......as I have learned dof is nothing but the necessary parameters to specify the location and configuration of a system.....if that's so then why is there only two extra dof for diatomic molecules to account for the rotation of its molecules? The mole...
You don't know the mass <span class="math-container">$m$</span> of the ball, but you know that <span class="math-container">$m$</span> is a constant, that is, <span class="math-container">$m$</span> is the same when the pitcher throws the ball as well as when the catcher chatches it. As the problem doesn't ask you to c...
Since the mass of the ball remains constant through time, and since <span class="math-container">$\Delta p = m \Delta v$</span>, the mass doesn't matter and is not needed. In fact, only knowing that the impulse is the change in momentum can help you solve this problem quickly ;) (Further hint, work out the momentum usi...
https://physics.stackexchange.com
8,946
[ "https://computergraphics.stackexchange.com/questions/8946", "https://computergraphics.stackexchange.com", "https://computergraphics.stackexchange.com/users/9298/" ]
I am learning about Cubemap and I learned that <strong>A cubemap is basically a texture that contains 6 individual 2D textures</strong> but my question is <strong>Why does it contain 6 individual texture ?</strong> and also I've read that it uses 3D directional vector for sampling, <strong>so what are the advantages of...
There are explicit rules in the OpenGL specification about invariance guarantees. For the purpose of this discussion, these rules boil down to the following. Given a particular series of vertex processing shaders (VS, tessellation, and GS), there are some set of input values, uniforms, and the like which lead to the c...
That would be because the GPU is deterministic. For the same inputs (vertex positions) it should produce the exact same per pixel depth outputs. Z-Fighting usually occurs with polygons with different vertex positions but still on the same plane, so interpolation rounding errors show up as differences and hence Z-figh...
https://computergraphics.stackexchange.com
80,107
[ "https://physics.stackexchange.com/questions/80107", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/16191/" ]
I am reading some introduction on quantum mechanics. I don't understand all but I get the point that the wavefunction tells some probability aspects. In one book, they show one example of the wavefunction $f(x)$ in position space as a complex function, so they said the probability of finding the particle is $f^*(x) f(x...
"$| f(x) \rangle$" does not mean anything and is not proper bra-ket notation. For translating back and forth beteween wavefunction and bra-ket notation, here is the #1 thing to keep in mind: $$ f(x) = \langle x \mid f \rangle $$ So, the probability density to find the particle at $x$ is $$ \left|f(x)\right|^2 = \lef...
In Bra-Ket language: Wave function is defined to be the coefficient of expansion of arbitary state in space base ket. $|\alpha \rangle=\int dx | x\rangle \langle x | \alpha \rangle=\int dx | x\rangle f_{\alpha}(x)$ . For a general state $|\alpha \rangle$, $f_{\alpha}$ is the wave function. The probability is $f^*f=|\l...
https://physics.stackexchange.com
25,063
[ "https://softwareengineering.stackexchange.com/questions/25063", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/9421/" ]
Recently I was being interviewed by a company and faced one question. The interviewer asked me a question and at that time I didn't know the answer but if I had been asked about just 4 months ago, I could have answered it. The question was from new language that I learned just 4 months ago. But I just get overview of ...
Well, ... human memory and instincts work faster than Google. But then again, we cannot commit everything to memory (human brain just doesn't work that way - you remember in the lower circles only the things you need momentarily). Google however is great as a replacement for paper books, manuals, everything really. An...
For the most part it's good though I think it has bought about a deterioration in problem solving skills among many programmers. Before the internet if you came up against a problem you'd not seen before you pretty much had no choice but to investigate and solve it yourself and if you couldn't come up with an answer t...
https://softwareengineering.stackexchange.com
438,680
[ "https://softwareengineering.stackexchange.com/questions/438680", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/414991/" ]
Relational database is mostly used for storing <strong>editable</strong> user data. But how about storing <strong>non-editable</strong> lists of information? Possible examples are: <ul> <li>GUI-related: main menu items, selectbox options, list of links, set of UI colors</li> <li>application logic: list of user types an...
<strong>Generally no, you shouldn't.</strong> I think the things you list as advantages are not real advantages: <ul> <li>&quot;solid structure and can be manipulated with SQL&quot;. General purpose programming languages all allow you to create documented and consistent structures. Depending on the language you may w...
If you extrapolate further, you could store <strong>all</strong> of your code and binaries in the database and fetch it at runtime. Databases store information, and unless you're doing something like storing users' interactions with the GUI elements for analytic purposes, then the best tool for storing static code data...
https://softwareengineering.stackexchange.com
228,564
[ "https://softwareengineering.stackexchange.com/questions/228564", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/119456/" ]
I am writing a matchmaking script for a game through a web portal. For the past few days I have been looking into the different options and I believe the following approach would be the most optimal but I would like the opinion of others. <ol> <li>Get players match requirements through a web form (Method GET) and plac...
Since you woun't have that much players, I wouldn't recommend on spending too much time on this issue, but continue on your other services. I would use an AJAX script that scans off a php script every second, where the PHP script is looking for an opponent. How would it work? - A "Find match" button calls an externa...
I suggest you look into websockets (like pusher.com or it's open source variant slanger or socket.io). It allows you to keep connections with clients open and thus see whether players are still active or not. It removes your need for ajax calls to any backend.
https://softwareengineering.stackexchange.com
649,396
[ "https://electronics.stackexchange.com/questions/649396", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/200281/" ]
I´m designing a really small circuit based on an ATtiny85 and a laser ranger sensor. The PCB is really small, 30 mm by 20 mm, so I need to use smaller and fewer components. I need a recommendation for an easy to find LDO that takes a 2S Battery (8.4 V max.) as Vin, 5 V as Vout, 50 mA max. of current draw (it´ll probabl...
Assuming your laser rangefinder draws pulsed current, If the rangefinder is powered from 8.4V, then this will be noisy and you need a LDO with decent PSRR. If it is powered from the output of the LDO, then you need a good transient response so the LDO output voltage does not fall out of spec when it emits a laser pulse...
Digikey has almost 700 models in stock matching that spec, most of which are in packages at least as small as SOT-23. Since there isn't a lot special about your needs, and this is about the most generic possible part, price is probably a major factor. Regarding capacitors, you need large enough to be stable, which sho...
https://electronics.stackexchange.com
109,726
[ "https://physics.stackexchange.com/questions/109726", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/19917/" ]
The pressure of a fluid can be explained microscopically in terms of molecules bouncing off the walls of a container. The molecules have a certain mass and speed, so when they bounce they transfer a certain momentum to the wall; and since a certain number of bounces occur per unit area and time, the averaged-out resul...
<blockquote> How do slight changes in these properties result in a large change in pressure, microscopically? </blockquote> Slight change of volume is not so easy to accomplish for solids - it takes a great force to achieve it. Considerable external force applied by different body (wall) needs to be maintained. The...
Yes, the pressure increases - but that does not require any work - you moved the piston with the force f by 0mm - and you have spend fN * 0mm = 0J on it.<br> You could as well use a static wall instead of a piston. Assume we have the higher pressure now.<br> Can we use the pressure to drive something with it - to ext...
https://physics.stackexchange.com
469,179
[ "https://physics.stackexchange.com/questions/469179", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/98822/" ]
In one question, which is further irrelevant for thís question, the comment was made that a single photon can have an energy density. I didn't agree. Off course the wavefunction is spread out in space, which seems to suggest that the energy is spread out in space also, giving the photon an energy density. The questi...
I'm not sure about a photon, but its possible to associate a charge density with an infinitesimally small source of charge. <span class="math-container">$\rho=q\delta(\vec{x'}-\vec{u}t);$</span> This represents the charge density, <span class="math-container">$\rho$</span>, in terms of the diract delta function. The...
You can define the energy density <span class="math-container">$T^{00}(x)$</span> for any field configuration, including a single photon. But it's crucial to remember that the energy density is a quantum object, just like everything else in quantum mechanics. The energy density at a given point can be in superposition....
https://physics.stackexchange.com
123,297
[ "https://physics.stackexchange.com/questions/123297", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/28802/" ]
In the world of scattering the angle at which you detect the scattered radiation is known as $q$, where $$ \vec{q} = \frac{4\pi\eta}{\lambda}\sin(\theta/2) $$ I read in a lot of books that this is known as the scattering vector or "momentum transfer". What I am trying to understand is why it is called "momentum trans...
Microscopically, i.e. in the quantum theory the scattering with radiation is a collision of particles with photons such as $$ e^- + \gamma \to e^- + \gamma$$ The momentum vectors of the particles above are $$ \vec p_1+\vec p_2= \vec p_3 + \vec p_4$$ where the identity holds due to momentum conservation. But in general ...
Here's a parallel answer to Luboš's but purely classical. Start by noting that the momentum vector of a plane wave with wavelength $\lambda$ is: $$ \vec{p} = \frac{2\pi}{\lambda} $$ In some elastic scattering experiment, e.g. X-ray or some other diffraction measurement, we have something like: <img src="https://i.st...
https://physics.stackexchange.com
308,732
[ "https://math.stackexchange.com/questions/308732", "https://math.stackexchange.com", "https://math.stackexchange.com/users/63066/" ]
$$y=5^{-1/x}$$ Help would be so greatly appreciated :] It's another homework problem...I unfortunately was not present during the lecture for these types of problems. I'm guessing from the $-1/x$ there would be a $\ln()$ in the answer?
It’s of the form $a^u$, where $u$ is some function of $x$. One of the basic differentiation formulas is $$\frac{d}{dx}a^x=a^x\ln a\;;$$ combine that with the chain rule, since the exponent isn’t just $x$, and you get $$\frac{dy}{dx}=5^{-1/x}(\ln 5)\left[-\frac1x\right]'\;.$$ Now you need the derivative of $-\frac1...
This has the form $a^{g(x)}$, where $a$ is a constant and $g(x)$ is some function of $x$. $$\frac{d}{dx}(a^{g(x)})=a^{g(x)} \cdot \ln(a) \cdot g'(x)$$ Don't forget to take the derivative of the exponent $g(x)$ by the chain rule. You have $$y = 5^{-\frac{1}{x}}$$ $$y' = 5^{-\frac{1}{x}} \cdot \ln(5) \cdot \frac{1}{x^2...
https://math.stackexchange.com
72,656
[ "https://security.stackexchange.com/questions/72656", "https://security.stackexchange.com", "https://security.stackexchange.com/users/60068/" ]
I have heard about both Web Application Firewalls (WAF) and Intrusion Prevention Systems (IPS). Which is better in preventing a Distributed Denial of Service (DDoS) attack and why?
Neither of these technologies can prevent a DDoS attack, what they can do is help to prevent a DDoS attack from taking down services. They have completely different functions so you can't say one is better is better than the other. An Intrusion Prevention System looks for anomalous traffic on a network and can alert ...
So first lets look at these two. A Web Application Firewalls, as the name implies, work with web applications almost exclusively. Most WAF are often not best-of-breed traditional firewalls, and should not be implemented in place of a traditional network firewall. Typical WAF deployments feature SSL decryption of web ap...
https://security.stackexchange.com
538,645
[ "https://electronics.stackexchange.com/questions/538645", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/271867/" ]
I have a magnetic reed switch connected between two pins of a Raspberry Pi. As far as I'm aware, the Pi can handle a short circuit between two of it's GPIO pins, so having nothing except the reed switch is completely fine. I've heard something about the maximum current of an input pin being 16 mA. My setup doesn't need...
16mA would not be input current, it would be the maximum output current of the output pin, while still being within logic level specs. Most likely short circuit current is even higher than 16mA. An input pin draws virtually no current, except when there is a weak pull-up or pull-down resistor enabled. You can save powe...
Just to answer your original question: Yes, a resistor does limit power output of a voltage source. Lets say you have a circuit with 1000 equivalent Ohms on a 10V voltage source. You will observe 10mA of current, this means 100mW of power. Now put in an additional 1000Ohm Resistor and your current will drop to 5mA. You...
https://electronics.stackexchange.com
82,998
[ "https://chemistry.stackexchange.com/questions/82998", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/43057/" ]
I have some unopened Clorox bleach bought over a year ago (at $8.25~\%\ \ce{NaOCl}$) and read on Wikipedia that bleach naturally decomposes according to $$\ce{3 NaOCl (aq) -&gt; NaClO3 (aq) + 2 NaCl(aq)}$$ Now, while there potentially might be some further decomposition as $$\ce{2 NaClO3 (aq) -&gt; 2 NaCl (aq) + 3 O...
You have outlined the principal decomposition path of hypochlorite in the question. Chlorate in itself is rather stable under ambient conditions and would probably not decompose. The greatest danger is if the bleach solution is no longer alkaline. If acidified, both hypochlorite and chloride as well as chlorate and ch...
Bleach decomposition can proceed with two pathways i.e. one is forming chlorate and other one is forming chloride. <span class="math-container">$$ \begin{align} \ce{3NaOCl -&gt; 2NaCl + NaClO3} &amp; \tag{R1}\\ \ce{2NaOCl -&gt; 2NaCl + O2} &amp; \tag{R2}\\ \end{align} $$</span> R1 is dominant although both reaction req...
https://chemistry.stackexchange.com
167,205
[ "https://physics.stackexchange.com/questions/167205", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/66515/" ]
If I touch the anode of a battery or connect the anode the the cathode of an other battery, none (or rather: a very small current) flows between those two. If I instead connect the connect the anode and cathode <strong>of the same battery</strong>, a current flows between those two points. Why is this? After all, there...
A battery is no capacitor, and the actual <em>charge</em> stored in the battery terminals is very low. When you connect the anode of one battery to the cathode of another, that charge is transferred very quickly, and the voltage drops to zero. When you connect anode and cathode of the same battery, a chemical reaction...
A battery works by making charge want to move from one terminal to the other (we call this a potential difference, or voltage). The charge is also moving through the inside of the battery itself (the electrolyte). When you hook up a wire to an anode and cathode of two different batteries, the buildup of charge on the ...
https://physics.stackexchange.com
24,327
[ "https://chemistry.stackexchange.com/questions/24327", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/13063/" ]
So, I read in a similar chemistry thread that you can get Mn and Mw of the polymer of the interest by comparing the result of the sample obtained from GPC/SEC with the standard known molecule weight polymer like polystyrene. I don't understand how this works. You compare what of the polymer with what of the polystyrene...
Vinyl ethers are "masked" carbonyls, therefore in acidic aqueous environment the following pathway takes place: alkene protonation assisted by the methoxy group followed by nucleophilic attack of water with hemiacetal formation. Subsequent intramolecular proton transfer to the methoxy group makes it a good leaving grou...
You're close. You are right in thinking that the first step involves protonation of the double bond. But which end of the double bond will you protonate? If you protonate the carbon bearing the methoxy group you wind up with a secondary carbocation. However if you protonate the other end of the double bond you wind...
https://chemistry.stackexchange.com
370,736
[ "https://math.stackexchange.com/questions/370736", "https://math.stackexchange.com", "https://math.stackexchange.com/users/64206/" ]
Liouville's theorem says that if $f$ is holomorphic in $\mathbb C$, then $f\not=const\implies\not\exists M:|f|&lt;M$. <br> So, $|f|$ is unbounded. But can both $\Re(f)$ and $\Im(f)$ be bounded below and unbounded above?
Try using the fact that if $f$ is entire, then so is $e^f$, $e^{-f}$, etc. What can you deduce about the absolute value of this new function? Try modifying this to address the imaginary part case. <em>Edit</em>: I changed my answer to be less explicit, because I think it's worth calculating this oneself.
Yes, because $f(\Bbb C)$ is dense in $\Bbb C$. Indeed, if we miss $B(z_0,\delta)$, then $z\mapsto \frac 1{f(z)-z_0}$ is entire and bounded by $\frac 1\delta$ hence $f$ would be constant.
https://math.stackexchange.com
39,009
[ "https://dba.stackexchange.com/questions/39009", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/21877/" ]
Hello I installed Ubuntu 12.04.2 LTS on a fresh box. This installed MySQL 5.5.29. I installed percona-xtrabackup-2.0.6-521.tar.gz, and moved the executables to /usr/bin/ But innobackupex is giving an error: "sh: 1: xtrabackup_55: not found" <hr> <pre><code>david@server1:/usr/bin$ sudo innobackupex --user=root --...
Check your server bit if it is 32 bit and if you try to install 64bit package percona's xtrabackup . It would end up throwing such error messages.
Based on the error, looks like you don't have [mysqld] section in /etc/my.cnf file
https://dba.stackexchange.com
52,874
[ "https://mathoverflow.net/questions/52874", "https://mathoverflow.net", "https://mathoverflow.net/users/11142/" ]
Consider a coprime pair of integers $a, b.$ As we all know ("Bezout's theorem") there is a pair of integers $c, d$ such that $ac + bd=1.$ Consider the smallest (in the sense of Euclidean norm) such pair $c_0, d_0$, and consider the ratio $\frac{\|(c_0, d_0)\|}{\|(a, b)\|}.$ The question is: what is the statistics of th...
I did a little experiment. Fix $a=29$, let $b=1,2,\dots,28$. So, you get 28 data points. Well, these points are already extremely regularly distributed. Taking just the first half, $1\le b\le14$, and rearranging the ratios in increasing order, they are (to three decimals) $$.034,.069,.103,.138,.172,.207,.242,.275,.310,...
Here's a more geometric formulation of your question: On the torus $\mathbb R^2/\mathbb Z^2$, consider a long simple closed geodesic $\overline {(0,0)(a,b)}$. It cuts the torus into a thin cylinder; the cylinder is joined to itself by a twist by some angle to form the torus. What is the distribution of the angle of t...
https://mathoverflow.net
52,220
[ "https://cs.stackexchange.com/questions/52220", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/44671/" ]
A semaphore is a variable that, apart from initialization is accessed through only two standard atomic operations wait(s) and signal(s). <pre><code>wait(S){ while S &lt;= 0 ; //no-op s--; } signal(S){ s++; } </code></pre> The function $wait()$ is an atomic operation which means that either it is exec...
Your assertion that <code>wait()</code> and <code>signal()</code> are atomic is incorrect. The increment/decrement to <code>s</code> within the functions (<code>s++</code>, <code>s--</code>), are what's atomic. That being said, what you have given here is only one possible <em>implementation</em> of a semaphore. An OS...
Semaphore do not work the way you have described. They are more like shared variables. So even inside the loop S can get modifies and the first process will come out of the loop. Note it is not same as while(1){}; .
https://cs.stackexchange.com
122,582
[ "https://dba.stackexchange.com/questions/122582", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/60094/" ]
I have several hundred (currently 466, but ever growing) tables I have to copy from one server to another. I have never had to do this before, so I'm not sure at all on how to approach it. All the tables are in the same format: <code>Cart&lt;Eight character customer number&gt;</code> This is part of a larger project ...
You could use SQL Server Management Studio's "Export Data" task. Right click on the database in SSMS, select Tasks and then "Export Data". It will launch an interactive wizard that will allow to copy tables from one server to another, although you will have to recreate the indices yourself. The wizard creates a tempora...
Here's a quick &amp; dirty approach that only needs a linked server, in each direction, with sufficient privileges, collation compatibility, and data access enabled. You run this on the source linked server to generate the dynamic SQL that will be executed on the destination linked server. <pre><code>DECLARE @sql NVAR...
https://dba.stackexchange.com
6,759
[ "https://stats.stackexchange.com/questions/6759", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/2725/" ]
How can I remove duplicate rows from this example data frame? <pre><code>A 1 A 1 A 2 B 4 B 1 B 1 C 2 C 2 </code></pre> I would like to remove the duplicates based on both the columns: <pre><code>A 1 A 2 B 4 B 1 C 2 </code></pre> Order is not important.
<code>unique()</code> indeed answers your question, but another related and interesting function to achieve the same end is <code>duplicated()</code>. It gives you the possibility to look up which rows are duplicated. <pre><code>a &lt;- c(rep("A", 3), rep("B", 3), rep("C",2)) b &lt;- c(1,1,2,4,1,1,2,2) df &lt;-data.f...
You are looking for <code>unique()</code>. <pre><code>a &lt;- c(rep("A", 3), rep("B", 3), rep("C",2)) b &lt;- c(1,1,2,4,1,1,2,2) df &lt;-data.frame(a,b) unique(df) &gt; unique(df) a b 1 A 1 3 A 2 4 B 4 5 B 1 7 C 2 </code></pre>
https://stats.stackexchange.com
189,318
[ "https://mathoverflow.net/questions/189318", "https://mathoverflow.net", "https://mathoverflow.net/users/3461/" ]
I am trying to figure out what the next calculation of the "area" (or "volume" in higher dimensional analogues) using Stokes' theorem really means. Here is my thought process: <strong>$2$-dimensional case:</strong> given a closed simple piece-wise smooth curve $C$ in $\mathbb{R}^2$ you can find out the area enclosed ...
Yes, this is a lower bound on the area of a surface bounded by the curve. Parameterize the surface and apply Stokes' theorem. Your squared area is: $$\sum_{1 \leq i &lt; j \leq n} \left( \int_S dx_i dx_j \right)^2 = \int_S \int_S \sum_{1\leq i &lt; j \leq n} dx_i dx_j dy_i dy_j$$ whereas the actual squared area is:...
The answer to my question in the edit is negative. Following the remark of Liviu Nicolaescu, one can always take the figure 8, embed it in the $x_1x_2-$plane and do a small perturbation such it doesn't intersect it self. Doing so you can get a "Stokes area" as small as you like, no matter how big your figure 8 is.
https://mathoverflow.net
444,096
[ "https://electronics.stackexchange.com/questions/444096", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/140343/" ]
How come THM (through hole mounting) 1/2 W resistors are bigger than their 1/4 W or 1/8 W counterparts, while SMD 1206 1/2 W and 1/8 W resistors are equally sized?
It's simple, the through hole resistors have the leads connected to the board, the smd resistors have pads which are directly in contact with the body of the resistor and the body itself is pretty much in contact with the board. That allows them to dissipate heat by transmission way more efficiently, plus when they are...
SMD 1206 defines the flat/projected size of the component / in other words, it defines the footprint. But they do have differences when their wattage is different. How much heat the component can handle not only depends on size, it also depends on other factors: component matérials used, board layout, ... . I could ...
https://electronics.stackexchange.com
339,994
[ "https://physics.stackexchange.com/questions/339994", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/159375/" ]
<blockquote> I have come across a physics riddle where 2 swimmers with same speed $c$ are competing against each other in a river, they start at the same spot, first swimmer (s1) is swimming distance $d$ up stream and back, while the other swimmer (s2) is swimming same distance but across and back. the river's stream...
If the second swimmer's aim is simply to cross to the other bank and back to the first bank (not necessarily needing to get back to his starting point) then he can ignore the water flow and direct all his swimming energy in heading across the river. He can just swim a distance of 2d relative to the water and ignore the...
@IanF1's already given the details, I'll just expand them a bit. Let's call the two swimmers, $A$ and $B$. Swimmer $A$ goes upstream and then comes back, and you have already calculated, which is simply - $$ t_A = \dfrac{l}{c - v} + \dfrac{l}{c + v} = \dfrac{2lc}{c^2 - v^2} $$ Swimmer B goes across the river, and the...
https://physics.stackexchange.com
136,505
[ "https://physics.stackexchange.com/questions/136505", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/55748/" ]
A resistor of resistance 12 ohms is connected in series with a cell of negligible internal resistance. The power dissipated in the resistor is P. The resistor is replaced with a resistor of resistance 3 ohms. What is the power dissipated in the resistor? A) 0.25 P B) P C) 2 P D) 4 P I used $P = \frac{V^2}{R}$ ...
You're just thinking 'upside down'. The 3 ohm resistor is just 1/4 the resistance of the 12 ohm resistor <em>but</em>, power is <em>inversely</em> proportional to the resistance. Thus, if you <em>decrease</em> the resistance by a factor of X, you <em>increase</em> the power by a factor of X. In this case, the resist...
what is your logic behind setting V=1? you do not have enough info to assume that. What you do know is that the voltage is constant (same cell), so you can write: $P_{ini}*R_{ini}=P_{final}*R_{final}$ Knowing both R's gets you $P_{final}=4P_{ini}$
https://physics.stackexchange.com
11,806
[ "https://dba.stackexchange.com/questions/11806", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/6235/" ]
New CentOS installation. I was running an import of a large DB (2GB sql file) and had a problem. The SSH client seemed to lose the connection and the import seemed to freeze. I used another window to login to mysql and the import appeared to be dead, stuck on a particular 3M row table. So I tried <pre><code>DROP DA...
Rather than killing the process, it would be safer if you did it within MySQL: <pre><code>$ mysqladmin processlist -u root -p Enter password: +-----+------+-----------+-------------------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info ...
Though I thought that the import process had died, it was probably still running. The <code>DROP DATABASE</code> command probably waited for the database to finish importing before it ran. So, rather than <code>DROP DATABASE</code> taking a long time, it was probably just the import. 1.) If anyone else reads this and i...
https://dba.stackexchange.com
4,010,070
[ "https://math.stackexchange.com/questions/4010070", "https://math.stackexchange.com", "https://math.stackexchange.com/users/749602/" ]
The question was: <ul> <li>Find <span class="math-container">$n$</span> where <span class="math-container">$GCD(a_{n}, 14) = 7$</span> where <span class="math-container">$n$</span> is natural if you knew that <span class="math-container">$a_{n} = n + 3$</span></li> </ul> The book solved it by saying that means <span cl...
Your last line comes straight from the definition of <span class="math-container">$\varphi(f)$</span> and the definition of continuity. Since <span class="math-container">$\varphi(f)$</span> is continuous, for every <em>small number</em> (here it is 1), we can find a neighborhood <span class="math-container">$V$</span>...
Some background: Suppose X is a vector space and <span class="math-container">$\Phi $</span> is a family of linear functionals on <span class="math-container">$X$</span>. This family defines a topology on <span class="math-container">$X$</span>, denoted by <span class="math-container">$\mathcal T_\Phi$</span> such tha...
https://math.stackexchange.com
6,144
[ "https://chemistry.stackexchange.com/questions/6144", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/876/" ]
This time I am interested in a specific type of acid anhydride, <strong>sulfonyl-carboxylates</strong>, i.e. compounds with the following molecular structure: <img src="https://i.stack.imgur.com/70uji.png" alt="enter image description here"> where $\ce{R2}$ can be an organic substituents <em>or</em> hydrogen atoms. $...
In addition to the procedures described by Ian Fang, these mixed anhydrides (with $\ce{R_1, R_2 \ne H}$) have been used to prepare symmetric anhydrides of carboxylic acid in solid state reactions. If that's interesting to anyone, I can look up the reference. As far as the effect of water is concerned, I do remember a ...
The mixed carboxylic anhydride, unless sterically hindered (the big sulfonyl helps) and electron rich, will be labile toward nucleophilic attack hydrolysis. Acetic anhydride usefully persists in cold (acidified) water. It goes exponentially as it exothermically hydrolyzes. Keep it cold. As above, use phase transfer...
https://chemistry.stackexchange.com
337,572
[ "https://softwareengineering.stackexchange.com/questions/337572", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/197053/" ]
I'm writing a very simple extension method that attempts to cast objects from one type to another. The intent of having this method is very similar to <code>Int32.TryParse(string, out int)</code>, which allows the user to see 1) if the conversion succeeded, and 2) what the converted object is, all in one line. Because...
Look to what your clients want, and try to provide an abstraction that is useful. And if you are your own client, try to think critically about what you want as a client rather than as the implementer. I would assert that at the point someone calls this they are now only interested in whether the item provides the AP...
If your input parameter is null you are not able to decide what is the right return value. Any return value would be as good as the other. It doesn't matter if it is null, true, false or "foobar". Getting a special type of object from an arbitrary object is really weired. I really doubt the usecase. The point is that ...
https://softwareengineering.stackexchange.com
1,584,779
[ "https://math.stackexchange.com/questions/1584779", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105100/" ]
Let $X_n=\left(\sum^n_{i=1} Y_i\right)^2$, and I would like to know if $\sum^n_{i=1} Y_i$ is measurable in $\sigma(X_1,...,X_n)$. If not, why? I tend to think that it's not. But I can't think of a justification for it... Any help would be appreciated.
(Following copper.hat comment) There are sets which are not Lebesgue measurable. Let $A$ be such a set. Define a function $f(x)= \begin{cases} 1, &amp; x\in A \\ -1, &amp; x\in A^c \end{cases} $. Clearly, f is not Lebesgue measurable. However, $f^2$ and $|f|$ are measurable. In this way, we could hav...
Let $(\Omega, \mathscr F, \mathbb P)$ be a probability space. Consider $Y$, a mapping from $\Omega \to \mathbb R$ s.t. $X := Y^2 \in m\mathscr F$. Let $\omega \in \Omega$. If we know $X(\omega)$, we don't necessarily know $Y(\omega)$. For example if $X(\omega) = 25$, then $Y(\omega)$ could be 5 or -5. So $\{Y = 5\} ...
https://math.stackexchange.com
134,834
[ "https://physics.stackexchange.com/questions/134834", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/37042/" ]
Let's consider the following situation. We put a body of mass $m$ at a distance $A$ from the center of Earth. We let the Earth attract the body and analyze the situation at a point $B$, closer to the Earth. Now, the work done by the gravitational force (a conservative force, which seems to be important) is given by: ...
Energy is conserved so it can't be created or destroyed. All we can do is change energy from one form to another. In your example we are changing the potential energy of the mass $m$ into kinetic energy. The increase in kinetic energy must be equal to the decrease otherwise energy wouldn't have been conserved. By an ...
Work done on a system increases the energy of the system. But you have to be clear about what system you are talking about. For the system consisting of the Earth and your other object, there is no external force, and no work done on the system. The total energy is constant; it just changes from potential energy to ...
https://physics.stackexchange.com
1,337,434
[ "https://math.stackexchange.com/questions/1337434", "https://math.stackexchange.com", "https://math.stackexchange.com/users/59157/" ]
Let $A \in \Bbb R^{n\times n}$. Let $C(A)$ denote the column space of $A$, and $E(A)$ denote the eigenspace, which is the span of all the eigenvectors of $A$. Now I am trying to see if $C(A)=E(A)$. Denote $\{z_1,\ldots,z_m\}$ as the eigenvectors of $A$. Then $Az_i =\lambda_iz_i$. Since $Az_i\in C(A)$ we have $z_i \in ...
That is false in general: take any invertible matrix $A$. Then $C(A)=\mathbf R^n$. But if the matrix is not diagonalisable, there are less than $n$ linearly independent eigenvectors, so that the span of all eigenvectors is a <em>strict</em> subspace of $\mathbf R^n$.
The matrix $A=\begin{bmatrix}0&amp;1\\-1&amp;0\end{bmatrix}$ has no real eigenvector, so the span of the eigenvectors is the $\{0\}$ subspace, while the column space is $\mathbb{R}^2$. The question makes sense only if we work in $\mathbb{C}$, rather than in $\mathbb{R}$. In this case, if $\lambda_1,\dots,\lambda_k$ ar...
https://math.stackexchange.com
84,216
[ "https://mathoverflow.net/questions/84216", "https://mathoverflow.net", "https://mathoverflow.net/users/5656/" ]
Let $(\Omega, \mathcal{F}, P)$ be a probability space, on which $\mathcal{F}_t$ is filtration satisfying general conditions. $W_t$ is a standard Brownian motion. Let $Y_t$ be a martingale given by $$Y_t = \int_0^t \sigma_r d W_r$$ where $\sigma_t$ is a bounded $\mathcal{F}_t$ measurable process. The question is, assum...
Here's an explicit construction that gives a counterexample. For simplicity let $c=0$ (not important). First, let $\alpha&gt;0$ and consider the probability that a standard Brownian motion started at 0 hits 0 at some time in the interval $(\alpha t, \alpha t+t)$. Then (1) this probability does not depend on $t$ (by B...
I have not thought about such questions for a while, but I do not see an immediate mistake in the following reasoning: Let $Y_t=E[\mathrm{sign}(W_1)| \mathcal{F}_t]$. Then it is a bounded martingale, and it also has a continuous modification since $Y_t=E[\mathrm{sign}(W_1) | W_t]$ and $E[\mathrm{sign}(W_1) | W_t=x]$ d...
https://mathoverflow.net
247,503
[ "https://electronics.stackexchange.com/questions/247503", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/108476/" ]
The quartz movement in battery-powered watches is plated with gold and trimmed individually using laser to achieve a vibration frequency of exactly 32,768 Hz to keep time accurately. The crankshaft in pistol engine is adjusted by hand or computer to make sure the center of gravity is in the middle of the shaft for smo...
In a CPU per se, no part requires calibration. Pure digital logic does not need it. In a microcontroller (combination of CPU+periperals in a single chip), the only parts that would need calibration would be the internal oscillators, and eventually a few specific elements for particular peripherals (internal references ...
MCUs that have internal RC oscillators are typically calibrated by storing a number in non-volatile memory that trims the oscillator frequency. That number might be used directly, but more often it is loaded into a register to trim the hardware oscillator. The calibration is done in testing. As a rough example, the...
https://electronics.stackexchange.com
3,858,517
[ "https://math.stackexchange.com/questions/3858517", "https://math.stackexchange.com", "https://math.stackexchange.com/users/157188/" ]
Is it possible to count exactly the number of binary strings of length <span class="math-container">$n$</span> that contain no two adjacent blocks of 1s of the same length? More precisely, if we represent the string as <span class="math-container">$0^{x_1}1^{y_1}0^{x_2}1^{y_2}\cdots 0^{x_{k-1}}1^{y_{k-1}}0^{x_k}$</span...
I confirm your results for <span class="math-container">$n \le 16$</span>. It might be useful to compute the values by conditioning on <span class="math-container">$k\in\{1,\dots,\lfloor(n+3)/2\rfloor\}$</span>: <span class="math-container">\begin{matrix} n\backslash k &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &...
An aproximation for large <span class="math-container">$n$</span> The runs of <span class="math-container">$0$</span>s and <span class="math-container">$1$</span>s can be approximated by iid geometric random variables (with <span class="math-container">$p=1/2$</span>, mean <span class="math-container">$2$</span>). Henc...
https://math.stackexchange.com
252,300
[ "https://security.stackexchange.com/questions/252300", "https://security.stackexchange.com", "https://security.stackexchange.com/users/12724/" ]
When a client makes the first request, I send a session ID cookie generated by the server as a string of 64 random bytes using <code>getrandom(2)</code> or <code>/dev/urandom</code>, stored in the database, with the flags <code>HttpOnly</code>, <code>Secure</code> and <code>SameSite=Strict</code> set. Additionally, the...
Depends how confident you are in the &quot;no subdomains&quot; and &quot;no browsers too old to understand <code>SameSite</code> cookie flag&quot; conditions. Both of those have several ways to break them. The &quot;no subdomains&quot; thing requires not only that <em>you</em> not have any subdomains, but that nobody e...
Yes, you still need it. Yes, I can’t think of a way to break your site today, but that isn’t the security question, and this is a security site. No, there are no other security benefits to using a csrf token. You could look at crypto systems that use nonces, or anti-replay stuff but that’s not what the csrf is doing. T...
https://security.stackexchange.com
2,206,813
[ "https://math.stackexchange.com/questions/2206813", "https://math.stackexchange.com", "https://math.stackexchange.com/users/430107/" ]
Define $f(x)=\frac{1}{\ln x}$ for $x\ge 1$. Show that for $p$ in $[1, \infty)$, $f$ is not in $L^p$
Observe that, $$\int_1^\infty\frac{1}{(\log x)^p}dx= \int_0^\infty\frac{e^t}{t^p}dt $$ Now use the hint.
For all $p\ge 1$ exists $k(p)\ge 1$ s.t. $$x\ge k(p)\implies (\log x)^p \le x.$$ Now, you can compare your integral with a divergent integral: $$\int_{k(p)}^\infty\frac1x\,dx\le\int_{k(p)}^\infty\frac1{(\log x)^p}\,dx\le\int_1^\infty\frac1{(\log x)^p}\,dx.$$
https://math.stackexchange.com
74,116
[ "https://cs.stackexchange.com/questions/74116", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/65888/" ]
Could a programming language be designed so that there is an inheritance relationship between <code>string</code> and <code>character</code> (both of which are native types), such that the inheritance alone resolves the use of an arbitrary binary operator between the two types: <code>&lt;string&gt; @ &lt;character&gt;<...
Character and String are conceptually very, very different. Google for "inheritance vs. composition" - you seem to think that Character and String should be connected via inheritance, but in reality a String is composed of 0, 1 or more Characters. And to throw a spanner in the works: Strings are often large, and Stri...
<ol> <li>Subtyping is conceptually very different from inheritance.<br> Subtyping refers to shared interfaces; $\tau$ is a subtype of $\tau'$, i.e. $\tau &lt;: \tau'$, then all expressions of type $\tau$ could be used when one of type $\tau'$ is expected. Inheritance refers to the reuse of implementation; if class A i...
https://cs.stackexchange.com
32,925
[ "https://mathoverflow.net/questions/32925", "https://mathoverflow.net", "https://mathoverflow.net/users/7607/" ]
We all know that Gödel showed that there, in a formal system, are true statements that are non-provable (undecidable). In ZFC, there's Kaplansky's Conjecture, the Whitehead problem, etc. We can also agree that we're sure to find more non-provable statements in ZFC. What I'm curious about is the following: What is th...
Not all statements that are not provable in ZFC are "strong", if by strong you mean that ZFC + the statement in question is stronger than ZFC in the sense that it implies the consistency of ZFC.<br> The typical example is the Continuum Hypothesis (CH). ZFC + CH is consistent iff ZFC is, and in this sense, CH is not st...
Often, you can classify characteristics of a collection of independence results through the use of forcing axioms. For example, if you assume Martin's axiom MA$(\aleph_1)$, which states that for every $\aleph_1$ many dense subsets of a partial order having the countable chain condition, there is a filter meeting all o...
https://mathoverflow.net
59,359
[ "https://softwareengineering.stackexchange.com/questions/59359", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/8250/" ]
When first implementing Scrum within a team, how should you go about determining the amount of story points that are in an initial sprint when you have no idea of the team's velocity? Should you base this on an estimate of hours and only use the points at a later stage?
You have no historical facts to draw upon, so I suggest that you don't bother with any guesses at all. Trying to calculate velocity based solely on some formula is just a waste of time. Simply estimate enough stories and let the team work on them during the first sprint. They'll finish what they finish anyway. After ...
Nobody can say you how many story points can you take for your first sprint. First of all story point is unitless value. You should not make initial decisions like 1 story point = 6 hours because in many cases it will run against you later on. Also each project can have different "size" of story points. Commitment sho...
https://softwareengineering.stackexchange.com
535,950
[ "https://electronics.stackexchange.com/questions/535950", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/39469/" ]
I would like to build a Colpitts oscillator. The oscillator will have a frequency of <span class="math-container">\$f = 1/2 \pi\sqrt{C_{tot} L}\$</span>. But what implications does my choice of <span class="math-container">\$L/C\$</span> have? Can I arbitrarily choose my tank circuit to be very inductive, or very capac...
It's all about being practical: Choose your inductor so that at the desired circuit oscillation frequency, the inductor's self resonant frequency is several times higher. If you want accuracy choose an inductor that has a SRF that is ten or more times higher than the oscillation frequency. This limits the inductor to a...
You know that <span class="math-container">\$X_{_\text{CT}}=\frac1{\omega_{_0}\,\cdot \,C_{_\text{T}}}\$</span> and that <span class="math-container">\$X_{_\text{L}}=\omega_{_0}\cdot L\$</span>. At resonance, <span class="math-container">\$X_{_\text{CT}}=X_{_\text{L}}\$</span>. At much lower frequencies, the tank imped...
https://electronics.stackexchange.com
259,891
[ "https://math.stackexchange.com/questions/259891", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53282/" ]
I'm trying to find a function that can convert each number (I mean natural numbers) in the range <code>M..N</code> to another number in the same range. Later I need to convert it back. Let's take the <code>0..99</code> range for example. A very easy solution is: <code>b = 99 - a</code> later to find <code>a</code> fr...
An example of what you require is $\mathbb F_2[x,y]\stackrel {def}{=}\mathbb F_2[X,Y]/(X^2,Y^2)$<br> What might not be completely evident is that $xy\neq 0$.<br> This means that in $\mathbb F_2[X,Y]$ the monomial $XY$ is not in the ideal $(X^2, Y^2)$ or that an equation $$ XY=X^2f(X,Y)+Y^2g(X, Y)\quad \text{with }f...
Let $E_2=\begin{pmatrix}1&amp;1\\1&amp;1\end{pmatrix}$. Consider the ring of matrices over $\mathbb{F}_2$ generated by $$ 0,\ I_4,\ x=\begin{pmatrix}E_2&amp;0\\0&amp;E_2\end{pmatrix},\ y=\begin{pmatrix}I_2&amp;I_2\\I_2&amp;I_2\end{pmatrix} $$ under usual matrix addition and multiplication.
https://math.stackexchange.com
1,287
[ "https://electronics.stackexchange.com/questions/1287", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/107/" ]
I have a project where I want to be able to cook food (very similar to a crock pot). What would anybody here recommend to use to convert AC to useable DC and what should I use to heat the food? Should I use cartridge heaters? How many watts would be OK? Also, I would need to turn on/off the heating element so what ...
nearly all simple cookers use AC power to directly run a heating element. The elements are usually just wire coils, or sometimes flat resistance wire types. since the quantity of food being heated varies it is nearly always necessary to incorporate a thermostatic controller in order to vary the power. On toasters this...
Consider buying a crock pot of suitable size (should only be US$15-$30, less than if you try to construct one from your own parts) and modify it as necessary to automatically turn on/off the AC power to meet your cooking needs.
https://electronics.stackexchange.com
209,951
[ "https://physics.stackexchange.com/questions/209951", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/94233/" ]
I was recently watching a video about elemental mercury and how it's cleaned up in water (fish tanks), and it was mentioned how mercury can be toxic in vapor form. My question is, if I were to drop a bead of mercury in a glass of water, could it still evaporate, since it's 13x denser than water, and therefore sinks to...
Mercury is slightly soluble in water. At room temperature the solubility is about 56$\mu$g/litre. So while the mercury would not evaporate if you added enough water, or kept replacing the water, the bead of mercury would eventually dissolve away. In principle the mercury solution could evaporate the mercury into the a...
The process of evaporation and condensation at the interfacial boundary between a liquid and gas is governed by models developed in statistical mechanics. The probablity that an atom or molecule of liquid will leave the interface into the gas or otherwise enter the interface is determined by a number of factors includi...
https://physics.stackexchange.com
69,234
[ "https://electronics.stackexchange.com/questions/69234", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/10190/" ]
Flash memory storage and EEPROM both use floating gate transistors for storage of data. What differs between the two and why is Flash so much faster?
The first ROM devices had to have information placed in them via some mechanical, photolithographic, or other means (before integrated circuits, it was common to use a grid where diodes could be selectively installed or omitted). The first major improvement was a "fuse-PROM"--a chip containing a grid of fused diodes, ...
Spoiler: EEPROM is in fact Flash. As supercat's answer brilliantly pointed out, EEPROM is an evolution of the older UV-eraseable EPROMs (EEPROM's &quot;EE&quot; stands for &quot;Electrically Eraseable&quot;). However, despite it being an improvement to its old pal, today's EEPROM's way of holding information is the <em...
https://electronics.stackexchange.com
189,354
[ "https://mathoverflow.net/questions/189354", "https://mathoverflow.net", "https://mathoverflow.net/users/62813/" ]
When defining tensor products $M\otimes_R N$ over a commutative ring $R$ one can use a universal property with respect to bilinear maps $M\times N\rightarrow P$, for any $R$-module $P$. On the other hand, in the general case, for noncommutative rings one has to use balanced maps $M \times N \rightarrow Z$ instead of b...
You seem to be asking whether any <strong>group</strong> homomorphism $M\otimes_RN\to P$ is $R$-linear. There is no reason why this should be true. As a huge overkill, consider $\Bbb R\otimes_{\Bbb R}\Bbb R=\Bbb R\to\Bbb R$: there are uncountably many group homomorphisms (even $\Bbb Q$-linear maps) that are not $\Bbb R...
I guess I have a counterexample. Let $G$ be an abelian group and form the group algebra $kG$ which is commutative. Pick any $kG$-module $M$ and define a structure of module on the dual $M^*$ via $[g.f](m)=f(mg)$. Actually does not matter on which side one multiplies by $g$ since the algebra is commutative. Then the e...
https://mathoverflow.net
43,518
[ "https://mechanics.stackexchange.com/questions/43518", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/11110/" ]
Looking at a 2015 Nissan Leaf I see it has a Quick Charge port (listed as part of the Charge Package on the spec sheet). Does this mean this car also has the 6.6kW on board charger? I'm not sure if you can have one without the other, which is why I ask, and I want to know whether the regular charger on this car is li...
I'm driving a 2015 LEAF in S (base) trim. It has a CHAdeMO port and 6.6kW L2 charging. The 2011 and 2012 LEAFs (like David B's) all had 3.3kW L2 charging, CHAdeMO or not. However, starting in 2013, CHAdeMO was an option on the S trim, standard on the SV and SL trim. And if you have CHAdeMO, you have 6.6kW L2.
My 2011 Leaf has CHAdeMO rapid charging but has a 3.3kW internal charger for AC. So, having rapid charge is no guarantee of having the built-in 6.6kW charger.
https://mechanics.stackexchange.com
163,619
[ "https://security.stackexchange.com/questions/163619", "https://security.stackexchange.com", "https://security.stackexchange.com/users/152817/" ]
I am a Mac User and while I was on youtube, I clicked on a url www.giftforfans .us I don't know what I was thinking but I got phished pretty hard... Now I am a bit paranoid and I am wondering if people's computer can get infected simply by just visiting this website... I don't know what the website does but I don't t...
<strong>I don't think you have much reason to be paranoid.</strong> Browsers are one of the best sandbox out there. Which means that anything that happens in your browser doesn't affect the rest of your computer. So theoretically, you could visit malicious link all day long and it would have no impact on your computer...
I do not think that this site was a phishing site because it is not directly linked to youtube. Also, youtube follows the HTTPS protocol and so your email credentials shall be protected by Youtube. Unless, you entered any private information into the website you should be just fine :))
https://security.stackexchange.com
457,026
[ "https://physics.stackexchange.com/questions/457026", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/187604/" ]
I was wondering that the density of electric field lines determine the strength of the electric field .Now let's say you have an isolated charge ; you know the flux through a closed surface which I take to be a unit sphere suddenly limited by the Gauss law. If the flux is limited then it's bound to be the field lines s...
<strong><em>I was wondering that the density of electric field lines determine the strength of the electric field</em></strong> First we need to realize that electric field lines are used to visualize and analyze electric fields and therefore should be considered as a pictorial tool as opposed to a physical entity. Fo...
It is <strong>not</strong> true that if <span class="math-container">$E \rightarrow \infty$</span> then it should be the case that <span class="math-container">$\Phi_E \rightarrow \infty$</span>. Notice that in your example, the surface area of your sphere tends to zero <span class="math-container">$A \rightarrow 0$<...
https://physics.stackexchange.com
383,029
[ "https://softwareengineering.stackexchange.com/questions/383029", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/311101/" ]
Often times, through my framework's importing side of things, I have access to certain data that functions I'm about to use will certainly need themselves. I have "resolvers" that these said functions can use to get the additional data they need but they're very heavy operations and I was thinking: Since I already ha...
This is definitely a trap. A steel bear trap. And the code's leg is caught in it. And a T-Rex has already chomped down on the code and is thrashing it back and forth Jurassic Park-style. Mixing a boolean parameter that turns functionality on and off, and combining that with another argument that is a nebulous "support...
What you should do is pass in a repository of the things that your function needs, and implement caching in that repository ie <pre><code>self::getComponentCategoryByName( $target_component_name ) </code></pre> If you have already called this once, somewhere up stream of the function, then it should no longer be a s...
https://softwareengineering.stackexchange.com
232,400
[ "https://softwareengineering.stackexchange.com/questions/232400", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/123198/" ]
I want to release an npm (NodeJS) module that will be a development dependency for extensions built for my product (will be used in testing). I don't want this module to be used in any released derivative work (commercial or free, open or closed source). Is there an existing suitable license that I can use?
No, there are no major software licenses that allow only personal use. Unless for some reason you want someone to be able to rebuff you when you try and bring them to court for going too far, there's no reason to write a formal license of any kind. A simple copyright statement is all that you really need. And even t...
Such a license cannot possibly exist. The requirements you list are inconsistent. You want the license to be open-source, but you want it to violate the definition of "open-source". A license cannot be open-source and not open-source at the same time.
https://softwareengineering.stackexchange.com
41,529
[ "https://stats.stackexchange.com/questions/41529", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/11090/" ]
I'm currently attending the <em>An Introduction to Operations Management</em> course in Coursera.org. At some point in the course, the professor started to deal with variation in the operations' time. The measurement he uses is the <em>Coefficient of Variation</em>, the ratio between the standard deviation and the me...
I think of it as a relative measure of spread or variability in the data. If you think of the statement, "The standard deviation is 2.4" it really tells you nothing without respect to the mean (and thus the unit of measure, I suppose). If the mean is equal to 104, the standard deviation of 2.4 communicates quite a diff...
Coefficient of variation is effectively a normalized or relative measure of the variation in a data set, (e.g. a time series) in that it is a proportion (and therefore can be expressed as a percentage). Intuitively, if the mean is the expected value, then the coefficient of variation is the expected variability of a m...
https://stats.stackexchange.com
406,734
[ "https://mathoverflow.net/questions/406734", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
Recall the construction of the reduced crossed product: <blockquote> Let <span class="math-container">$\Gamma$</span> be a discrete group and <span class="math-container">$A$</span> be a <span class="math-container">$C^*$</span>-algebra with an action <span class="math-container">$\alpha: \Gamma\to \operatorname{Aut}(A...
This is Exercise 4.1.4 in the book by Brown+Ozawa (is that where this question ultimately comes from?) The &quot;Hint&quot; is &quot;The reduced case is easy.&quot; Hmm. Well, it might perhaps help to look at this section of the book. Indeed, Proposition 4.1.5, <em>and its proof</em>, shows that if <span class="math...
Here is a proof free of Hilbert space representations. I will use the notation <span class="math-container">$G$</span> instead of <span class="math-container">$\Gamma$</span> for the group, which could be also locally compact, and <span class="math-container">$\alpha$</span> will denote the action of <span class="math-...
https://mathoverflow.net
197,434
[ "https://electronics.stackexchange.com/questions/197434", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/72853/" ]
Consider a USB 2.0 device that can be powered either from the bus, from an external power supply, or from both simultaneously. The source of power can be switched at run time while USB is operating. The maximum current consumption is known and does not exceed the 500 mA limited by USB 2.0. Should such a device report ...
If it is capable of being bus-powered, then I would report it as such. The end result of the power negotiation is a maximum that you're not allowed to exceed, but you don't actually have to use it. (The maximum power is rarely enforced, but every once in a while it is.) To make your device a bit smarter, and if you ...
It would report two configurations, one of them self-powered (implicit 2mA), the other bus powered (500mA). The device would refuse to enter the self-powered configuration when the external power supply is not connected. This means that if there is less than 500mA available, e.g. because the device is connected behind...
https://electronics.stackexchange.com
62,284
[ "https://physics.stackexchange.com/questions/62284", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/12934/" ]
<img src="https://i.stack.imgur.com/fl0fF.jpg" alt="enter image description here"> This is an inclined surface having and unit vector A. The perpendicular and horizontal surfaces are the components of the inclined surface. We want to find out that how much flux will pass through the inclined surface. My question is t...
You are perfectly free to call the other angle $\theta$, so long as you are consistent. Then the area of interest would be written $A \sin(\theta)$, and the other $\theta$ marked in the diagram would have to be relabeled $\pi/2-\theta$.
Imagine taking the inclined surface to be close to horizontal. In this case, the angle between $\mathbf A$ and the horizontal would be approximately $90^\circ$, while the angle you have indicated in red would be approximately $0^\circ$, so they can't possibly be the same.
https://physics.stackexchange.com
89,467
[ "https://mechanics.stackexchange.com/questions/89467", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/16554/" ]
I have a motor with an an internal parallel keyway and a sprocket with a set screw. The sprocket set screw keeps coming loose allowing the shaft key to slip out. Usually I'd use some blue loctite on the set screw but I'm scared I'll never get the set screw back out as it's a tiny, easily strippable, allen head. Is ther...
I'd use the thread locker. If it's too difficult to remove you can apply heat which will soften the thread locker and allow it to be easily removed.
If space allows, you can replace the socket set screw with a longer socket cap screw. The head of the screw will be exposed and it will have a bigger socket, allowing you to torque the screw properly (so that it won't come loose again) without fear of stripping out the socket. This would also allow you to use a jam nut...
https://mechanics.stackexchange.com
657,481
[ "https://physics.stackexchange.com/questions/657481", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/231654/" ]
<strong>Edit 1</strong>: May be I should modify my question after getting the answers. I see why <span class="math-container">$(X_c, Y_c, Z_c, \theta, \phi)$</span> are legitimate <em>Dof</em>'s of the dumb-bell, I never had any problem with that. Please consider now <em>any</em> rigid body in general. It has <span cla...
<blockquote> But can we really know the 6th coordinate? </blockquote> You are right -- given knowledge of five coordinates, there is a discrete choice (corresponding to a reflection) for the remaining coordinate. However, by convention we typically (but not always) use the word &quot;degree of freedom&quot; to mean a c...
&quot;There is a new suggestion: <span class="math-container">$(X_c,Y_c,Z_c,θ,ϕ)$</span> where <span class="math-container">$(X_c,Y_c,Z_c)$</span> are the coordinates of the center-of-mass and θ and ϕ are the polar and the azimuthal angles. If this is the effect of the constraint relation, then it doesn't really elimin...
https://physics.stackexchange.com
30,466
[ "https://cs.stackexchange.com/questions/30466", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/22254/" ]
I am trying to create a dfa for L={w: every run of a's has length either two or three} this is my attempt at the solution..i feel like I am missing something..? <img src="https://i.stack.imgur.com/10PDO.jpg" alt="enter image description here">
There's a significant difference between the question as you pose it and the question posed in the exercise. The question asks for an example of a set of regular languages $L_{1}, L_{2}, \ldots$ such that their union $$ L = \bigcup_{i=1}^{\infty}L_{i} $$ is not regular. Note the range of the union: $1$ to $\infty$. Reg...
For your second question, consider the languages defined by $$ M_n = \{a^{k^2}\mid 1\le k \le n\}\cup\{a^j\mid j\ge(n+1)^2\} $$ Observe that for any $n\ge 1$, $M_n$ is regular, since (1) the left set is finite and hence regular, (2) the right set is denoted by the regular expression $a^naa^*$ so is regular, and (3) reg...
https://cs.stackexchange.com
116,922
[ "https://softwareengineering.stackexchange.com/questions/116922", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/21497/" ]
I participated in a coding competition today, and I found that almost all of the command line input our programs needed to receive would start with an integer representing the amount of data sets to follow. There were 6 different problems, and they all started this way. For example, one sample problem had: "Input to ...
I don't think there's another option other than the ones you mentioned. You either: a) iterate through all the the data sets and work on them as they come up or b) store everything (in some suitable data structure, like an array, hash table, tree, etc) and work on it later.
I would usually define a class to represent each problem instance, then add a class constructor that accepts a FileReader or istream. Actually, I solve problems like these in Perl, but the contest rules require Java or C++.
https://softwareengineering.stackexchange.com
484,725
[ "https://electronics.stackexchange.com/questions/484725", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/244484/" ]
I'm looking to create my own buck-boost converter but want to test it on a breadboard. I have done online searches but only surface mounted ICs show up. The Texas instruments TPS63061 looks ideal for me because I have an input between 2 and 10 voltas and need a 5 volt output, but this ic is surface mounted and very sma...
If you want a different substrate voltage in p-substrate process: 1) Create a n-well in the p-substrate and connect this new n-well to VDD. The depletion layer between the n-well and the p-substrate does the isolation job.<br> 2) Inside the n-well, create a p-well and connect this to the body-bias voltage.<br> 3) In...
In most integrated circuit, all the substrates are connected to the same potential. For PMOS, this usually is the higher potential available, and for NMOS, the lowest available. If you want different substrates voltages, you need to use a fabrication technology like Sillicon On Insulator (SOI).
https://electronics.stackexchange.com
54,599
[ "https://cs.stackexchange.com/questions/54599", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/32260/" ]
A $k$-sorted array is one in which every element is at most distance $k$ from its position when the array is sorted. The complexity of sorting such array is $O(n\log k)$. But if $k=1$, then $\log k=0$ so what happens? What is the complexity of sorting an array where each element is at most one place away from its sort...
When we say an algorithm runs in $O(\lg k)$ time, that is an <em>asymptotic</em> statement. It means that there exists a constant $c$ such that when $k$ is sufficiently large, the running time is $\le c \lg k$. It says nothing about what happens when $k$ is small. In particular, if we say an algorithm runs in $O(\lg...
There is hidden linear time to perform merge part of sorting algorithm.<br> Linear is less than loglinear, so it was not visible. $\log1=0$, but it means that you will not e.g. heapify, just merge in $O(n)$ (heap structure in case of <em>1-sorted</em> array degrades to swapping consecutive elements to perform sort). I...
https://cs.stackexchange.com
27,375
[ "https://physics.stackexchange.com/questions/27375", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/184/" ]
For a $n$-qubit state $\rho$ we perform all projective measurement consisting of one-particle measurements in the same basis, that is, $$p_{i_1i_2\ldots i_n}(\theta,\varphi) = \text{Tr}\left \{ \rho [P_{i_1}(\theta,\varphi)\otimes P_{i_2}(\theta,\varphi) \otimes \ldots\otimes P_{i_n}(\theta,\varphi)] \right\},$$ wh...
Working out an explicit case of Alex's construction, you get the two states $$ \rho_1 = \frac{1}{2} \left(|0\rangle\langle 0| \otimes |+ \rangle \langle + | + |1\rangle\langle 1| \otimes |- \rangle \langle - |\right) = \frac{1}{4}\left(\begin{array}{cccc}1 &amp; 1 &amp;&amp; \\ 1 &amp; 1 &amp; &amp; \\ &amp; &amp; \pha...
It does not suffice for $n&gt;1$. The idea is that density matrix for qubit may be expressed as $\frac{1}{2}\bigl(\hat{1}+ \sum_{k=1}^3 v_k \hat\sigma_k\bigr)$, there $v$ is a 3D real unit vector. Now we should consider span of tensor products of such terms. For any fixed $v$ we have $2^n$ tensor products of $\hat{P...
https://physics.stackexchange.com
389,417
[ "https://physics.stackexchange.com/questions/389417", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/171660/" ]
I'm reading book in classical physics where it mentioned that, quote: <blockquote> " the transformation matrix (of two different cartesian coordinate systems) was orthogonal, so the transformation was reflection or a rotation (Goldstein, Poole, and Safko,2002)". </blockquote> I was thinking that for a reflection al...
Gamma matrices are defined by the Clifford algebra $$ \{\gamma^\mu, \gamma^\nu\}= 2g^{\mu\nu}\mathbb I_n \,. $$ So, you see the index $\mu$ in $\gamma^\mu$ runs from $0$ upto $D-1$ where $D$ is the number of spacetime dimensions. It does not mean $\gamma^\mu$ is a vector. The $\mu$ index here only tells you how many ...
Where did you get this formula $\bar{\psi}_a=\psi_a\gamma^0$? It is wrong, and one of the reasons is complex conjugation is missing. So components of $\gamma$- matrices have index $\mu$ for different $\gamma$- matrices and spinor indices $a,b$. I usually write spinor indices as lower indices. So the formula should be...
https://physics.stackexchange.com
252,308
[ "https://softwareengineering.stackexchange.com/questions/252308", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/-1/" ]
I've recently read several articles about the advantages of the composition over inheritance. Their authors said that you can always replace inheritance with composition (to be precise, they say they don't know such situations where it can't be done). However, I can't think how to do this in the following case: <pre><...
This example is a bit contrived but here's one way. You seem to have things going on here - operations and reading. The reading should be done by Reader and the operations can be performed by a different class. <pre><code>class ReadOperations { private Reader reader; public Int32 ReadSum() { ...
Sure, for example you can pass the reading behaviours into the <code>Reader</code> class from outside: <pre><code>class Reader { private Func&lt;Int32&gt; read; public Reader(Func&lt;Int32&gt; read) { this.read = read; } public Int32 ReadSum() { return read() + read(); } ...
https://softwareengineering.stackexchange.com
85,901
[ "https://electronics.stackexchange.com/questions/85901", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/16695/" ]
I'm a little confused about the 011 condition in the Full-Subtractor truth table. <img src="https://1.bp.blogspot.com/-szr3mfp33Xg/UI61JNVaKYI/AAAAAAAAADc/XZsRra96u1E/s1600/full+subtractor.jpg" alt="enter image description here"> I don't get how the output can be D = 0, B = 1. Since D = A - B - C, that gives D = 0 -...
"How does a difference of 0, and borrow of 1 represent a -2? Makes no sense at all." That makes perfect sense, because a borrow is in effect a -1 in the next column (to the left), which has a weight twice the weight of the column we are working on. Hence when a 1 in your column represent 1, borrowing (= subtracting) 1...
Think about the <em>difference</em> and <em>borrow</em> in the reverse order. A borrow of 1 and a difference of 0 can be interpreted as a two-bit result of \$10_2\$. If your binary number system allows negative numbers then they are almost certainly two's-complement, and \$10_2\$ in two's-complement is indeed equivalen...
https://electronics.stackexchange.com
253,690
[ "https://physics.stackexchange.com/questions/253690", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/113431/" ]
When we're talking about a wave, just a singular sinusoidal wave, what exactly is a 'phase'? I came across a question that gave values of frequency ($550$Hz), and speed ($330$m/s). The question then asked to find how far apart two points are that differ in phase by $\frac{\pi}{3}$ rad. The answer came out to be $0.1$...
The clue here is " how far apart". The question is asking for distance which must be in terms of the wave's wavelength. Phase measures fractions of wavelength. And you are given information of the wave's speed and the periodic time in which it propagates (frequency). The fundamental "distance = rate * time" applies in...
<blockquote> Phase is the argument of the wave. </blockquote> This is the definition written in my book and quite hard for beginners (<em>like me</em>). So the question "What is phase?" <blockquote> Phase is the quantity which tells us the status of the wave. </blockquote> In normal x-y grid like x-axis tells ...
https://physics.stackexchange.com
40,505
[ "https://dba.stackexchange.com/questions/40505", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/5591/" ]
This might be some ambiguous but I have not much info about this so I need some start point; As a general idea; in conventional RDBMS', there are a DB engine and storage of data. We use the language 'SQL' to access these datas on the DB. To access datas, is there other ways different from using SQL queries? Can we 'fi...
I don't see a reason why you should be using a DSN. Create the linked server using the SQL Server Native Client directly: <pre><code>EXEC master.dbo.sp_addlinkedserver @server = N'MAIN', @srvproduct = N'SQLServ', -- it’s not a typo: it can’t be “SQLServer” @provider = N'SQLNCLI', @datasrc = N...
The IP address. If it's an IP it gets interpreted as TCPIP
https://dba.stackexchange.com
59,557
[ "https://stats.stackexchange.com/questions/59557", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/17953/" ]
I'm trying to determine if the exponential distribution is a good model for a data set that I'm exploring. It doesn't have to be precise. I'm using the data for capacity planning (if it's a good fit) and for my own learning. I found a data set that I have ready access to and I wanted to test to see it fit a known distr...
It depends on what you want to use this for. I can easily imagine situations in capacity planning where you would be most interested in extreme occurrences, as these peak events are what strains capacity most. If that is the case, then your tail behaviour would be a problem. I can also imagine other situations where th...
I know this is not really a direct answer to your question, but I was looking for a qq-plot function for the exponential distribution in R and found this. It may be helpful for other people browsing this page with the goal to find a qq-plot function for exponential distribution. <pre><code>"qqexp" &lt;- function(y, l...
https://stats.stackexchange.com
560,976
[ "https://electronics.stackexchange.com/questions/560976", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/218949/" ]
In the case of a noisy process value, what are the pros and cons of filtering the process value (PV) versus filtering the controller output (CO) or maybe both? Filtering PV changes the process model and affects PID constants. I was told that ISA standard recommend not filtering the process value in a PID but I didn't f...
First, fixing up your process value measurement is always better, assuming that it's a noisy measurement and that the value itself isn't bouncing around. If the PID controller is a linear device, then -- aside from what the controller &quot;thinks&quot; is happening -- there's absolutely no difference between filtering...
I'd rather filter in the forward path, i.e. the output. Here's why: Consider a loop with forward gain A (includes transfer functions of both plant and controller) and feedback gain B (often 1). CL gain is A/(1+AB) We are deciding where to add LPF = 1/(1 + s/p). We can put it into A or into B. The denominator of the CL ...
https://electronics.stackexchange.com
187,464
[ "https://softwareengineering.stackexchange.com/questions/187464", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/57196/" ]
I am working on a product in which the responsibility of one of the modules is to parse XML files and dump the required content in a database. Even though the present requirement is only to parse XML files, I want to design my parsing module in a fashion that I can support any kind of files in the future. The reason fo...
I have a couple of concerns: <ol> <li>I would make sure you actually need a generic design before implementing one. Are you sure you're going to need file types other than XML? If not, why code for them? If you eventually need it, you can retrofit your code at that point. It won't take much longer, you will probab...
Your design is not a best option. By your design, the only way to use it: <pre><code>ProductDataXMLTYPE parser = new ProductDataXmlParser&lt;ProductDataXMLTYPE&gt;().parse(input); ProductDataTextTYPE parser = new ProductDataTextParser&lt;ProductDataTextTYPE &gt;().parse(input); </code></pre> We can't see too much be...
https://softwareengineering.stackexchange.com
113,314
[ "https://softwareengineering.stackexchange.com/questions/113314", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5184/" ]
I do line of business apps where the all the other developers are used to doing basic CRUD apps or are focused solely on making pretty/functional interfaces and I am getting the following a lot. "With the way we use to do it Employee would have all the things you could possibly do with an employee." And it was true. ...
It seems that what you've described (i.e. Employee class having ALL possible code that you could do with an employee) is an extremely common pattern that I've personally seen quite a lot. Some of that code I've written myself before I knew any better. What starts off as a class that is supposed to represent a single ...
It can be a problem. Particularly if you name things badly. But there are a number of solutions to it without resorting to complex classes. Heck, a class with too many methods can be equally difficult to navigate with Intellisense. Try using namespaces (C#) or packages (Java), or whatever similar concept your language...
https://softwareengineering.stackexchange.com
36,308
[ "https://mechanics.stackexchange.com/questions/36308", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/22161/" ]
I've been searching for some cars on the internet and I've observed that newer cars get smaller engines. For instances, I've found a Ford Focus diesel 1.6, or even a Mercedess A Klass 2015 diesel has a 1.6 engine, which seem to be both good. Could you explain why?
Smaller engines provide a myriad of benefits versus huge engines. Mainly it's fuel efficiency which also translates into emissions. The less fuel you burn, the fewer amount of gasses that get expelled from the engine. Not only that, but weight is something to consider as well. Space in the engine bay for more accessor...
As cloudnyn3 says, it's all about improvements in engine design - a modern 1.4 can produce just as much power as a 2.0 from 20 years ago, but with much better fuel consumption and emissions - plus it's smaller and lighter, which helps again - you get more space in the car for other things, and the better fuel economy m...
https://mechanics.stackexchange.com