text stringlengths 1 1.11k | source dict |
|---|---|
classical-mechanics, lagrangian-formalism, coordinate-systems, velocity, differentiation
$$\begin{align}
\frac{d}{dt} \frac{\partial L}{\partial \dot q^\alpha} & = \frac{\partial}{\partial \dot q^\alpha} \frac{dL}{dt} &\text{commutativity of derivatives} \\ \ \\
&= \frac{\partial \dot L}{\partial \dot q^\alpha} \\ \ \\
&= \frac{\partial L}{\partial q^\alpha} & \text{cancellation of dots} \end{align}$$
This can't be right, or else nobody would give a hoot about this equation and it would be totally useless to solve any problem. What is wrong with the logical reasoning above? Ah, what a tricky mistake you've made there. The problem is that you've simply confused some notions in multivariable calculus. Don't feel bad though-- this is generally very poorly explained. Both steps 1 and 3 above are incorrect. Rest assured, the Euler-Lagrange equation is not trivial.
Let's first take a step back. The Lagrangian for a particle moving in one dimension in an external potential energy $V(q)$ is
$$
L(q, \dot q) = \frac{1}{2}m \dot q^2 - V(q).
$$ | {
"domain": "physics.stackexchange",
"id": 51811,
"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": "classical-mechanics, lagrangian-formalism, coordinate-systems, velocity, differentiation",
"url": null
} |
python, beginner, project-euler
Now the rest of the code simplifies to:
#horizontal and vertical
for h in xrange(0,20):
for hsub in xrange(0,17):
horizontal = product_in_direction(grid, (hsub, h), (1, 0), 4)
vertical = product_in_direction(grid, (h, hsub), (0, 1), 4)
if horizontal > largest[0]:
largest[0] = horizontal
if vertical > largest[1]:
largest[1] = vertical
#diagonal right and left
for r in xrange(0,17):
for rsub in xrange (0,17):
right_diagonal = product_in_direction(grid, (rsub, r ), (1, 1), 4)
left_diagonal = product_in_direction(grid, (rsub, r+3), (1, -1), 4)
if right_diagonal > largest[2]:
largest[2] = right_diagonal
if left_diagonal > largest[3]:
largest[3] = left_diagonal
As a next step, we will remove the unnecesary largest array: Why do we need to remember four different values when we only want the largest?
largest = 0 | {
"domain": "codereview.stackexchange",
"id": 5402,
"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, project-euler",
"url": null
} |
Last edited: Mar 15, 2014
11. Mar 15, 2014
### economicsnerd
Some examples of things that work for Banach space, but stop being true if we replace "Banach space" with "normed linear space":
- Every absolutely summable series in a Banach space has a sum.
- If $X,Y$ are Banach spaces, and $T:X\to Y$ is a linear continuous bijection, then the inverse map $T^{-1}:Y\to X$ is also a linear continuous map. This really helps us get some nice structure on $\mathcal B(X)=\{T:X\to X: \enspace T \text{ is linear and continuous}\}$ for a Banach space $X$.
- If $X,Y$ are Banach spaces, and $(T_n)_{n=1}^\infty$ is a sequence of linear continuous maps $X\to Y$ which converges pointwise to $T:X\to Y$ (i.e. $T_n(x)\to T(x)$ as $n\to\infty$ for every $x\in X$), then $T$ is itself a linear continuous map. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9572777975782054,
"lm_q1q2_score": 0.815555496511275,
"lm_q2_score": 0.8519527963298947,
"openwebmath_perplexity": 323.1467838469467,
"openwebmath_score": 0.8602431416511536,
"tags": null,
"url": "https://www.physicsforums.com/threads/why-banach-spaces.733882/"
} |
newtonian-mechanics, general-relativity, inertial-frames, geodesics
The coordinate time $t$ is not an invariant, so can not be used to define a vector.
The relation between the coordinate time $t$ and the proper time $\tau$ depends on the metric of the reference frame in which you describe the physical events. In general relativity you have $ds^2 = g_{\mu \nu} dx^\mu dx^\nu$, where for a timelike trajectory $ds^2 = - d\tau^2$. The relation with the time coordinate is not as simple as it is in special relativity, as in your post. | {
"domain": "physics.stackexchange",
"id": 57952,
"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": "newtonian-mechanics, general-relativity, inertial-frames, geodesics",
"url": null
} |
My function is: \\$\\overline XZ + XY\\$ H. Strugging with truth tables? I made this app just for you - quickly generate truth tables from any boolean logic statement - it also includes an interactive tutor that teaches you how to solve truth tables step-by-step! Download Now!. Improve your math knowledge with free questions in "Truth tables" and thousands of other math skills. Show using truth tables :. related qualifications Eg, in electronics or computer science. In the above table (Table 4. ) Using the truth table as a guide I desgined the following logic gate using my DPDT relays. Most of us use the IF function all the time, for example to test if one value is larger than another value. We are going to use four logic gates: AND, OR, NOT and XOR. Theorems which have the form "P if and only Q" are much prized in mathematics. However, it must be noted that there are two basic methods in determining the validity of an argument in symbolic logic, namely, truth table and. Is there any | {
"domain": "cloudscuola.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464485047916,
"lm_q1q2_score": 0.8132801752066438,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 795.8803509624115,
"openwebmath_score": 0.6178021430969238,
"tags": null,
"url": "http://cloudscuola.it/sgxh/truth-table-logic-gates-calculator.html"
} |
ros, python2.7, ros-kinetic
Title: Subscriber python CameraInfo and Image
Hello i am new to ros and python. Need little help in how to subscribe to CameraInfo and Image of format sensor_msgs.msg and use its data for further image processing. Here are few lines of code that i am starting with:
from sensor_msgs.msg import CameraInfo, Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
if __name__ == '__main__':
rospy.init_node('node_name')
while ~rospy.is_shutdown():
sub_cam_info = rospy.Subscriber('/camera/rgb/raw_camera_info', CameraInfo)
sub_rgb = rospy.Subscriber('/camera/rgb/raw_image_color', Image)
From here i want to extract header and data information from 'sub_cam_info' and 'sub_rgb'. Something like this:
camera_info_K = sub_cam_info.K
camera_info_dist_model = sub_cam_info.distortion_model
rgb_image = CvBridge().imgmsg_to_cv2(sub_rgb, encoding="rgb8")
And then use this data for image undistortion:-
rgb_undist = cv2.undistort(rgb_img.data, camera_info_K, camera_info_dist_model) | {
"domain": "robotics.stackexchange",
"id": 32898,
"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, python2.7, ros-kinetic",
"url": null
} |
python, meta-programming
You’re pretty much re-inventing zip here, use that instead. To extract out the first (self) parameter, you can use next (in Python 3) or slicing (in Python 2). To get a consistent behaviour accross Python versions, you can use itertools.izip in Python 2.
Something along the lines of:
arguments = zip(formalArgs, args)
_, self = next(arguments)
for name, value in arguments:
setattr(self, name, value)
You can also define your wrapper as def wrapper(self, *args, **kwargs) to remove the need for next and already extract the value of self out of the args tuple. This will mean you’ll have to slice formalArgs though:
def wrapper(self, *args, **kwargs):
formal_args = inspect.getargspec(func)[0][1:]
for name, value in zip(formal_args, args):
setattr(self, name, value) | {
"domain": "codereview.stackexchange",
"id": 27274,
"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, meta-programming",
"url": null
} |
homework-and-exercises, electromagnetism, electromagnetic-induction, inductance
So you can use the formula $B = \frac{\mu_0 \cdot I}{Lenght}$ which is the formula they used in the solution you linked to your post. So using these assumptions is a good approach for this problem if you solve it by hand, since otherwise it would get way too complicated. | {
"domain": "physics.stackexchange",
"id": 74169,
"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, electromagnetic-induction, inductance",
"url": null
} |
c++, recursion, mathematics
This follows one of the typical recursive formulations -- basically a function that's almost like an inductive proof. Start by establishing a correct value for the simplest possible base case (or some obvious base case anyway), and then establish a pattern that's correct for some some sort of "Base+1" type of case. | {
"domain": "codereview.stackexchange",
"id": 751,
"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, mathematics",
"url": null
} |
The easiest and most elegant way is to apply the chain rule literally: $\def\lfrac#1#2{{\large\frac{#1}{#2}}}$
$\lfrac{d(\cos(cx))}{dx} \overset{\text{chain rule}}= \lfrac{d(\cos(cx))}{d(cx)} \times \lfrac{d(cx)}{dx} = -\sin(cx) \times c$ for any variable $x$ and constant $c$.
Of course this then gives $\lfrac{d(-\frac1c\cos(cx))}{dx} = -\lfrac1c ( -\sin(cx) \times c ) = \sin(cx)$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992909680777,
"lm_q1q2_score": 0.8023292807399302,
"lm_q2_score": 0.8289388040954684,
"openwebmath_perplexity": 1159.5011957794827,
"openwebmath_score": 0.998849093914032,
"tags": null,
"url": "https://math.stackexchange.com/questions/1872713/understanding-a-cosine-derivative/1872874"
} |
java, algorithm
Title: Check if a binary tree is a subtree of another tree I am doing a refresher on algorithms.
I tried to solve the problem of determining if you have 2 trees (T1 and T2), one is a subtree of the other.
I came up with the following:
public boolean isSubtree(Node n1, Node n2){
if(n2 == null) //Empty Subtree is accepted
return true;
if(n1 == null)
return false;
//If roots are equal, check subtrees
if(n1.data == n2.data){
return isSubTree(n1.left, n2.left) && isSubTree(n1.right, n2.right);
}
else{//No match found for this root. Check subtrees
return isSubTree(n1.left, n2) || isSubTree(n1.right, n2);
}
} | {
"domain": "codereview.stackexchange",
"id": 1714,
"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, algorithm",
"url": null
} |
thermodynamics, power, thermal-conductivity
Most discussions about the second thermodynamic law focuses on adding heat to some ambient system. Your thought is that if you start with a very large heat source, you don't need to add anything until "Venus is a cold, dead planet" as commented. And everything the question posits is true, however it is omitting any process for waste heat disposal, without which the process can not run on indefinitely. The math for this has been done by a 19th century French army mechanical engineer named Nicolas Sadi Carnot, who through meticulous calculations derived an ideal heat engine, with which we can calculate the maximum theoretical attainable efficiency of any heat engine. That final calculation reduced the entire efficiency problem down to nothing more than two variables: the hot and cold temperatures of the system:
$$\eta_{max} = 1 - \frac{T_L}{T_H}$$ | {
"domain": "physics.stackexchange",
"id": 70799,
"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, power, thermal-conductivity",
"url": null
} |
statistical-mechanics
But then, I couldn't understand why the number of systems 'entering this volume in time $dt$ through the face $q_1$= constant' is given by the quantity $\rho(\dot{q_1}\mathrm dt, \mathrm dq_2, \ldots,\mathrm dp_f )\;.$
My questions are:
$\bullet$ How does $\rho(q_1,q_2,\ldots, q_f; p_1,p_2,\ldots, p_f ; t)((\dot{q_1}\mathrm dt)(\mathrm dq_2, \ldots,\mathrm dp_f ))$ represent the number of systems that would enter the volume in time-interval $\mathrm d t\;?$
$\bullet$ How does the evaluation of $\dot q_i$ at $q_1+\mathrm dq_1$ yield $\dot q_i +\dfrac{\partial \dot q_i}{\partial q_1}\mathrm dq_1 \;?$ In the figure the volume element is moving from right to left. So the shaded region on the left multiplied by the "coarse-grained" density at that region is the number of systems entering the volume element. | {
"domain": "physics.stackexchange",
"id": 28797,
"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": "statistical-mechanics",
"url": null
} |
c++, algorithm, programming-challenge, time-limit-exceeded, c++14
n: an integer, the length of string s
s: a string
Input Format
The first line contains an integer, n , the length of s. The second line
contains the string .
Constraints
1 ≤ n ≤ 10^6
Each character of the string is a lowercase alphabet, ascii[a-z].
Output Format
Print a single line containing the count of total special palindromic
substrings.
Sample Input 0
5
asasd
Sample Output 0
7
Explanation 0
The special palindromic substrings of s = asasd are {a, s, a, s, d, asa, sas}.
Sample Input 1
7
abcbaba
Sample Output 1
10
Explanation 1
The special palindromic substrings of s = abcbaba are {a, b, c, b, a, b, a, bcb, bab, aba}.
Sample Input 2
4
aaaa
Sample Output 2
10
Explanation 2
The special palindromic substrings of s = aaaa are {a, a, a, a, aa, aa, aa, aaa, aaa, aaaa}.
Code:
#include <bits/stdc++.h>
using namespace std;
// Complete the substrCount function below.
long substrCount(int n, string s) { | {
"domain": "codereview.stackexchange",
"id": 31809,
"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++, algorithm, programming-challenge, time-limit-exceeded, c++14",
"url": null
} |
human-biology, pathology
Title: Standard Classification of Disease I am working on a project for health center. It involves the creation of a database of all diseases. Currently I want to classify disease on the base of their category based on international standard.
Did anyone know where i can find one, I did a lot of research but was only able to come across this which seem not very useful to me: ICD The two I know of off the top of my head are
OMIM : Online Mendelian Inheritance in Man. This is very good and very well organized but only deals with inheritable diseases, no infections etc.
Human disease ontology. From their webpage: | {
"domain": "biology.stackexchange",
"id": 1638,
"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": "human-biology, pathology",
"url": null
} |
c#, multithreading, .net
{
action(closure);
}
catch (Exception ex)
{
HandleException(ref exceptionsBag, countdown, ex);
}
finally
{
countdown.Signal();
}
}, item);
}
foreach (T value in onMainThread)
{
try
{
action(value);
}
catch (Exception ex)
{
HandleException(ref exceptionsBag, countdown, ex);
}
}
countdown.Wait();
if (exceptionsBag != null)
throw new AggregateException(exceptionsBag);
} | {
"domain": "codereview.stackexchange",
"id": 18747,
"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#, multithreading, .net",
"url": null
} |
spectroscopy, molecules, heat
Can it vibrate only on one axis, the one joining the two atoms? What happens to the electrons during the vibration? The diatomic can vibrate only by extending and contracting the bond. The more energy that is added the bigger the bond excursion. (More vibrational levels are excited and have bigger excursions). The bond only extends by a few % of its length in lower vibrational levels so its pretty hard to see. If heaps & heaps of energy are added (temp say $1000$ K) then in a real molecule the bond can break as it is actually anharmonic in its motion. When this happens the atoms fly apart.
Additionally the molecule can also rotate while it is vibrating. Rotation is a slower motion than vibration so many vibrational periods occur within a $360$ degree rotation.
At any given constant temperature in a sample of molecules the energy moves between vibrations, rotations and translations so that each type of energy is in equilibrium. | {
"domain": "chemistry.stackexchange",
"id": 6901,
"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": "spectroscopy, molecules, heat",
"url": null
} |
organic-chemistry, acid-base
Title: Why is CF3COOH exceptionally acidic? The pKa values of almost all carboxylic acids lie much above 0. But this is violated by trifluoroacetic acid(-0.25). How can this be justified? Try drawing the structure of the conjugate base $\ce{CF_3COO^-}$. In general, the more stabilized the negative charge of the conjugate base is, the more the equilibrium favors that form, thus the more the acid dissociates, thus the "stronger" the acid is. | {
"domain": "chemistry.stackexchange",
"id": 7509,
"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": "organic-chemistry, acid-base",
"url": null
} |
rviz
Comment by dgossow on 2013-02-23:
Indeed, RViz caches all meshes, textures, etc.
Comment by TommyP on 2013-02-23:
So is it impossible to re-load them without re-starting rviz?
Comment by lucasw on 2016-05-24:
It looks like a previous poster tracked down the code responsible (circa 2011) http://answers.ros.org/question/11871/collada-dae-resource-not-updated-in-rviz/ - it would be great to be able force a reload without creating multiple files, maybe a pr can be made out of this. | {
"domain": "robotics.stackexchange",
"id": 13012,
"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": "rviz",
"url": null
} |
organic-chemistry, bond, halides, hydrocarbons
Accordingly, we can easily suggest that $\ce{C-H}$ bond in 1,2-dibromoethane is longer than that in 1,2-dibromoethene. However, this is hardly a surprise since we are comparing a $\mathrm{sp^3-s}$ bond versus a $\mathrm{sp^2-s}$ bond. Nonetheless, this is a good exercise because it confirm the validity of the test, in a way. Yet, the $\ce{C-H}$ stretching at around $\pu{3000 cm^{-1}}$ is undoubtedly suggested that $\ce{C-H}$ bond in 1,2-dibromoethane is shorter than a $\ce{C-H}$ bond in a regular alkane.
Now, let's see two good liquid alkane and alkene examples to represent gasious ethane and ethene, respectively.
2-Methylpent-1-ene (a terminal alkene) is a liquid at room temperature and $\pu{760 torr}$ with boiling point of $\pu{62 ^\circ C}$. n-Pentane (the shortest n-alkene at ambient condition) is a liquid at room temperature and $\pu{760 torr}$ with its boiling point around the range of $\pu{35-36 ^\circ C}$. | {
"domain": "chemistry.stackexchange",
"id": 10222,
"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": "organic-chemistry, bond, halides, hydrocarbons",
"url": null
} |
image-processing, discrete-signals, frequency, time-frequency
Title: Why we need Frequency and Time information at the same time The big disadvantage of a DFT is that it has only frequency resolution and no time resolution. This means that although we might be able to determine all the frequencies present in a signal, we do not know when they are present. So we go for Wavelets.
My question is, What are the applications (other than music & speech processing ) that require both the time and frequency information at same time ?
How do you relate that we require both spatial (time) and frequency information in an image at a same time ?
Give me some good examples and suggest a book (PDF links) to learn Wavelet Multiresolution Analysis (For Dummies) For the source, go to end of the answer | {
"domain": "dsp.stackexchange",
"id": 1524,
"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": "image-processing, discrete-signals, frequency, time-frequency",
"url": null
} |
homework-and-exercises, particle-physics, definition
If there is a probability non zero for a specific interaction, it will happen, in order to fulfill the probability spectrum.
Probabilities are controlled not only by the form of the wavefunctions in the boundary conditions of the interaction, but also by conservation laws: energy, momentum, angular momentum, and a plethora of quantum number conservation as charge, baryon number , lepton number ... If these are conserved during the interaction, it will have a probability of happening.
In the specific case, the weak interaction does not conserve flavor, charge and lepton number are, so if it is energetically possible, the quarks can change flavor through weak interaction. | {
"domain": "physics.stackexchange",
"id": 61085,
"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, particle-physics, definition",
"url": null
} |
waves, acoustics, interference, double-slit-experiment
\begin{align}
\alpha &= \frac{1}{2}\sqrt{(x+d/2)^2+y^2} + \frac{1}{2}\sqrt{(x-d/2)^2+y^2}, \\
\beta &= \frac{1}{2}\sqrt{(x+d/2)^2+y^2} - \frac{1}{2}\sqrt{(x-d/2)^2+y^2}.
\end{align}
Approximate expressions for $\alpha$ and $\beta$ may be found by expanding the square roots in a Taylor series and isolating terms that differ by the presence of the $\pm$ symbol. To $O(d^6/y^6)$ we may write
\begin{align}
\alpha &= y + \frac{x^2+d^2/4}{y} + \frac{x^6+(3/2)x^2d^2+d^6/64}{y^3}, \\
\beta &= \frac{xd}{2y} - \frac{2xd}{y^3}(x^2+d^2/4).
\end{align}
Substituting this expression the acoustic pressure expression we may then write
$$p = Ae^{ik\alpha}\left[ \frac{e^{- ik\beta}}{\alpha - \beta} + \frac{e^{ik\beta}}{\alpha + \beta} \right] = Ae^{ik\alpha}\left[ \frac{2\alpha\cos(k\beta)-2i\beta\sin(k\beta)}{\alpha^2-\beta^2} \right].$$
Loud spots will be at the local maxima of the pressure magnitude squared, which is given by | {
"domain": "physics.stackexchange",
"id": 88729,
"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, acoustics, interference, double-slit-experiment",
"url": null
} |
pressure, measurements, instrument
When the atmospheric pressure increases, the oil level in the bottle will rise, and when the pressure decreases, the oil level in the bottle will fall. This happens because the mass of air in the bottle is fixed, so an increase in atmospheric pressure reduces its volume and vice versa.
You can use any fluid, but water will evaporate into the bottle and air in the bottle will dissolve in the water. I suggested motor oil because it's vapour pressure is low and air isn't very soluble in it. | {
"domain": "physics.stackexchange",
"id": 3917,
"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": "pressure, measurements, instrument",
"url": null
} |
ros
From my understanding libva is a graphics library and it is weird that it can't be found. I have NVIDIA GTX 660
when i run nvidia-smi:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.57 Driver Version: 367.57 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 660 Off | 0000:01:00.0 N/A | N/A |
| 30% 26C P5 N/A / N/A | 353MiB / 1997MiB | N/A Default |
+-------------------------------+----------------------+----------------------+ | {
"domain": "robotics.stackexchange",
"id": 26901,
"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
} |
javascript, jquery, validation
<label for="select-3">Value 3</label>
<select id="select-3">
<option value="0">Select</option>
<option value="1">Select 1</option>
<option value="2">Select 2</option>
<option value="3">Select 3</option>
</select>
<i id="error-3" class="error">Error</i>
</div>
<div> <button type="submit" id="formsubmission">Submit</button></div>
</form> your html has pattern, so it might be easier if you do this way.
(function ($) {
$.fn.xSelect = function (e) {
return this.each(function () {
var $this = $(this);
if ($this.val() === '0') {
e.preventDefault();
$this.next(".error").show();
}else{
$this.next(".error").hide();
}
});
};
})(jQuery);
then use like
$("#form").submit(function (e) {
$("#select-1,#select-2,#select-3").xSelect(e);
}); | {
"domain": "codereview.stackexchange",
"id": 6288,
"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, validation",
"url": null
} |
haskell, lazy
Title: How can I make a shorter binary rule in haskell? Here is a code I experimented with recently:
let br = [0]:[n:(concat $ take n br) | n <- [1..]] in concat br
This code produces the binary rule 0 1 0 2 0 1 0 3 ...
Here is the idea of how it works:
create a list starting with [0]
each step, concatenate all the current elements in the list, put the next number at the begining and add at the end.
[[0] ...]
[[0], [1, 0] ...]
[[0], [1, 0], [2, 0, 1, 0]...]
[[0], [1, 0], [2, 0, 1, 0], [3, 0, 1, 0, 2, 0, 1, 0] ...]
...
My question now is: is there a shorter/smarter one-liner to get this infinite lazy binary-rule ?
Edit:
I found another way to do the same thing:
let f n = if n==0 then [0] else n:([0..n-1] >>= f) in [0..]>>= f
The extra question would be: wich one of the 2 version is more readable for an haskell programmer, and why ? I'm a little out of practice with haskell, but I'm quite fond of it. I want to address your "extra" question first. | {
"domain": "codereview.stackexchange",
"id": 41385,
"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": "haskell, lazy",
"url": null
} |
performance, vba, excel, hash-map
For i = OF_clearanceColumn1 To OF_clearanceColumn4
currentWeek = Cells(orderStart - 1, i).Value
internalFile.Sheets(currentWeek).Activate
For t = 1 To 700
If Cells(t, 1) = "Station" Then
stationStart = t + 1
Exit For
End If
Next
For t = stationStart To 700
If Cells(t, 1).Value = Cells(stationStart - 2, 1).Value & " Total" Then
stationEnd = i - 1
Exit For
End If | {
"domain": "codereview.stackexchange",
"id": 33929,
"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, vba, excel, hash-map",
"url": null
} |
electrochemistry, analytical-chemistry
Any oxygen that reaches the working electrode is reduced and produces a current that is measured to produce the analytical signal. The amount of current produced depends on how much oxygen diffuses through the membrane, which depends on the concentration of dissolved oxygen in the test solution.
Now, for your questions:
how would you know that this sensor is working - meaning that only
dissolved oxygen triggers the electrical change in the sensor, and not
other atoms? | {
"domain": "chemistry.stackexchange",
"id": 2031,
"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": "electrochemistry, analytical-chemistry",
"url": null
} |
java, beginner, inheritance, polymorphism
private boolean areTokensValid() {
return areTokensInEvenNumber();
}
private boolean areTokensInEvenNumber() {
return tokens.length % 2 == 0;
}
private void createResultMapFromTokens() {
this.result = new HashMap<>();
for (int keyIndex = 0, valueIndex = 1; valueIndex < tokens.length; keyIndex+=2, valueIndex+=2) {
this.result.put(tokens[keyIndex], tokens[valueIndex]);
}
}
}
PropertyHelper
import java.util.Map;
import java.util.Optional;
public class PropertyHelper {
/**
* The line used to produce the property map.
*/
private final String inputLine;
/**
* the map obtained by parsing the input line.
*/
private final Map<String,String> properties;
public PropertyHelper(String inputLine, Map<String,String> properties) {
this.inputLine = inputLine;
this.properties = properties;
} | {
"domain": "codereview.stackexchange",
"id": 23699,
"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, inheritance, polymorphism",
"url": null
} |
acoustics
Title: Physical amplitude of sound So, as far as I understand, sounds are ripples through a material. If you strike a rock, then (ignoring thermal motion, if we may) the molecules in the rock start off stationary, then wiggle back and forth as the waves pass through them, then return to a stop. How far do they move? I assume it varies based on material and loudness, but is there a table and equation somewhere? I found no good leads, searching the internet. | {
"domain": "physics.stackexchange",
"id": 71313,
"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": "acoustics",
"url": null
} |
In mathematics, particularly category theory, a representable functor is a certain functor from an arbitrary category into the category of sets. Such functors give representations of an abstract category in terms of known structures allowing one to utilize, as much as possible, knowledge about the category of sets in other settings.
In category theory, a natural numbers object (NNO) is an object endowed with a recursive structure similar to natural numbers. More precisely, in a category E with a terminal object 1, an NNO N is given by:
1. a global element z : 1 → N, and
2. an arrow s : NN, | {
"domain": "wikimili.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9935117313638977,
"lm_q1q2_score": 0.8052203037869744,
"lm_q2_score": 0.8104789086703225,
"openwebmath_perplexity": 253.32611020648804,
"openwebmath_score": 0.8290358185768127,
"tags": null,
"url": "https://wikimili.com/en/Singleton_(mathematics)"
} |
lagrangian-formalism, symmetry, field-theory, action, noethers-theorem
which, as I understand, comes form the replacement (7.3.30). Now what I am confused about is that why he did not consider the change in the integration measure $\int d^4 x$. I thought we should also replace $\int d^4 x \to \int J d^4 x $, where $J$ is the Jacobian for the transformation $x^\mu \to x^\mu +\epsilon^\mu (x)$. If someone can clarify why the Jacobian is not considered it will be very helpful. Conceptually, changing the measure $\int d^4 x$ would defeat the point. The action is a functional of an input field,
$$
S = S[\psi]
$$
and a symmetry transformation $\delta \psi$ is a transformation which satisfies
$$
S[\psi + \delta \psi] = S[\psi] + \mathrm{boundary \; term}.
$$
This means that if $\psi$ extremizes the action, then $\psi + \delta \psi$ must also extremize the action, meaning that our symmetry transformation maps one solution to the equations of motion, $\psi$, to another solution to the equations of motion, $\psi + \delta \psi$. | {
"domain": "physics.stackexchange",
"id": 76866,
"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": "lagrangian-formalism, symmetry, field-theory, action, noethers-theorem",
"url": null
} |
audio, impulse-response
Yes. Plus also the delays in your audio drivers, the audio stack of the OS, kernel mixers, sample rate converters, and whatever else is in the signal chain.
Your best shot is to try a calibration: Do a near field measurement at close range (maybe 5 cm in front of the center of the full range driver, not the passives on the side). Eyeball the delay and subtract 0.14ms for your 5cm measuring distance. That's your baseline delay.
Repeat this a few times and see if it's stable or if it drifts. Repeat again but unpair and repair the speaker. Then repeat again a few times but reboot everything between trials.
If all of the repeats give you the same baseline delay, you can calibrate your setup simply be shifting your measured impulse responses. | {
"domain": "dsp.stackexchange",
"id": 10369,
"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": "audio, impulse-response",
"url": null
} |
water, density
Title: How to find out the compress happen when some force act on water/oil/air? I need to do some calculation to find out whether my design works. I may use oil/water/air in my pneumatic cylinder (or you can call it hydraulic cylinder). Assume I have just a cylinder and I put oil into the chamber to raise a weight. My question is how much of volume will reduce when the weight is x kg (Let assumes x = 20). Also what if I change the oil to water or air.
From my knowledge air is easier to calculate, because I can use the ideal gas law. Am I right?
Thanks Air is by ideal gas law, for water, you need the bulk modulus which is $2.2 \times 10^9$ Pascals. This means that at a pressure P Pascals slightly more than atmospheric pressure, you reduce the volume by P divided by this number.
According to this web page, oil has a bulk modulus of roughly 200,000 Psi, which is about $1.5 \times 10^9$ Pascals. | {
"domain": "physics.stackexchange",
"id": 4417,
"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": "water, density",
"url": null
} |
# Proving That The Product Of Two Different Odd Integers Is Odd
Okay, here is how I begin my proof:
Let $q$ and $r$ be odd integers, then $q = 2k+1$ and $r = 2m+1$, where $k,m \in Z$.
$q \times r = (2k+1)(2m+1) \implies q \times r = 4mk + 2k + 2m + 1 \implies q \times r = 2(2mk + k + m) + 1$
I would then conclude that $q \times r$ results in an odd number, because 2 times an integer with one added to it is, by definition, an odd number.
However, how can I conclude this? Is $(2mk + k + m)$ in fact an integer? How do I know if the product of any two integers is an integer; similarly, does adding any two integers yield another integer? Now, obviously, I have an intuitive notion that these are true, but is there a way to prove them?
Side note: I would also appreciate it if someone could critique my proof. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731126558706,
"lm_q1q2_score": 0.8397853561089826,
"lm_q2_score": 0.8723473680407889,
"openwebmath_perplexity": 260.1404362682639,
"openwebmath_score": 0.9445431232452393,
"tags": null,
"url": "http://math.stackexchange.com/questions/330471/proving-that-the-product-of-two-different-odd-integers-is-odd"
} |
ros, ros-melodic, actionlib, smach
# Possible error codes:
...
uint32 outcome
string message
nav_msgs/Path path
float64 cost
---
Since I have the target_pose stored in an array, I need to pass it to the get_path-actionServer via the goal_cb-Param of the smach_ros.SimpleActionState. Therefore, my code looks as follows:
sm.userdata.next_goal = [target_pose]
smach.StateMachine.add('GET_GLOBAL_PATH_IN_GOAL_CHECK_SM',
smach_ros.SimpleActionState(
'/move_base_flex/get_path',
GetPathAction,
result_cb = getPathCallback,
goal_cb=set_goal_callback,
input_keys=['next_goal', ...]),
transitions={...})
with the goal_cb as: | {
"domain": "robotics.stackexchange",
"id": 35619,
"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, ros-melodic, actionlib, smach",
"url": null
} |
java, algorithm, strings
assertTrue(set1.equals(set2));
}
}
}
The performance figures I get:
Seed = 44473779525966
Aho-Corasick in 316.28 milliseconds.
Brute force in 2635.01 milliseconds.
Same matches: true | {
"domain": "codereview.stackexchange",
"id": 42095,
"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, algorithm, strings",
"url": null
} |
solar-system, history
If planets were numbered inwards from the outermost known one, the list in 1801 would have been 1 Uranus, 2 Saturn, 3 Jupiter, 4 Ceres. in 1802 2 Pallas would become 4 and Ceres 5.
In 1846 Neptune would be discovered and Ceres would become # 6. In 1849 10 Hygiea was discovered and Ceres would become # 7. In 1852 16 Psyche was discovered making Ceres # 8. In 1852 22 Kalliope was discovered making Ceres # 9. In 1853 24 Themis was discovered making Ceres # 10. In 1854 28 Bellona was discovered making Ceres number 11. And in 1854 31 Euphrosyne was discovered, making Ceres number 12.
But I should note that none of the asteroids after 15 Eunomia, discovered in 1851, were ever considered to be planets. | {
"domain": "astronomy.stackexchange",
"id": 4541,
"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": "solar-system, history",
"url": null
} |
java, strings, column
private String pad(String word, int newLength){
while (word.length() < newLength) {
word = align.apply(word, pad);
}
return word;
}
public Columns withColumnSeparator(String columnSeparator){
this.columnSeparator = columnSeparator;
return this;
}
public Columns withPad(String pad){
this.pad = pad;
return this;
}
public Columns alignLeft(){
align = (word, pad) -> word = word + pad;
return this;
}
public Columns alignRight(){
align = (word, pad) -> word = pad + word;
return this;
}
public Columns alignCenter(){
align = (word, pad) -> {
return (word.length() % 2 == 0)
? pad + word
: word + pad
;
};
return this;
}
} | {
"domain": "codereview.stackexchange",
"id": 44500,
"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, strings, column",
"url": null
} |
organic-chemistry, alcohols, ethers, chemoselectivity
Title: Selectivity in dehydration of isopropyl alcohol to diisopropyl ether Can isopropyl alcohol be dehydrated by sulfuric acid to diisopropyl ether in a similar way as to how ethanol can? Is there a way to avoid or at least minimize the inevitable dehydration to propylene? The acid catalyzed dehydration of secondary and tertiary alcohols to give corresponding ethers at room temperature and atmospheric pressure is unsuccessful as elimination competes over substitution and as a consequence, alkenes are easily formed.
However, in the presence of specific conditions such as low temperature and additional catalysts, isopropyl alcohol can get converted to diisopropyl ether. | {
"domain": "chemistry.stackexchange",
"id": 16357,
"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": "organic-chemistry, alcohols, ethers, chemoselectivity",
"url": null
} |
ecology, food, ethology, food-web
As @heracho pointed out, from a network/food web/flow-diagram perspective, yes, cannibalism is repressed as a negative feedback loop on itself.
Evaluating the statement: "Food chains are found within the population of a species," I interpret is as, within species, there are subgroups that consume subgroups, that consume subgroups. You'd need at least 3 levels for it to be considered a chain (i.e., you don't have a chain with two species/a single link). Cannibalism would be a single link/two species, and not considered a chain. As to whether or not chains exist within a species, I suspect it is not common if it exists at all. If it did, I would guess it'd be found in a group like fishes where prey are often size dependent. | {
"domain": "biology.stackexchange",
"id": 9668,
"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": "ecology, food, ethology, food-web",
"url": null
} |
orbitals, reference-request, alcohols, reactivity, esters
In contrast, I calculated the PES of hydroxy group in the following two systems:
2-oxo-3s-hydroxy-tetrahydrofuran [S1]
(1S,2S)-isopropyl 1-hydroxy-2-((vinyloxy)methyl)cyclohexanecarboxylate
The latter one is:
The oxygen of iprO-(C=O)- group was pointed away from [S2] and towards to [S3] cyclohexane. The PES is: (It was calculated with am1 due to computational resources, it was done with my laptop.)
It can be observed that the intramolecular hydrogen bond (IHB) in [S3] is more stable than in the other systems. The order of intramolecular hydrogen bond preference is [S3]>[S2]>[S1]. In other words, the IHB formed with the oxygen SP$^3$ of iprO-(C=O)- group is preferred over the carbonyl oxygen. [b] This can be seen on the rotational barrier between both minima. This conformational preference allows the lone pair of hydroxyl oxygen to be more nucleophilic than in the other systems. As it can be seen in the following figures:
[S1]
[S2]
[S3] | {
"domain": "chemistry.stackexchange",
"id": 6831,
"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": "orbitals, reference-request, alcohols, reactivity, esters",
"url": null
} |
optics, experimental-physics, laser, non-linear-optics
I suggest checking out a reference such as the Hamamatsu Photomultiplier Tubes Basics and Applications. (For example, see Sections 4.3 and 5.3.5 in that guide.) FlatterMann is certainly correct that you are responsible for the final choice of your PMT, but I have found a good manufacturer's sales rep can be very helpful in avoiding mistakes when purchasing instruments. They sometimes identified issues I hadn't thought of. | {
"domain": "physics.stackexchange",
"id": 91277,
"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": "optics, experimental-physics, laser, non-linear-optics",
"url": null
} |
python, classification, gradient-boosting-decision-trees
Title: Am I building a good or bad model for prediction built using Gradient Boosting Classifier Algorithm? I am building a binary classification model using GB Classifier for imbalanced data with event rate 0.11% having sample size of 350000 records (split into 70% training & 30% testing).
I have successfully tuned hyperparameters using GridsearchCV, and have confirmed my final model for evaluation.
Results are:
Train Data-
[[244741 2]
[ 234 23]]
precision recall f1-score support
0 1.00 1.00 1.00 244743
1 0.92 0.09 0.16 257
accuracy - - 1.00 245000
macro avg 0.96 0.54 0.58 245000
weighted avg 1.00 1.00 1.00 245000
test data -
[[104873 4]
[ 121 2]]
precision recall f1-score support | {
"domain": "datascience.stackexchange",
"id": 11001,
"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, classification, gradient-boosting-decision-trees",
"url": null
} |
python, performance, python-3.x, programming-challenge, dynamic-programming
return abs(min(dungeon[0][0], 0)) + 1
memoize = {}
def create_arg(size, *, _i):
size = int(size)
key = size, _i
if key in memoize:
return copy.deepcopy(memoize[key])
divisors = [
(i, size // i)
for i in range(1, int(size ** 0.5) + 1)
if size % i == 0
]
if len(divisors) > 1:
divisors = divisors[1:]
y_size, x_size = random.choice(divisors)
output = [[None] * x_size for _ in range(y_size)]
for i in range(size):
y, x = divmod(i, x_size)
output[y][x] = random.randint(-100, 100)
memoize[key] = output
return output | {
"domain": "codereview.stackexchange",
"id": 34778,
"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, performance, python-3.x, programming-challenge, dynamic-programming",
"url": null
} |
java, matrix, image
}
}
//method to print array
public static void printArray(int[][] myArray) {
for(int x = 0; x < 7; x++)
{
for(int y = 0; y < 7; y++)
{
System.out.print(myArray[x][y]);
System.out.print(" ");
}
System.out.print("\n");
}
}
} I think your solution, and also the one proposed by Claudiordgz, are overkill.
You mentioned recursion in your question, and, recursion is the 'simple' solution to this problem.
problem description:
The goal of this code is to take a matrices of 1's and 0's, and go through and any nodes (that are 1's) that are connected to the left, right, up, or down (no diagonals), to change to different numbers. Each group, the number goes up by one
You can narrow this problem down in to four stages: | {
"domain": "codereview.stackexchange",
"id": 6522,
"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, matrix, image",
"url": null
} |
thermodynamics, energy, differential-geometry, entropy
https://en.wikipedia.org/wiki/Ruppeiner_geometry
(presumably Weinhold's site) https://www.researchgate.net/publication/258879552_Thermodynamics_and_geometry
[Update: The answer to two of your questions can be answered without consulting the above references.]
$\gamma$ is likely the ratio $C_p/C_v$ (familiar from thermodynamics).
Then the matrix element you obtained [from your reference] simplifies to
$$\frac{p \gamma }{V}-\frac{p^2}{C_v T}=\frac{p}{V},$$
using $C_p-C_v=R_{idealGasConstant}$ (the ideal gas constant) and the Ideal Gas Law ($PV=nR_{idealGasConstant}T$) (both familiar from thermodynamics). | {
"domain": "physics.stackexchange",
"id": 100258,
"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, differential-geometry, entropy",
"url": null
} |
ros, ros2, real-time
Title: Best practices for real-time capabilites in ROS2
We are designing the software stack for an autonomous racing vehicle. The high speeds require good real-time capabilities of the software stack. Are there some resources on best practices or tutorials on this topic? The ros2 documentation provides some information on this but it doesn't go into detail on e.g. how to configure the operating system or how to design your overall node architecture.
Thanks in advance! | {
"domain": "robotics.stackexchange",
"id": 36734,
"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, ros2, real-time",
"url": null
} |
beginner, c
filter.c
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include "helpers.h"
int main(int argc, char *argv[])
{
// Define allowable filters
char *filters = "begr";
// Get filter flag and check validity
char filter = getopt(argc, argv, filters);
if (filter == '?')
{
fprintf(stderr, "Invalid filter.\n");
return 1;
}
// Ensure only one filter
if (getopt(argc, argv, filters) != -1)
{
fprintf(stderr, "Only one filter allowed.\n");
return 2;
}
// Ensure proper usage
if (argc != optind + 2)
{
fprintf(stderr, "Usage: filter [flag] infile outfile\n");
return 3;
}
// Remember filenames
char *infile = argv[optind];
char *outfile = argv[optind + 1];
// Open input file
FILE *inptr = fopen(infile, "r");
if (inptr == NULL)
{
fprintf(stderr, "Could not open %s.\n", infile);
return 4;
} | {
"domain": "codereview.stackexchange",
"id": 42115,
"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": "beginner, c",
"url": null
} |
python, gui, tkinter, data-visualization, matplotlib
I am the only person using this program, but I am trying to build it in such a way that others could learn my job function and use it too. To this end, I am trying to make it pretty and intuitive.
Since you won't have the equipment connected some buttons won't work, but most of the app should be available for prodding.
My main areas of concern
Readability
I did lint the code, but it still hurts my eyes in some spots... - what do?
Design
UI elements and logic elements are kind of mixed - what do?
it's not a massive app, but most lines of code are setting up GUI elements
I would like to separate the UI and logic more, but I'm not sure how, or if doing so would be "astronaut architecture" for a project of this size
Object-orientedness | {
"domain": "codereview.stackexchange",
"id": 37911,
"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, gui, tkinter, data-visualization, matplotlib",
"url": null
} |
quantum-gate, hamiltonian-simulation, hamiltonian
O & O & O & O\\
O & O & O & O\\
O & O & O & O\\
O & O & O & \pi(X - I)\\
\end{pmatrix}
\end{equation}
such that $O$ is a $2\times 2$ zero matrix, $X$ and $I$ are the usual $2\times 2$ Pauli operators.
It is straighforwad to verify that what follows holds:
$$e^{iH/2} = \textrm{Toffoli}.$$ | {
"domain": "quantumcomputing.stackexchange",
"id": 3975,
"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-gate, hamiltonian-simulation, hamiltonian",
"url": null
} |
data-structures, heaps
Title: How huffman tree uses MinHeap? As far as I know, a minheap is data structure whose parent node's value is less than child node and maxheap is when parent node is greater than child node. Here they have used minheap. But as the node closer to root have less length code than nodes below that level i.e., level 1 codes will have shorter codes than level 5; which means level 1 nodes are more frequently occurring than level 5 nodes. Also the numeric value after addition is also greater than that nodes at high level. I am confused, isn't that definition of max heap but they are using min heap. Please explain why they are using Min heap and not Max heap (considering nodes at lower level are more frequent than at higher level) Building a Huffman tree is bottom up.
You start with the all the leaf nodes with their frequency.
Then you select and remove the 2 nodes with the smallest frequencies | {
"domain": "cs.stackexchange",
"id": 12403,
"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, heaps",
"url": null
} |
(d) What is the probability that the second marble has the same color as the first marble?
My work so far:
(a) P(choosing red) = $(0.4)(\frac4{12}) + (0.6)(\frac58) = \frac{61}{120}$
(b) P(choosing from box I | choosing red) = $\frac{P(choosing red | choosing from box I) P(choosing from box I)}{P(choosing red)}$
P(choosing red | choosing from box I) = $(0.4)(\frac4{12}) = \frac2{15}$
P(choosing from box I) = 0.4
P(choosing red) = $\frac{61}{120}$
P(choosing from box I | choosing red) = $\frac{(\frac2{15})(0.4)}{\frac{61}{120}}= \frac{32}{305}$
(c) Just like (a),
P(choosing blue) = $(0.4)(\frac8{12}) + (0.6)(\frac38) = \frac{59}{120}$
(d) I haven't attempted this one yet. I assume I can simply consider all of the outcomes and add them together, but is there a quicker way? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.992654174294781,
"lm_q1q2_score": 0.8092439380320908,
"lm_q2_score": 0.8152324938410784,
"openwebmath_perplexity": 87.24794535442929,
"openwebmath_score": 0.9611208438873291,
"tags": null,
"url": "https://math.stackexchange.com/questions/2446772/conditional-probability-choosing-marbles"
} |
newtonian-mechanics, classical-mechanics, rotational-dynamics, reference-frames, coordinate-systems
Thus, the time derivative of the angular momentum is
\begin{align}
\mathbf{T} &= \left(\frac{\text{d}}{\text{d}t}\right)_{K} (\underline{\mathbf{I}}\boldsymbol{\omega}) \\
&= \underline{\mathbf{I}}\left(\frac{\text{d}}{\text{d}t}\right)_{K} \boldsymbol{\omega}+\boldsymbol{\omega}\left(\frac{\text{d}}{\text{d}t}\right)_{K} \underline{\mathbf{I}}\\
&=\underline{\mathbf{I}}\left(\frac{\text{d}}{\text{d}t}\right)_{K} \boldsymbol{\omega} + [\boldsymbol{\omega}\times]\underline{\mathbf{I}}\boldsymbol{\omega}-\underline{\mathbf{I}}\underbrace{[\boldsymbol{\omega}\times]\boldsymbol{\omega}}_{\boldsymbol{\omega}\times\boldsymbol{\omega}=\mathbf{0}}\\
&=\underline{\mathbf{I}}\left(\frac{\text{d}}{\text{d}t}\right)_{K} \boldsymbol{\omega} + \boldsymbol{\omega}\times(\underline{\mathbf{I}}\boldsymbol{\omega})
\end{align}
as before. | {
"domain": "physics.stackexchange",
"id": 70819,
"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": "newtonian-mechanics, classical-mechanics, rotational-dynamics, reference-frames, coordinate-systems",
"url": null
} |
Let $$y\in(0,1)$$. Since $$F$$ is continuous, there exists $$x\in\mathbb{R}$$ s.t. $$F(x)=y$$. Thus, $$\mathsf{P}(Y\le y)=\mathsf{P}(F(X)\le F(x))=F(x)=y,$$ i.e., $$Y\sim\text{U}[0,1]$$. In order to see the first equality we don't need continuity. Specifically, since any cdf is right-continuous, \begin{align} \{F(X)\le F(x)\}&=\{\{F(X)\le F(x)\}\cap\{X\le x\}\}\cup \{\{F(X)\le F(x)\}\cap\{X>x\}\} \\ &=\{X\le x\}\cup \{\{F(X)=F(x)\}\cap\{X>x\}\}, \end{align} and $$\mathsf{P}(\{F(X)=F(x)\}\cap\{X>x\})=0$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464443071381,
"lm_q1q2_score": 0.8643288760552705,
"lm_q2_score": 0.8856314617436727,
"openwebmath_perplexity": 174.14235605365812,
"openwebmath_score": 0.957176685333252,
"tags": null,
"url": "https://math.stackexchange.com/questions/868400/showing-that-y-has-a-uniform-distribution-if-y-fx-where-f-is-the-cdf-of-contin/868405"
} |
astronomy, planets, spectroscopy, exoplanets
Title: For a planet which has a temperature gradient, hot in the center and cooler on the surface, why do we get absorption lines? For a planet which has a temperature gradient, hot in the center and cooler on the surface, why do we see absorption lines?
Similarly, why do we see emission lines if the planet is hot on the surface and gets cooler as you move to the center?
Note, for this question I am only thinking of the planet as a black body, not as something, for example, transiting a star and observing the spectra (transit spectra) of the light that shines through the planet's atmosphere. The source of the spectra is the planet itself.
For a planet which has a temperature gradient, hot in the center and cooler on the surface, why do we see absorption lines? | {
"domain": "physics.stackexchange",
"id": 15024,
"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": "astronomy, planets, spectroscopy, exoplanets",
"url": null
} |
c#, .net, email
var fullMessage = AddRecipients(message, highestProbability);
return await SendMessageAsync(fullMessage).ConfigureAwait(false);
}
/// <summary> Sends the message using MimeMessage/office365 </summary>
/// <param name="message"> The message we are sending </param>
/// <returns>Whether or not the message send was successful.</returns>
private async Task<bool> SendMessageAsync(MimeMessage message)
{
try
{
using (var client = new SmtpClient())
{
await client.ConnectAsync(_emailSettings.Host, _emailSettings.Port, false);
await client.AuthenticateAsync(_emailSettings.FromAddress, _emailSettings.Password); | {
"domain": "codereview.stackexchange",
"id": 38291,
"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, email",
"url": null
} |
javascript, ecmascript-6, html5, audio
// Pick a frequency
const frequencies = getFrequencies(difficultyMode);
const frequency = getNewFrequency(frequencies, previousFrequency);
return {
frequencies,
frequency
};
}
function stopFrequencyTrainer() {
toneContext.close();
}
function startToneGenerator(frequency, volumeControl, startTimer, stopTimer) {
// Create and configure the oscillator
toneGenerator = toneContext.createOscillator();
toneGenerator.type = 'sine'; // could be sine, square, sawtooth or triangle
toneGenerator.frequency.value = frequency;
// Connect toneGenerator -> toneAmplifier -> output
toneGenerator.connect(toneAmplifier);
toneAmplifier.connect(toneContext.destination);
// Set the gain volume
toneAmplifier.gain.value = volumeControl.value / 100;
// Fire up the toneGenerator
toneGenerator.start(toneContext.currentTime + startTimer);
toneGenerator.stop(toneContext.currentTime + startTimer + stopTimer);
} | {
"domain": "codereview.stackexchange",
"id": 32007,
"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, ecmascript-6, html5, audio",
"url": null
} |
rviz, ros-groovy, osx, ogre
"Ogre::Technique::setLightingEnabled(bool)", referenced from:
ImageView::showEvent(QShowEvent*) in image_view.cpp.o
"Ogre::Technique::getPass(unsigned short)", referenced from:
ImageView::showEvent(QShowEvent*) in image_view.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/kevin/tmp/groovy2/devel_isolated/rviz/lib/rviz/image_view] Error 1
make[1]: *** [src/image_view/CMakeFiles/rviz_image_view.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Scanning dependencies of target default_plugin
[ 71%] [ 71%] Building CXX object src/rviz/default_plugin/CMakeFiles/default_plugin.dir/camera_display.cpp.o
Building CXX object src/rviz/default_plugin/CMakeFiles/default_plugin.dir/axes_display.cpp.o
[ 72%] Building CXX object src/rviz/default_plugin/CMakeFiles/default_plugin.dir/depth_cloud_display.cpp.o | {
"domain": "robotics.stackexchange",
"id": 12433,
"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": "rviz, ros-groovy, osx, ogre",
"url": null
} |
This is (very!) far from my research expertise, so any comments/references/links would be appreciated. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9843363489908259,
"lm_q1q2_score": 0.8265806599660777,
"lm_q2_score": 0.8397339596505965,
"openwebmath_perplexity": 203.84582501835078,
"openwebmath_score": 0.9159128069877625,
"tags": null,
"url": "http://math.stackexchange.com/questions/2879/mapping-natural-numbers-into-prime-exponents-space"
} |
c++, c++11, game
RandomNumber::RandomNumber()
{
srand(static_cast<unsigned int>(time(0)));
}
RandomNumber::~RandomNumber()
{
resetUniqueRandomNumbersContainer();
}
int RandomNumber::randomNumberGenerator() {
int randomRange = MIN_PICK_VALUE + MAX_PICK_VALUE;
return (rand() % randomRange);
}
void RandomNumber::generateUniqueRandomNumbers(size_t UniqueRandomNumberCount)
{
if (!UniqueRandomNumbersContainer.empty())
{
UniqueRandomNumbersContainer.clear();
}
size_t generatedCount = 0;
while (generatedCount < UniqueRandomNumberCount)
{
int rngValue = randomNumberGenerator();
if (std::find(UniqueRandomNumbersContainer.begin(), UniqueRandomNumbersContainer.end(), rngValue) == UniqueRandomNumbersContainer.end())
{
UniqueRandomNumbersContainer.push_back(rngValue);
generatedCount++;
}
}
}
award.h
#pragma once
#include "KenoWinCalculator.h"
#include "Bank.h"
#include <map> | {
"domain": "codereview.stackexchange",
"id": 28894,
"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++, c++11, game",
"url": null
} |
generative-adversarial-networks, generative-model, latent-variable
The generator doesn't have to produce images from either a smooth or noisy latent space. It will just tend towards what the architecture and initial weights encourage. As it happens, this will more often be a smoothly interpolatable space than a high frequency pseudo-random one. | {
"domain": "ai.stackexchange",
"id": 3913,
"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": "generative-adversarial-networks, generative-model, latent-variable",
"url": null
} |
computer-architecture, software-engineering
harder to use. Then there are computers in the TV. Well to be honest,
we are surrounded by computers that are so easy to use that we do not
even know there are there. That is why you are not even aware that
computer are so easy to use. It is so easy you no longer notice them.
So why is it that you still have a home computer that is hard to use?
The main reason is that you have closer access to various functions, so
that you can put it to a wide variety of tasks. We are not yet very
good at preserving the flexibility while making it easy to use, though
that is improving all the time. See for example how easy it has become
(well, most of the time) to use a tablet. Smartphones are more
complex than phones, but do so many things.
We are not yet good enough to make computers very simple, while preserving their innate flexibility, though we made enormous progress. But many computers have become (at the expense of flexibility) so simple to use as to be invisible. | {
"domain": "cs.stackexchange",
"id": 3068,
"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": "computer-architecture, software-engineering",
"url": null
} |
machine-learning, python, neural-network, deep-learning, keras
Title: If I do not do any data normailization, is datagen.fit required in Keras? I use keras for training an image classification problem as follows:
datagen = ImageDataGenerator(
featurewise_center=False,
featurewise_std_normalization=False,
rotation_range=20,
width_shift_range=0.2,
height_shift_range=0.2,
horizontal_flip=True)
# compute quantities required for featurewise normalization
# (std, mean, and principal components if ZCA whitening is applied)
datagen.fit(x_train)
# alternative to model.fit_generator
for e in range(epochs):
print('Epoch', e)
batches = 0
for x_batch, y_batch in datagen.flow(x_train, y_train, batch_size=32):
model.fit(x_batch, y_batch)
batches += 1
if batches >= len(x_train) / 32:
# we need to break the loop by hand because
# the generator loops indefinitely
break | {
"domain": "datascience.stackexchange",
"id": 2628,
"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": "machine-learning, python, neural-network, deep-learning, keras",
"url": null
} |
java, swing, calculator
private final CalcFunction operation;
public CalculationListener(CalcFunction function) {
this.operation = function;
}
@Override
public void actionPerformed(ActionEvent e) {
if (tempNumbers1 == 0) {
tempNumbers1 = Double.parseDouble(resultJText.getText());
resultJText.setText("");
} else {
tempNumbers2 = Double.parseDouble(resultJText.getText());
resultJText.setText("");
}
function = operation;
}
}
And use it like this:
divideButton.addActionListener(new CalculationListener(CalcFunction.DIVISION));
Currently, you're using one loop to create the buttons:
for ( int i = 9; i >= 0; i--) {
numberButtons[i] = new JButton(Integer.toString(i));
}
And then you have one loop to add the buttons to the panel:
for(int i = 9; i>=0; i--) {
numberButtonsPanel.add(numberButtons[i]);
} | {
"domain": "codereview.stackexchange",
"id": 8086,
"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, swing, calculator",
"url": null
} |
online-algorithms, random-number-generator
Format Preserving Encryption (on Wikipedia)
Can you create a strong blockcipher with small blocksize, given a strong blockcipher of conventional blocksize? (on crypto.SE)
Is it possible to generate a secure permutation F over 32-bit integers even if F(0) … F(n) is public knowledge? (on crypto.SE)
Can I create a fixed length output from a fixed length input? (on crypto.SE) | {
"domain": "cs.stackexchange",
"id": 3301,
"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": "online-algorithms, random-number-generator",
"url": null
} |
navigation, odometry, husky, frequency, robot-pose-ekf
Originally posted by Florian Blatt with karma: 16 on 2014-03-23
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by moejoegoe on 2014-04-10:
Hello Florian,
it seems I have the same problem as you had! Can you please explain in more detail how you solved it!?
Bye Matthias
Comment by Florian Blatt on 2014-04-10:
Hi Matthias, as I stated above, I used the tf_prefix parameter, so that I would have different name spaces for multiple robots. Removing this parameter did the trick. Otherwise maybe you need to post a little bit more information about your setup ;) | {
"domain": "robotics.stackexchange",
"id": 17356,
"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": "navigation, odometry, husky, frequency, robot-pose-ekf",
"url": null
} |
javascript, linked-list, tree
Binary Search Tree:
var Node = function(value) {
this.value = value;
this.left = null;
this.right = null;
return this;
};
Node.prototype.insert = function(newNode) {
if(newNode.value < this.value) {
if(this.left === null) {
this.left = newNode;
} else {
this.left.insert(newNode);
}
} else if(newNode.value > this.value) {
if(this.right === null) {
this.right = newNode;
} else {
this.right.insert(newNode);
}
} else {
return true;
}
}; | {
"domain": "codereview.stackexchange",
"id": 13458,
"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, linked-list, tree",
"url": null
} |
quantum-mechanics, photons, hydrogen, dipole-moment
we can see that $\Delta m=1$ and therefore the photon should be circularly right polarized. But does this not harm the conservation of angular momentum and are the photons not emitted in all spatial directions? The spin of the electron has to do with the deflection in magnetic fields and with the orientation between electrons. The spin of the photon has to do with the direction between the photons electric to its magnetic field component. In this sense these spins are totally different things.
Only a rotating electron passes on a part of its torque to the emitted photon. The two E and M field components of the photon are then (in vacuum) still oriented 90° to each other, but rotate together in the axis of motion of the photon. | {
"domain": "physics.stackexchange",
"id": 85972,
"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, photons, hydrogen, dipole-moment",
"url": null
} |
photons, electrons, collision, wave-particle-duality, photoelectric-effect
Title: Does Quantum Theory allow an Electron to take a fraction of Photon energy In Photoelectric Effect of Theory of Spectral Lines , an electron takes the entire or none of the energy of the Photon ( it absorbs the entire quanta not its fractionS resulting in the disappearance of the Photon).
But in Compton Effect the Electron takes only a fraction of the Photon Energy and the Photon stays alive.
What I specifically want to know is that Quantum theory says that an electron will either take the whole or none of the Photon energy .
Why then in Compton Effect the electron takes a fraction of the Photon energy Is that allowed by Quantum theory ?
Or is not so ? Or the electron takes up 1 photon only when in an energy level . When an electron is free , can it absorb half the energy of a photon ?
Edit: | {
"domain": "physics.stackexchange",
"id": 39359,
"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": "photons, electrons, collision, wave-particle-duality, photoelectric-effect",
"url": null
} |
filters, filter-design, finite-impulse-response
Type IV filters cannot be used for standard frequency selective filters, for the same reasons as type III filters. They are well suited for differentiators and Hilbert transformers, and their magnitude approximation is usually better because, unlike type III filters, they have no zero at $z=-1$.
In some applications an integer group delay is desirable. In these cases type I or type III filters are preferred. | {
"domain": "dsp.stackexchange",
"id": 973,
"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": "filters, filter-design, finite-impulse-response",
"url": null
} |
cosmology, spacetime, universe, curvature, cosmological-inflation
Title: How is the universe flat? I have real trouble visualising what is meant by the descriptor 'flat' when referred to the shape of the observable universe. Which one of the below is more accurate?
a) It is flat in a 2D way, like a big disk mostly spread out on one plane, similar to a solar system or disk-shaped galaxy
b) It is flat in a 3D way, in the sense that lines in space travel straight and even in all directions, e.g. like the lines of a gridded cube
c) It is not like either of the above, but something else all together
BONUS QUESTION: if the closest and most simple explanation is b), then what would be a better term than 'flat', which suggests 2 dimensionality to general audiences? You probably learned Pythagoras' theorem at school, and this states that if you move a distance $x$ along the $x$ axis then $y$ along the $y$ axis the distance between your starting and ending points is given by:
$$ s^2 = x^2 + y^2 \tag{1} $$ | {
"domain": "physics.stackexchange",
"id": 28726,
"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": "cosmology, spacetime, universe, curvature, cosmological-inflation",
"url": null
} |
javascript, ecmascript-6
if (lettersFirst) {
return Object.fromEntries(Object.entries(map).map(([k, v]) => [v, k]));
} else {
return map;
}
}
To encode, I iterate through every pair of input numbers, check if it is in the map, and if so, add the letter to the encoded output. For odd length inputs I simply remove the last digit, dont encode it, and simply append the number to the output string untouched:
encode(text) {
const map = getValueMap();
let values;
let suffix = '';
if (text.length % 2 !== 0) {
suffix = text.charAt(text.length - 1);
values = text.slice(0, -1);
} else {
values = text;
}
let encoded = '';
for (let i = 0; i <= text.length - 2; i += 2) {
if (map[values[i] + values[i + 1]]) {
encoded += map[values[i] + values[i + 1]];
} else {
encoded += values[i] + values[i + 1];
}
}
encoded += suffix;
return encoded;
} | {
"domain": "codereview.stackexchange",
"id": 36904,
"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, ecmascript-6",
"url": null
} |
ds.algorithms, nt.number-theory
It definitely feels like this argument can be pushed even further...
And Jeff is right - this is not necessarily too interesting as far as pure theory. But it is fun...
Lower bound. Observe that if the two rectangles are $x_1\times y_1$ and $x_2\times y_2$, then the rectangle $(x_1+x_2)\times(y_1+y_2)$ must have area larger than $P$. But then, the minimum perimeter rectangle of a given area is a square. This implies that $2(x_1+x_2+y_1+y_2) \geq 4\sqrt{P}$. | {
"domain": "cstheory.stackexchange",
"id": 3073,
"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.algorithms, nt.number-theory",
"url": null
} |
ros, sbpl-lattice-planner, header
[rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
-- checking for module 'sbpl'
-- package 'sbpl' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:266 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:320 (_pkg_check_modules_internal)
CMakeLists.txt:15 (pkg_check_modules)
-- Configuring incomplete, errors occurred!
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package sbpl_lattice_planner written to:plete ]
[ rosmake ] /home/auto/.ros/rosmake/rosmake_output-20120704-161258/sbpl_lattice_planner/build_output.log
[rosmake-0] Finished <<< sbpl_lattice_planner [FAIL] [ 0.81 seconds ]
[ rosmake ] Halting due to failure in package sbpl_lattice_planner.
[ rosmake ] Waiting for other threads to complete. | {
"domain": "robotics.stackexchange",
"id": 10039,
"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, sbpl-lattice-planner, header",
"url": null
} |
magnetic-fields, magnetic-moment
The magnetization is material related. Some materials have magnetic dipoles and thus magnetization whereas others have not.
The magnetic field is $\mathbf{H}$ with units $[Am^{-1}]$. The field can be nonzero in a material but also be nonzero in vacuum (whereas the magnetization is zero in vacuum because there are no dipoles). This magnetic field is also the field present in an electromagnetic wave for example.
The magnetic induction is defined as the sum of the magnetic field and magnetization:
$$\mathbf{B} = \mu_0 (\mathbf{H} +\mathbf{M})\hspace{10pt} [T]$$
So, the magnetic induction can be seen as a quantity that quantifies the net magnetic strength at a specific point in space. It takes into account the magnetic effects originating from fields ($\mathbf{H}$) and from the materials themselves ($\mathbf{M}$). | {
"domain": "physics.stackexchange",
"id": 62881,
"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": "magnetic-fields, magnetic-moment",
"url": null
} |
genetics, molecular-biology, molecular-genetics, homework, gene
The answer you come up with will also be influenced by whether you would like to include a stop codon (+3) to avoid nonsense-mediated degradation, and a transcriptional start site and polyadenylation sequence (in eukaryotes). The ''gene'' itself, in the genetic sense, will include enhancer elements over a much longer region of the chromosome and regulatory 3'-untranslated regions. And then there's alternative splicing to consider... | {
"domain": "biology.stackexchange",
"id": 11044,
"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": "genetics, molecular-biology, molecular-genetics, homework, gene",
"url": null
} |
python, performance, python-3.x, json, csv
Code
import csv
import json
CSV_PATH = 'file.csv'
JSON_PATH = 'file.json'
def flattenjson(json_data, delim):
"""
Flatten a simple JSON by prepending a delimiter to nested children.
Arguments:
json_data (dict): JSON object
e.g: {
"key1": "n1_value1",
"key2": "n1_value2",
"parent1": {
"child_key1": "n1_child_value1",
"child_key2": "n1_child_value2"
}
}
delim (str): Delimiter for nested children (e.g: '.')
Returns:
Flattened JSON object.
e.g: {
'key1': 'n1_value1',
'key2': 'n1_value2',
'parent1.child_key1': 'n1_child_value1',
'parent1.child_key2': 'n1_child_value2'
}
""" | {
"domain": "codereview.stackexchange",
"id": 38116,
"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, performance, python-3.x, json, csv",
"url": null
} |
- 3 years, 1 month ago
Pretty interesting is name of this. Except Titu's lemma (sometimes written as T2 lemma), you can also find it as SQ lemma (like ...escu), or (at least in Czech and Slovak republic) as CS-fractionfighter (CS stands for Cauchy-Schwartz)
- 6 years, 11 months ago
Many also call it Cauchy "in fractional form," which is similar to your last name.
- 6 years, 11 months ago
Some even call it Cauchy in Engel Form
- 3 years ago
other method for 1)
$A.M \geq H.M$
$s = a + b + c$
$\dfrac{a}{s - a} + \dfrac{b}{s - b} + \dfrac{c}{s - c} = \dfrac{s}{s - a} - 1 + \dfrac{s}{s - b} - 1 + \dfrac{s}{s - c} - 1$
$\dfrac{\dfrac{s}{s - a} + \dfrac{s}{s - b} + \dfrac{s}{s - c}}{3} \geq \dfrac{3}{\dfrac{s - a + s - b + s - c}{s}}$
$\dfrac{\dfrac{s}{s - a} + \dfrac{s}{s - b} + \dfrac{s}{s - c}}{3} \geq \dfrac{3}{2}$
$\dfrac{\dfrac{s}{s - a} - 1 + \dfrac{s}{s - b} - 1 + \dfrac{s}{s - c} - 1 }{3} \geq \dfrac{1}{2}$ | {
"domain": "brilliant.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.964855149556857,
"lm_q1q2_score": 0.8081819310827131,
"lm_q2_score": 0.8376199592797929,
"openwebmath_perplexity": 1909.7137651220587,
"openwebmath_score": 0.9777302742004395,
"tags": null,
"url": "https://brilliant.org/discussions/thread/titus-lemma-part-1/"
} |
measurements, error-analysis, statistics
Title: Why does taking more readings reduce random error? So I was tossing a coin
And I did two experiments
Experiment 1:
Tossing same Coin with no fan with different torque each time and did'nt much care about orientation of the coin, 8 times
I got 5 T 3 H
Experiment 2:
Tossing the same coin without fan with different torque ,but same orientation of coin and Always Heads up while tossing
I got 7 T and 1 H
I know this isn't large enough data but is the conclusion correct ?? | {
"domain": "physics.stackexchange",
"id": 52084,
"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": "measurements, error-analysis, statistics",
"url": null
} |
rotational-dynamics, angular-momentum, momentum, collision
But here, what if we combine above two models. We have two moving and spinning wheels. Each has a mass of $m_1$ and $m_2$ (distributed linearly), each as a moving velocity of $v_1$ and $v_2$, radius of $r_1$ and $r_2$, angular velocity $\omega_1$ and $\omega_2$. What happens after the perfectly inelastic collision?
Can we argue their linear momentum and "angular momentum" conserve individually? How do we model this case?
This is not a homework problem, just a problem I am thinking of myself.
[EDIT]. I am thinking of modeling the problem like below. Let the reference frame be the center of wheel 1. Then wheel 1 has a angular momentum $I_1 \omega_1$, no linear momentum. Wheel 2 comes at colliding with wheel 1 with velocity $v = v_2-v_1$, angular momentum $I_2 \omega_2$ | {
"domain": "physics.stackexchange",
"id": 84900,
"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": "rotational-dynamics, angular-momentum, momentum, collision",
"url": null
} |
it in Python: We can implement the above algorithm in Python, we do not require any module to do this, though there are modules available for it, well it’s good to get ur hands busy once in a while. So it excludes the rows where both columns have 0 values. Parameters. If you want similarity instead of dissimilarity, just subtract the dissimilarity from 1. Excellent work. site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. ... Python lib textdistance is a "python library for comparing distance between two or more sequences by many algorithms." Does Python have a string 'contains' substring method? Mathematically the formula is as follows: python pandas matrix similarity. Looking at the docs, the implementation of jaccard in scipy.spatial.distance is jaccard dissimilarity, not similarity.This is the usual way in which distance is computed when using jaccard as a metric. Actually I think I can get the Jaccard distance by 1 minus Jaccard similarity. | {
"domain": "stcc.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9559813488829417,
"lm_q1q2_score": 0.8236144646640222,
"lm_q2_score": 0.8615382147637196,
"openwebmath_perplexity": 3354.926989212767,
"openwebmath_score": 0.26279759407043457,
"tags": null,
"url": "http://stcc.org/qtmuxl/jaccard-similarity-matrix-python-a46b8d"
} |
nielsen-and-chuang, matrix-representation, textbook-and-exercises
With the other basis:
$A |v_{0}\rangle = 0 \times |v_{0}\rangle + 1 \times |v_{1}\rangle = 0 \times \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} + 1 \times \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix} = |v_{1}\rangle $
$A |v_{1}\rangle = 1 \times |v_{0}\rangle + 0 \times |v_{1}\rangle = 1 \times \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} + 0 \times \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = |v_{0}\rangle $
I hope all become clear now. I couldn't explain my problem correctly before. I'm really sorry.
I have to thanks a lot to teclado from another forum web page. | {
"domain": "quantumcomputing.stackexchange",
"id": 1709,
"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": "nielsen-and-chuang, matrix-representation, textbook-and-exercises",
"url": null
} |
classical-mechanics
t = 8.90; v=11.3; drag = 21.68 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.00; v=11.4; drag = 21.84 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.10; v=11.4; drag = 22.01 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.20; v=11.5; drag = 22.17 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.30; v=11.5; drag = 22.33 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.40; v=11.5; drag = 22.49 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.50; v=11.6; drag = 22.64 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.60; v=11.6; drag = 22.80 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.70; v=11.7; drag = 22.95 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.80; v=11.7; drag = 23.10 N; F roll = 3.04 N; F gravity = 0.00 N
t = 9.90; v=11.7; drag = 23.25 N; F roll = 3.04 N; F gravity = 0.00 N | {
"domain": "physics.stackexchange",
"id": 27311,
"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": "classical-mechanics",
"url": null
} |
sql, vba, ms-access
Set oNone = CurrentDb.OpenRecordset(sql, dbOpenSnapshot)
sql = "SELECT d.[Tagname], m.[Tagname] AS [MasterTagname] " _
& "FROM tblData d " _
& "LEFT JOIN Master m " _
& " ON m.ID = d.[Tagname] " _
& "WHERE d.[Attribute] = " & cbxAttributeFilter01 _
& " AND d.[Property] = " & cbxPropertyFilter01
Set oData = CurrentDb.OpenRecordset(sql, dbOpenSnapshot)
...
TreeView.Nodes.Add sTemp, tvwChild, !MasterTagname, !MasterTagname
...
TreeView.Nodes.Add "MISC", tvwChild, !MasterTagname, !MasterTagname
Also, best practice in VBA is to never use On Error Resume Next but to handle any error that raises which in this case may be a missing or Null DLookUp result. Therefore, enclose If logic.
...
If Not IsNull(!MasterTagName)
TreeView.Nodes.Add sTemp, tvwChild, !MasterTagname, !MasterTagname
End If
...
If Not IsNull(!MasterTagName)
TreeView.Nodes.Add "MISC", tvwChild, !MasterTagname, !MasterTagname
End If | {
"domain": "codereview.stackexchange",
"id": 40369,
"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": "sql, vba, ms-access",
"url": null
} |
electromagnetic-radiation, quantum-electrodynamics
One can now use this evolution to see what would happen if we look at just one point in space and see what the electric field does as a function of time. So let's set $z=0$, then we get $\mathbf{E}(-ct)$. So we see that we get the same function but as a function of time and now it is inverted. The the electric field oscillates at any particular point in space.
The energy in the field is carried along with it. One can calculate the energy by integrating the power over time.
Hope all the issues have been addressed. Let me know if anything is still unclear. | {
"domain": "physics.stackexchange",
"id": 34631,
"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, quantum-electrodynamics",
"url": null
} |
For more general alphabets, we can use the above process to generate the error locations and then choose from the $$q-1$$ possible error values for each location. Concretely let $$M=C(q-1)^t$$ be the size of our message space. Given a message $$m\in[0,M-1]$$ we let $$N=[m/(q-1)^t]$$ so that $$N\in[0,C-1]$$ and generate a list of locations as above. We then let $$B=m\mod{(q-1)^t}$$ and write $$B$$ as a $$t$$-digit number in base $$(q-1)$$ (allowing leading zeroes) and assign the values digit+1 to each location. Again the reverse map is straightforward. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936073551712,
"lm_q1q2_score": 0.8284352399205042,
"lm_q2_score": 0.8418256492357358,
"openwebmath_perplexity": 377.7651421958605,
"openwebmath_score": 0.7643802165985107,
"tags": null,
"url": "https://crypto.stackexchange.com/questions/97690/how-to-map-the-message-to-the-vector-of-weight-t-in-niederreiter-cryptosystem"
} |
javascript, unit-testing, ecmascript-6
expect(range(3).toString()).to.equal('range(0, 3, 1)');
expect(range(4, 2, -1).toString()).to.equal('range(4, 2, -1)');
});
});
describe('#valueOf', () => {
it('returns the result of toString() method', () => {
expect(range(3).valueOf()).to.equal(range(3).toString());
expect(range(4, 2, -1).valueOf()).to.equal(range(4, 2, -1).toString());
});
});
describe('#inspect', () => {
it('returns the result of toString() method', () => {
expect(range(3).inspect()).to.equal(range(3).toString());
expect(range(4, 2, -1).inspect()).to.equal(range(4, 2, -1).toString());
});
});
describe('PythonRange.areEqual()', () => {
it('throws an error for invalid arguments', () => {
expect(() => PythonRange.areEqual()).to.throw(Error);
expect(() => PythonRange.areEqual(range(3))).to.throw(Error);
expect(() => PythonRange.areEqual(1, 2)).to.throw(Error); | {
"domain": "codereview.stackexchange",
"id": 23574,
"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, unit-testing, ecmascript-6",
"url": null
} |
quantum-mechanics, homework-and-exercises, integration, causality, complex-numbers
Therefore you can adjoin a semicircle in the upper half plane to the real line, and we take its radius to infinity - but we deform the contour so that it dips below the upper branch cut. By the residue theorem, the contour integral is zero, and so the integral over the real line is equal to minus the integral around the branch cut (the integral over the semicircle vanishes for the reasons mentioned above). | {
"domain": "physics.stackexchange",
"id": 76093,
"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, homework-and-exercises, integration, causality, complex-numbers",
"url": null
} |
quantum-mechanics, experimental-physics, measurements, experimental-technique
$$H_r = R(t)V(t)R^\dagger(t) = -F_d x_0 \cos(\omega_0 t + \phi) (a e^{-i\omega_0 t} + a^\dagger e^{i\omega_0 t}).$$
If we now use
$$\cos(\omega t + \phi) = \frac{1}{2} \left[ e^{i(\omega_0 t + \phi)} + e^{-i(\omega_0 t + \phi} \right]$$
we get
$$
H_r =
-\frac{F_d x_0}{2}
\left[
ae^{i\phi} + ae^{-i(2\omega_0 t + \phi)} + a^\dagger e^{-i\phi} + a^\dagger e^{i(2\omega_0 t + \phi)}
\right]
$$
The two time dependent terms oscillate at high frequency and are neglected in the so-called "rotating wave approximation".
This leaves
$$
H_r =
-\frac{F_d x_0}{2}
\left[ ae^{i\phi} + a^\dagger e^{-i\phi} \right] . \qquad (*)
$$
Now suppose that our system weren't quite a harmonic oscillator so that only the first energy gap has energy spacing $\hbar \omega_0$.
In that case our drive is not on resonance with any other levels and it's an ok approximation to consider only the lowest two levels which are on resonance with the drive. | {
"domain": "physics.stackexchange",
"id": 16685,
"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, experimental-physics, measurements, experimental-technique",
"url": null
} |
java, game
Title: Game Loop and FPS Some time ago I made my simple game loop, so here's the code:
public class Game {
private final int TARGET_FPS = 60;
/** optimal waiting time in milliseconds */
private final long OPTIMAL_TIME = 1000 / TARGET_FPS;
/** last Frame time */
private long lastFrame;
private int fps;
/** last FPS time in ms */
private long lastFPS;
private boolean running;
public Game() {
running = true;
}
public static void main(String[] args) {
Game game = new Game();
game.gameLoop();
}
private void gameLoop() {
initialize();
while (running) {
int delta = getDelta();
update(delta);
render();
synchronize(lastFrame - getTime() + OPTIMAL_TIME);
}
}
private void initialize() {
getDelta();
lastFPS = getTime();
}
private void update(int delta) {
// ToDo
updateFPS();
} | {
"domain": "codereview.stackexchange",
"id": 6333,
"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, game",
"url": null
} |
operators, hilbert-space, linear-algebra
$$ \det([H]_B) \ne 0 $$
Note that this property of the determinate is invariant under a change of basis since:
\begin{align}
\det(S^{-1} \cdot [H]_B \cdot S) & = \det(S^{-1}) \cdot \det([H]_B) \cdot \det(S) = \frac{1}{\det(S)} \cdot \det([H]_B) \cdot \det(S) \\
& = \det([H]_B)
\end{align}
with $S$ the matrix representing the change of basis.
Also a hermitian matrix is always diagonalizable, such that
$$ \det(H) = \prod_i \lambda_i $$.
So a hermitian matrix/operator H on a vector space $V$ is invertiable if and only if none of its eigenvalues $\lambda_i$ are zero. | {
"domain": "physics.stackexchange",
"id": 21221,
"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": "operators, hilbert-space, linear-algebra",
"url": null
} |
electrons, quarks, confinement, color-charge
This doesn't happen when you pull apart a proton and electron because the force between them falls according to the inverse square law. The difference between the electron/proton pair and a pair of quarks is that the force between the quarks doesn't fall according to the inverse square law. Instead at sufficiently long distances it becomes roughly constant.
I don't think this is fully understood (it certainly isn't fully understood by me :-), but it's thought to be because the lines of force in the quark-quark field represent virtual gluons, and gluons attract each other. This means the lines of force collect together to form a flux tube. By contrast the electron-proton force is transmitted by virtual photons and photons do not attract each other. | {
"domain": "physics.stackexchange",
"id": 49790,
"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": "electrons, quarks, confinement, color-charge",
"url": null
} |
electrostatics, quantum-spin, charge, coulombs-law
Further reading: I recommend Matt Strassler's pedagogical articles about particle physics and field theory. He does a great job at explaining things in an honest way with no or very little mathematics. The argument I went through above is covered in some capacity in just about every textbook on quantum field theory, but a particularly clear exposition along these lines (with the math included) is in Zee's Quantum Field Theory in a Nutshell. This is where I would recommend starting if you want to honestly learn this stuff, maths and all, but this is an advanced physics textbook (despite being written in a wonderful, very accessible style) so you need probably at least two years of an undergraduate physics major and a concerted effort to make headway in it. | {
"domain": "physics.stackexchange",
"id": 12005,
"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": "electrostatics, quantum-spin, charge, coulombs-law",
"url": null
} |
A standard uniform random variable x has probability density function fx1 0 standard uniform distribution is central to random variate generation. Expectation, variance and standard deviation for continuous. The uniform distribution continuous is one of the simplest probability distributions in. Statistically, it means that the population is 100. It is defined by two parameters, x and y, where x minimum value and y maximum value. In probability theory and statistics, the continuous uniform distribution or rectangular distribution. | {
"domain": "web.app",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713878802044,
"lm_q1q2_score": 0.8078174471572794,
"lm_q2_score": 0.8198933381139645,
"openwebmath_perplexity": 262.3417673963411,
"openwebmath_score": 0.8667429685592651,
"tags": null,
"url": "https://terketpmafoun.web.app/1408.html"
} |
condensed-matter, solid-state-physics, superconductivity, phase-transition
which is also called the particle-hole SU(2) transformation. In this sense, the relation between CDW and SC is like that between Ising order and XY order in the spin system. Therefore, if the Hamiltonian indeed has the particle-hole SU(2) symmetry (i.e. there is no anisotropy between CDW and SC), then, yes, there is no difference between CDW and SC. The CDW transition and the SC transition becomes the same transition, happening at the same temperature and belongs to the same universality class. One such example is the negative-$U$ Hubbard model at half-filling
$$H=-t\sum_{\langle ij\rangle,\sigma}(c_{i\sigma}^\dagger c_{j\sigma}+\text{h.c.})+U\sum_{i}n_{i\uparrow}n_{i\downarrow},$$
with $U<0$ providing the attractive interaction which is necessary to for the formation of both the CDW and the SC order. In this model, the CDW and SC orders are unified. | {
"domain": "physics.stackexchange",
"id": 41059,
"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, solid-state-physics, superconductivity, phase-transition",
"url": null
} |
quantum-gate, quantum-state, quantum-operation
The measurement changes the vector and different measurements change the vector in different ways. Measurement 0 in basis 1 will apply some projection operator $P_1$, measurement + in basis 2 will do some other projection operator $P_2$. They are different operators, so of course, you can't expect to get the same thing even if the input state was the same. If you write $P_1$ in basis 1 you get a matrix $M_1$, and if you write $P_2$ in basis 2 as $M_2$ you get those same matrix entries, but that doesn't mean that the operators were the same. If you write $P_2$ in basis 1 you will get something totally different from $M_1$. Doing the rewrite of the state into basis 2 was so you wouldn't have to write down that matrix and could just work with matrix $M_2$. | {
"domain": "quantumcomputing.stackexchange",
"id": 634,
"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-gate, quantum-state, quantum-operation",
"url": null
} |
java, beginner, object-oriented, game
//The main game loop
while (game) {
//This is the input we will enter to the console.
inputString = console.nextLine();
//If we are not in any of the games..
if (!spinGame && !tofGame) {
//Looping through the array
for (String s : content) {
//If the entered input, contains any word that is in the array, enter switch statement, to find out which word was it.
if (inputString.equalsIgnoreCase(s)) {
//Entering switch statement to find out which of the values matched in the array.
switch (inputString) {
//Spin game match
case "spin":
//Start spin game
spinGame = true;
break; | {
"domain": "codereview.stackexchange",
"id": 4079,
"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, object-oriented, game",
"url": null
} |
quantum-mechanics, homework-and-exercises, angular-momentum, eigenvalue, hydrogen
For the first part of this, showing that $|\psi\rangle$ is an energy eigenstate I have to show that $H|\psi\rangle=E|\psi\rangle$ - i.e. $|\psi\rangle$ is an eigenfunction of H, with eigenvalue E.
To go about this, I would simply calculate $H|\psi\rangle$, but I feel that I'm missing something here.
Should I simply look up the $|210\rangle$ and $|211\rangle$ waves in a table, and calculate the product with the hydrogen Hamiltonian $H= \frac{p^2}{2m}-\frac{e^2}{4\pi\epsilon_0 r}$? It seems very "brute force", am I missing something clever about rewriting $H$ in terms of the angular operators? I scoured my book for information, but couldn't seem to find any tricks of the sort.
$|\psi\rangle$ is an eigenstate for $L^2$ with eigenvalue l(l+1)\hbar^2... Correct?
Second Question Determine the expectation value of $L_z$ (in state $|\psi\rangle$). Account for the fact that the standard error of $L_x$ and $L_y$ must be $\sigma_{L(x)} \sigma_{L(y)} \leq \frac{\hbar^2}{4}$ | {
"domain": "physics.stackexchange",
"id": 63133,
"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, homework-and-exercises, angular-momentum, eigenvalue, hydrogen",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.