text
stringlengths
49
10.4k
source
dict
homework-and-exercises, electromagnetism, magnetic-fields, torque, induction Title: Spinning a bar magnet above a disc I'm preparing for a physics exam and this scenario was in one of the past papers: If I have a horizontal bar magnet connected to a motor, and directly underneath there is a horizontal copper disc that is free to spin, when I turn the motor on and the magnet begins to rotate above the disc, which direction will the disc rotate? I initially thought that as the magnet moves, eddy currents will be induced directly under where the magnet poles just moved away from, to make a magnetic field in the same direction as the pole that just moved, by Lenz's law. So induced N and S poles always lagging behind the moving N and S poles of the magnet, so the disc will always be repelled and hence rotate opposite to the magnet. However, the answers say that the disc will rotate in the same direction as the magnet. The explanation is that "interaction of the magnetic fields produces a drag torque that tries to rotate the disc in the same direction as the spinning magnet" but this doesn't really explain why. Could someone please help explain why the disc will chase the magnet in the same direction? What is wrong with my reasoning- how should I be properly approaching these induction questions? Thank you very much. This experiment is called Arago's Disc, and is essentially no different from the one in which you drop a magnet into a copper tube and - surprisingly - it take much longer than expected to fall. In both cases the explanation is that the changing magnetic field induces eddy currents in the copper disc, in a manner which opposes the change in flux, according to Lenz' Law. These currents produce magnetic fields in directions which opposes the change in the magnetic field from the magnet. Induced currents ahead of the magnet push against the magnet, while induced current behind the magnet pull on it. (I find it difficult to explain exactly how the opposing magnetic fields create forces between the magnet and the copper disc. All the websites I've read skip over the issue as I am doing here. I shall try to rectify this later.) Like mechanical friction, this magnetic friction opposes relative motion between the magnet and disc. Lenz' Law is related to le Chatelier's Principle in chemistry, which can be stated as a much broader principle : When a system is in dynamic equilibrium, any change in the status quo prompts an opposing reaction from the system.
{ "domain": "physics.stackexchange", "id": 32808, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, electromagnetism, magnetic-fields, torque, induction", "url": null }
ds.data-structures I think I know how to provide the queue operations in $\Theta(1)$ time and delete and depth in $\Theta(\lg n)$ time (all expected amortized). Is it possible to do better? My proposed solution is as follows: Maintain a balanced tree with $O(1)$ operations at the ends. Nearly any finger tree will do. This tree will store the keys in queue order at its nodes. Also, annotate every non-spine node with its number of descendants. Keep a hash table mapping keys to pointers to nodes in the tree. To enqueue a key k, add k to the back of the tree. This invalidates $O(1)$ node pointers and creates $O(1)$ new node pointers, so we need only perform $O(1)$ hash table operations. Dequeue is similar. To delete a key, we look it up in the hash table and find its location in the tree, then delete it from the tree. This takes $O(\lg n)$ time in the tree, and invalidates $O(\lg n)$ slots in the hash table. We must also maintain non-spine node size annotations in the tree, but this also only takes logarithmic time. To find the depth of a key, we first annotate the spine nodes of the tree with their number of descendants. This takes $O(\lg n)$ time. We then look up the key in the hash table and find its location in the tree. We then follow parent pointers until we reach the root, summing the annotations at left siblings. Note that this is the exact depth. Your solution can be modified to do everything in $O(1)$ amortized time. Instead of maintaining a balanced tree, just keep track of the number of successful enqueue operations (those in which something was actually added to the back of the queue) and attach that number to queue along with the item during a successful enqueue operation. To find the depth of a key, just take the difference between the number of successful enqueues when it was enqueued, and the number of successful enqueues when the item currently at the front of the queue was enqueued. Note that this gives exact depth.
{ "domain": "cstheory.stackexchange", "id": 993, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ds.data-structures", "url": null }
error-correction, stabilizer-code, linear-algebra, encoding Context for the claim in the paper $\newcommand{\ket}[1]{|#1\rangle}$ Remember that we are trying to construct a code that encoded $k$ "logical" qubits into $n$ "data" qubits. Obviously, the state of $n$ data qubits lives in the Hilbert space $\mathbb{C}^{2^n}$. The Pauli group $E$ is made of the $n$-fold tensor products of two-dimensional Pauli operators. Hence, the elements of $E$ act naturally on $\mathbb{C}^{2^n}$. In fact, we can easily write any $p \in E$ as a $2^n \times 2^n$ matrix operator $\Gamma_p$ [1]. Remember that these operators $\Gamma_p$ are unitary. Now, we know that the Pauli group $E$ has $4^{n+1}$ elements, but the group $S$ only has $4 \times 2^{n-k}$. All these elements can be written as $2^n \times 2^n$ matrix operators as above. These operators as well act naturally on the $\mathbb{C}^{2^n}$ Hilbert space. We have also established that all elements of $S$ commute. The claim from the paper is that simultaneously diagonalizing the matrix operators of $S$ will decompose $\mathbb{C}^{2^n}$ into orthogonal eigenspaces.
{ "domain": "quantumcomputing.stackexchange", "id": 5203, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "error-correction, stabilizer-code, linear-algebra, encoding", "url": null }
quantum-field-theory, s-matrix-theory, ward-identity $$\langle f| i\rangle = g^4\int dx_1 dx_2 dx_1' dx_2' e^{i(k_1x_1+k_2x_2-k_1'x_1'-k_2'x_2')}\frac{1}{16}\langle0|T\phi(x_1)^2\phi(x_2)^2\phi(x_1')^2\phi(x_2')^2|0\rangle + \text{graveyard of neglected contact terms}$$ The devil led me astray, since the scattering amplitude should go as $g^2$, not $g^4$! This now leads me at last to my question, in two parts:
{ "domain": "physics.stackexchange", "id": 66770, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, s-matrix-theory, ward-identity", "url": null }
quantum-mechanics, fermions, dirac-delta-distributions, grassmann-numbers, coherent-states Title: Grassmann variables and orthogonality of coherent fermionic states Let a coherent fermionic state $$ \left|\phi\right> := \left|0\right> + \left|1\right> \phi,\tag{0} $$ where $\phi$ is a Grassmann number (i.e. it anticommutes with other Grassmann numbers). Now, I wish to see if it's orthogonal to another state $\left|\phi'\right>$: $$ \left<\phi|\phi'\right> = \left[ \left<0\right| + \phi \left<1\right| \right] \left[ \left|0\right> + \left|1\right> \phi' \right] = 1 + \phi\phi' \equiv e^{\phi\phi'},\tag{1} $$ where I've used $\left<n|m \right>=\delta_{n,m}$ and the Taylor series for the exponential. Now, this should be a delta function, so \begin{align} \int d\phi\, e^{\phi\phi'} f(\phi) =& \int d\phi\, e^{\phi\phi'} (a + b\phi)\\ =& \int d\phi\, (1 + \phi\phi') (a + b\phi) \\ =& \int d\phi\, (a + b\phi + a\phi\phi')\\ =& b + a\phi' \neq f(\phi').\tag{2} \end{align} Why do I find that (1) does not satisfy the definition of a delta function? Also, in my lecture notes I've seen that I should get $$ \left<\phi|\phi' \right> = \phi - \phi',\tag{3} $$ which turns out to be a nicely behaving delta function. But in some other reference (eq 28.16) I've seen that (1) is correct! How can I derive (3)?
{ "domain": "physics.stackexchange", "id": 100235, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, fermions, dirac-delta-distributions, grassmann-numbers, coherent-states", "url": null }
information-theory, communication, channel-capacity Question 3 As above, yes, you can assume arbitrarily many i.i.d. copies of the channel between the sender and receiver. You are not necessarily increasing the rate because the definition of rate divides by the number of channel copies you used. There is a quantum-specific phenomenon that boosts quantum communication rates in a way that is classically impossible. This is called superadditivity and a good resource to understand it is to start with Section 13.1 of Mark Wilde's book for classical channels before moving onto later chapters for what changes when you look at quantum channels.
{ "domain": "quantumcomputing.stackexchange", "id": 5353, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "information-theory, communication, channel-capacity", "url": null }
c++, beginner, game } else { cout << "The Game Master takes 1 ring from peg " << x << "." << endl; break; } } while ((x != 1 && x != 2 && x != 3) || ((x == 1) && (PegOne == 0) || (x == 2) && (PegTwo == 0) || (x == 3) && (PegThree == 0)));
{ "domain": "codereview.stackexchange", "id": 11762, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, game", "url": null }
# Clock losing time puzzle The question goes as: A wall clock and a Table clock are set to correct time today on 10 pm. The wall clock loses 3 minute in 1st hour, 6 minutes in the second hour and 9 minutes in the third hour and so on. The table clock loses 5 minutes in the 1st hour, 10 minutes in the second hour and 15 minutes in the third hour and so on. When will they show the same time? My approach: In the first hour, the difference between the two clocks would be $2$ (obtained from $5-3$) minutes. In the second hour, it'll be four minutes and so on. This would form an arithmetic progression with $a$ = 2 and $d = 2$. I, then, formulated the problem as: $$2 + 4 + 6+ 8 + \dots + n = 720$$ The RHS is $720$ because I assumed they'll meet after 12 hours. With this, I got the root as $23.337$ hours, so I arrived at the answer as $10 \, \text{PM} + 23.337$ hours i.e $9:20 \, \text{PM}$. Is this correct? EDIT: I realised this equation won't give an integral answer, and we need one as $n$ on the LHS represents the number of terms. So instead of that, I wrote it as: $$2 + 4 + 6 + \dots + n = 720 \times k$$ where $k \in (1,2,3,4, \dots)$. Using this method, for $k = 9$, I get the value of $n$ $\text{as}$ $80 \, \text{hours}$. Does this seem correct?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347875615794, "lm_q1q2_score": 0.8141242269802133, "lm_q2_score": 0.8354835411997897, "openwebmath_perplexity": 2276.1167408934866, "openwebmath_score": 0.8130736351013184, "tags": null, "url": "https://math.stackexchange.com/questions/2878715/clock-losing-time-puzzle" }
anisotropic-diffusion Title: Perona Malik Anisotropic Diffusion Filter in HLSL I'm trying to write a perona malik filter in HLSL texture2D Input0; sampler2D Input0Sampler = sampler_state { Texture = <Input0>; MinFilter = Point; MagFilter = Point; MipFilter = Point; AddressU = Clamp; AddressV = Clamp; }; struct VertexShaderInput { float4 Position : POSITION0; float2 TextureCoordinate : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : POSITION0; float2 TextureCoordinate : TEXCOORD0; }; struct PixelShaderOutput { float4 Index0 : COLOR0; }; // input texture dimensions static float w = 1920 - 8; static float h = 1080 - 8; static const float2 pixel = float2(1.0 / w, 1.0 / h); static const float2 halfPixel = float2(pixel.x / 2, pixel.y / 2); static const float3x3 hN = { 0, 1, 0, 0, -1, 0, 0, 0, 0 }; static const float3x3 hS = { 0, 0, 0, 0, -1, 0, 0, 1, 0 }; static const float3x3 hE = { 0, 0, 0, 0, -1, 1, 0, 0, 0 }; static const float3x3 hW = { 0, 0, 0, 1, -1, 0, 0, 0, 0 }; static const float3x3 hNE = { 0, 0, 1, 0, -1, 0, 0, 0, 0 }; static const float3x3 hSE = { 0, 0, 0, 0, -1, 0, 0, 0, 1 }; static const float3x3 hSW = { 0, 0, 0, 0, -1, 0, 1, 0, 0 }; static const float3x3 hNW = { 1, 0, 0, 0, -1, 0, 0, 0, 0 };
{ "domain": "dsp.stackexchange", "id": 1270, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "anisotropic-diffusion", "url": null }
Solve $2x+y = w, -3x=z$ for $x,y$ to get $x=-{1 \over 3} z$ and $y={2 \over 3} z+w$. Hence for any $(w,z)$ there is a unique $(x,y)$ such that $T(x,y) = (w,z)$. It follows that $T$ is injective and surjective. Hint: 1. One-to-one: Let $u, v$ as you have them. Show that $T(u)=T(v) \implies u=v$. You will need to solve a two-by-two system of equations. 2. Onto: Show that $\dim \Im(T)=2$. How? By finding two vectors in the image of $T$ that are linearly independent. For example: what is the image of the vector $e_2=\begin{bmatrix} 0 \\ 1 \end{bmatrix}$ under $T$? Can you find another one, say $z$ so that $T(e_2)$ and $T(z)$ are linearly independent (and therefore span $\mathbb R^2$)? Of course as @kevinzakka comments, it suffices to show that $T$ is one-to-one. This is equivalent to $\dim Ker (T)=0$ and hence by the Rank - nullity Theorem you can conclude that $\dim \Im (T)=2$. • Since the image and the co-image are the same, all you have to show is one or the other. Usually proving it is one-to-one is easier. – Kevin Zakka Dec 9 '15 at 15:14
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9799765622193215, "lm_q1q2_score": 0.8405926440542913, "lm_q2_score": 0.8577681104440172, "openwebmath_perplexity": 99.98469886694613, "openwebmath_score": 0.9305991530418396, "tags": null, "url": "https://math.stackexchange.com/questions/1567310/prove-that-t-is-linear-one-to-one-and-onto" }
data-structures, arrays, search-trees, intervals Title: Why does a range query on a segment tree return at most $\lceil \log_2{N} \rceil$ nodes? If an array $A[1 \ldots N]$ is represented using a segment tree having sets in each interval, why does a range query $[L\ldots R]$ returns at most $\lceil \log_2{N} \rceil$ sets (or disjoint intervals)? If came across this statement while reading this answer. To quote: Find a disjoint coverage of the query range using the standard segment tree query procedure. We get $O(\log n)$ disjoint nodes, the union of whose multisets is exactly the multiset of values in the query range. Let's call those multisets $s_1, \dots, s_m$ (with $m \le \lceil \log_2 n \rceil$).
{ "domain": "cs.stackexchange", "id": 16009, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "data-structures, arrays, search-trees, intervals", "url": null }
in acids, alkaline and neutral medium. When did organ music become associated with baseball? Expert Answer . \end{align} It only takes a minute to sign up. How to determine the equivalent weight of CO2. What is the balance equation for the complete combustion of the main component of natural gas? Examples: (1) H 2 SO 4 + 2OH-= 2H 2 O + SO 4 2- Molecular weight of sulfuric acid (H 2 SO 4) = 98.07 g/mol. Find The Equivalent Weight, Equivalent Gram Number, And Normality Of KMnO4 Prepared Accordingly. Thus, potassium permanganate reacting by double decomposition has an equivalent weight equal to its gram molecular weight, 158.038/1 g; as an oxidizing agent under different circumstances it may be reduced to the manganate ion (MnO 42-), to manganese dioxide (MnO 2), or to the manganous ion (Mn 2+), with the equivalent weights of 158.038/1 g, 158.038/3 g, and 158.038/5 g, respectively. Asking for help, clarification, or responding to other answers. Do sinners directly get moksha if they die in Varanasi? But from the balanced reaction we can see that this ratio is $1:8$. And the $n$-factor of $\ce{HCl}$ is $1$. What's the fastest / most fun way to create a fork in Blender? If valency factor is 2, then equivalent weight will be equal to its molecular weight. So, the equivalent weight of $\ce{KMnO4}$ is. For the preparation of 1 litre of N/10 oxalic acid solution amount of oxalic acid required = 6.3 g Equivalent weight of oxalic acid = 126/2 = 63. The molar mass of potassium permanganate is 158 g/mol. 0 1. Trending questions. Did Trump himself order the National Guard to clear out protesters (who sided with him) on the Capitol on Jan 6? Finding mass percentage of components of a solid mixture. Molar mass of KMnO4 = 158.033949 g/mol This compound is also known as Potassium Permanganate.. In MnO 2, the oxidation state of Mn is + … Equivalent weight = molecular
{ "domain": "parafarmaciasip.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9473810525948927, "lm_q1q2_score": 0.8264453724789917, "lm_q2_score": 0.8723473730188543, "openwebmath_perplexity": 4129.517395354383, "openwebmath_score": 0.39839452505111694, "tags": null, "url": "http://parafarmaciasip.com/fall-out-vyr/kmno4-equivalent-weight-dfbe55" }
javascript, html, vue.js input { display: block; font-size: 16px; font-weight: bold; } canvas { border: 1px solid black; } <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script> <div id='app'> <input type='number' v-model='n' min='0' max='10' /> <canvas id='canvas' :height='height' :width='width'></canvas> </div>
{ "domain": "codereview.stackexchange", "id": 44369, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, html, vue.js", "url": null }
What if the friend guesses 18? 1/20 = 5%. Et cetera. In every case, from guess = 1 up to guess = 20, the probability of the die roll equaling the guess is 1/20 = 5%. The guess doesn't matter at all (as long as it falls between 1 and 20, clearly a guess of 42 has a 0% chance of being correct). Whatever the guess, whether the process for generating the guess is random, bad human-approximation of random, fixed, or anything else, as long as the guess is between 1 and 20, the probability of the roll matching the guess is 1/20. Mathematically, this is shown rigorously in @fblundun's answer - I'm trying to explain that math in an accessible way. • Yes, I think this is the clearest way to look at it, at least for a non-statistician such as the OP. No matter which number between 1 and 20 is guessed, there is a 1/20 chance that a roll of a fair d20 will result in that number. Therefore, the likelihood that the player guesses any particular number does not factor in. Nov 5 '21 at 17:21 The probability of your friend correctly predicting the outcome of the roll was 1 in 20. The probability of your friend correctly predicting that that specific number would be the outcome of the roll was 1 in 400. Let's say the friend predicted it would be a 20. If you'd have been equally impressed if he'd predicted it would be a 4, then you're in the first situation (1/20). If you don't care about a correct prediction unless it was a 20, you're in the second situation (1/400). Put another way, suppose you were watching your friend from behind a glass window, and you knew he was going to try to call the roll. If you said, "he will correctly predict the outcome of the roll" you'd have a 1 in 20 chance of being right. If you said, "he will correctly predict that he will roll a perfect 20" you'd have a 1 in 400 chance of being right.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9702399051935107, "lm_q1q2_score": 0.8064081560144102, "lm_q2_score": 0.8311430520409023, "openwebmath_perplexity": 614.6189777826722, "openwebmath_score": 0.8243175148963928, "tags": null, "url": "https://stats.stackexchange.com/questions/550800/is-there-a-1-in-20-or-1-in-400-chance-of-guessing-the-outcome-of-a-d20-roll-befo/550802" }
geology, geophysics, gravity, pressure Title: What is the pressure at the center of the Earth? In the question Does gravity increase the closer to the core you get?, it was determined that gravity reduces to zero at the center of the Earth. That is logical. However if pressure is proportional to mass and gravity, then would pressure also reduce to zero at the center of the Earth? If all the atoms in the center of the Earth are essentially weightless (equal gravity on all sides), then how can there be any pressure? And if there is no pressure, just weightless atoms, then could voids or bubbles form in the center of the Earth? And if a bubble did form, would its ‘skin’ not feel more gravity on the outward side of the bubble, thus inducing the void to grow? And if such a hypothetical void did grow at the center of the Earth, at what size would it stabilize? It is the pressure gradient that is proportional to the local gravitational force. When that force is integrated over a distance, the pressure gradient is integrated to accumulate a total pressure. The maximum occurs at the point towards which gravity is directed in a spherical mass, which is the center. True, gravity at that point is zero, but it and therefore the pressure gradient have already been integrated over the whole radius (and mass) of the Earth. Instead of zero, the pressure at the center will be a maximum. The pressure at the center of Earth is about 360 GPa [1]. Note carefully that, as expected where the gravity is locally zero, the total pressure levels off until its gradient is zero at the center; but the total pressure itself is maximized there instead of dropping to zero. From Ref. [1]. Reference 1. Lajos Volgyesi, M Moser; "The Inner Structure of the Earth", Periodica Polytechnica Chemical Engineering (1982) 26(3).
{ "domain": "earthscience.stackexchange", "id": 2617, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "geology, geophysics, gravity, pressure", "url": null }
def helper(self, candidates, idx, target): # base cases if target == 0: return [[]] if target < 0 or idx >= len(candidates): return [] result = [] # remember to give the current number another chance, rather than moving on (idx instead of idx+1) for arr in self.helper(candidates, idx, target-candidates[idx]): result.append(arr + [candidates[idx]]) # skip number result += self.helper(candidates, idx+1, target) return result """ """ class Solution_: def combinationSum(self, candidates, target): results = [] def backtrack(remain, comb, start): if remain == 0: results.append(list(comb)) return elif remain < 0: return for i in range(start, len(candidates)): # add the number into the combination comb.append(candidates[i]) # give the current number another chance, rather than moving on (i instead of i+1) backtrack(remain - candidates[i], comb, i) # backtrack, remove the number from the combination comb.pop() backtrack(target, [], 0) return results # Dynamic programming Dynamic Programming - 7 Steps to Solve any DP Interview Problem Patterns Grokking Dynamic Programming Patterns for Coding Interviews - Learn Interactively Dynamic Programming Fibonacci Numbers - Coderust: Hacking the Coding Interview Demystifying Dynamic Programming 5 Simple Steps for Solving Dynamic Programming Problems Calculating Fibonacci Numbers - Algorithms for Coding Interviews in Python Memoization and Dynamic Programming | Interview Cake Bottom-Up Algorithms and Dynamic Programming | Interview Cake Introduction to Dynamic Programming 1 Tutorials & Notes | Algorithms | HackerEarth leetcode/dynamic-programming-en.md at master · azl397985856/leetcode Dynamic Programming - 7 Steps to Solve any DP Interview Problem Dynamic Programming Dynamic Programming Dynamic programming is simple #3 (multi-root recursion) - LeetCode Discuss Patterns
{ "domain": "paulonteri.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9559813501370535, "lm_q1q2_score": 0.8218225111577803, "lm_q2_score": 0.8596637487122111, "openwebmath_perplexity": 6090.381773024074, "openwebmath_score": 0.30743175745010376, "tags": null, "url": "https://dsa.paulonteri.com/Data%20Structures%20and%20Algorithms%2016913c6fbd244de481b6b1705cbfa6be/Recursion%2C%20DP%20%26%20Backtracking%20525dddcdd0874ed98372518724fc8753.html" }
c#, generics, inheritance Title: Generic classes with inheritance/equals/comparison operators I would like to greatly reduce verbosity of following code fragment. What I'd like to do: Reduce number of occurrences of MaterialRangedParam<Value> and MaterialParam<Value>. C++ has typedef. C# doesn't. Is there keyword for own type of a class? Remove operator !=, operator ==, GetHashCode and Equals and make compiler generate them for me (the way C++ would do it). How can I do that? Additional info: I'm already aware that clone method offers functionality similar to ICloneable. I have no need to support ICLoneable at the moment. Usage pattern: Those items are going to be stuffed into several lists, arrays and hashtables, compared to each other, assign is going to be called often. Advice? public class MaterialParam<Value> where Value: System.IEquatable<Value>{ public string name = ""; public string shaderValueName = ""; public Value value;// = Value(); public void assignFrom(MaterialParam<Value> other){ name = other.name; shaderValueName = other.shaderValueName; value = other.value; } public MaterialParam<Value> clone(){ var result = new MaterialParam<Value>(); result.assignFrom(this); return result; } public override bool Equals(object obj){ if(!(obj is MaterialParam<Value>)) return false; MaterialParam<Value> other = (MaterialParam<Value>)obj; if((System.Object)other == null){ return false; } return (this.name == other.name) && (this.shaderValueName == other.shaderValueName) && (this.value.Equals(other.value)); } public override int GetHashCode(){ return name.GetHashCode() ^ shaderValueName.GetHashCode() ^ value.GetHashCode(); } public static bool operator !=(MaterialParam<Value> a, MaterialParam<Value> b){ return !(a == b); }
{ "domain": "codereview.stackexchange", "id": 13028, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, generics, inheritance", "url": null }
python, python-3.x, object-oriented, interview-questions, tic-tac-toe would become horiz_winning_line_found = abs(sum(self.board[y_pos])) == self.board_size also self._change_turn would simplify to def _change_turn(self) -> None: self.turn *= -1 Vertical check If you pass x_pos into self._check_state, then you can simplify the vertical winning line check to just vert_winning_line_found = all(self.board[r][x_pos] == self.turn for r in range(self.board_size)) or vert_winning_line_found = ''.join(self.board[r][x_pos] for r in range(self.board_size) == [self.turn] * self.board_size You are mixing terms like (rows, columns) with (x_pos, y_pos). I would suggest you rename (x_pos, y_pos) to (c, r), (col, row), (colNum, rowNum) or something to that effect so that everything is in terms of rows and columns. If you do end up passing x_pos and y_pos to self._check_state, here's a quick way to check whether x_pos, y_pos lie on the diagonal # NW to SE diagonal check_main_diag = x_pos == y_pos # SW to NE diagonal check_minor_diag = x_pos == self.board_size - 1 - y_pos then you can just do main_diag_winning_line = check_main_diag * all(self.board[i][i] == self.turn for i in range(self.board_size)) and something similar for minor_diag_winning_line
{ "domain": "codereview.stackexchange", "id": 43405, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, object-oriented, interview-questions, tic-tac-toe", "url": null }
electromagnetism, magnetic-fields, field-theory, conventions, notation $$ B^k = \epsilon^{ijk} F_{ij}. \tag{2}$$ Here you are now summing over all possible values for $i$ and $j$, not only over their permutations - but those indices $ijk$ which are not permutations of $123$ simply yield zero because the Levi-Civita symbol is zero for those indices.
{ "domain": "physics.stackexchange", "id": 36754, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, magnetic-fields, field-theory, conventions, notation", "url": null }
photochemistry Title: Photochemistry and steady state approximation I am unsure whether to ask this in physics or chemistry as there is overlap but I am taking this in a chemistry module. System A undergoes photophysical pathways: $$\ce{A + hv -> A\mathrm{*}}$$ $$\ce{A\mathrm{*} -> A + hv \tag{k1}}$$ $$\ce{A\mathrm{*} + B -> A + B\mathrm{*} \tag{k2}}$$ $$\ce{B\mathrm{*} -> B + hv \tag{k3}}$$ $$\ce{B\mathrm{*} -> C \tag{k4}}$$ It wants me to show that the quantum yield of energy transfer is equal to the quantum yield of fluorescene B and the quantum yield of photochemical conversion from B to C. I am quite stuck on this problem. I assume the steady state approximation needs to be employed in order to determine quantum yields for the processes asked for. I am wondering what the general strategy would be to answer this question? The processes are absorb light into A, and then A* has only two pathways, i.e. fluoresces and reacts with B to form B*. The B* has only two pathways, it fluoresces and converts to C. All B* molecules must therefore follow one of these paths, so the sum of yields of B* (paths fluorescence + forming C) must be the same as the yield to form B* in the first place, thus you don't need to do a calculation. In general if you have to find a yield of any process x this is, $\displaystyle \phi_x = \frac{\text{rate of process x}}{\text{rate of absorption}} \equiv \frac{\text{rate const x} }{\text{sum of all other rate constants from x}}$.
{ "domain": "chemistry.stackexchange", "id": 9736, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "photochemistry", "url": null }
java, combinatorics } scan.close(); ArrayList<ArrayList<Person>> p = generatePerm(hm.keySet()); ArrayList<Rule> ruleSet = parseRules(hm); System.out.println("\nRule set: " + ruleSet + "\n"); boolean noValid = true; outer: for (ArrayList<Person> sub : p) { for (Rule r : ruleSet) { if (!r.isValid(sub)) { continue outer; } } System.out.println("Valid: " + sub.toString().replace("false", "is knave").replace("true", "is knight")); noValid = false; } if (noValid) { System.out.println("No valid solutions."); } }
{ "domain": "codereview.stackexchange", "id": 9931, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, combinatorics", "url": null }
# How many distinct ways to climb stairs in 1 or 2 steps at a time? I came across an interesting puzzle: You are climbing a stair case. It takes $n$ steps to reach to the top. Each time you can either climb $1$ or $2$ steps. In how many distinct ways can you climb to the top? Is there a closed-form solution to the problem? One can compute it by creating a 'tree' of possibilities of each step. That is, I can either take 1 or 2 steps at each stage and terminate a branch once it sums to $n$. But this is would get really unwieldy very quickly since the maximum number of nodes in a binary tree is $2^{n+1}-1$, i.e., exponential. Is there an easier way to solving this puzzle? Let $F_n$ be the number of ways to climb $n$ stairs taking only $1$ or $2$ steps. We know that $F_1 = 1$ and $F_2 = 2$. Now, consider $F_n$ for $n\ge 3$. The final step will be of size $1$ or $2$, so $F_n$ = $F_{n-1} + F_{n-2}$. This is the Fibonacci recurrence.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9912886157996524, "lm_q1q2_score": 0.8594826918063857, "lm_q2_score": 0.8670357735451834, "openwebmath_perplexity": 185.00184216765106, "openwebmath_score": 0.8375009298324585, "tags": null, "url": "https://math.stackexchange.com/questions/789804/how-many-distinct-ways-to-climb-stairs-in-1-or-2-steps-at-a-time/1376123" }
phase, temperature Title: Why does the distance between molecules increase when the temperature is raised? I have learnt that when we heat ice-like substances it changes to water and when I asked my teacher she said that the distance between molecules increases. When I thought about it a bit more a question arose: Why does the distance between the molecule increase as we raise the temperature? The answer "the distance between molecules increase" is incomplete if not plain wrong. Temperature is an effect of energy present. Basically, it's an effect of little movements and vibrations of molecules and atoms due to their energy. In an crystal, the energy of the molecules is so low, that they don't vibrate and move enough to break the structure. The more energy you put into the system, the more the molecules move. At one point, the movement is too much to keep the molecules in place, the crystal structure breaks apart, the ice melts. A liquid (NOT WATER, IT IS A SPECIAL CASE) has lower density than the crystal because the molecules are moving around a lot and "need more space".
{ "domain": "chemistry.stackexchange", "id": 9906, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "phase, temperature", "url": null }
momentum Title: Question about the effects of mass transfer on momentum Two boats move parallel to and towards each other on a stagnant lake with the same speed. At the moment they are side by side a box is being transferred quickly from the first boat to the other. I am asked the mass of the boat that takes the box with the mass of the first boat, its speed, the box's mass, the other boat's mass and its speed before and after having the box transferred. I have checked the solution and this is a simple momentum problem and I can understand that there is going to be a change in momentum for each boat since one loses mass and the other gains it but why should the change in momentum be equal for the two objects? I know about the conservation of momentum but the proof given for C.o.M is based on the fact that when two objects interact they exert an equal amount of force on each other for an equal amount of time which results in an equal impulse and thus equal change in momentum. Like when there is a collision or a firing of a cannon ball. There are force pairs that make an equal impulse on both bodies possible. But I can't see that in this example. Where are the force pairs? I mean, yes, we could argue that the box was carried by force but I believe we would still have done the same calculations if the box had just disappeared on one boat and then had emerged on the other. How and why would that work? And how does this compare to an example where there is only one boat moving with constant speed and then a box emerges out of nowhere. How would we calculate the change in velocity? I hope my understanding of momentum isn't completely flawed. Suppose I'm in the first boat carrying the mass, $m$, and you're in the second boat. And let our closing speed be $v$. As we pass I drop the mass into your boat. I do this without changing the velocity of the mass, so no force is exerted on me and my boat carries on at an unchanged speed.
{ "domain": "physics.stackexchange", "id": 41617, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "momentum", "url": null }
stim Am I correct? Yes, this is a good definition of a detector. Note that the binary sum of a set of measurement outcomes needs to be deterministic to be able to use it as a detector. For example, a single measurement outcome from measuring a qubit in the state $|0>$ in the + basis can't be used as a detector. But if the measurement is done in the computational basis one can define a detector: $m_1 = 0$.
{ "domain": "quantumcomputing.stackexchange", "id": 5542, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "stim", "url": null }
java, performance, swing, cellular-automata That's your engine - it's really got two different pieces to it; a factory that creates a new state, and then a calculator that figures out what the state looks like. The only thing that is missing (because in your design, it is implicit), is a way to notify the rest of the application of what the changes are. It's completely fine to broadcast the entire grid as the "new state", but you will eventually discover faster alternatives. for (int h = 0; h < board_size.height; h++) for (int w = 0; w < board_size.width; w++){ try{ if (grid[h][w] == black) g.setColor(black); else g.setColor(white); g.fillRect(h * cell_size, w * cell_size, cell_size, cell_size); } catch (ConcurrentModificationException cme){} } There's your view. He needs to know how to draw live and dead cells, but doesn't need to know anything about the rules that choose cells which are alive or dead. Make separate classes for each of those, and wire them together. Notes on style: your code here is difficult to read, because of some of the choices you are making. For readability among a large, respectful audience... make different choices. private static final Color white = Color.WHITE, black = Color.BLACK; One variable definition per line. Static constants are normally spelled with UPPER_CASE names. Notice the example provided by java.awt.Color Where possible, you should prefer to inject your dependencies. public CA_DriverV2(){ board = new Board(); board.setBackground(white); A better alternative would be to pass in a correctly initialized Board public CA_DriverV2(Board board){ this.board = board;
{ "domain": "codereview.stackexchange", "id": 9789, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance, swing, cellular-automata", "url": null }
formal-languages, turing-machines, lambda-calculus, computation-models Title: Turing Machine for the Language $L=\{(a^n)b(a^n)b(a^n) | n\geq0\}$ Turing Machine for the Language $L=\{(a^n)b(a^n)b(a^n) | n\geq0\}$ Here is what I have tried: 1. Starting State Read $a$, Write $x$, Move Right, Go To 2 Read $x$, Write $x$, Move Right, Go To 1 Read Bottom, Go to State YES. 2. Looking for $ab$ Read $b$, Write $b$, Move Right, Go To 3 Read $a$, Write $a$, Move Right, Go To 2 3. Middle Segment Read $a$, Write $x$, Move Right, Go To 4 Read $x$, Write $x$, Move Right, Go To 3 4. Looking for $ab$ Read $b$, Write $b$, Move Right, Go To 5 Read $a$, Write $a$, Move Right, Go To 4 5. Last Segment Read $a$, Write $x$, Move Right, Go To 6 Read $x$, Write $x$, Move Right, Go To 5 6. Back to Beginning Read $x$, Write $x$, Move Left, Go To 6 Read $a$, Write $a$, Move Left, Go To 6 Read $b$, Write $b$, Move Left, Go To 6 Read Bottom, Write Bottom, Move Right, Go To 1 However the problem is that it Accepts the Empty String but the Smallest Acceptable Input is $bb$. Please help in resolving the issue. Implicit Information Bottom means Blank Symbol, often denoted by B Starting State means $q_o$ $\Sigma = \{a,b\}$ (Input Alphabet) $T = \{a,b,x,Bottom\}$ (Tape Alphabet) YES means Accept State Please check the start state, since your TM will accept when its Bottom, which from your explanation is Blank. That should be the reason for the TM accepting an empty input. Also, you do not have any means for checking a $bb$ input at the start.
{ "domain": "cs.stackexchange", "id": 19877, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "formal-languages, turing-machines, lambda-calculus, computation-models", "url": null }
ros Title: Will declaring a metapackage dependency pull all children packages I have meta package structured like so catkin_ws/src/vision_common/ vision_common/ (a subpackage in the package) vision_msgs/ vision_3d/ I want to use the vision_msgs in another package. Is it sufficient to do <run_depend>vision_common</run_depend>and generate_messages( DEPENDENCIES vision_msgs ) In the other package? I'm running into trouble with the following error: CMake Error at /home/vision/catkin_ws/build/planning_common/cmake/planning_common-genmsg.cmake:3 (message): Could not find messages which '/home/vision/catkin_ws/src/planning_common/srv/SimplePlanningSrv.srv' depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
{ "domain": "robotics.stackexchange", "id": 15305, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
algorithms, complexity-theory, algorithm-analysis, approximation Often instances also comes with a natural size function (sometimes several). We denote the size of an instance $\mathcal{I}$ by $|\mathcal{I}|$. A (deterministic) approximation algorithm for a minimization problem gets as input an instance $\mathcal{I}$ and outputs a feasible solution $A(\mathcal{I}) \in F_{\mathcal{I}}$ (sometimes we allow an approximation algorithm to relax the feasibility constraints — such an algorithm is known as a bicriteria approximation algorithm). The algorithm has approximation ratio $\rho(n)$, or that it is a $\rho(n)$-approximation (just different terminology), if for all $\mathcal{I}$, $$ \phi_{\mathcal{I}}(A(\mathcal{I})) \leq \rho(|\mathcal{I}|) \min_{x \in F_{\mathcal{I}}} \phi_{\mathcal{I}}(x). $$ In words, the approximation algorithm is guaranteed to returns a solution which is within a multiplicative factor of $\rho(n)$ of the optimal solution, where $n$ is the size of the instance. (Sometimes this definition is relaxed by also allowing a small additional additive error.) For a randomized approximation algorithm, we require this guarantee to hold in expectation, with constant probability, or with high probability — different algorithms will have different guarantees. Maximization problems are handled similarly, the guarantee becoming $$ \phi_{\mathcal{I}}(A(\mathcal{I})) \geq \rho(|\mathcal{I}|)^{-1} \max_{x \in F_{\mathcal{I}}} \phi_{\mathcal{I}}(x). $$
{ "domain": "cs.stackexchange", "id": 19128, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, complexity-theory, algorithm-analysis, approximation", "url": null }
charge, notation, density Title: Why is charge $= nALe$? Sorry if this question is a bit broad but I can't find any info on this by just searching. The equation $q = neAL$ where $L$ is the length of a conductor, $A$ is the area of cross section, $n$ is the number of charges and $e$ is the fundamental charge. This equation clearly does not make sense from a dimensional point of view at first glance. So why is it true and why is it assumed true in most derivations for charge density in terms of drift velocity? $n$ is the particle density: Number of particles per cubic meter in SI units. $e$ would be the charge on a particle (Coulombs), here equal to the elementary charge (they could be protons). With that I think that you will see the the dimensions are correct.
{ "domain": "physics.stackexchange", "id": 70096, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "charge, notation, density", "url": null }
Posting the trivial estimates so that we can measure progress. Assume that the side of the hexagon has length $1$, and that the radius of the circle is $r$. The area of a single hexagon is then $6\cdot\sqrt3/4=3\sqrt3/2$. Let $N$ be the number of hexagons inside the circle. Their total area is less than that of the circle, so we get the inequality $$\frac{3\sqrt3 N}2<\pi r^2.$$ On the other hand the hexagons cover the concentric circle of radius $r-2$ completely. Therefore we get another inequality $$\frac{3\sqrt3 N}2>\pi (r-2)^2.$$ The midway point gives then the ballpark estimate of $$N\approx\frac{2\sqrt3\pi(r-1)^2}9$$ together with the bound on the absolute value of the error $$|\Delta N|<\frac{4\sqrt3\pi r}9.$$ The link by Chris Culter suggests that it may be possible to get an error term of order $r^{2/3}$. The problem considered there is about the number of lattice points, so it is not exactly equivalent.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9669140235181257, "lm_q1q2_score": 0.8036438766122043, "lm_q2_score": 0.8311430562234877, "openwebmath_perplexity": 358.758935714033, "openwebmath_score": 0.7562983632087708, "tags": null, "url": "https://math.stackexchange.com/questions/1283085/hexagon-packing-in-a-circle" }
machining Title: When milling, is there such a thing as a cut that is too small? I was milling a pocket recently with a 7/16in endmill. It came out 20 thousandths undersized. Worn tool maybe? To try to fix this, I expanded the coordinates by 10 thou and milled the pocket again. Surprisingly, when I measured afterward it had barely changed. My guess is that the cut was too light and the endmill was deflecting instead of cutting? Is that likely what happened? I didn't try to go farther out of fear that it would start cutting all of a sudden and oversize the pocket. The material is 7075 aluminum, and I had to clamp only about 0.5in of the endmill in the collet, so that I could reach down far enough into the part. I know that's not ideal. The distance from the collet to the blades was about 1in, and I cut approximately 0.6in depth per pass (just on this operation). What do you think happened, and how can I remedy this? Edit: I repeated the original cut using plunge milling followed by a finishing pass to cut off the bumps and that fixed it. Yes, you can definitely take too small a cut. This becomes quite evident when working on a manual machine. The smallest cut you can effectively take depends on the material, the sharpness of the cutting tool, and to an extent what the cutting tool is made of. Materials have spring to them so taking too light a can cause the material to deform (I'm talking about the workpiece here but I suppose it also holds for the cutting tool) under cutting pressure and not "bite" preventing a proper cut from happening. When this happens the cutting tool instead rubs producing excessive heat made worse by the absence of chips to carry the heat away which kills the cutting tool, or deforms the material instead which works harden the material. Therefore a sharper tool lets you take smaller cutters since it reduces cutting pressure is required. All that said, I don't think that should be happening at 10 thousandths in aluminum in a tool of good condition. But I am not familiar with 7075. Take a cut on a test piece and see how much is actually cut versus the coordinates of the tool. Sometimes it's more and sometimes it's less.
{ "domain": "engineering.stackexchange", "id": 5182, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machining", "url": null }
np-complete, complexity-classes I am not familiar with complexity theory. Such proof does not look like a traditional theoretical proof (would be many pages). Nonetheless, it is thought a valid proof, because the argument is supported by 'real programs', what can go wrong? What you showed is that no such program "Sat" can exist. Note that the complexity didn't matter here, since the argument still holds valid for any other complexity classes (a sign of this is that the analysis does not make a reference to the complexity of "Sat"). In fact, this is a well known fact! One can reduce the halting problem to the description of the problem that your "Sat" claims to solve, and since there is no turing machine (i.e, program) that solves the halting problem (and also always halts) - there also won't be one for this.
{ "domain": "cs.stackexchange", "id": 20616, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "np-complete, complexity-classes", "url": null }
> 0, then f'(x) is increasing in an interval around c. Since f'(c) =0, then f'(x) must be negative to the left of c and positive to the right of c. Therefore, c is a local minimum. Do we have local And that's pretty obvious, negative infinity as x approaches negative infinity. Extreme value theorem, global versus local extrema, and critical points Find critical points AP.CALC: FUN‑1 (EU) , FUN‑1.C (LO) , FUN‑1.C.1 (EK) , FUN‑1.C.2 (EK) , FUN‑1.C.3 (EK) or minimum point? Note that the term critical point is not used for points at the boundary of the domain. say that the function is where you have an just by looking at it. © 2020 Houghton Mifflin Harcourt. of some interval, this tells you on the maximum values and minimum values. Our mission is to provide a free, world-class education to anyone, anywhere. Get the free "Critical/Saddle point calculator for f(x,y)" widget for your website, blog, Wordpress, Blogger, or iGoogle. And x sub 2, where the So we have an interesting-- and Khan Academy is a 501(c)(3) nonprofit organization. point, all of these are critical points. And for the sake min or max at, let's say, x is equal to a. point right over there. the tangent line would look something like that. So a minimum or maximum This calculus video tutorial explains how to find the critical numbers of a function. Well we can eyeball that. slope going into it, and then it immediately jumps The first derivative test for local extrema: If f(x) is increasing ( f '(x) > 0) for all x in some interval (a, x 0 ] and f(x) is decreasing ( f '(x) < 0) for all x in some interval [x 0 , b), then f(x) has a local maximum at x 0 . All local extrema occur at critical points of a function — that’s where the derivative is zero or undefined (but don’t forget that critical points aren’t always local extrema). So we have-- let me
{ "domain": "british-hydro.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9773707966712549, "lm_q1q2_score": 0.826799439584339, "lm_q2_score": 0.8459424431344437, "openwebmath_perplexity": 351.80045437290323, "openwebmath_score": 0.6818031072616577, "tags": null, "url": "https://events.british-hydro.org/xhf5vuld/critical-points-calculus-d69c5f" }
template <typename F> requires(Transformation(F)) Domain(F) connection_point_nonterminating_orbit(const Domain(F)& x, F f) { Domain(F) y = collision_point_nonterminating_orbit(x, f); return convergent_point(x, f(y), f); } template <typename F> requires(Transformation(F)) triple<DistanceType(F), DistanceType(F), Domain(F)> orbit_structure_nonterminating_orbit(const Domain(F)& x, F f) { typedef DistanceType(F) N; Domain(F) y = connection_point_nonterminating_orbit(x, f); return triple<N, N, Domain(F)>(distance(x, y, f), distance(f(y), y, f), y); } int main() { typedef Transformation<int> F; F f([](int seed) { srand(seed); return rand(); }); int x = 1; orbit_structure_nonterminating_orbit(x, f); return 0; } ## 4 Chapter 3: Associative Operations This chapter explores associative binary operations, which are operations of arity 2, with the property that: op(a, op(b, c)) = op(op(a, b), c) for all a,b,c, \in T By convention, if the type T and operation op are known in context, we will use multiplicative notation: $$a(bc) = (ab)c$$, $$\forall a,b,c \in T$$ Created: 2018-09-29 Sat 07:52 Validate
{ "domain": "tobilehman.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806512500486, "lm_q1q2_score": 0.8254779394753002, "lm_q2_score": 0.8418256452674008, "openwebmath_perplexity": 7426.21936086845, "openwebmath_score": 0.45936593413352966, "tags": null, "url": "https://tobilehman.com/elem-prog.html" }
python, combinatorics, complexity, set it is not efficient it is not easy to read and understand it is easy to get wrong if you ever need to update the set definition. You should write something like: p2 = frozenset(s - p1) Various hints If sum(p1) == sum(p2), then sum(p1) == sum(p2) == sum(s) // 2 and sum(p1) == sum(s) // 2 is a sufficient condition. You could write something like: def f(n): s = set([i+1 for i in range(n)]) target_sum = sum(s) / 2 valid_partitions = [] for i in range(1,n): for c in combinations(s,i): if sum(c) == target_sum: p1 = frozenset(c) p2 = frozenset(s - p1) valid_partitions.append(frozenset((p1,p2))) return len(set(valid_partitions)) You could just consider only p1 without bothering about p2. Partitions would be counted twice but you can always divide the result at the end. Once you start this, you realise that all the logic about removing duplicates can be removed (all generation combinations are unique): you do not need sets and you do not need frozensets: def f(n): s = set([i+1 for i in range(n)]) target_sum = sum(s) / 2 valid_partitions = [] for i in range(1,n): for c in combinations(s,i): if sum(c) == target_sum: valid_partitions.append(c) return len(valid_partitions) // 2
{ "domain": "codereview.stackexchange", "id": 29361, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, combinatorics, complexity, set", "url": null }
special-relativity, speed-of-light, velocity, inertial-frames, observers Title: Observed speed while travelling close to the speed of light I was watching Discovery channel the other night, they were telling that time slows down when you travel at a higher speed. This means there is a difference between the actual speed you travel at, and the perceived speed. Does anybody know what the perceived speed is, the speed it seems you're travelling at? What does this imply? Does it have any meaning, in some theories perhaps, that the perceived speed is lower? Does this mean that you can never actually travel close to the speed of light? I'm also not into physics, so try to keep it simple. I apologise, this answer as it stood originally was sloppy and flat out wrong on key points, and probably still needs attention from a physicist. When you travel close to the speed of light, you experience less subjective time, according to the Lorentz transform. Moreover, external distances are contracted by the same transform. The factor by which time slows down for a rapidly moving object is $\frac{1}{\sqrt{1-\frac{v^2}{c^2}}}$. As velocity $v$ increases it approaches equality with the speed of light, $c$, and the factor approaches infinity. This means that if you had an arbitrarily fast spacecraft (I assume you don't) you could tour the universe in (from your reference frame) a few years, however you may return to find humanity extinct and continents in unexpected locations. You would actually perceive yourself as travelling at arbitrarily high speeds, in terms of the subjective time it takes to travel from point to point. However, in making measurements against objects you move past, you would see that your subjective velocity does not exceed the speed of light as the rest of the universe appears length-contracted. There are other limitations in your ability to enjoy your tour of the universe - if you set your sights on a star that is millions of light-years away it may well rapidly age (again, from your reference frame) and die before you get there. References: Lorentz factor at wikipedia Relativistic Doppler Effect at wikipedia The 3rd book of Tipler Physics also has a great primer on relativity, albeit with neglect of acceleration, which is critical in generating discrepant clocks between two observers a la the twin paradox.
{ "domain": "physics.stackexchange", "id": 29525, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, speed-of-light, velocity, inertial-frames, observers", "url": null }
php, object-oriented, dependency-injection Title: Dependency Injector Container in PHP I am practicing the SOLID principles and my first step was taking a dive into dependency injection(DI), so I created a class, a container for all DIs. It works, but I'm just not entirely sure if this is how I should go about doing it, although to me it seems fine. interface ContainerInterface { public function set($name, callable $value); public function get($name); } class DI implements ContainerInterface { protected $services; public function set($name, callable $value) { $this->services[$name] = $value(); } public function get($name) { return $this->services[$name]; } } That covers the DI class, now I'll set an example of how I could use it: $di = new DI(); $di->set('database', function() { return new Database(); }); $di->set('pagination', function() use ($di) { return new Pagination(DatabaseInterface $di->get('database')); }); $application = new Application(ContainerInterface $di); In the last line, I just injected the container and now I can access all the DIs. A few thoughts:
{ "domain": "codereview.stackexchange", "id": 25355, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, object-oriented, dependency-injection", "url": null }
condensed-matter, experimental-physics, research-level, superconductivity, topological-order Bohm-Jung Yang, Mohammad Saeed Bahramy, and Naoto Nagaosa. “Topological protection of bound states against the hybridization.” Nature communications 4 (2013): 1524. (arXiv version) These helical states, which form a 2D electronic system on the boundary of a 3D system, have half the degrees of freedom (DOF) of an equivalent purely 2D system; the other half (DOF) are on the other surface (look up the holographic principle). As a result, no time-reversal symmetry preserving perturbation can gap them out. In other words, they are topologically protected (due to symmetry). Another important thing to stress is that just because an insulator is topologically trivial doesn’t mean it cannot have surface states. The only difference is that these states can be destroyed. Now, in the case of topological superconductors, the surface states are even more exotic. The surfaces of 3D time-reversal invariant topological superconductors host Majorana modes. You would observe a topologically protected Dirac cone, just like a 3D topological insulator, on the surface of a topological superconductor. The only difference is that this Dirac cone represents the dispersion of Majorana modes instead of Dirac fermions and has half the degrees of freedom due to particle-hole symmetry. There is a tonne of literature out there which proposes schemes of experimentally detecting these Majorana modes. For the case of 3D time-reversal invariant topological superconductors, however, I am familiar with only two: Scanning Tunneling Microscopy (STM) and Angle-Resolved Photoemission Spectroscopy (ARPES). In a point contact spectroscopy measurement on a topological superconductor you are supposed to see a so-called Zero-Bias Conductance Peak (ZBCP) inside the bulk gap as shown in Fig. 2 of: Satoshi Sasaki, M. Kriener, Kouji Segawa, Keiji Yada, Yukio Tanaka, Masatoshi Sato, and Yoichi Ando. “Topological Superconductivity in Cu$_x$Bi$_2$Se$_3$.” Physical Review Letters 107, no. 21 (2011): 217001. (arXiv version)
{ "domain": "physics.stackexchange", "id": 8592, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "condensed-matter, experimental-physics, research-level, superconductivity, topological-order", "url": null }
Computing residues in a practical way is often done using our favorite software to get the Laurent series of $f(z)$ at $z=\pi i$. Without computer I spontaneously expanded $f(z)$ this way (for $\,z:=\pi i+x\,$ with $\,|x|\ll 1$) : \begin{align} f(\pi i+x)&=\frac{e^{(1+i)(\pi i+x)}}{(1+e^{\pi i+x})^2}=\frac{-e^{-\pi}\;e^{(1+i)x}}{(1-e^x)^2}\\ &=-e^{-\pi}\frac {1+(1+i)x+O\bigl(x^2\bigr)}{x^2\left(1+x/2+O\bigl(x^2\bigr)\right)^2}\\ &=-\frac{e^{-\pi}}{x^2}\left((1+(1+i)x)(1-x)+O\bigl(x^2\bigr)\right)\\ &=-\frac{e^{-\pi}}{x^2}\left(1+ix+O\bigl(x^2\bigr)\right)\\ &=-\frac{e^{-\pi}}{x^2}-\frac{i\,e^{-\pi}}{x}+O(1) \end{align}
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846691281407, "lm_q1q2_score": 0.8482944832111032, "lm_q2_score": 0.8670357477770337, "openwebmath_perplexity": 599.0337981774695, "openwebmath_score": 0.9994819760322571, "tags": null, "url": "http://math.stackexchange.com/questions/468019/evaluating-an-improper-integral-using-complex-analysis" }
c++, array, iterator, collections, vectors test(); } Before I get into the review, I need to offer some advice. std::vector is a type of dynamic array, but not the only type. The thing that makes std::vector special is that it has extra capacity. You can reserve space in a vector, and fill that space in later with actual objects. That is handy for minimizing the number of allocations, and controlling when those allocations happen. The cost is a massive increase in complexity, and almost doubling the size needed for the type. A simple dynamic array, on the other hand, does not have extra capacity. That means that every time you push another object into the array, it needs to reallocate and shuffle stuff around. On the other hand, such a dynamic array is much simpler, and the type itself only needs to store a pointer and a size. If you are trying to remake std::vector, my advice to you is: don’t. It is hard. It is stupidly hard. I have seen literally hundreds of coders attempt it, and fail—and I mean “literally” quite literally; just do a search for vector re-implementation here at CodeReview, and you will see thousands of results, and almost all of them are wrong. Beginners frequently fall for the trap of thinking that because std::vector is easy to understand and use, then it must be easy to implement… but it is not. It may be the hardest thing in the entire standard library to implement. Yes, it is way harder to implement than std::string, std::map, std::thread, std::shared_ptr, and anything in the IOstreams library. Just about the only things in C++20 that are harder might be std::regex and some of the floating point conversion stuff. Beginners also assume that if they do manage to figure out how to re-implement std::vector correctly, they will have learned a lot of useful C++. False. Most of the knowledge you need to correctly re-implement std::vector is useful only for re-implementing std::vector (or similar types), and does not provide any useful skills you can translate to any other problem domain. So to summarize:
{ "domain": "codereview.stackexchange", "id": 45374, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, array, iterator, collections, vectors", "url": null }
Value Theorem. fails to hold, then f(x) might fail to have either an absolute max or an absolute min If f'(c) is undefined then, x=c is a critical number for f(x). However, for a function defined on an open or half-open interval… Extreme Value Theorem Theorem 1 below is called the Extreme Value theorem. Extreme Value Theorem: When examining a function, we may find that it it doesn't have any absolute extrema. It ... (-2, 2), an open interval, so there are no endpoints. Lagrange mean value theorem; Bound relating number of zeros of function and number of zeros of its derivative; Facts used. y = x2 0 ≤ x ≤2 y = x2 0 ≤ x ≺2 4.1 Extreme Values of Functions Day 2 Ex 1) A local maximum value occurs if and only if f(x) ≤ f(c) for all x in an interval. State whether the function has absolute extrema on its domain $$g(x)= \begin{cases} x & x> 0 \\ 3 & x\leq 0 \end{cases}$$ Join the initiative for modernizing math education. Thus, a bound of infinity must be an open bound. Plugging these special values into the original function f(x) yields: The absolute maximum is \answer {17} and it occurs at x = \answer {-2}.The absolute minimum is \answer {-15} and it occurs at x = \answer {2}. This theorem is sometimes also called the Weierstrass extreme value theorem. Notice how the minimum value came at "the bottom of a hill," and the maximum value came at an endpoint. Suppose that the values of the buyer for nitems are independent and supported on some interval [u min;ru min] for some u min>0 and r 1. Depending on the setting, it might be needed to decide the existence of, and if they exist then compute, the largest and smallest (extreme) values of a given function. Renze, Renze, John and Weisstein, Eric W. "Extreme Value Theorem." need to solve (3x+1)e^{3x} = 0 (verify) and the only solution is x=\text {-}1/3 (verify).
{ "domain": "waqsp.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9863631647185701, "lm_q1q2_score": 0.8344064653798489, "lm_q2_score": 0.8459424431344437, "openwebmath_perplexity": 259.6843062088817, "openwebmath_score": 0.8095170855522156, "tags": null, "url": "https://waqsp.org/telescope-price-zwgol/73f536-extreme-value-theorem-open-interval" }
vba, functional-programming Title: VBA function that returns color RBG code of a referenced cell I have this function I'm building to return the RBG code of a cell I input. The code "works" but something funny is going on. If I write multiple functions each referencing different cells, then all the functions simultaneously show the last cell I run through the function. I'm probably doing something trivial here, but I'm also new to VBA. Public Function ColorCode(Reference As Range) As Variant ' Function to return RGB code of a single cell when referenced Dim RGBColor As Long Dim Red As Long, Green As Long, Blue As Long Range(Reference.Address).Activate RGBColor = Selection.Interior.Color Red = &HFF& And RGBColor Green = (&HFF00& And RGBColor) \ 256 Blue = (&HFF0000 And RGBColor) \ 65536 ColorCode = Red & "/" & Green & "/" & Blue End Function I don't think you need to activate the cell, or use the selection, just inspect the range directly. I've also made the function volatile so it will update when you calculate. But, for Code Review purposes, you're only getting the interior color, but the cell might not actually appear in that color, for example: If there is conditional formatting on the cell, the interior color will not be accurate. If there is a style on the cell, and the style applies a fill, then the interior color will not be accurate. If the cell's interior has a 2-color fill, then then the interior color doesn't necessarily reflect either color of the 2-color fill. Also, you're using some nice concise bit-shifting, and you'll have noticed that VBA doesn't have any shifting operators, but you might consider using some bit-shifting functions to make the code slightly clearer (and you can re-use them everywhere else that you need to shift bits. And finally, unless you're certain that reference will always be a single celled reference, the color will default to 0/0/0 if there are more than 2 cells in the range and they have different colors. Public Function ColorCode(Reference As Range) As Variant Application.Volatile ' Function to return RGB code of a single cell when referenced Dim RGBColor As Long
{ "domain": "codereview.stackexchange", "id": 21197, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vba, functional-programming", "url": null }
to store electric charge. 2 μC charge gains 3. doc Page 3 Teacher Reference Introduction: Capacitance, parallel plate capacitor, dielectric, dielectric constant so the "plates" can be rolled up in a spiral without worrying about the plates touching each other. Subscribe CHANNEL Capacitance of parallel plate capacitor with conducting slab between the plates. Capacitors vary in shape and size, but the basic configuration is two conductors carrying equal but opposite charges (Figure 5. • As expected, the capacitance of this capacitor depends only on its GEOMETRY (A,d). Which of the following apply to the situation after the plates have been moved? 1)The capacitance increases True False 2)The electric field increases True False 3)The voltage between the plates increases True False Another Question -q +q +. The capacitance of each of the three capacitors is equal and given by (27. 2 mm respectively. The parallel plate capacitor formula is expressed by, $$C=k\frac{\epsilon. How it works: The capacitor consists of two 1/4" (6mm) aluminum plates 20 cm in diameter. When you get down to 30 meters the bandwidth narrows to about 10KHz. Wire separation is measured from center-to-center, so when it is less than or equal to the wire diameter then the wires are in physical contact. The capacitor can separate different DC voltage levels from each other, but also conducts AC current 3. 4 10 C 640 pC 5. 00m2, with which to construct a parallel-plate capacitor. A parallel plate capacitor is a capacitor with 2 large plane parallel conducting plates separated by a small distance. Dielectrics are usually placed between the two plates of parallel plate capacitors. A simple capacitor is the parallel plate capacitor, represented in Figure 1. It only becomes significant when d is large (hence C is small). This set of Basic Electrical Engineering Multiple Choice Questions & Answers (MCQs) focuses on “Capacitance and the Capacitor”. Capacitance and Capacitors Energy Stored in a Capacitor Dielectrics Feb. Some examples include storing electric potential energy, delaying voltage changes when coupled with. 01 m2 If we connect 1. The plates are separated by
{ "domain": "agenzialenarduzzi.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9481545304202039, "lm_q1q2_score": 0.8040044772205128, "lm_q2_score": 0.847967764140929, "openwebmath_perplexity": 531.7615776063614, "openwebmath_score": 0.6449436545372009, "tags": null, "url": "http://mqeo.agenzialenarduzzi.it/capacitance-of-a-parallel-plate-capacitor-with-3-dielectrics.html" }
physical-chemistry, electrochemistry, aqueous-solution, solutions Title: What is the interaction between dissolved ions of opposite valence in a solution at rest? NaCl is dissolved in water. Ions sodium and chloride are sufficiently free from each other so that they may occupy different regions of the solution after an active transport process through a membrane, or a mere electric field is in place. They still act upon each other, and a membrane voltage is set by oppositely charged ions lining its interior and exterior surfaces. So my question is this: how free are those ions in a uniform solution at equilibrium? Aren't they actually forming pairs of watered ions, although weakly bound? Can they form even bigger clusters, be them of short lifetime? Note: I originally asked this on Physics SE but after several weeks I have received no answer nor any other kind of reaction, so I am trying Chemistry SE now. The answer is: it depends. Dissolution of a salt implies that the entropy gained exceeds the cost of breaking lattice interactions (the solution enthalpy, assuming it is positive). Electrostatic interactions compete with kT (thermal jostling). Under physiological conditions, long range interactions are strongly screened by intervening solvent molecules and other ions. At best ions are subject to an effective potential due to distant ions, in particular between segregated charges as in the cases you present (e.g. on opposite sides of a membrane). However, ionic solutions are generally regarded as "non-ideal". This means that interactions between the ions and with the solvent cannot be dismissed. At high salt concentration ion pairing will be encouraged. Above the solubility limit salt precipitation will occur, preceded by formation of clusters (seeds). If an ion has multiple charges, then electrostatic interactions will be stronger and pairing will be encouraged. Some metal ions form permanent ligand complexes that can attenuate the overall charge or distribute it over the complex, and the ligands can form a "cage" about the central ion, altering the interaction potential with solvent and other ions. The effect of temperature is complex. The entropic cost of association increases with T, but the dielectric constant of the solvent tends to decrease also. If you are interested in reading on ion-pairing in NaCl solutions you may want to start with Ref. 1. It explains that association is negligible in dilute solutions:
{ "domain": "chemistry.stackexchange", "id": 12667, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, electrochemistry, aqueous-solution, solutions", "url": null }
Convert to date strings: strings = DateString[Join[{2012, 1, 23}, #], {"Hour12", ":", "Minute"}] & /@ times {"12:00", "01:05", "02:10", "03:16", "04:21", "05:27", "06:32", "07:38", "08:43", "09:49", "10:54", "12:00"} Convert to the necessary angle units. degrees = {1, -6 Degree}*# & /@ times {{0, 0.}, {1, -0.571199}, {2, -1.1424}, {3, -1.7136}, {4, -2.28479}, {5, -2.85599}, {6, -3.42719}, {7, -3.99839}, {8, -4.56959}, {9, -5.14079}, {10, -5.71199}, {11, -6.28319}} Graphics[{Circle[{0, 0}, 0.85], Text[#1, {Cos[#2 + Pi/2], Sin[#3 + Pi/2]}] &, {strings, degrees[[All, 2]], degrees[[All, 2]]}]}, ImageSize -> 250]
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9496693702514737, "lm_q1q2_score": 0.8163963274530945, "lm_q2_score": 0.8596637451167997, "openwebmath_perplexity": 2707.6329848836563, "openwebmath_score": 0.27267125248908997, "tags": null, "url": "http://mathematica.stackexchange.com/questions/573/figuring-when-the-minute-and-hour-hand-coincide-on-a-clock" }
civil-engineering, building-design Title: Is it OK for a 2 story house not have a column or pillar sorry for my english. I was looking to buy a house. I saw some in my hometown, which is very affordable. but on a picture of the house they are selling I found on the net troubled me. no pillar/column, just hollowblocks and some steel bars. kindly look at the pic. I found it in this site https://fiestacommunitiesblog.wordpress.com/tag/fiesta-communities/ As @SamFarjamirad states it's best to consult a knowledgeable construction engineer where you live, or in your region, because such people would know the building codes & construction practices for your region. A column or pillar for a two storey house may not be necessary if the load bearing walls are designed & built properly. This may include internal load bearing wall, inside the house. The other thing to be wary of is the quality of the foundations for the load bearing walls. Also, if the house to be renovated later all load bearing walls must not be removed or altered. It looks like the steel is being threaded through the hollow block in the external walls. This would be done to increase the flexibility of the house during earthquakes and should a typhoon/cyclone/hurricane affect the house. Internal load bearing walls should also have such steel reinforcement. If designed and built correctly such steel reinforced walls should not collapse. They might crack during extreme natural events but they should not fall and collapse the house. Looking at the picture you included, some things that I found strange were:
{ "domain": "engineering.stackexchange", "id": 2783, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "civil-engineering, building-design", "url": null }
taxonomy, nomenclature Title: Author statements (Readers) in biological nomenclature I know that a binomial name may be followed by the name of the reader who has been the first to identify the species and to give it that binomial name. It is not completely clear to me what the same of a botanist, zoologist etc. means if it is placed between parentheses, as in Blysmus compressus (L.) Panzer. Does it mean that Panzer gave that species the binomial name Blysmus compressus but it was Linnaeus that identified it as a species? I cannot find precise information on line, nor in my books... Moreover, the pattern may get more complicated if we introduce the subspecies, for example another Cyperacea: Carex ferruginea Scop. subsp. macrostachys (Bertol.) Arcang.. It seems quite trivial to me that Scopoli (Scop.) identified and gave the species the name Carex ferruginea; as to the subspecies, did Arcangeli (Arcang.) named it macrostachys after that Bertoloni (Bertol.) had identified it as a subspecies? I thank any answerer very much. As @C_Z_ mentions, the double author citation is due to a naming revision. In your case, 'Panzer' has revised the name given by 'L' (Linneus). It can for instance be due to an assignment to a new genus or a change in rank status (e.g. going from subspecies to species). Note that author citations differ between botany and zoology, where changes in authorship are usually not recognized in zoology (as long as there is a proper and complete species description in the first place), while the botanical code allows for multiple author citations. From Wikipedia: Author citation (botany): ... in contrast to the situation in zoology, where no authorship change is recognized within family-group, genus-group, and species-group names, thus a change from subspecies to species, or subgenus to genus, is not associated with any change in cited authorship
{ "domain": "biology.stackexchange", "id": 6209, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "taxonomy, nomenclature", "url": null }
ds.data-structures, dynamic-algorithms Title: Set query in a universe with overlapping sets Suppose we have a universe $U$ of $n$ items $u_1,u_2,u_3,...,u_n$. And a collection of sets (no restriction on being disjoint or exhaustive etc.) which cover some items. Size of each set is bounded by some parameter $k<n$. We need to perform the following update and query efficiently. Update: 1- Add a new set to the collection having some elements of $U$. 2- Delete any existing set from collection. Query: Given two vertices, does there exist a set which has both these vertices. A trivial way would be to maintain a 2D matrix with each $M(i,j)$ storing number of sets containing both $i$ and $j$. Update would be done in $O(k^2)$ by incrementing $M(i,j)$ for all pairs of vertices in set S_i. The query can be done in$ O(1)$ time. I am looking for some solution with o(k^2) update time and poly log query time.. One can reverse the roles of elements and sets. This can be seen by considering a Boolean matrix of size $m\times n$ where there are $m$ sets and $n$ is the size of the universe. The $i$th row corresponds to the characteristic vector of the $i$th set. Transposing this matrix reverses the roles of sets and elements ($n$ sets and $m$ elements).
{ "domain": "cstheory.stackexchange", "id": 3224, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ds.data-structures, dynamic-algorithms", "url": null }
slam, navigation, ros-kinetic, rtabmap Originally posted by matlabbe with karma: 6409 on 2020-04-03 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by willzoe on 2020-04-06: If I use the above 2D method or 3D method, do I have to add a lidar to the robot? Can I enable ray tracing when only using zed stereo camera, and then configure the above parameters to fill the unknown space? Comment by matlabbe on 2020-04-08: No, they work also with the depth image of the camera. The map you are seeing is from depth image in 3D by default (without ray tracing). Ray tracing can be enabled with cameras. Comment by willzoe on 2020-04-08: How to enable ray tracing with cameras? I refer to zed_nodelet_example and use depthimage_to_laserscan node to convert the depth image generated by the camera into 2D scan. Is this method feasible? By the way, this example zed_nodelet_example uses nodelet, and I use node. Which one should I choose? Comment by willzoe on 2020-04-09: I have enabled ray tracing, and the resulting 2D map has no holes. Comment by matlabbe on 2020-04-17: We can also convert the depth image to a laser scan, for which RTAB-Map will do ray tracing by default. It is not necessarily though, as if you set parameter Grid/RayTracing to true, it will also do it with depth images. In general, using nodelet is the preferred approach for efficiency. For example, if two nodelets are in the same manager and images should be shared between them, the image topics won't be serialized and deserialized, only a copy of the pointer in memory would be required. Comment by willzoe on 2020-04-28:\ According to the above, when I set the parameter Grid / RayTracing to true and Grid / 3D to false, rtabmap convert the depth image to a laser scan. Is it possible for rtabmap to publish sensor_msgs / LaserScan type topics? (By using rostopic find sensor_msgs / LaserScan I did not find the related topic published by rtabmap.)
{ "domain": "robotics.stackexchange", "id": 34671, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation, ros-kinetic, rtabmap", "url": null }
php, datetime DEMO: https://3v4l.org/68Qur This way you'll get an error message when you supply a stringy date or another type of object. Your functions don't need them, but have a look at DateTimeImmutable, they are preferred because the normal DateTime can often cause unexpected effects when you use them as function arguments.
{ "domain": "codereview.stackexchange", "id": 45054, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, datetime", "url": null }
python, beginner, python-3.x, sorting, mergesort Title: Recursive Merge Sort Algorithm (Python) Merge Sort Merge Sort algorithm is a general-purpose comparison-based sorting algorithm. Most implementations produce a stable sort, in which the order of equal elements is preserved. Just for practicing, I've implemented the merge sort algorithm copied below and I'd appreciate it if you'd like to review any part of it for any small or big changes/improvements. Code from typing import List, TypeVar import random from scipy import stats T = TypeVar("T") def recursive_merge_sort(input_list: List[T]) -> List[T]: """ Recursive Merge Sort ----------------------------------------------- Merge Sort is a Divide and Conquer algorithm. It divides the input array in two halves, calls itself for the two halves and then merges the two sorted halves. The merge function is used for merging two halves. Attributes: - Time Complexity: O(N*Log N) - Space Complexity: O(N) - Stable Sort """ # Assigns the length of input list. size_of_input_list = len(input_list) # Creates a new list for sorted output list. temp_output_list = [None] * size_of_input_list # Sorts the input list. recursive_sort(input_list, temp_output_list, 0, size_of_input_list - 1) return temp_output_list def recursive_sort(input_list: List[T], temp_output_list: List[T], first_index: int, last_index: int) -> List[T]: """ This method recursively sorts the divided sublists """ # Stops the recursion if there is only one element in the sublists. if first_index == last_index: return # Otherwise, calculates the middle point. mid_index = (first_index + last_index) // 2
{ "domain": "codereview.stackexchange", "id": 36066, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, sorting, mergesort", "url": null }
applications, evolutionary-algorithms, robotics, genetic-programming, path-planning Title: How can genetic programming be used for path planning? I have been reading quite a few papers, on genetic programming and its applications, in particular, chapter 10 of "Genetic Programming: An Introduction and Tutorial, with a Survey of Techniques and Applications" (Langdon, Poli, McPhee, Koza; 2008) Unfortunately, I can not wrap my head around how one could apply genetic programming to robotics, for example, in path planning. Can anyone explain this in the most simple manner? I know that it all depends on the fitness function. Take a robot that we want to be able to move from the bottom right corner to the top left corner of a 4x4 matrix full of random holes it should avoid. With holes represented by 1s, it could look something like: exit \/ [0,0,0,1] [0,1,1,0] [0,1,1,1] [0,0,0,0] /\ enter
{ "domain": "ai.stackexchange", "id": 491, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "applications, evolutionary-algorithms, robotics, genetic-programming, path-planning", "url": null }
$\displaystyle 6 = 2 \times 3 = (1+\sqrt{-5}) (1-\sqrt{-5})$ that decomposes ${6}$ non-uniquely into the product of irreducibles in ${{\bf Z}[\sqrt{-5}]}$. Nevertheless, it is an important fact that the fundamental theorem of arithmetic can be salvaged if one uses an “idealised” notion of a number in a ring of integers ${{\mathcal O}}$, now known in modern language as an ideal of that ring. For instance, in ${{\bf Z}[\sqrt{-5}]}$, the principal ideal ${(6)}$ turns out to uniquely factor into the product of (non-principal) ideals ${(2) + (1+\sqrt{-5}), (2) + (1-\sqrt{-5}), (3) + (1+\sqrt{-5}), (3) + (1-\sqrt{-5})}$; see Exercise 27. We will review the basic theory of ideals in number fields (focusing primarily on quadratic fields of negative discriminant) below the fold. The norm forms (1), (2) can be viewed as examples of positive definite quadratic forms ${Q: {\bf Z}^2 \rightarrow {\bf Z}}$ over the integers, by which we mean a polynomial of the form $\displaystyle Q(x,y) = ax^2 + bxy + cy^2$
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9905874104123901, "lm_q1q2_score": 0.8075590360644194, "lm_q2_score": 0.8152324848629214, "openwebmath_perplexity": 4622.61496713103, "openwebmath_score": 1.0000090599060059, "tags": null, "url": "https://terrytao.wordpress.com/category/mathematics/mathnt/page/2/" }
html, css, html5, layout, cross-browser span instead of i You should not use the i element for CSS icons. Use the meaningless span instead: <span class="fa fa-trash fa-align-center" aria-hidden="true"></span> Accessibility of delete function Note that this icon will not be accessible (because the element has no content, and because of aria-hidden anyway). If it’s really a delete function (which the class name suggests), you should provide alternate content so that, for example, also users with screenreaders can delete files. The most simple solution would be to use a button with an img that has an alt value like "Delete file xy": <button type="button"><img src="delete.png" alt="Delete file 'File name Short.ext'"></button> Markup structure It seems to me that you have a table, not a list. Then you should use the table element. <table> <thead> <tr> <th>Name</th> <th>Date</th> <th>Size (in <abbr title="Megabyte">MB</abbr>)</th> <th>Delete</th> </tr> </thead>
{ "domain": "codereview.stackexchange", "id": 21884, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "html, css, html5, layout, cross-browser", "url": null }
c++, game, matrix, dependency-injection, sfml { m_graphicInterface.currentScreen = screenSelection::game_screen; } } else if (m_graphicInterface.currentScreen == screenSelection::game_screen) { if (m_graphicInterface.gameMenu[0].getGlobalBounds().contains(event.mouseButton.x, event.mouseButton.y)) { m_gamePieces.reset(); m_graphicInterface.currentScreen = screenSelection::main_menu; } if (m_graphicInterface.gameMenu[1].getGlobalBounds().contains(event.mouseButton.x, event.mouseButton.y)) { m_graphicInterface.popUpOpen = true; // rules } if (m_graphicInterface.gameMenu[2].getGlobalBounds().contains(event.mouseButton.x, event.mouseButton.y)) { m_graphicInterface.popUpOpen = true; // credits }
{ "domain": "codereview.stackexchange", "id": 30750, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, game, matrix, dependency-injection, sfml", "url": null }
javascript <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> </div>
{ "domain": "codereview.stackexchange", "id": 32317, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript", "url": null }
object-oriented, ruby, programming-challenge, unit-testing, rspec Title: Simple Ruby program to model a prepaid transit card system I have written a simple Ruby program to model a transit card system which aims to address the following user stories. I wanted to see whether I could get any feedback on it. My main interest is understanding where I have made fundamental mistakes that violate OOP(SOLID) Principles with a real focus on Single Responsibility. I have included the code and specs and link to my repo - https://github.com/benhawker/oyster-cards. In order to use public transport As a customer I want money on my card In order to keep using public transport As a customer I want to add money to my card In order to protect my money As a customer I don't want to put too much money on my card In order to pay for my journey As a customer I need my fare deducted from my card In order to get through the barriers As a customer I need to touch in and out In order to pay for my journey As a customer I need to have the minimum amount for a single journey In order to pay for my journey As a customer I need to pay for my journey when it's complete In order to pay for my journey As a customer I need to know where I've travelled from In order to know how far I have travelled As a customer I want to know what zone a station is in In order to be charged correctly As a customer I need a penalty charge deducted if I fail to touch in or out In order to be charged the correct amount As a customer I need to have the correct fare calculated require "./lib/journey" class Oystercard attr_reader :balance MIN_BALANCE = 1 MAX_BALANCE = 50 def initialize(balance=0) raise "Max balance is #{Oystercard::MAX_BALANCE}" if exceeds_max_balance?(balance) @balance = balance end def top_up(amount) raise "This would take you over the max balance!" if exceeds_max_balance?(@balance + amount) @balance += amount end def tap_in(origin_station) raise "You don't have enough for this journey :(" if below_min_balance?(@balance) @journey = Journey.new(origin_station) end
{ "domain": "codereview.stackexchange", "id": 18244, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "object-oriented, ruby, programming-challenge, unit-testing, rspec", "url": null }
torque starting from scope being completely vertical, activate the servo so it wants to go anticlockwise. it shouldnt have the torque to accomplish this. now manually raise the scope until the servo does has torque to move the scope on its own. the angle where this happens is the critical angle. Do $51\over\cos\theta$ to calculate what torque you need for a new servo that can do this on its own. my advice would be to use gears. specifically worm gear for the driver (servo). which will protect the system from failing like above (if the critical angle is reached it wont fall over, just stall in position). worm gears have the advantage that they can only be driven from the worm, and for example, cannot be forced to turn by pushing on the telescope, bumping into it etc. the disadvantage is the very low gear ratio (slow but high torque). and you would need a motor not servo..
{ "domain": "physics.stackexchange", "id": 9904, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "torque", "url": null }
fft, discrete-signals, moving-average The waveform is first accumulated (the accumulator wraps on overflow), this is then followed by a decimator where the Dth output is selected, and then at this lower output rate ($f_s/D$ where $f_s$ is the input sample rate), each successive sample is differenced. As detailed in the referenced link above, this is identical to a moving average over D samples! The accumulator is a digital integrator, and the differencing filter is known as a "comb filter", thus it is called a "Cascade Integrator Comb" filter. The implementation of multiple moving averages is also easily implemented by adding more integrator and combs as shown in the diagram below for a $CIC^2$ structure of two moving averages in cascade. The accumulators are sized so that they only overflow once for each output sample, otherwise the result would be corrupted.
{ "domain": "dsp.stackexchange", "id": 11173, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft, discrete-signals, moving-average", "url": null }
thermal-radiation, optical-materials Kirchhoff's law states: $$ \frac{r(\omega,T)}{a(\omega,T)}=f(\omega,T) $$ where $a$ is the (temperature and frequency dependent) absorptivity of the object, $f$ is the black-body spectrum and $r$ is the emission spectrum of the object. A high-quality sample of glass does not induce perceptible changes in color (well it does, and you can see this from a prism, but that's beside the point right now) so it may be safe to say, that in the visible part of the spectrum $a$ is constant. In that case, the emission spectrum of hot glass is $$ r(\omega,T)=a(T) f(\omega,T) $$ i.e. proportional to the black-body spectrum (in visible frequencies, we aren't discussing any others right now) with a frequency-independent coefficient. Caveat: room-temperature $a$ may be $\omega$-independent. High-temperature $a$ need not retain that property, though it might to some degree. Caveat #2: human perception is a terrible way to judge the absorption spectrum of glass. A human is sensitive to the value $1 - a(\omega)$ and how uniform it is. A good glass is highly transparent and probably absorbs much less than it reflects (4% IIRC). But a human will not be able to distinguish between $a(700nm)\approx0.01$ and $a(400nm)\approx0.001$ (numbers taken of the top of my head). This will completely skew the thermal radiation spectrum. EDIT: Here's some data on the complex refractive index of silica glass. See bottom of page 7. It appears, that the absorption of glass in the visible spectrum is indeed rather uniform. $k(400nm)=.7\cdot10^{-7};\,k(700nm)=1.1\cdot10^{-7}$, which is quite a bit more uniform than I initially expected. Thus the emission spectrum of glass compared to black-body is somewhat red-shifted, but not drastically.
{ "domain": "physics.stackexchange", "id": 32177, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermal-radiation, optical-materials", "url": null }
geophysics, seismology, earthquakes, tectonics Title: Calculating the displacement of a fault In the calculation of scalar moment magnitude of an earthquake we have the formula $$M_0=\mu AD$$ where: $\mu$ is the shear modulus of the rocks involved in the earthquake (in Pa) $A$ is the area of the rupture along the geologic fault where the earthquake occurred (in m2), and $D$ is the average displacement on $A$ (in m). In many cases the displacement can occur in the subsurface.In order to predict the moment magnitude of such earthquakes the value of $D$ must be estimated. How is this process carried out ? The process is carried out by solving an "inverse problem" and there are many ways to estimate the moment depending on the observable. For example if you have some measurements of ground deformation following the earthquake (using GPS/InSAR) then by combing a physics based model, with an optimizer, you can estimate the area/slip distribution that best explains the observations. Once you know the area/slip distribution then you can estimate the moment. The physical models can be simple or complex (e.g., semi-analytical or fully numerical). Same goes for the optimizer (local or global). For computationally expensive numerical models global optimization is typically not feasible. For local optimization you need a 'reasonable' initial model.
{ "domain": "earthscience.stackexchange", "id": 374, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "geophysics, seismology, earthquakes, tectonics", "url": null }
css, fizzbuzz Title: FizzBuzz in CSS So someone challenged me to write FizzBuzz using CSS only. This was the best I could come up with, but I think the "divisible by 5, not divisible by 3" CSS rule is a bit clunky. So I'm looking for advice to provide a more readable and maintainable solution.
{ "domain": "codereview.stackexchange", "id": 21758, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "css, fizzbuzz", "url": null }
ros2, c++, custom-message rosidl_adapter.parser.InvalidResourceName: druai Call Stack (most recent call first): /opt/ros/dashing/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:130 (rosidl_adapt_interfaces) CMakeLists.txt:24 (rosidl_generate_interfaces) --- Failed <<< druai_msg [ Exited with code 1 ] package.xml <package format="3"> <name>druai_msg</name> <version>0.7.3</version> <description>Examples of custom message handling</description> <maintainer email="TimCraig@Druai.com">Tim Craig</maintainer> <license>Apache License 2.0</license> <author>Tim Craig</author> <buildtool_depend>ament_cmake</buildtool_depend> <build_depend>builtin_interfaces</build_depend> <build_depend>rosidl_default_generators</build_depend> <exec_depend>builtin_interfaces</exec_depend> <exec_depend>rosidl_default_runtime</exec_depend> <member_of_group>rosidl_interface_packages</member_of_group> <export> <build_type>ament_cmake</build_type> </export> </package> CMakeList.txt cmake_minimum_required(VERSION 3.5) project(druai_msg) # Default to C++14 if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() find_package(ament_cmake REQUIRED) #find_package(rclcpp REQUIRED) #find_package(std_msgs REQUIRED)
{ "domain": "robotics.stackexchange", "id": 33757, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2, c++, custom-message", "url": null }
ros, inverse-kinematics, moveit, inverse Title: Temporarily changing of joint limits in RobotState I am calculating the IK for my robot setup using: robot_state::RobotState kinematicStateArm = *m_arm.getCurrentState(); foundIkForArm = kinematicStateArm.setFromIK(jointModelGroupArm, targetPose, 10, 0.05); kinematicStateArm.copyJointGroupPositions(jointModelGroupArm, jointValuesArm); Now on certain occasions, I do have to restrict the joint limits in one of the joints further than required for the default case. Is there any method that allows one to change the joint limits used within the RobotState IK framework? I have seen that the moveit::core::JointModel setVariableBounds() Reference allows one to modify the joint limits. However I do see no way of accessing this method from the RobotState API. Does anyone know of a method or way on how to approach my issue? Originally posted by Florian_W on ROS Answers with karma: 15 on 2016-12-02 Post score: 0 I found that by using the moveit_msgs::GetPositionIK service, it is possible to specify individual moveit_msgs::JointConstraint . First tests yield promising results. Originally posted by Florian_W with karma: 15 on 2016-12-02 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by gvdhoorn on 2016-12-02: Yes, that service contains the same JointConstraint entry as the MotionPlanRequest that @rbbg mentioned. If you're only after single solutions, then this should work. For actual planning, the approach @rbbg describes could be used (but the constraints are the same). Comment by Florian_W on 2016-12-03: @gvdhoorn I only require the end-effector to be "in front" of the robot. Without limiting the joints the Ik solution derived by TRAC-IK is some weirdly looking "behind the shoulder" grasp. The planning procedure may actually utilize the full joint space. Are you aware of a more elegant solution ?
{ "domain": "robotics.stackexchange", "id": 26378, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, inverse-kinematics, moveit, inverse", "url": null }
electromagnetic-radiation, visible-light, wavelength But our eyes can see the same named colors with a combination of light frequencies, called color perception: The color perceived at point T , comes from a combination of frequencies, and many different pairs give the same perceived color. White in this plot is around the achromatic point. Please read the link for details. In summary, white is not a color in the visible light spectrum, many frequencies could make up the perception of white color, which means that photons of a large variation in energies make up the white color. At the quantum level, light is a confluence of zillions of photons that combine to give the classical electromagnetic wave, for references see this. The figure shows how the frequencies combine to give the perception of white. One needs many photons for our eyes to be able to perceive them, but even a few hundreds can give a signal to the brain, this link might interest you. The answer your "What is the distribution of different wavelengths in single ray of white light?" is: The distribution is not unique to give the perception of white light. There are very many frequencies/wavelengths as seen in the plot that will give "white". It will depend on the production mechanism. If the light front started as white from the sun, and if it does not interact with any particles or fields on the way, the phases between the different frequencies/waves will be fixed, so it will arrive with the perception of white light with the same frequency/wavelength distribution it started with, still giving the perception of white. .
{ "domain": "physics.stackexchange", "id": 86482, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetic-radiation, visible-light, wavelength", "url": null }
special-relativity, acceleration, inertial-frames Update The rapidity $\theta$ is Minkowski-analogue of the "angle between 4-velocities". It's useful to compare the rapidity and the hyperbolic trig functions in Minkowski-spacetime-geometry and angle and the circular trig functions in Euclidean-geometry. (In my opinion, if you expect students to be comfortable with functions like $(1-(u/c)^2)^{-3/2}$, they could be comfortable with hyperbolic trig functions (assuming they are familiar with the circular functions and trigonometry)). Below, I have attached a Minkowski-spacetime diagram [time runs upwards by convention]. Imagine the tips of all possible 4-velocities from a given event... their tips trace out a hyperbola [with spacelike tangents]. The rapidity is the spacelike-arclength along a hyperbola [with spacelike-tangents], divided by the radius. (The angle is the arc-length on a circle, divided by the radius of the circle $\theta_E=S_{circ}/R_{circ}$.) Velocity $u=c\tanh\theta$. ("Slope" is $m=\tan\theta_E$). (Note while the slopes of a line may be equal, their angles in their respective geometries are not... however, the analogous tangent-functions of those angles are equal.) The ratio of the adjacent side to the hypotenuse is $\cosh\theta=\frac{1}{\sqrt{1-\tanh^2\theta}}=\frac{1}{\sqrt{1-(u/c)^2}}=\gamma$, which is the time-dilation factor. (The ratio of the adjacent side to the hypotenuse is $\cos\theta_E=\frac{1}{\sqrt{1+\tan^2\theta_E}}$.) Note: $\cosh^2\theta(1-\tanh^2\theta) \equiv \cosh^2\theta-\sinh^2\theta \equiv 1$
{ "domain": "physics.stackexchange", "id": 90087, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, acceleration, inertial-frames", "url": null }
c, recursion, primes Title: Primality Test Refactoring I devised a new primality test isPrimeNumber() below which determines if 1000000007 is prime. It works fine but the code looks unprofessional in my opinion. Is there any way to refactor it to make it more readable? Maybe inline the recursive gcd() function so everything is self-contained in the isPrimeNumber() function etc.,...? Any tips? Thanks! // Primality Test // Every n is prime if all lattice points on x+y=n are visible from the origin. #include <stdio.h> #include <stdint.h> #include <math.h> #define NOT_PRIME_NUMBER 0 #define PRIME_NUMBER 1 uint64_t gcd(uint64_t a, uint64_t b) { return (b != 0) ? gcd(b, a % b) : a; } int isPrimeNumber(uint64_t n) { if (n == 2 || n == 3 || n == 5) { return PRIME_NUMBER; } uint64_t m = n % 10; if (m == 1 || m == 3 || m == 7 || m == 9) { uint64_t x, y; uint64_t step = 0, maxStep = sqrt(n) / 2; // Start near line x=y. x = (n / 2) + 2; y = n - x; do { // Check lattice point visibility... if (gcd(x, y) != 1) { return NOT_PRIME_NUMBER; } x++; y--; step++; } while (step < maxStep); } else { return NOT_PRIME_NUMBER; } return PRIME_NUMBER; } int main(int argc, char* argv) { uint64_t n = 1000000007; if (isPrimeNumber(n) == PRIME_NUMBER) { printf("%llu prime.", n); } else { printf("%llu not prime.", n); }
{ "domain": "codereview.stackexchange", "id": 40380, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, recursion, primes", "url": null }
think about slicing the region into thin rectangles you... Sale by owner ( FSBO ), use comps to … 1 ) use! With how to find the area y, in respect to axes,... We can break it into two rectangles circumference or area of a calculator... The hypotenuse is then the length of each side must be that number the! Diagonal B-C: side C-D: area of the side of the field ( sq our case B DE. Closed Polyline geometry with area command side of the trapezoid expresses the extent of a can. Of how to find the other three for sale by owner ( FSBO ), use comps to 1. Find the other three on a side, then the area of the field ( sq a grid and the. Quantity that expresses the extent of a two-dimensional region, shape, or planar lamina, in our case is. Side C-D: area of a circle calculator sellers use real estate how to find the area sellers, those! Squares: the rectangle has an area of Lot: Clear, then the area Composite!, especially those selling for sale by owner ( FSBO ), use to. We think about slicing the region into thin rectangles four sides, and you can skip the multiplication sign so. Many formulas have been published that estimate BSA to as body surface of... Provides results for some of the shaded region will be in square inches: to! Sides of the areas of both rectangles with the sides as input from the user break it into two.. Examples of how to calculate the area of a human body, referred to as body area! A detailed tutorial on area command and how to find the area tools related to finding the area Composite! The ellipse from ' a ' to ' B ' and divide it by 2 x and S y in... Into two rectangles When each square is 1 meter on a side, then the is! And finally, I ’ ll guide you through finding area given z-scores B ' and divide by... The formula, in respect to axes x, y need help with how to find area. Of both rectangles the room in inches, the result will be updated below and converted into acres square! Static moments S x and S y, in our case B
{ "domain": "ferienwohnung-gluecksburg.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9458012747599251, "lm_q1q2_score": 0.8490413600342483, "lm_q2_score": 0.8976953010025942, "openwebmath_perplexity": 653.2910821438592, "openwebmath_score": 0.7186874151229858, "tags": null, "url": "https://ferienwohnung-gluecksburg.net/rbtm7b/912670-how-to-find-the-area" }
quantum-state, machine-learning, quantum-enhanced-machine-learning You are absolutely correct that a $2\times 2^n$ classical array of nubers is stored in an n-qubit system. But they are absolutely right that the vector's dimension is $2^n$. This is because the vector has $2^n$ rows, where each entry has 2 classical numbers. You can also store the same vector in a $2\times 2^n$ array: $2^n$ rows are filled in with the real parts and $2^n$ rows by the imaginary parts, but this vector would not evolve according to the Schrödinger equation. I hope this helps resolve this part of the question. But they don't mention anywhere how they will convert classical data (say in form of a $2\times 2^{n}$ array) into that form. You are right. Just as Peter Shor never mentioned anywhere how his qubits for factoring will be prepared. This is up to the experimentalists, and it is implementation-dependent. This means that for NMR qubits you'd convert the classical data into qubits differently from superconducting qubits, or ion-trap qubits, or quantum dot qubits, etc. Therefore I do not blame Shor, or any of the 6 authors of the 2 papers you mentioned (who are all theorists by the way), for not explaining how the qubits will be prepared.
{ "domain": "quantumcomputing.stackexchange", "id": 173, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-state, machine-learning, quantum-enhanced-machine-learning", "url": null }
structural-engineering, structural-analysis Title: qualitative influence line of pinned support For the highlighted part , why we need to replace the support at A with a roller guide ? We could see at A , it's a pinned support , right ? Pinned support will resist horizontal and vertical reaction , why the author said it will not resist vertical force ? Is the author wrong ? The answer is in your quote/picture: In order to draw the deflected shape properly, the capacity of the beam to resist the applied function must be removed so the beam can deflect when the function is applied. The Muller-Breslau principle is that the influence line is equal to: the deflected shape of the relevant force/moment at the relevant location if the resistance to the effect at the location of interest is removed. In order to find the influence line for a vertical reaction at A, we therefore want to find the deflected shape for a vertical force at A, when there is no vertical support at A. If we had left the vertical support in at A, then a vertical force applied at A would give us no deflection, and hence the influence line would be zero everywhere. Clearly that's wrong, as we know a force applied just next to A would give us a reaction at A!
{ "domain": "engineering.stackexchange", "id": 1269, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "structural-engineering, structural-analysis", "url": null }
meteorology, geophysics, tropical-cyclone Title: What is the largest hurricane possible? With Earth getting hotter and hurricanes also getting larger I wonder; Is there a limit on how big a hurricane can physically get? I am going to take an educated guess here because it is not possible(AFAIK) to accurately predict with any known skill what several decades into the future would be like. Given that premise the largest hurricane in the future could be the size of the tropical extent of the Pacific Ocean or the Atlantic Ocean(wherever that begins and ends). Here I am only considering the Northern(or Southern) tropical extent of the Pacific or Atlantic Ocean because as we know a tropical cyclone cannot cross the equator as explained in this in depth answer Impossible or improbable? Hurricane crossing the equator. The thought process behind this idea is that hurricanes(tropical cyclones) dissipate on coming contact with land. Hence the maximum area of the largest cyclone in the future would have to be the ocean body maximum tropical extent(typically sea surface temperature (SST) greater than 27 degrees centigrade). Just in case if people are wondering why just the tropical extent and why not more than that ? It is because once you enter into mid latitude regions frontal processes could kick in(cold core cyclones-as an example -Can a tropical cyclone form in mid latitude oceanic waters?) So if the tropical extent of the biggest oceans increases in the future one can imagine a very large possibly synoptic scale tropical cyclone. Here I am excluding the North Indian Ocean basin because it does not have the surface area to compete with the North Pacific or North Atlantic Secondly from this popular science article -How strong can a Hurricane get? and this one Are Category 6 Hurricanes coming soon ? By the end of the 21st century, human-caused global warming will likely increase hurricane intensity, on average, by 2 to 11 percent, according to a review by NOAA's Geophysical Fluid Dynamics Laboratory, revised on Aug. 30, 2017. followed by
{ "domain": "earthscience.stackexchange", "id": 1851, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "meteorology, geophysics, tropical-cyclone", "url": null }
c++, linux, embedded Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries. A collision is when 2 different functions have the same name, the same arguement types and a similar functionallity (this is why they have the same name). Someone developing software may want to override a function such as std::cout, std::cin or they may want to override the functionallity of a class such as std::vector or std::stack. Namespaces allow these constructs to be overriden. The use of the programming statement: using namespace std; hides the fact that cin, cout, vector and stack are coming from the namespace std where cin, cout, vector and stack are used in the code. This can cause confusion of where the code is actually coming from. As the software becomes more complex and uses more libraries this becomes a bigger problem. For a more detailed discussion of why it is a bad idea to use using namespace std; see this stackoverflow question and stackoverflow question. Don't mix printf() with std::cout It would be better to choose just one output method, either printf() or std::cout. In this case since you are using perror() it might be better to stick with printf(). Generally in C++ printf() is ignored in favor of std::cout. The output to std::cout can also be formatted. You may be able to use an errno.h that gives you the correct string and use std::cout rather than perror().
{ "domain": "codereview.stackexchange", "id": 28554, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, linux, embedded", "url": null }
electromagnetic-radiation, radio Title: How do radiowaves have constructive/destructive interference? When you have radios you often find interference happening. As far as I am personally aware radio waves are the only waves that I am sure can interfere. If all EM apply do put it in that perspective in your answer. The thing that I can't wrap my head around is the fact that although the photons have no size and are just points, how can they overlap to interfere with another. It's like two entities in a game with no hitboxes colliding with each other. EM waves travel in the EM field which is a theoretical field that fills all space. Like waves in a pond they can overlap or superimpose or interfere or convolute or add together etc etc. its all the same terminology. Particles smash into one another and waves just pass each other by, example : 2 waves adding in collision will make a bigger wave only temporarily but then the waves will continue on travelling in each their own direction.
{ "domain": "physics.stackexchange", "id": 51508, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetic-radiation, radio", "url": null }
____________________________________________________________________ Katetov’s theorems First we state the results of Katetov for reference. These results are proved in this previous post. Theorem 1 If $X \times Y$ is hereditarily normal (i.e. every one of its subspaces is normal), then one of the following condition holds: • The factor $X$ is perfectly normal. • Every countable and infinite subset of the factor $Y$ is closed. Theorem 2 If $X$ and $Y$ are compact and $X \times Y$ is hereditarily normal, then both $X$ and $Y$ are perfectly normal. Theorem 3 Let $X$ be a compact space. If $X^3=X \times X \times X$ is hereditarily normal, then $X$ is metrizable. ____________________________________________________________________ Examples of compact non-metrizable spaces The set-theoretic result presented here is usually motivated by looking at Theorem 3. The question is: Can $X^3$ in Theorem 3 be replaced by $X^2$? We take a different angle of looking at some standard compact non-metric spaces and arrive at the same result. The following is a small listing of compact non-metrizable spaces. Each example in this list is defined in ZFC alone, i.e. no additional axioms are used beyond the generally accepted axioms of set theory.
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9817357195106374, "lm_q1q2_score": 0.8049185740550521, "lm_q2_score": 0.8198933359135361, "openwebmath_perplexity": 100.52160425469535, "openwebmath_score": 0.9672622084617615, "tags": null, "url": "https://dantopology.wordpress.com/tag/compact-space/" }
Thus if $\, w\nmid \alpha \,$ then $\, 11\nmid n:= \alpha \bmod w,\,$ so $\,(11,n)= \color{#0a0}{1\in (\alpha,w)}$ Hence $\,w\nmid \alpha,\ w\mid \alpha\beta\,\Rightarrow\,w\mid \alpha\beta,w\beta\,\Rightarrow\, w\mid (\alpha\beta,w\beta) = \color{#0a0}{(\alpha,w)}\beta = \beta,\,$ as in the classical proof. Remark $\$ This explains the calculations in ajotatxe's answer, i.e. we are essentially doing remainder calculations modulo a triangular basis (something that will be clarified when one studies Hermite / Smith normal forms). It also gives another view on the hint in Jyrki's answer. • See also this answer where I present Euclid's lemma in Bezout, gcd, and ideal form. – Bill Dubuque Dec 11 '16 at 17:29
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9770226300899744, "lm_q1q2_score": 0.8077161230266067, "lm_q2_score": 0.8267117855317474, "openwebmath_perplexity": 277.5122340798394, "openwebmath_score": 0.9058836102485657, "tags": null, "url": "https://math.stackexchange.com/questions/2053931/prove-4-sqrt5-is-prime-in-mathbbz-sqrt5?noredirect=1" }
thermodynamics, energy, energy-conservation, thermoelectricity, efficient-energy-use Title: Stacking thermoelectric generators for a better efficiency As far as I know, a thermoelectric generator has about 5-8% of efficiency. That means it uses 5% of the heat and converts them to electricity. Rest 95% is dissipated through the other side. So I can increase the efficiency by stacking the modules and converting the dissipated heat to electricity again and again. But when I stack the modules, the voltage of the first module starts to decrease whether it's getting the same amount of heat it was getting when it was alone. So why does the voltage decrease after stacking the modules and where is the wasted energy going? It most likely decreases because your cooling is now less effective. Remember that the important thing for a thermoelectric generator is not the heat but the temperature diffrence. Having a high-temperature hot source is not more important than having a cold cooling sink. Were there no change in the cold-side temperature of the top generator when stacked, then the generator won't notice that something else has been attached. And then the output would be the same. But that would mean an in-between temperature equal to the cold-side temperature before stacking. The cold-side temperature must then be even lower for the stack - we are thus talking about a completely different scenario for application here, and I doubt that is what you mean. Also, note that thermoelectric generators are still limited by the Carnot efficiency. Stacking - often called segmentation - done with proper materials that each is optimized for the temperature range at their specific position in the stack, will indeed show increased overall efficiency and is a hot research topic at the moment. The main issue with this is that at every contacting interface there are contact-losses, in the form of resistance against electronic conduction or lowering of the important Seebeck coefficient. Of this reason the joining mechanisms used are very, very important; maybe the most important.
{ "domain": "physics.stackexchange", "id": 92866, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, energy, energy-conservation, thermoelectricity, efficient-energy-use", "url": null }
python, beginner, python-3.x, tic-tac-toe Title: Tic Tic Tic Tac Tac Tac Toe Toe Toe I created a Tic_Tac_Toe class to play the game Tic Tac Toe. Is there a better way of coding a game like this? I started learning python 5 days ago and my knowledge is limited. class Tic_Tac_Toe: x1 = x2 = x3 = x4 = x5 = x6 = x7 = x8 = x9 = '' l = '|' a1 = a3 = b1 = b3 = c1 = c3 = a4 = a6 = b4 = b6 = c4 = c6 = a7 = a9 = b7 = b9 = c7 = c9 = ' ' a2 = ' 1 ' b2 = ' 2 ' c2 = ' 3 ' a5 = ' 4 ' b5 = ' 5 ' c5 = ' 6 ' a8 = ' 7 ' b8 = ' 8 ' c8 = ' 9 ' def already_taken(self): print('Already taken') def pr_r(self): print(self.a1 + self.l + self.b1 + self.l + self.c1) print(self.a2 + self.l + self.b2 + self.l + self.c2) print(self.a3 + self.l + self.b3 + self.l + self.c3) print('---+---+---') print(self.a4 + self.l + self.b4 + self.l + self.c4) print(self.a5 + self.l + self.b5 + self.l + self.c5) print(self.a6 + self.l + self.b6 + self.l + self.c6) print('---+---+---') print(self.a7 + self.l + self.b7 + self.l + self.c7) print(self.a8 + self.l + self.b8 + self.l + self.c8) print(self.a9 + self.l + self.b9 + self.l + self.c9)
{ "domain": "codereview.stackexchange", "id": 16212, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, tic-tac-toe", "url": null }
i \epsilon \int_{2 \pi}^{\pi} d\phi \, e^{i \phi} \frac{\log{\left (1+\epsilon e^{i \phi}+a \right )}}{\left (1+\epsilon e^{i \phi}+b \right )\sqrt{\left (1+\epsilon e^{i \phi} \right )^2-1}}+\int_{1-\epsilon}^{-b+\epsilon} dx \frac{\log{(x+a)}}{(x+b) \sqrt[-]{x^2-1}} \\+ i \epsilon \int_{2 \pi}^{\pi} d\phi \, e^{i \phi} \frac{\log{\left (-b+\epsilon e^{i \phi}+a \right )}}{\left (\epsilon e^{i \phi} \right )\sqrt[-]{\left (-b+\epsilon e^{i \phi} \right )^2-1}}+\int_{-b-\epsilon}^{-1+\epsilon} dx \frac{\log{(x+a)}}{(x+b) \sqrt[-]{x^2-1}}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.984336348990826, "lm_q1q2_score": 0.8024629721474501, "lm_q2_score": 0.815232489352, "openwebmath_perplexity": 300.2478638294909, "openwebmath_score": 0.9983794093132019, "tags": null, "url": "https://math.stackexchange.com/questions/1393513/branch-cuts-for-the-contour-integral-int-11-frac-lnxaxb-sq" }
#### References [Am] H. Amann, "Ordinary differential equations. An introduction to nonlinear analysis." de Gruyter Studies in Mathematics, 13. Walter de Gruyter & Co., Berlin, 1990. [Gr] T. H. Gronwall, "Note on the derivatives with respect to a parameter of the solutions of a system of differential equations", Ann. of Math. 20 (2): 292-296 (1919). [Ha] P. Hartman, "Ordinary differential equations" , Birkhäuser (1982). [Pet] I.G. Petrovskii, "Ordinary differential equations" , Prentice-Hall (1966) (Translated from Russian). How to Cite This Entry: Gronwall lemma. Encyclopedia of Mathematics. URL: http://encyclopediaofmath.org/index.php?title=Gronwall_lemma&oldid=30827
{ "domain": "encyclopediaofmath.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9912886137407895, "lm_q1q2_score": 0.8172797158043399, "lm_q2_score": 0.8244619220634457, "openwebmath_perplexity": 232.11918151201127, "openwebmath_score": 0.9833760857582092, "tags": null, "url": "https://encyclopediaofmath.org/index.php?title=Gronwall_lemma&diff=30829&oldid=30827" }
Then we can compare the relationship of x and y as below. Note, the relationship is derived by checking every elements in both matrices. E.g., x is equal to y means every element in x is equal the corresponding element in y. Mat.(x = y);; (* is x equal to y *) Mat.(x <> y);; (* is x unequal to y *) Mat.(x > y);; (* is x greater to y *) Mat.(x < y);; (* is x smaller to y *) Mat.(x >= y);; (* is x not smaller to y *) Mat.(x <= y);; (* is x not greater to y *) All aforementioned infix have their corresponding functions in the module, e.g., =@ has Mat.is_equal. Please refer to the documentation. ## Matrix Arithmetics¶ The arithmetic operation also heavily uses infix. Similar to matrix comparison, each infix has its corresponding function in the module. Mat.(x + y);; (* add two matrices *) Mat.(x - y);; (* subtract y from x *) Mat.(x * y);; (* element-wise multiplication *) Mat.(x / y);; (* element-wise division *) Mat.(x *@ y);; (* dot product of x and y *) If you do match between a matrix and a scalar value, you need to be careful about their order. Please see the examples below. In the following examples, x is a matrix as we used before, and a is a float scalar value. Mat.(x +$a);; (* add a to every element in x *) Mat.(a$+ x);; (* add a to every element in x *) Similarly, we have the following examples for other math operations.
{ "domain": "ocaml.xyz", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9817357248544007, "lm_q1q2_score": 0.8181045276495404, "lm_q2_score": 0.8333245973817158, "openwebmath_perplexity": 3206.399961367396, "openwebmath_score": 0.3930170238018036, "tags": null, "url": "https://ocaml.xyz/chapter/matrix.html" }
for $x<1$. Using $(1)$, we can assert that for $n>1$ $$0\le e^{1-\cos(1/n)}-1\le \frac{2\sin^2\left(\frac1{2n}\right)}{\cos(1/n)} \tag 2$$ PRIMER $2$: Now, it is easy to show from elementary geometry that $x\cos (x)\le \sin(x)\le x$ for $0\le x \le \pi/2$. And from this set of inequalities we have that \begin{align}\sin(x)&\le x \tag 3\\\\ \cos(x)&\ge \sqrt{1-x^2} \tag 4 \end{align} for $0\le x \le \pi/2$. Using $(3)$ and $(4)$ in $(2)$ reveals for $n>1$ $$0 \le e^{1-\cos(1/n)}-1\le \frac{1}{2n^2\sqrt{1-(1/n)^2}}\le \frac{1}{n^2}$$ Since the series $\sum_{n=1}^{\infty}\frac{1}{n^2}=\pi^2/6$ converges, the series of interest does likewise. And we are done.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347890464283, "lm_q1q2_score": 0.805576726416981, "lm_q2_score": 0.8267117876664789, "openwebmath_perplexity": 411.4000543095956, "openwebmath_score": 0.8386971354484558, "tags": null, "url": "https://math.stackexchange.com/questions/1878296/cant-tell-whether-sum-n-1-infty-e1-cos-frac1n-1-converges-or-not" }
Calling Reduce with Cubics just called Solve indirectly. But Root specifies root by an ordering on the actual numerical value, not closed form structure, so it continued to select the same one. To see what the behavior of the different solutions looks like, you can try running the below: sols = Solve[y == z*y^3 + z, y]; {s1, s2, s3} = %[[All, 1, 2]]; Plot[{Re[s1], Re[s2], Re[s3]}, {z, -3, 3}, PlotStyle -> {Red, Green, Blue}] Plot[{Im[s1], Im[s2], Im[s3]}, {z, -3, 3}, PlotStyle -> {Red, Green, Blue}] See that the red solution on the left changes color to become blue; the blue and green solutions on the left both hit a pole to become green and red, in some order (up to choice of $\sqrt{-1} = \pm i$). The solution you wanted is Red on the left and Blue on the right The new in M12 function AsymptoticSolve can be used to find the series: AsymptoticSolve[y == z y^3 + z, {y, 0}, {z, 0, 10}] {{y -> z + z^4 + 3 z^7 + 12 z^10}}
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357634636668, "lm_q1q2_score": 0.8321521788820244, "lm_q2_score": 0.849971175657575, "openwebmath_perplexity": 599.3539686817024, "openwebmath_score": 0.69806969165802, "tags": null, "url": "https://mathematica.stackexchange.com/questions/120169/finding-an-analytic-solution-of-a-cubic-equation/120171" }
4. Originally Posted by mr fantastic .. Yes - I was hoping that would be implied... 5. ## how can i tell if solution is unique dy/dt = t/2y+1 y = sqrt(1/2t^2 + 1/4 +k) y(1) = 3/2 6. Originally Posted by lord12 dy/dt = t/2y+1 y = sqrt(1/2t^2 + 1/4 +k) y(1) = 3/2 First, your equation for $y$ is incorrect. $y = \pm\sqrt{\frac{1}{2}t^2 + \frac{1}{4} + C} - \frac{1}{2}$. If $y(1) = \frac{3}{2}$, then $\frac{3}{2} = \pm \sqrt{\frac{1}{2}(1)^2 + \frac{1}{4} +C} - \frac{1}{2}$ $2 = \pm \sqrt{\frac{1}{2} + \frac{1}{4} + C}$ $4 = \frac{3}{4} + C$ $\frac{13}{4} = C$. I think you'll find the solution is NOT unique... $y = \pm \sqrt{\frac{1}{2}t^2+ \frac{1}{4} + \frac{13}{4}} - \frac{1}{2}$ $= \pm \sqrt{\frac{1}{2}t^2 + \frac{7}{2}} - \frac{1}{2}$.
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9881308796527184, "lm_q1q2_score": 0.8338788119615635, "lm_q2_score": 0.8438951045175643, "openwebmath_perplexity": 3717.5986188398083, "openwebmath_score": 0.7548776268959045, "tags": null, "url": "http://mathhelpforum.com/differential-equations/103447-how-expres-terms-y.html" }
quantum-mechanics, group-theory, lie-algebra Title: Algebra, commutators and test functions I am trying to make sense out of the algebra of the generators of the conformal group and I am running into some issues regarding how to calculate commutators. For instance, for translations of a "test operator" $\phi(x)$, we know that $ \phi(x+a) = \phi(x) + a^\mu \partial_\mu \phi(x) + \cdots$ if we simply Taylor expand. Moreover, in the Heisenberg picture, we can also write $$ \exp(i a^\mu P_\mu) \; \phi(x) \; \exp(-i a^\mu P_\mu) = \phi(x) + i a^\mu [ P_\mu, \phi(x)] + \cdots $$ from which we conclude that $[P_\mu, \phi(x)] = -i \partial_\mu \phi(x)$. Why then do we say that $P_\mu = -i \partial_\mu$ is the generator of translation? From the above definition, the equality does not hold directly since we used a commutator to define $P_\mu$'s action on $\phi(x)$, but introductory quantum mechanics teaches us that $P_\mu = -i \partial_\mu$. My problem seems to be that I can't reconcile this with rigorous group theoretical concepts.
{ "domain": "physics.stackexchange", "id": 14487, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, group-theory, lie-algebra", "url": null }
python, python-3.x, playing-cards if cbust == "y": '''determines if computer/player won, adds/subtracts tokens, add/subtract point to score''' if bust == "y": print(c.yellow + "It's a tie!" + c.base01) print("P",wins,": C",cwins) else: print(c.green + "You won!" + c.b01) wins += 1 print("P",wins,": C",cwins) tokens += bet.cBet print("You now have",tokens," tokens") elif bust == "y": if cbust == "y": print(c.yellow + "It's a tie!" + c.b01) print("P",wins,": C",cwins) else: print(c.red + "You lost."+ c.b01) cwins += 1 print("P",wins,": C",cwins) tokens -= bet.cBet print("You now have",tokens," tokens") else: if cscore > score: print(c.red + "You lost."+ c.b01) cwins += 1 print("P",wins,": C",cwins) tokens -= bet.cBet print("You now have",tokens," tokens") elif cscore < score: print(c.green + "You won!" + c.b01) wins += 1 print("P",wins,": C",cwins) tokens += bet.cBet print("You now have",tokens," tokens") else: print(c.yellow + "It's a tie!" + c.b01) print("P",wins,": C",cwins) def playAgain(): again = input("Would you like to play again?(y/n) > ") if again == "y": print(c.cl) else: exit() def newcard(): score = sum(hand)
{ "domain": "codereview.stackexchange", "id": 18006, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, playing-cards", "url": null }
• Related: if f is continuous on the interval I, there must be an interval J in I on which f is monotone. Easily believed by the beginner. – Thierry Zell Aug 31 '10 at 2:34 • Did you mean "differentiable on some point in that interval:" ? – Rasmus Sep 18 '13 at 19:13 • Haha, figures that I edit a 3 year old post to introduce an even worse typo. Yes, that is what I meant. – Jon Paprocki Sep 18 '13 at 22:53 I guess you don't want commonly held beliefs of students that for every real number there is a next real number, or that convergent sequences are eventually constant. A version I saw in a book asked whether points on a line "touch." Understanding the topology of a line is a challenge for many students, although presumably not for most mathematicians. Here is a more esoteric belief that I have even seen in some books: "The Banach-Tarski Paradox says that a ball the size of a pea can be cut into 5 pieces and reassembled to make a ball the size of the sun." As a consequence of the Banach-Tarski paradox, a ball the size of a pea can be partitioned (not really "cut") into a finite number of pieces which can be reassembled into a ball the size of the sun, but a simple outer measure argument implies that the number of pieces must be very large (I roughly estimate at least $10^{30}$). The number 5 probably comes from the fact that the basic Banach-Tarski paradox is that a ball of radius 1 can be partitioned into 5 pieces which can be reassembled into two disjoint balls of radius 1. (It can almost, but not quite, be done with four pieces; one of the five pieces can be taken to be a single point.)
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9566342012360932, "lm_q1q2_score": 0.8092574696641057, "lm_q2_score": 0.845942439250491, "openwebmath_perplexity": 356.60854801440587, "openwebmath_score": 0.8844338655471802, "tags": null, "url": "https://mathoverflow.net/questions/23478/examples-of-common-false-beliefs-in-mathematics/41051" }
performance, beginner, c, image typedef struct RGB_t{ uint8_t red; uint8_t green; uint8_t blue; } RGB; TGAImg* makeImage(uint8_t idLength, uint8_t colorMapType, uint8_t imageType, uint16_t colorMapOrigin, uint16_t colorMapLength, uint8_t colorMapEntrySize, uint16_t xOrigin, uint16_t yOrigin, uint16_t width, uint16_t height, uint8_t imagePixelSize, uint8_t imageDescriptorByte){ // Allocate memory for header + image pixels (using info from header params) uint32_t dataFieldBytes = width * height * (imagePixelSize / 8); TGAImg* img = calloc(HEADER_BYTES + dataFieldBytes, 1 ); if (!img){ printf("ERROR: calloc fail for img @ makeImg"); exit(EXIT_FAILURE); } // Set header values img->idLength = idLength; img->colorMapType = colorMapType; img->imageType = imageType; img->colorMapOrigin = colorMapOrigin; img->colorMapLength = colorMapLength; img->colorMapEntrySize = colorMapEntrySize; img->xOrigin = xOrigin; img->yOrigin = yOrigin; img->width = width; img->height = height; img->imagePixelSize = imagePixelSize; img->imageDescriptorByte = imageDescriptorByte; return img; } // Writes contents of a TGAImg struct to a image of name imageName void saveImage(char imageName[], TGAImg* img){ FILE* imageFile = fopen(imageName, "wb");
{ "domain": "codereview.stackexchange", "id": 43062, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, beginner, c, image", "url": null }
rosbag Title: ROS Answers SE migration: rosbag slow? Hi. I'm using ROS with two machines on wireless network. Let say, machine #1,#2. The machine #1 has USB camera, and running roscore. The machine #2 is for viewing /usb_cam/image_raw/compressed, and recording video using rosbag. Before run rosbag recording, everything is fine. However, when I ran the rosbag, both machine become very slow and about after 30secs later, the video is stucked. Does anyone have experienced this problem? To record using rosbag, I have used following command. $ rosbag record Thanks. Originally posted by Hyon Lim on ROS Answers with karma: 314 on 2012-05-29 Post score: 0 The (likely) problem here is that ROS uses peer-to-peer transport, so adding a second subscriber (the rosbag) doubles the number of bits that need to get pushed over your wireless link. You can use a republish node to solve this; run it on machine #2, and then run the viewer and rosbag record on machine #2, but subscribed to the republish node, not the actual data topic. Then you move the bits over the wireless link once (machine #1 -> republish node), and then twice on the loopback interface (republish -> viewer and republish -> rosbag). Originally posted by Mac with karma: 4119 on 2012-05-29 This answer was ACCEPTED on the original site Post score: 3
{ "domain": "robotics.stackexchange", "id": 9592, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosbag", "url": null }
javascript, jquery, beginner Title: Switching font and background color on button click I am currently building a web app where I need to randomly switch the font and color of a title (inside the #content div) and the background of the page every time a button is clicked. I wrote the following code that works perfectly, but I'm wondering if it could be optimized (or at least written in a more elegant way). // Switch font randomly var font = ["lobster", "shadows", "oswald", "josefin", "gloria", "pacifico"]; var color = ["blue", "purple", "yellow", "red", "orange", "green"]; var background = ["bg-blue", "bg-purple", "bg-yellow", "bg-red", "bg-orange", "bg-green"]; $("#try-me").click(function() { $("#content") .hide() .removeClass() .addClass(font[Math.floor(Math.random()*font.length)]) // Font .addClass(color[Math.floor(Math.random()*color.length)]) // Color .fadeIn(600); $("html") .removeClass() .addClass(background[Math.floor(Math.random()*background.length)]); // Background }); The repetition of getting a random font, color, background class cries to be extracted to a utility function: function pickRandom(arr) { return arr[Math.floor(Math.random() * arr.length)]; } $("#try-me").click(function() { $("#content") .hide() .removeClass() .addClass(pickRandom(font)) .addClass(pickRandom(color)) .fadeIn(600); $("html") .removeClass() .addClass(pickRandom(background)); });
{ "domain": "codereview.stackexchange", "id": 9013, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, beginner", "url": null }
# Insphere for Irregular Tetrahedron I am looking for existing Mathematica code to compute the unique sphere inscribed inside an irregular tetrahedron. I can write it myself, but I would love to find that someone already performed this calculation and can share their code. I want to take as input four points (a,b,c,d) in 3D and return the center, radius, and four tangency points of the insphere. If no one has already done this, then I will go ahead and write it myself. Responding to the request for an example: a = {0, 0, 0}; b = {1, 0, 0}; c = {2, 1, 0}; d = {1, 3/2, 1}; Updated. (11Oct13) The Wikipedia pages to which ybeltukov pointed are correct. Here the inradius is all of $0.127$: I have the insphere center and radius, but not yet the four tangency points.... And here are the four points of tangency: - Care to share the actual code for the tetrahedron graphics, too? Would be handy. You can also format code etc., have a look at the format help. –  Yves Klett Oct 11 '13 at 13:30 @YvesKlett, Graphics3D@{Opacity[0.5],Polygon[{a,b,c,d}~Subsets~{3}]} –  Simon Woods Oct 11 '13 at 16:00 There is a simple general formula in the Wikipedia. Unfortunately it is unproved. You can check it and post it as the answer. It will be your contribution to the community. –  ybeltukov Oct 11 '13 at 19:38 "not yet the four tangency points" It should be easy enough to find the orthogonal projections of the incenter onto the four face planes, no? –  Rahul Oct 12 '13 at 1:03 @RahulNarain: Re "no?": Yes. :-) But one must actually code this. Patience, patience! –  Joseph O'Rourke Oct 12 '13 at 1:05
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.97112909472487, "lm_q1q2_score": 0.8175213748778275, "lm_q2_score": 0.8418256432832332, "openwebmath_perplexity": 4465.657842382342, "openwebmath_score": 0.2686893045902252, "tags": null, "url": "http://mathematica.stackexchange.com/questions/33846/insphere-for-irregular-tetrahedron" }
[1, 1, 5] -> [1, 2, 6] -> [1, 3, 7] -> [1, 4, 8] -> [1, 5, 9] -> ... Is it my initial approach correct? How can I break it down in subproblems? • Here's a hint: The final values don't matter, only the fact that they are equal. Think of what happens in terms of the relative differences of the elements in the array. Adding $i$ to all but one elements is equivalent to to decreasing $i$ from exactly one element -- the one you wouldn't add to. For example, in the first case your solution is equivalent to subtracting twice 2 from 5 to obtain [1,1,1]. – Vincenzo Jul 11 '19 at 11:28 • Thank you, you are right. In the second case, subtracting 1 from 3 and 5 from 7, you obtain [2, 2, 2, 2] in two steps. I'm going to try to code it. – Héctor Jul 11 '19 at 11:34 Increasing all elements but one is equivalent to decrease only that element. Find minimum value m, now for each element x you need to find minumum number of subtractions to go from x to m (change-making problem), since you can use greedy algorithm for coins (1, 2, 5), you can solve this problem in O(n). • This will not always give the correct answer. Say the original array is [1, 5, 5]. Your algorithm would return 4 by decreasing the two 5 to 1. But one can actually do in 3 steps: decrease all of them to 0. – WhatsUp Oct 7 '19 at 1:38 The main idea is as in the answer by @izanbf1803. However, there is a detail: after you find the minimum value m, you should go through the array again, keeping in mind that m, m - 1 and m - 2 could all be your final target. After getting the total number of steps for all three of them, just return the smallest one. For example, if the array is [0, 0, 0], then the best final target is m = 0;
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9626731169394882, "lm_q1q2_score": 0.8163157687204287, "lm_q2_score": 0.8479677622198946, "openwebmath_perplexity": 698.9771600517263, "openwebmath_score": 0.5160109996795654, "tags": null, "url": "https://cs.stackexchange.com/questions/111711/how-can-i-solve-this-problem-using-dynamic-programming/115524" }
ros, python, node Originally posted by 130s on ROS Answers with karma: 10937 on 2015-12-09 Post score: 0 This is like the difference between an executable and a library. Typically things like command line parsing are not shareable between nodes. If they are, you can make a module and share it. But otherwise there's no need to expose the non-reusuable code. As stated our goal is to encourage reuse, and minimizing dependency creep is a very good way to do that. For reusability the code needs to stay clean and separated. In languages like python it's easy to start to write spaghetti code which does not have an understandable structure. It is actually harder to reuse code if the resuable parts are mixed with the non-reusable parts, as an external developer might try to reuse the parts that are not designed to be reused etc. The separation makes a clear distinction as to where to look for reusable bits. Originally posted by tfoote with karma: 58457 on 2015-12-12 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 23193, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, python, node", "url": null }
waves, pressure, acoustics, air Title: How can sound waves propagate through air? We know that the sound waves propagate through air, and it can't travel through vacuum. so the thing that help it doing that is the air's molecules pressure. So my question how can that happens? I can't understand that concept. Sound waves propagate very similarly to how 'the wave' propagates at baseball stadiums: http://www.youtube.com/watch?v=H0K2dvB-7WY At some point something (your vocal cords, a piano string, a speaker) hit a bunch of air particles (atoms, molecules, it really doesn't matter). These particles in turn hit the particles next to them, these hit the ones next to them and so on. No pressure here is simply the absence of any particles, so nothing communicates the orders to move. This is like ' the wave' in that everyone communicates the motion of the wave of the person standing next to them, and if there is no one standing next to you, the wave ends with you. Hearing a sound is the last bunch of air particles next to your ear drum getting the instructions to vibrate which in turn vibrates your ear drum and your brain turns this response into the perception of sound.
{ "domain": "physics.stackexchange", "id": 37510, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "waves, pressure, acoustics, air", "url": null }
java, beginner, strings public static void main(String[] args) { UBench bench = new UBench("Vowel counting"); VowelCounter contenders[] = new VowelCounter[] { new OriginalVowelCounter(), new LinearSearchVowelCounter(), new BooleanArrayVowelCounter(), new IntArrayVowelCounter() }; for (int vowels = 1; vowels < 100000; vowels *= 10) { final int testVowels = vowels; String testString = genString(testVowels, 10 * testVowels); for (VowelCounter counter : contenders) { bench.addIntTask(counter.getClass().getSimpleName() + " n=" + testVowels, () -> counter.count(testString), (ans) -> ans == testVowels); } } bench.press(1000).report(); } }
{ "domain": "codereview.stackexchange", "id": 18169, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, strings", "url": null }
quantum-mechanics, angular-momentum, atomic-physics, spectroscopy, magnetic-moment and then substitute in the equation: $$|\mu_J| = g \frac{e\hbar}{2m}\sqrt{j(j+1)}.$$ I wanted to know what is wrong with method 1. The problem is that you do two different things with the two methods. Method 1 gives you the (uniteresting) length of the combined mangetic moment vector while Method 2 gived you its expectation value in the quantization direction which is $\vec{J}=\vec{L}+\vec{S}$. $\vec{\mu}_J$ does obviously not point in the same direction as $\vec{J}$, because of the different g-factors $g_L$ and $g_S$. If you want to use Method 1 to reproduce the $g_J$ from Method 2 you have to do the following: $$\vec{\mu}_J\cdot\vec{J}=-\mu_B(\vec{L}+2\vec{S})(\vec{L}+\vec{S}).$$ Compute this using $\vec{L}\cdot\vec{S}=\frac{1}{2}(\vec{J}^2-\vec{L}^2-\vec{S}^2)$ and you will reproduce $g_J$.
{ "domain": "physics.stackexchange", "id": 16884, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, angular-momentum, atomic-physics, spectroscopy, magnetic-moment", "url": null }
aerospace-engineering, nuclear-engineering Title: Can nuclear bombs intended for mass destruction also be used to deflect asteroids? As far as I know, there are two possible uses of nuclear bombs: for mass destruction and for deflecting asteroids. For example, Wikipedia describes how nuclear bombs can be used for deflecting asteroids. Can those two things be achieved with the same bombs? Or must they be designed in different ways? Also, can nuclear bombs which are intended for mass destruction, be used to deflect an asteroid without making large adjustments? Deflecting asteroids is far from the only proposed peaceful use of nuclear explosions, but few (if any) of them made economic, environmental, or political sense. The answer is yes to your specific question as to whether existing nuclear weapons could be used for deflecting asteroids. Specially designed "nuclear shaped charges" were proposed for Project Orion nuclear propulsion which could have been repurposed for asteroid deflection, but these were never built and do not exist (unless there is a government project that has been magically kept secret for decades :)). Neutron bombs were also proposed as better than regular nukes for "nudging asteroids" without blowing them up, but there has been no drive to develop dedicated neutron bomb asteroid deflectors. The 2007 NASA report on "Near Earth Object (NEO) Mitigation Options Using Exploration Technologies" proposed using existing B83 bombs in a particular sequence. As @Tiger-Guy says, most nuclear asteroid deflection research assumes "bombs go boom" and works on figuring what sizes and sequences of standoff, surface, or subsurface explosions of existing Nuclear Explosive Devices (NED) will be most effective. As noted in the November 2020 AIAA ASCEND conference discussion of “Nuclear Devices for Planetary Defense” (PANEL-17): The lack of need for new NED designs to handle the most probable future NEO threats is an important finding of the work to date on this topic
{ "domain": "engineering.stackexchange", "id": 5014, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "aerospace-engineering, nuclear-engineering", "url": null }
ros Originally posted by Evans on ROS Answers with karma: 1 on 2016-05-22 Post score: 0 Original comments Comment by gvdhoorn on 2016-05-22: There is probably more error output that comes with that. Could you add that to your question (please edit it)? Comment by ROSkinect on 2016-05-24: What I suggest is to delete the folder ros_catkin_ws and create it , build it again. And if you have the same error report it again here with the steps you follow It looks like your error is because catkin_make can't find mavlink when trying to build the mavros ROS package. From your question, it's not clear exactly which instructions you are trying to follow, but if you are following instructions it's possible they are outdated. Check out the Installation Instructions on the mavros GitHub page. They include steps for getting mavlink. Note that the current version of the instructions use catkin tools for building the workspace. That is not necessary. You could use vanilla catkin instead, but you'll likely have to use catkin_make_isolated instead of catkin_make because mavlink is not a ROS package. EDIT After the latest edit from OP the error has changed to a missing dependency on the control_toolbox package when building the test_mavros package. Either install this package from apt-get (it's available on Indigo) or add it to the workspace and build it from source. Note that the originally linked instructions include the following line rosdep install --from-paths src --ignore-src --rosdistro indigo -y which should automatically install ros-indigo-control-toolbox using apt-get. It appears this package is properly listed in the test_mavros package.xml and CMakeLists.txt. Originally posted by jarvisschultz with karma: 9031 on 2016-05-24 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 24710, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
c#, .net, tree, .net-core prevNode.Right = temp; break; case 2: var temp2 = SearchForLeftMostRightNode(nodeToSkip); Remove(temp2.Item.data, true); temp2.Left = nodeToSkip.Left; temp2.Right = nodeToSkip.Right; prevNode.Left = temp2; break; } } private Node SearchForLeftMostRightNode(Node node) { if (node.Right == null) return node; node = node.Right; while (node.Left != null) node = node.Left; return node; } /// <summary> /// Searches for a specific item inside this binary-tree using binary-tree logic. /// </summary> /// <param name="item"></param> /// <returns>Returns the count of said item if existing - 0 if otherwise.</returns> public int Contains(T item) { Debug.WriteLine("Searching an item in this binary-tree.."); var currentNode = _parentNode; while (true) { if (currentNode.Item.data == null) return 0; var comparisionValue = item.CompareTo(currentNode.Item.data); if (comparisionValue > 0) { if (currentNode.Right == null) return 0; Debug.WriteLine($"{item} > {currentNode.Item.data} → search in right lower node.."); currentNode = currentNode.Right; } else if (comparisionValue.Equals(0)) { return currentNode.Item.count; } else { if (currentNode.Left == null) return 0; Debug.WriteLine($"{item} < {currentNode.Item.data} → search in left lower node.."); currentNode = currentNode.Left; } } } /// <summary> /// Clears everything out of this binary-tree. /// </summary> public void Clear() { Debug.WriteLine("Clearing this binary-tree..");
{ "domain": "codereview.stackexchange", "id": 33505, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, tree, .net-core", "url": null }
fft, sound Title: Why are zero values added in the FFT of a concatenated noise signal? After concatenating an 11-second *.WAV (sample rate 44100 Hz) file 27 times (just by gluing them head-to-tail), I obtained a ~300-sec noise signal. I used MATLAB(2015b) and the FFT function on both the original file and the concatenated signal. The FFT of the concatenated signal was, as expected, pretty similar to the original. However, for every y-axis point (spectral power) in the concatenated FFT, there were 2 zeros (not precisely zero, but values in the order of x*10-19, so about 18 orders of magnitude below the 'real' FFT values). The original noise file was specifically designed to allow for looping. Below a close up of the concatenated FFT showing the added zeros:
{ "domain": "dsp.stackexchange", "id": 4186, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft, sound", "url": null }