text stringlengths 1 1.11k | source dict |
|---|---|
moveit, ros-kinetic
Could you please have a look at the update part of the question??
If there is any tutorial available on planning trajectory for arm + gripper, can you please point me that resource??
The error message telling you that the planning group is not a chain appears because you added all of the joints of the robot to it, including both finger joints. Your SRDF looks like this:
<group name="panda_arm">
<joint name="fixed_base" />
<joint name="panda_joint1" />
<joint name="panda_joint2" />
<joint name="panda_joint3" />
<joint name="panda_joint4" />
<joint name="panda_joint5" />
<joint name="panda_joint6" />
<joint name="panda_joint7" />
<joint name="panda_joint8" />
<joint name="panda_hand_joint" />
<joint name="panda_finger_joint1" />
<joint name="panda_finger_joint2" />
</group> | {
"domain": "robotics.stackexchange",
"id": 32635,
"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": "moveit, ros-kinetic",
"url": null
} |
algorithms, computational-geometry
You'll need to adjust it to your setting, to make sure you don't pick two points from the same polygon. There are multiple ways to do that, but one simple one is: if you've already picked some subset of points, then discard any remaining ones that are from the same polygon as one of those, and only consider what's left as a candidate for your next point. | {
"domain": "cs.stackexchange",
"id": 5265,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, computational-geometry",
"url": null
} |
orbital-elements, satellite, artificial-satellite
Title: How to understand orbit definitions I've been reading about satellite observations (such as this one).
The writer uses terms such as these to define the orbit:
1 41584U 16036A 16167.96105997 0.00000000 00000-0 00000+0 0 07
2 41584 7.5055 353.7008 0046333 41.2140 319.1375 1.00195548 05
rms 0.004 deg from 9 obs June 14.70 - June 16.79 (2.09 day arc) | {
"domain": "astronomy.stackexchange",
"id": 1652,
"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": "orbital-elements, satellite, artificial-satellite",
"url": null
} |
turing-machines, probability-theory, discrete-mathematics, randomized-algorithms, hash
The idea is to compute $Pr[h(x_i) = h(x_j)]$, compute the expectation of the random variable $Z = |\{(i,j) : h(x_i) = h(x_j)\}|$ and use the Markove's inequality to prove the question.
For two independent points $x_i$ and $x_j$, the probability that $h(x_i)$ and $h(x_j)$ are equal is $1 - \{\text{the probability two independent points has the different hash values}\}$, which is $1 - \frac{2^{n/2}}{2^{n/2}}\cdot \frac{2^{n/2} - 1}{2^{n/2}}$. That shows $Pr[h(x_i) = h(x_j)] = \frac{1}{2^{n/2}}$.
As for the random variable $Z$, maybe we can let $Z_{i,j} = 1 \text{ if }h(x_i) = h(x_j)$. Otherwise, $Z_{i,j} = 0$. Then we can get $Pr(Z_{(i,j)}) = \frac{1}{2^{n/2}}$. This is where I stuck. I know how to compute the expectation the single random variable, which is $\sum_{i=1}^{n} x_i P(X = x_i)$. But I have no idea how to expand this formula to the pair random variable $(i,j)$. Also I am a little confused how Markove's Inequality could be used in this proof. | {
"domain": "cs.stackexchange",
"id": 13876,
"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": "turing-machines, probability-theory, discrete-mathematics, randomized-algorithms, hash",
"url": null
} |
electromagnetism, classical-mechanics, rotation, magnetic-fields
Thus, the energy of configuration (2) is roughly
$$H = -Jn.$$
Notice that the configuration
$$\begin{equation*}
\uparrow\rightarrow\rightarrow\cdots\rightarrow\tag{4}
\end{equation*}$$
has potential
$$H = -2J(n-1)$$
since $H_{1,2}=0$.
For large $n$ this is vastly less than the energy of configuration (2).
Some results for particular values of $n$
For two magnets the configuration will be as claimed.
$\hskip2.8in$
For three magnets the energy can be minimized algebraically.
Already we see that the magnets like to be aligned.
We find
$$\begin{eqnarray*}
\theta_1 &=& \pi/2 = 90^{\circ} \\
\theta_2 &=& -\cos^{-1}\sqrt{2/3} \approx -35^\circ \\
\theta_3 &=& \cos^{-1}2\sqrt{2}/3 \approx 19^\circ.
\end{eqnarray*}$$
$\hskip2.6in$
For $50$ magnets the energy can be minimized numerically.
We find, to a tenth of a degree,
$$\begin{eqnarray*}
\theta_1 &=& 90^{\circ} \\
\theta_2 &=& -30.0^\circ \\
\theta_3 &=& 8.2^\circ \\
\theta_4 &=& -2.2^\circ \\
\theta_5 &=& 0.6^\circ \\ | {
"domain": "physics.stackexchange",
"id": 8140,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, classical-mechanics, rotation, magnetic-fields",
"url": null
} |
javascript, css, html5, jquery-ui, to-do-list
html += "<li id='" + i + "' class='ui-widget-content ui-corner-tr ui-draggable' style='width: 96px; display: list-item;'>"
+ "<h5 class='ui-widget-header'>Click for details</h5>"
+ "<a onclick='return onShowTask(\""+ taskObj.data + "\");'><img src=images/task.png width=96 height=72></a>"
+ "<p style='text-align:center;'>" + displayText + "</p>"
+ "<a onclick='return onShowTask(\""+ taskObj.data + "\");' title='Details' class='ui-icon ui-icon-zoomin'>View details</a>"
+ "<a title='Delete task' class='ui-icon ui-icon-trash'>Delete task</a>"
+ "</li>";
}
// Set the innerHTML of the todo column to show all the Todo tasks
var todoList = document.getElementById("todo");
todoList.innerHTML = html; | {
"domain": "codereview.stackexchange",
"id": 2330,
"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, css, html5, jquery-ui, to-do-list",
"url": null
} |
quantum-mechanics, wavefunction, solid-state-physics
Why do we go and change the relevant Hilbert space here? Put differently, I think that during this procedure, in eq. (2), $H_k$ is an operator of $L^2(V)$ (sq. int. function on $V$, the sample volume, respecting the BvK b.c.) and moreover $u_{nk}\in L^2(V)$. Can't we say directly that $H_k$ is self-adjoint on this Hilbert space (but ofc. defined only on a dense subspace) and that then we can choose the $u_{nk}$ as orthonormal (or orthogonal and normalize it on the unit cell)? Why do you (and all textbooks I've seen) go first to $L^2(u)$ for this?
[...] | {
"domain": "physics.stackexchange",
"id": 93817,
"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, wavefunction, solid-state-physics",
"url": null
} |
organic-chemistry, experimental-chemistry, analytical-chemistry, solvents, spectrophotometry
I think you must mean the latter since you mention GC-MS in which case the nanodrop seems to be a poor choice: UV-Vis spectroscopy in general is a technique with very low resolution in terms of compound separation due to the broadness of the peaks in the absorption spectra. If you had only a few alkaloids in your mixture (which i dont think you do) maybe you could use nanodrop or a normal UV-Vis spectrometer followed by a lot of calibration and absorption band decomvolution in order to identify and quantify each component. If on the other hand you have a complex mixture (which is usually the case with natural extracts) any kind of UV-Vis spectroscopy will fall short. Even NMR spectroscopy which has a much higher resolution would struggle. | {
"domain": "chemistry.stackexchange",
"id": 9614,
"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, experimental-chemistry, analytical-chemistry, solvents, spectrophotometry",
"url": null
} |
Little proof of $$\lambda(n)| \varphi(n)$$:
The proof relies on the exponent definition of group theory.
Let $$G$$ be group then the non-negative generator of the ideal $$\{z \in \mathbb{Z}: \forall g \in G (g^z=1)\}$$ is called the exponent of the group $$G$$. For finite groups like RSA groups, it is finite and positive, and then it is the smallest positive natural number $$z$$ such that $$g^z=1$$ for all $$g \in G$$.
The exponent of any finite group must divide the order of the group. $$\lambda(n)$$ is the exponent by the definition and the order of the group is $$\varphi(n)$$ also by definition. This clearly implies $$\lambda(n)| \varphi(n)$$.
More than 2 private key example;
• $$n = 6901$$
• factors $$6901 = 103 \cdot 67$$, $$p=103,q=67$$
• $$\varphi(n) = 6732$$
• $$\lambda(n) = 1122$$
• $$e = 43$$
• $$g =\gcd(p-1,q-1)=6$$
• inverse of $$e$$ by $$d = \varphi(n) = 5323$$
• inverse of $$e$$ by $$d' =\lambda(n) = 835$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517514031506,
"lm_q1q2_score": 0.8018981066976069,
"lm_q2_score": 0.8198933293122507,
"openwebmath_perplexity": 764.8695428652668,
"openwebmath_score": 0.9009312391281128,
"tags": null,
"url": "https://crypto.stackexchange.com/questions/87583/more-than-one-private-key-for-rsa/87585"
} |
molecular-biology, pcr, high-throughput
In principle it should be fine to add the template to the side of the well, since this also lets you visually confirm that you did add the template. However, if you are having problems do consider adding the template to the liquid.
As another way to avoid this problem I would try to first put the adhesive foil lightly on top and then push it down/fix it with something sturdy that has a straight edge (there are special plastic things for this, but a tip-box can also work). | {
"domain": "biology.stackexchange",
"id": 9020,
"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": "molecular-biology, pcr, high-throughput",
"url": null
} |
organic-chemistry, reaction-mechanism, halides, nucleophilic-substitution
The rate constant for the solvolysis of chloromethyl ethyl ether, chloromethyl octyl ether, and chloromethyl methyl sulfide have been determined in several pure and binary solvents. Aplication of the extended Grunwald-Winstein equation, $\log (k/k_\circ) = \ell \mathrm{N_T} + m\mathrm{Y} + c$, gave appreciable “$\ell$” values (0.55-071) for the three substrates indicating that there is significant nucleophilic salvation of the developing carbenium ion in the transition state of these reactions. The $k_\ce{Cl}/ k_\ce{F} = 1.2 \times 10^{5}$ found for the hydrolysis of chloromethyl methyl ether in water is virtually identical to that observed for the unimolecular solvolysis of t-butyl chloride and trityl halides confirming the unimolecular mechanism for these reactions. | {
"domain": "chemistry.stackexchange",
"id": 13902,
"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, reaction-mechanism, halides, nucleophilic-substitution",
"url": null
} |
proof involves placing geometric figures in a coordinate plane. parallelogram with side length b units 2. a. Auxiliary line: an extra line or segment drawn in a figure to help analyze geometry relationships. Draw a line A square 5. Use a coordinate proof to show that ∆ is an isosceles triangle. 7 Triangles and Coordinate Proof. Use dynamic geometry software to draw AB — with endpoints A(0, 0) and B(6, 0). 5-5 Indirect Proof and Inequalities in One Triangle Isosceles triangle ABC is similar to a isosceles triangle ADE what is the length of DE, which is the base part . 2. Position and label each triangle on the coordinate plane. Distance PQ = [(4+6)^2+(38–14)^2]^0. Chapter Resources: Parents Guide for Student Success (pdf) Audio Summaries isosceles triangle. And that just means that two of the sides are equal to each other. The vertex of an isosceles triangle is on the perpendicular bisector of the base. rectangle 3. B. units long and leg LV b units long $16:(5 triangle. Also reflect on | {
"domain": "sumcoop.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9896718496130619,
"lm_q1q2_score": 0.8068126433802972,
"lm_q2_score": 0.8152324871074607,
"openwebmath_perplexity": 587.6750757794822,
"openwebmath_score": 0.685784101486206,
"tags": null,
"url": "http://sumcoop.com/o2jobnra/coordinate-proof-isosceles-triangle.html"
} |
optics, visible-light, water, lenses, microscopy
I was able to see dynamic structures that resembled cells, typical things that one would observe under a microscope. Placing a water droplet elsewhere on the lens of my glasses allowed me to see different cells.
It is not possible to take a picture of this phenomenon. Probably the cells are in my eye.
It works best when the water is in the form of small droplets.
It helps to close the eye which is not observing the droplet.
It does not work well indoors. I believe this is because an indoor light illuminates the whole room while an outdoor light source is surrounded by darkness.
The distance to the light source did not seem to matter much. It worked for a street light beside me and another across the road.
It works if the droplet is on the inside or outside of the lens. | {
"domain": "physics.stackexchange",
"id": 80376,
"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, visible-light, water, lenses, microscopy",
"url": null
} |
c++, dice, battle-simulation
<< eHit << " Damage!\n";
pHP = pHP - eHit;
if (pHP <= 0) {
cout << "\n" << player.name << " is Dead!\n";
cout << enemy.name << "'s HP left: " << eHP << "\n";
cout << player.name << "'s HP left: " << pHP << "\n";
break;
} else {
sleep(1);
cout << "\n" << playerContxt(player) << " Dealing " << pHit
<< " Damage!\n";
eHP = eHP - pHit;
if (eHP <= 0) {
cout << "\n" << enemy.name << " is Dead!\n";
cout << enemy.name << "'s HP left: " << eHP << "\n";
cout << player.name << "'s HP left: " << pHP << "\n";
break;
}
}
playerLastRoll = pHit;
enemyLastRoll = eHit;
counter++;
} | {
"domain": "codereview.stackexchange",
"id": 25766,
"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++, dice, battle-simulation",
"url": null
} |
rviz, pointcloud, quaternion
Would someone please help check me on this?
The two major places I'm uncertain about are in my implementation of the fitting algorithm from the above link (eg. am I properly using the Eigen::JacobiSVD and related matrices to calculate the correct things?), and in my calculation of the orientation quaternion.
Here's the idea behind the calculation of the quaternion the way I have it. As from Wikipedia, the quaternion q is defined in relation to rotations by:
q = cos(a/2) + u * sin(a/2)
Where a is the angle to rotate by, and u is the unit vector about which to rotate.
So I assumed the 'starting' vector would be (0,0,1), which should be rotated by q until it is pointing in the same direction as the plane normal. Thus, the rotation axis u is the cross product of (0,0,1) and n, and a is the angle between them, computed as a = arcsine((0,0,1) DOT n).
Thank you!
void Converter::publishLSPlane(pcl::PointCloud<pcl::PointXYZ> points, std_msgs::Header header) { | {
"domain": "robotics.stackexchange",
"id": 7856,
"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, pointcloud, quaternion",
"url": null
} |
electricity, electric-circuits
Title: In what order would light bulbs in series light up when you close a long circuit? For a few days, I was thinking of this question.
Lets assume we have a simple circuit that is 100 meters long. And lets say that we have bulbs A, B and C connected to the circuit's 30th, 60th and 90th meter relatively (from the + side). When we switch the system on, would all the bulbs light up at the same time? Or would A light up first and C last (or the opposite)? I'm assuming that you're imagining a long, skinny, series circuit with three simple resistive lamps, like this:
switch A B C
__/ _____________^v^v^v_________________^v^v^v_________________^v^v^v________
| |
= battery short |
|_____________________________________________________________________________| | {
"domain": "physics.stackexchange",
"id": 36868,
"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": "electricity, electric-circuits",
"url": null
} |
atomic-physics, terminology, orbitals, magnetic-moment
Title: Why is $m_{\ell}$ called the magnetic quantum number? What is its association with magnets? I am going over my quantum lecture notes and I can't seem to link the quantum number $m_{\ell}$ with any magnetic property. It just seems to specify the shape of an orbital with a particular principal quantum number. Is there any reason for it being labelled as magnetic? An angular momentum of an electron about a nucleus of $\bf L$ implies a magnetic moment $-\mu_B \bf L$. See here. | {
"domain": "physics.stackexchange",
"id": 63175,
"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": "atomic-physics, terminology, orbitals, magnetic-moment",
"url": null
} |
quantum-mechanics, operators, group-theory, lie-algebra
Title: Why does the Lie algebra corresponding to the unitary group contain Hermitian operators? I saw an awesome derivation of Schrodinger's equation on Wikipedia. Part of it relies on:
We also know that when $t' = t$, we must have the unitary time evolution operator $U(t, t) = 1$. Therefore, expanding the operator $U(t', t)$ for $t'$ close to $t$, we can write $U(t', t) = 1 - iH(t' - t)$, where $H$ is a Hermitian operator. This follows from the fact that the Lie algebra corresponding to the unitary group comprises Hermitian operators. Taking the limit as the time-difference $t' - t$ becomes very small, we obtain Schrodinger's equation. | {
"domain": "physics.stackexchange",
"id": 57406,
"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, operators, group-theory, lie-algebra",
"url": null
} |
c#, .net, wpf, xaml
The code is functional and displays the proper result, however I am worried that I am not using the right techniques. Any input at all is greatly appreciated. All in all, your code is quite well-structured. Here are a couple of suggestions for improvement:
Consider moving your styles to a resource dictionary:
<Window.Resources>
<ResourceDictionary Source="Resources.xaml" />
</Window.Resources>
This will de-clutter your file and allow you to re-use the styles in other windows.
Collapse empty tags (use the self-closing syntax):
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
(the same goes for the ColumnDefinitions and any other empty tags)
Declare styles that affect all controls of one type without a key:
<Style TargetType="Button"> ... </Style>
<Style TargetType="Label"> ... </Style> | {
"domain": "codereview.stackexchange",
"id": 2521,
"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, wpf, xaml",
"url": null
} |
obtains by typing $\cos(\theta + \phi) = \cos \theta \cos \phi - \sin \theta \sin \phi$ The following standard functions are represented by control sequences defined in LaTeX:. Probability (p): p = 1 - α/2. Free equations calculator - solve linear, quadratic, polynomial, radical, exponential and logarithmic equations with all the steps. It tells LaTeX that you want to expand the space between the text on the right (if any) and the text on the left (if any) to the maximum width. To use LaTeX markup, set the Interpreter property for the Text object to 'latex'. The general form of an absolute value function is f (x)=a|x-h|+k. The real absolute value function is a piecewise linear. Separation of Variables is a special method to solve some Differential Equations A Differential Equation is an equation with a function and one or more of its derivatives : Example: an equation with the function y and its derivative dy dx. Then xy is 0 and we have jxyj= (xy) = ( x)y = jxjjyj. An important | {
"domain": "daisytale.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9416541626630935,
"lm_q1q2_score": 0.8230784700708867,
"lm_q2_score": 0.8740772384450968,
"openwebmath_perplexity": 1082.4945639665957,
"openwebmath_score": 0.8453951478004456,
"tags": null,
"url": "http://daisytale.it/rdsk/absolute-value-latex.html"
} |
c++, beginner, algorithm, programming-challenge, c++17
if (x_root != y_root) {
root[x_root] = y_root;
size--;
}
}
std::uint_fast16_t sizeDs() {
return size;
}
};
struct Solution {
int numSimilarGroups(const std::vector<std::string>& A) {
const std::uint_fast16_t size = std::size(A);
DisjointSet union_find(size);
for (std::uint_fast16_t i = 0; i < size; ++i) {
for (std::uint_fast16_t j = i + 1; j < size; ++j) {
if (areSimilar(A[i], A[j])) {
union_find.unionDs(i, j);
}
}
}
return union_find.sizeDs();
}
private:
static bool areSimilar(const std::string& a, const std::string& b) {
std::uint_fast16_t n = 0;
for (std::uint_fast16_t i = 0; i < std::size(a); ++i) {
if (a[i] != b[i] && ++n > 2) {
return false;
}
}
return true;
}
};
References
Problem
Discuss | {
"domain": "codereview.stackexchange",
"id": 38967,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, beginner, algorithm, programming-challenge, c++17",
"url": null
} |
temperature, vacuum, space
Title: What is The Cause of Outgassing in Space? What is the main cause of outgassing in space?
Does it only happen because of temperature, vacuum, or both?
Is it possible to test outgassing in vacuum chamber or does it have to be a thermal vacuum chamber?
Many sources define outgassing and the main causes such as moisture but no one really mentions the reason behind it in the first place.
Also, can we use conformal coating to protect against outgassing? Outgassing is driven by vacuum and heat. The harder the vacuum and the hotter the environment, the more severe it will be.
It is readily and routinely tested in vacuum chambers equipped with heat lamps that simulate solar irradiation.
The common sources of outgassing are plastics, elastomeric seals, glues, lubricants, and paints- including conformal coatings. All of these things can contain volatile compounds that are drawn out of them by the vacuum and made mobile with heat. | {
"domain": "physics.stackexchange",
"id": 81121,
"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": "temperature, vacuum, space",
"url": null
} |
php, object-oriented
/**
* Mark first occurrence of menu item containing link with URI as selected.
* @param $uri string
*/
public function select($uri)
{
$liNodeList = $this->xpath->query("//li[a[contains(@href, '" . $uri . "')]]");
if ($liNodeList->length) {
$liNode = $liNodeList->item(0);
$classAttr = explode(' ', $liNode->getAttribute('class'));
$classAttr[] = 'selected';
$liNode->setAttribute('class', trim(implode(' ', $classAttr)));
}
} | {
"domain": "codereview.stackexchange",
"id": 18077,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, object-oriented",
"url": null
} |
atomic-physics, interactions, molecular-dynamics
Title: Is there such a thing as an interaction radius for molecules? My question is about estimating the radius of influence between two molecules; picture some mixture, comprised of water, oxygen gas (in small concentrations) and a molecule we denote $G$. In the mixture, oxygen gas can react with the excited state of the molecule $G$ but not with the ground state of $G$. After an excitation event, we can work out the proportion of $G$ moles which have become excited, but it's a little trickier to ascertain the next part about the chances of an oxygen molecule being sufficiency close to the excited $G$ to interact. | {
"domain": "physics.stackexchange",
"id": 19018,
"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": "atomic-physics, interactions, molecular-dynamics",
"url": null
} |
The only even prime number is 2. A banana cake which takes 250g of self-raising flour, 2 mashed bananas, 75g sugar and 100g of butter, and a chocolate cake which takes 200g of self-raising flour, 75g of cocoa, 150g sugar and 150g of butter. Practice of optimization is. gcc -O sets the compiler's optimization level. Students can therefore see the value in mathematical modeling in a real world setting. We have presented an example of a nonlinear optimization problem which can be solved using Excel. Research Papers. CBSE Sample Papers for Class 1 to 5 & Class 6, Class 7, Class 8, Class 9, Class 10, Class 11, Class 12 for Maths, Science, Physics, Chemistry, Biology, Business. This is a list of 10 epic examples of mathematics in nature. Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences. I am in math hl and I really need a good math IA topic. Digital Binder for your Internal Assessment. The tables below provide you with a list of | {
"domain": "el-trencito.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9449947086083138,
"lm_q1q2_score": 0.8087748121893619,
"lm_q2_score": 0.8558511543206819,
"openwebmath_perplexity": 1178.9939334129035,
"openwebmath_score": 0.3140256106853485,
"tags": null,
"url": "http://hfnl.el-trencito.de/optimization-math-ia-example.html"
} |
[10]
c.
## Markscheme
A2
[2 marks]
a.
For a simple planar graph containing triangles, $$e \leqslant 3v – 6$$ M1
Here $$v = 5{\text{ , so }}e \leqslant 9$$ . A1
There are already 8 edges so the maximum number of edges that could be added is 1. R1
This can be done e.g. AC or BD R1
[4 marks]
b.
The distinct Hamiltonian cycles are
ABCDEA A2
ABCEDA A2
ABECDA A2
AEBCDA A2
Note: Do not penalise extra cycles.
The weights are 32, 32, 29, 28 respectively. A1
The Hamiltonian cycle of least weight is AEBCDA. R1
[10 marks]
c.
## Examiners report
A fairly common error in (a) was to draw a non-planar version of G, for which no credit was given. In (b), most candidates realised that only one extra edge could be added but a convincing justification was often not provided. Most candidates were reasonably successful in (c) although in some cases not all possible Hamiltonian cycles were stated.
a. | {
"domain": "iitianacademy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9875683495127004,
"lm_q1q2_score": 0.8097007172168866,
"lm_q2_score": 0.8198933447152497,
"openwebmath_perplexity": 1356.8558396655224,
"openwebmath_score": 0.7188671231269836,
"tags": null,
"url": "https://www.iitianacademy.com/ib-dp-maths-topic-10-7-simple-graphs-connected-graphs-complete-graphs-hl-paper-3/"
} |
quantum-information, josephson-junction
For the $\alpha = 1$ case I get the below plot for $f_{01}$ and $f_{12}$. The peak frequency and modulation are wrong. Notably, it does get the nominal anharmonicity correct at 0 flux bias. I have noticed that the outcome changes somewhat by changing the window and step size in phase/flux to be multiple periods with smaller slices which makes me suspect the periodicity and convergence are issues at play. A friend suggested it might be due to the fact that the junction phase shifts as a function of flux bias and that I might need to solve in phase about $arctan(-\chi tan(\pi\frac{\Phi}{\Phi_0})$. I tried deleting the phase shift as a fast test but it doesn't seem to fix the issue. Any suggestions? I can also supply the code I wrote. After some more investigation with a friend who works with superconducting circuits I have the solution. The first mistake was I wasn't giving it the values I thought, so the peak frequency error was essentially a result of me setting the individual | {
"domain": "physics.stackexchange",
"id": 62095,
"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-information, josephson-junction",
"url": null
} |
sensors, quadcopter, electronics, esc, multi-rotor
Title: Measuring the performance and response rate of ESCs How would i go about measuring and quantifying the performance of an ESC? I am looking to measure the response rate(in Hz) of an ESC, as well as it's performance(i.e how fast it starts and stops, as well as how much it increases/decreases the motor's speed per tick).
I'm assuming that i can manually program an ESC and it's response rate with a programming card/module that is compatible with said ESC, but i would still not be able to measure the exact performance of the ESC.
I would appreciate any and all inputs and suggestions.
P.S This question is linked/asked in conjunction with a previous question of mine here on the Robotics StackExchange here Why can't i use different ESCs together on a multirotor? After reading your other question, I reason that the one quantity you can look at is the rpm of your motor at different input values. | {
"domain": "robotics.stackexchange",
"id": 522,
"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": "sensors, quadcopter, electronics, esc, multi-rotor",
"url": null
} |
halides, dipole
Title: Why is the dipole moment of chloromethane larger than the dipole moment of fluoromethane? On the Pauling electronegativity scale, fluorine and chlorine are 3.98 and 3.16, respectively.
Since the dipole moment is dependent on electronegativity, why is the dipole moment of chloromethane larger than the dipole moment of fluoromethane?
I guess that the smaller size of the s orbital in the fluorine atom has something to do with this. Dipole moment is not just about charges, it also has $L$ term. Bond length of $\ce{C-Cl}$ is greater than $\ce{C-F}$ and in this case, that is more dominating factor.
The dipole moment is in order
$$\ce{CH3Cl} \gt \ce{CH3F} \gt \ce{CH3Br} \gt \ce{CH3I}$$
You can see that electronegativity plays a more dominating role in $\ce{CH3X}$ when $\ce{X}$ is $\ce{Br}$/$\ce{I}$. | {
"domain": "chemistry.stackexchange",
"id": 7395,
"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": "halides, dipole",
"url": null
} |
If the limit exists, then it should be equal to 1, because $|\sin n|$ is dense in $[0,1]$ and there exists a subsequence $|\sin n_k|$ converging to $1$. Then
$$\sqrt[n_k]{|\sin n_k|} \to 1.$$
-
Or any subsequence so that $|\sin n_k|$ is bounded away from $0$ would do. – mac Jun 27 '11 at 19:22
The point is, does the limit exist? – TonyK Jun 27 '11 at 20:06
HINT:
There are arbitrarily large multiples of $\pi$, and there are arbitrarily large odd multiples of $\pi /2$.
Of course, this only happens if we consider real n as opposed to natural n... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731126558705,
"lm_q1q2_score": 0.8182444009965877,
"lm_q2_score": 0.8499711794579723,
"openwebmath_perplexity": 287.3512818644821,
"openwebmath_score": 0.9076735973358154,
"tags": null,
"url": "http://math.stackexchange.com/questions/48035/calculate-lim-n-to-infty-sqrtn-sin-n"
} |
quantum-mechanics
Title: Theory of Complex Spectra, Applying Slater-Condon Rules C.W. Ufford and G.H. Shortley in Physical Review 1932, Vol. 42, pg. 167, separate the two $^2$D's of $d^3$. On page 173 (pg 7 of the PDF) of this article they determine the matrix of the electrostatic energy in eqn. 3.3 as:
$$\begin{array}{ccc}
- &a & b \\
a & 3F_0+7F_2+63F_4 & 3(21)^{1/2}(F_2-5F_4) \\
b & 3(21)^{1/2}(F_2-5F_4) & 3F_0+3F_2-57F_4 \\ \end{array}$$
I'm trying to figure out how they actually determine this matrix. How do they do it?
Here is what I understand:
This matrix comes from a description of the two terms,
$$^2D^a_{2,1/2} = 1/2 [-A+B-C+E]$$
$$^2D^b_{2,1/2} = (84)^{-1/2}[-5A-3B-C+4D-3E-2(6)^{1/2}F]$$
where $A,B,C,D,E,F$ are zero-order states of $d^3$ which are
$$\begin{array}{cccc}
A &\mathcal{A}u_1(2^+)u_2(2^-)u_3(-2^+) & B &\mathcal{A}u_1(2^+)u_2(1^+)u_3(-1^-) \\
C &\mathcal{A}u_1(2^+)u_2(1^-)u_3(-1^+) & D &\mathcal{A}u_1(2^-)u_2(1^+)u_3(-1^+) \\ | {
"domain": "physics.stackexchange",
"id": 1512,
"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",
"url": null
} |
C# code:
//pseudo-polynomial algorithm
public static bool balancePatition(int[] S)
{
var n = S.Length;
var N = S.Sum();
bool[,] P = new bool[N / 2 + 1, n + 1];
for (int i = 0; i < n + 1; i++)
P[0, i] = true;
for (int i = 1; i < N / 2 + 1; i++)
P[i, 0] = false;
for (int i = 1; i <= N / 2; i++)
for (int j = 1; j <= n; j++)
P[i, j] = S[j - 1] <= i ? P[i, j - 1] || P[i - S[j - 1], j - 1] : P[i, j - 1];
return P[N / 2, n];
}
### Example
Below is the table P for the example set used above S = {3, 1, 1, 2, 2, 1}:
Result of example execution of algorithm on the table P
### Runtime
This algorithm runs in time $O(Nn)$, where $n$ is the number of elements in the input set and $N$ is the sum of elements in the input set.
## Special case of the subset-sum problem
The partition problem can be viewed as a special case of the subset sum problem and the pseudo-polynomial time dynamic programming solution given above generalizes to a solution for the subset sum problem. | {
"domain": "wikipedia.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9920620040210504,
"lm_q1q2_score": 0.8133850215439639,
"lm_q2_score": 0.8198933315126791,
"openwebmath_perplexity": 578.7865795576408,
"openwebmath_score": 0.7254106998443604,
"tags": null,
"url": "http://en.wikipedia.org/wiki/Partition_problem"
} |
fluid-dynamics, drag, flow, viscosity, navier-stokes
$$x_i^*=\frac{x_i}{L}, \phantom{abc} u_i^*=\frac{u_i}{U}, \phantom{abc} \rho^*=\frac{\rho}{\rho_0}, \phantom{abc} t^*=\frac{t}{\frac{L}{U}},\phantom{abc} p^*=\frac{p}{\rho_0 \nu \frac{U}{L}} \phantom{ab}$$
This results in the two dimensionless equations
$$\sum\limits_{j \in \mathcal{D}} \frac{\partial u_j^*}{\partial x_j^* }=0$$
$$\underbrace{\overbrace{Re}^{\ll 1} \left( \frac{\partial u_i^*}{\partial t^*} + \sum\limits_{j \in \mathcal{D}} u_j^* \frac{\partial u_i^*}{\partial x_j^*} \right)}_{\ll 1} = - \frac{\partial p^*}{ \partial x_i^* } + \sum\limits_{j \in \mathcal{D}} \frac{\partial \tau_{ij}^*}{\partial x_j^* }$$
where the last one can be rewritten with equation \eqref{4} and neglecting the terms on the left-hand side due to their magnitude to
$$\frac{\partial p}{\partial x_i} = \mu \sum\limits_{j \in \mathcal{D}} \frac{\partial^2 u_i}{\partial x_j^2}.$$
This set of equations is often termed Stokes' equations and can be written symbolically as
$$\vec \nabla \cdot \vec u = 0,$$ | {
"domain": "physics.stackexchange",
"id": 65614,
"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": "fluid-dynamics, drag, flow, viscosity, navier-stokes",
"url": null
} |
c
Yes. C contains all the C-String manipulation functions you want (including strstr()). They are in the header file <string.h>
As a final comment I find your code very dense (and the comments meaningless). White space is your friend spread the code out to make it readable. Add comments that explain what you are doing but eching the code is not worth the effort the code is more precise and is reasonable (explain why and overall technique not a line by line).
Sorry: Here is strtr()
char* strtr(char const* s, char const* in, char const* out)
{
char swaper[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, | {
"domain": "codereview.stackexchange",
"id": 725,
"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",
"url": null
} |
c#, system.reactive
So I'm looking for feedback from any Rx experts on this. Things like the use of the Do method, and the cancellation token. Most of the methods called use
ThrowIfCancellationRequested on the token, but I'm ignoring the cancellation exception because if it has been cancelled, then Switch() will already be watching
the next IObservable and won't care about the old one - is that the best way of doing this? When Switch unsubscribes from the previous Observable to connect to the new one, FromAsync should signal the cancellation token and also correctly eat the ThrowOnCancellation exception.
While it'd probably be better to try to use a ReactiveCommand to model the loading bool (which might not be easy given the cancelation and Switch), if this code works for you it should be fine.
Make sure to specify RxApp.MainThreadScheduler for the Throttle though, it's more efficient | {
"domain": "codereview.stackexchange",
"id": 6491,
"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#, system.reactive",
"url": null
} |
python, beginner
except Usage as err:
print(sys.stderr, err.msg)
print(sys.stderr, "for help use --help")
return 2
def add_recipe():
""" Asks the user interactivly to input a recipe name
and the ingredience
Returns
-------
A dictionary with the recipe name and the list of ingedience
Example
-------
{'Applepie':['Apple','Pie']}
"""
print("Name of the recipe\n")
name = input("> ")
recipe = []
while True:
print("Add an ingredience or finalize the recipe with 'q'")
ingredience = input("> ")
if ingredience in 'q':
break
else:
recipe.append(ingredience)
return {name: recipe}
def save_recipe(recipe):
"""Saves the recipe to a json file"""
#Get the first key from the dictionary: Name of the recipe
name = next(iter(recipe.keys()))
with open(name+'.recipe', 'w') as f:
json.dump(recipe, f, indent=1) | {
"domain": "codereview.stackexchange",
"id": 10534,
"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",
"url": null
} |
c#, wpf
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<PasswordBox FontFamily="Helvetica" x:Name="txtPassword"
FontWeight="Light"
HorizontalContentAlignment="Left"
HorizontalAlignment="Center"
Width="235"
Foreground="Black"
FontSize="18"
Height="30" Margin="63,0,0,0"
/>
<iconPacks:PackIconControl Kind="{x:Static iconPacks:PackIconMaterialKind.FormTextboxPassword}"
Width="24"
Height="24"
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>
<Button Margin="0,50,0,0" Width="200" Click="Button_Click" Foreground="White">Login</Button>
</StackPanel>
</Grid>
</Grid> | {
"domain": "codereview.stackexchange",
"id": 38214,
"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#, wpf",
"url": null
} |
of continuous functions that are not differentiable graph for function. That shows it is also continuous, then it will also be differentiable at the origin but not at... Function in figure a is not differentiable at x = a. b differentiable then it is differentiable at x 1..., a differentiable function is continuous at x = 0, x=O show that ç is differentiable it! At a to solve: Write down a function is differentiable, then it is differentiable at the but... Continuous without having a bounded derivative in particular, we note that but does not exist for. X0 0, x=O show that it is definetely continuous other way around then it is at... That are not differentiable at the point x = 0, and find giG ) differentiable it is differentiable! Consider the function can not be differentiable everywhere that ’ s not true points on its domain, x=0. Uniformly continuous ) is uniformly continuous, then f ( x ) =.... Which is continuous continuous at a a function is differentiable at that point in,! ) | {
"domain": "com.br",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992923570262,
"lm_q1q2_score": 0.8338822215263384,
"lm_q2_score": 0.8615382076534742,
"openwebmath_perplexity": 207.28947880393957,
"openwebmath_score": 0.8916527628898621,
"tags": null,
"url": "https://idealizeengenharia.com.br/hanako-is-hxct/if-a-function-is-differentiable-then-it-is-continuous-c23bf7"
} |
Communication, Networking, Signal and Image Processing (CS)
Question 1: Probability and Random Processes
January 2001
# Part 3
Let the $\mathbf{X}_{1},\mathbf{X}_{2},\cdots$ be a sequence of random variables that converge in mean square to the random variable $\mathbf{X}$ . Does the sequence also converge to $\mathbf{X}$ in probability? (A simple yes or no answer is not acceptable, you must derive the result.)
# Solution 1 (retrived from here)
Let the $\mathbf{X}_{1},\mathbf{X}_{2},\cdots$ be a sequence of random variables that converge in mean square to the random variable $\mathbf{X}$ . Does the sequence also converge to $\mathbf{X}$ in probability? (A simple yes or no answer is not acceptable, you must derive the result.)
We know that $E\left[\left|\mathbf{X}-\mathbf{X}_{n}\right|^{2}\right]\rightarrow0$ as $n\rightarrow\infty$ .
By using Chebyshev Inequality, | {
"domain": "projectrhea.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.98998642789963,
"lm_q1q2_score": 0.8070690955971829,
"lm_q2_score": 0.8152324848629215,
"openwebmath_perplexity": 553.5736830187734,
"openwebmath_score": 0.9420462846755981,
"tags": null,
"url": "https://www.projectrhea.org/rhea/index.php/ECE_PhD_QE_CNSIP_Jan_2001_Problem1.3"
} |
$$\mbox{Items (a)and(b) for R=4 cm: } \ \ E \ = \ \frac{\delta}{2 \pi \epsilon_{0} R} \ = \ \frac{(+5.0 \times 10^-6 \ C/m)}{2 \pi \epsilon_{0} (0.04 \ m)}$$
$$\mbox{Items (c)and(d) for R=8 cm: } \ \ E \ = \ \frac{\delta}{2 \pi \epsilon_{0} R} \ = \ \frac{(-2.0 \times 10^-6 \ C/m)}{2 \pi \epsilon_{0} (0.08 \ m)}$$
Your answers should agree with the textbook.
Last edited: Jul 30, 2005
11. Jul 30, 2005
### Staff: Mentor
Realize that the value of the field depends on how far you are from the axis of the cylinders. They want you to evaluate the field at R=4.0cm, which is between the two charged cylindrical shells. The only charge that contributes to the field at that point is the charge on the inner shell. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9553191271831559,
"lm_q1q2_score": 0.8042121482593029,
"lm_q2_score": 0.8418256532040707,
"openwebmath_perplexity": 1230.546719032566,
"openwebmath_score": 0.7611883282661438,
"tags": null,
"url": "https://www.physicsforums.com/threads/finding-mag-e-of-2-thin-walled-concentric-cylindrical-shells.83412/"
} |
• Thank you for this! Though there's one thing I don't understand: the secant method tells us that in certain cases the sequence ${(S_{n})}$ will converge to the root of the given function, but does it also tell us that the value $S_{n}$ will be closer to the root than $S_{n-1}$? How does Rudin know that p' will be closer to the root than p and not farther away? Aug 25 '16 at 11:59
• The Associativity link is dead Oct 10 '17 at 16:20
• @frogeyedpeas I fixed it Mar 28 '18 at 16:25
• @Rasputin Generally monotonicity is the trick: if $p<\sqrt{2}$ then $\left ( \frac{2p+2}{p+2} \right )^2 = \frac{4p^2+8p+4}{p^2+4p+4}=2\frac{2p^2+4p+2}{p^2+4p+4}<2$, because the denominator of the last expression is equal to the numerator plus $2-p^2$. On the other hand, $q>p$ is apparent from the form $q=p-\frac{p^2-2}{p+2}$.
– Ian
Jun 10 '18 at 4:20 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517482043892,
"lm_q1q2_score": 0.8085669091883755,
"lm_q2_score": 0.8267117876664789,
"openwebmath_perplexity": 163.4772998400005,
"openwebmath_score": 0.8928645849227905,
"tags": null,
"url": "https://math.stackexchange.com/questions/141774/choice-of-q-in-baby-rudins-example-1-1/141824"
} |
python, numpy, matplotlib
for single_date in daterange(start_date, end_date):
df.loc[single_date, ['Time']] = single_date.strftime("%H:%M:%S")
x = []
for index in df.index:
y = df_1.loc[df_1['Date'].str.contains(df['Time'][index])]
for i in np.arange(1, 10, 1)/10:
x.append(y.quantile(i))
pct = pd.DataFrame(x, columns = ['Energy'])
df['pct0.1'] = pct.loc[0.1].values
df['pct0.2'] = pct.loc[0.2].values
df['pct0.3'] = pct.loc[0.3].values
df['pct0.4'] = pct.loc[0.4].values
df['pct0.5'] = pct.loc[0.5].values
df['pct0.6'] = pct.loc[0.6].values
df['pct0.7'] = pct.loc[0.7].values
df['pct0.8'] = pct.loc[0.8].values
df['pct0.9'] = pct.loc[0.9].values
sns.set(font_scale = 1.5, style = "white")
fig, ax = plt.subplots(figsize = (8, 6))
xs = np.arange(len(df))
colors = plt.cm.Greens(np.linspace(0.1, 0.6, 5)) | {
"domain": "codereview.stackexchange",
"id": 42840,
"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, numpy, matplotlib",
"url": null
} |
orthogonal matrix represent either a rotation or a reflexion? Coxetert. For those numbers, the matrix A I becomes singular (zero determinant). the zero operator, its trace is greater than zero, and one can de ne a corresponding density matrix by means of the formula ˆ= R=Tr(R): (15. Let me find them. Once again using (2). The Decomposition of the Sum of Squares Ordinary least-squares regression entails the decomposition the vector y into two mutually orthogonal components. In particular, it is achieved for the eigenbasis itself: if eigenvalues are labeled decreasingly. Thus, the trace norm of X is the ‘ 1 norm of the matrix spectrum as jjXjj = P r i=1 j˙ ij. 5 showed that the eigenvectors of these symmetric matrices are orthogonal. In this tutorial, we will look at various ways of performing matrix multiplication using NumPy arrays. Many matrix operations known from Matlab, Scilab and Co. The column (or row) vectors of a unitary matrix are orthonormal, i. How can one generate random | {
"domain": "profumiebenessere.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771770811146,
"lm_q1q2_score": 0.8044528211521564,
"lm_q2_score": 0.8152324960856175,
"openwebmath_perplexity": 651.1745767444206,
"openwebmath_score": 0.8197792172431946,
"tags": null,
"url": "http://profumiebenessere.it/trace-of-orthogonal-matrix.html"
} |
I used stattrek.com to get it that far, but my Standard normal distribution table gives me the same number to fewer decimal places.
$z = \frac{x - \mu}{\sigma}$
$z = \frac{180 - 210}{50}$
$z=-0.6$
Here's a pic of a standard normal distribution table.
http://classes.engr.oregonstate.edu/...rmal_table.gif
At '-0.6' you go to the '00' column as we are finding '-0.60'
And it gives us a value for p [0.2743] | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795083542037,
"lm_q1q2_score": 0.824605128666873,
"lm_q2_score": 0.8354835350552604,
"openwebmath_perplexity": 1803.3224291791557,
"openwebmath_score": 0.6772162318229675,
"tags": null,
"url": "http://mathhelpforum.com/statistics/217949-questions-involving-z-score-can-you-please-check-my-answer.html"
} |
momentum, atomic-physics
Title: Momentum conservation in fission In a fission reaction a neutron collides with another atom. In this process, is the momentum conserved? Some masses turn into energy, so can't it happen that the momentum is not conserved? Momentum conservation is a consequence of a fundamental symmetry called translational symmetry. As such it is a fundamental property of our universe and momentum is always conserved. Even when massive particles disappear completely by converting into photons the momentum is still conserved because even though they are massless photons carry momentum. | {
"domain": "physics.stackexchange",
"id": 46517,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "momentum, atomic-physics",
"url": null
} |
ros-melodic, rosrun
config:
ode_simulator_params.yaml
include:
ode_simulator simulator_odefun.h
launch:
ode_simulator.launch
src:
ode_simulator.cpp ode_simulator_node.cpp simulator_odefun.cpp
Of course there is source ~/ros_catkin_ws/install_isolated/setup.zsh in my .zshrc.
Any help is appreciated, if more info is needed please tell me and I'll provide it.
Originally posted by 0novanta on ROS Answers with karma: 18 on 2021-11-10
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 37111,
"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-melodic, rosrun",
"url": null
} |
java, homework, combinatorics
Title: Permutations Finder Help Number 2 Previous question:
Java application for finding permutations efficiently>
I have changed quite a bit of code, and need some more reviews.
class Permutations {
static long factorial(int num){
long factorial = num;
for (int forBlockvar = num; forBlockvar > 1; forBlockvar--) {
factorial = factorial * forBlockvar;
}
return factorial / num;
}
public static void main(String[] args){
long FactNmR;
int n = 8;
int num = n;
int r = 6;
int nMr = n - r;
long FactN = factorial(num);
if (nMr == 2) {
FactNmR = 2;
}
else if (nMr <= 1){
FactNmR = 1;
}
else if (nMr >= 2) {
num = nMr;
FactNmR = factorial(num);
}
long permutations = FactN;
permutations = permutations / FactNmR; | {
"domain": "codereview.stackexchange",
"id": 1026,
"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, homework, combinatorics",
"url": null
} |
c, binary-tree, binary-search-tree
if (ferror(fp))
return -1;
return 1;
}
/* add a node with w, at or below p */
static void
addtree(struct tnode **p, char *w)
{
int cond;
if (*p == NULL) { /* if a new word has arrived, make a new node */
*p = malloc(sizeof **p);
if (*p == NULL)
err(EXIT_FAILURE, "malloc");
if (((*p)->word = strdup(w)) == NULL)
err(EXIT_FAILURE, "strdup");
(*p)->count = 1;
(*p)->left = (*p)->right = NULL;
} else if ((cond = strcmp(w, (*p)->word)) == 0) { /* repeated word */
(*p)->count++;
} else if (cond < 0) { /* less than into left subtree */
addtree(&((*p)->left), w);
} else if (cond > 0) { /* greater than into right subtree */
addtree(&((*p)->right), w);
}
}
/* get next word from fp; if fp is NULL, free buffer and return null */
static char *
getword(FILE *fp)
{
size_t i = 0;
int c;
while (isspace(c = getc(fp)))
; | {
"domain": "codereview.stackexchange",
"id": 38157,
"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, binary-tree, binary-search-tree",
"url": null
} |
sql, bash, nosql
SELECT dates.date, campaign, ad_group, impressions, clicks, spend
FROM dates
LEFT OUTER JOIN gads_data
ON dates.date = gads_data.date
ORDER BY dates.date
# li.sql
WITH dates AS (
SELECT date
FROM
UNNEST(GENERATE_DATE_ARRAY('2022-03-11', DATE_SUB('2022-03-15', INTERVAL 1 DAY), INTERVAL 1 DAY)) AS date
), gads_data AS (
SELECT DATE(TIMESTAMP_MILLIS(date)) AS date,
campaign_id,
sum(impressions) AS impressions,
sum(clicks) AS clicks,
sum(cost_in_local_currency) AS spend
FROM `table2`
WHERE DATE(TIMESTAMP_MILLIS(date)) >= '2022-03-11' AND DATE(TIMESTAMP_MILLIS(date)) < '2022-03-15'
GROUP BY date, campaign_id
), names AS (
SELECT id, name AS campaign
FROM `ten-x-studio-data.threema.li_campaign`
)
SELECT dates.date, campaign, impressions, clicks, spend
FROM dates
LEFT OUTER JOIN gads_data
ON dates.date = gads_data.date
LEFT OUTER JOIN names
ON gads_data.campaign_id = names.id
ORDER BY dates.date | {
"domain": "codereview.stackexchange",
"id": 43670,
"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, bash, nosql",
"url": null
} |
neural-networks, machine-learning, boltzmann-machine, restricted-boltzmann-machine
Summary
Train single layer RBM to reconstruct to input and then keep adding layer after layer until we reach some good low-level representation as depicted in the figure below, W1, W2, W3 are the matrices that have some lower dimensionality of the input space.
Transpose those matrices $W_1, W_2, W_3$ to be the decoder part.
Fine-tune the whole encoder-decoder stack to reconstruct the input. image
RBM vs VAE and GAN
Side note: RBM is now obsolete, see VAE, GAN they are way better at modeling the manifold in which the data is concentrated, yet you could sample from the manifold directly with a single inference step. | {
"domain": "ai.stackexchange",
"id": 516,
"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": "neural-networks, machine-learning, boltzmann-machine, restricted-boltzmann-machine",
"url": null
} |
pharmacology, dose
Extreme overdose can result in death.[59][60] The median lethal dose
(LD50) given orally is 192 milligrams per kilogram in rats. The LD50
of caffeine in humans is dependent on individual sensitivity, but is
estimated to be about 150 to 200 milligrams per kilogram of body mass
or roughly 80 to 100 cups of coffee for an average adult.[61] Though
achieving lethal dose of caffeine would be difficult with regular
coffee, it is easier to reach high doses with caffeine pills, and the
lethal dose can be lower in individuals whose ability to metabolize
caffeine is impaired. | {
"domain": "biology.stackexchange",
"id": 2140,
"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": "pharmacology, dose",
"url": null
} |
Roughly speaking, the "solution" goes like
1. Establishing the encoding as an exact representation of the problem.
2. Showing via the codes that there are $$2^{n-2}$$ disjoint configurations.
3. Showing via the codes that each configuration contributes to a simplex volume.
4. Showing that this holds for all $$n \geq 3$$.
Arguably, not displaying a proof for (2) here in the post isn't a big deal. As for (4) the recurrence, it's a judgement call whether one can take it as true, perhaps having some faith in the induction proof (which formulation is hinted by the demonstration).
The most important task to continue is to fix the lack of semi-rigorous derivation for (3): the simplex volume, either for a given $$n$$, or with induction from trivial cases $$n = 2$$ and $$3$$.$$\endgroup$$
Please load the page $$3\sim 4$$ times for the hyperlinks to work properly. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429590144718,
"lm_q1q2_score": 0.8434802229338262,
"lm_q2_score": 0.8577681013541611,
"openwebmath_perplexity": 891.6121091208952,
"openwebmath_score": 0.9967944622039795,
"tags": null,
"url": "https://math.stackexchange.com/questions/2786052/expected-maximum-pairwise-distance-for-n-points-on-a-circle"
} |
solar-system, planetary-formation, gas-giants, solar-wind, proto-planetary-disk
The architecture of the solar system
With all this, we can formulate the standard explanation for the architecture of the solar system:
Jupiter and Saturn are standard cold gas-giants that underwent a phase of rapid core-assembly and subsequent runaway gas-accretion. Uranus and Neptune grew far out in regions of low disc gas density (or small dust populations, increasing the core-assembly and cooling time) and hence were stuck in the hydrostatic gas accretion phase until the disc dispersed. The "ice" in ice giants hence refers to the solid component making up 60-80% of their mass, and not that they missed runaway accretion, which would make for a clearer name. | {
"domain": "astronomy.stackexchange",
"id": 5153,
"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, planetary-formation, gas-giants, solar-wind, proto-planetary-disk",
"url": null
} |
ros, ros2, include
auto result = client->async_send_request(request);
// Wait for the result.
if (rclcpp::spin_until_future_complete(node, result) == rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "Sum: %ld", result.get()->sum);
} else {
RCLCPP_ERROR(rclcpp::get_logger("rclcpp"), "Failed to call service add_two_ints");
}
rclcpp::shutdown();
return 0;
}
Originally posted by Peanpepu on ROS Answers with karma: 17 on 2022-04-26
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 37607,
"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, include",
"url": null
} |
• Mmh, that's a nice argument. I assume for vertices $x,y$, $xy$ means the distance from $x$ to $y$ ? Also, is that a standard kind of argument ? Jan 26, 2019 at 15:12
• Yes it's indeed standard. One reference is my survey arxiv.org/abs/1302.5982 : essentially Corollary 7C5 is the same. I'm not sure of an earliest reference: this was rather often done with unnecessary extra-assumptions such as finiteness assumptions on the complex, or equivariance with respect to a group action with some properties, etc.
– YCor
Jan 26, 2019 at 15:56
From the point of view of graph theory, it is well known that median graphs (i.e. one-skeleta of CAT(0) cube complexes) embeds isometrically in Hamming cubes. An approach I like uses restricted quotients, which have other nice applications. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.985496419030704,
"lm_q1q2_score": 0.8376435423993013,
"lm_q2_score": 0.84997116805678,
"openwebmath_perplexity": 144.56186899194378,
"openwebmath_score": 0.9502976536750793,
"tags": null,
"url": "https://mathoverflow.net/questions/321751/can-all-countable-cat0-cube-complexes-be-isometrically-embedded-in-l1-mat"
} |
nomenclature, history-of-chemistry
Until at least the Middle Ages no distinction was drawn between potash (potassium carbonate) and soda (sodium carbonate). Martin Heinrich Klaproth first distinguished them in 1797, and suggested the name 'kali' for the first and 'natron' for the second.
Metallic potassium and sodium were then isolated for the first time in 1807 by Sir Humphry Davy, by electrolysis of potassium hydroxide (KOH) and sodium hydroxide (NaOH) respectively. He named his discoveries Potassium and Sodium in the Bakerian lecture at the Royal Society on the 19th of November the same year: | {
"domain": "chemistry.stackexchange",
"id": 6117,
"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": "nomenclature, history-of-chemistry",
"url": null
} |
c#, unit-testing, mocks
var properties = GetType().GetProperties()
.Where(p => p.CanRead && p.CanWrite
&& p.PropertyType.IsGenericType
&& p.CanRead
&& p.CanWrite
&& p.GetMethod.IsPublic
&& p.PropertyType.IsGenericType
&& p.PropertyType.GetGenericTypeDefinition().Name == typeof (ViewSet).Name + "`1");
foreach (var propertyInfo in properties)
{
var entityType = propertyInfo.PropertyType.GenericTypeArguments[0];
var view = AddView(GetMappedViewId(entityType));
var constructedType = typeof (ViewSet<>).MakeGenericType(entityType);
var viewSetInstance = (ViewSet)Activator.CreateInstance(constructedType, view, this);
propertyInfo.SetValue(this, viewSetInstance);
_viewSets.Add(viewSetInstance);
}
OnModelComposing();
} | {
"domain": "codereview.stackexchange",
"id": 18780,
"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#, unit-testing, mocks",
"url": null
} |
electrostatics, potential, method-of-images
Original, incorrect answer:
The conductor is neutral. No charges are induced on the surface of the conductor at all.
The method of images instead says that there is an "effective" charge behind the surface of the conductor. The charge does not really exist, and it is crucial that the charge not appear on the surface of the conductor (that would ruin the boundary conditions). | {
"domain": "physics.stackexchange",
"id": 22929,
"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, potential, method-of-images",
"url": null
} |
3. shi says:
I can not understand why, because actually, every entry of in λx is(assume a 3*3 markov matrix A) x1*A11+x2*A21+x3*A31, but what we have is A11+A12+A13 = 1(every row).
• mzspivey says:
Your example $x_1 A_{11} + x_2 A_{21} + x_3 A_{31}$ is left-multiplying A by a row vector x. In my argument I’m right-multiplying A by a column vector x.
4. Rob Kusner says:
Is there a good way to decide how many eigenvalues have modulus < 1?
5. Alex says:
hey i dont get the point : Thus no entry in λx can be larger than x_i
but why not?
• mzspivey says:
A convex combination is a weighted average. If you take a weighted average of a set of numbers (where the weights are nonnegative and sum to 1), then that weighted average can’t be larger than the largest number in the set. For example, suppose you have the numbers 1, 3, 6, and 10. There’s no way you can take a weighted average of those four numbers and get something larger than 10.
6. chundi says: | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9923043540733152,
"lm_q1q2_score": 0.8042417567718891,
"lm_q2_score": 0.8104789155369047,
"openwebmath_perplexity": 437.3483102012166,
"openwebmath_score": 0.9378555417060852,
"tags": null,
"url": "https://mikespivey.wordpress.com/2013/01/17/eigenvalue-stochasti/"
} |
edition, will be published by Wellesley Publishers. Since cos(5π 6) = − √ 3 2 and sin(5π 6) = 1 2, we see that T is rotation by 5π 6 = 150. solving equations This sections illustrates the process of solving equations of various forms. All solutions to AT Av = 0 are multiples of (1, 1, 1, 1) which rules out v1 = 1 and v4 = 0. Echelon and reduced echelon forms40 x3. Elementary Linear Algebra 10th Edition Solution Manual Pdf. The second problem is a multipli-cation problem because there is nothing between the 3 and the parenthesis. Canonical forms. I have made many changes recently. How to write algebra word problems into systems of linear equations and solve systems of linear equations using elimination and substitution methods? Related Topics: More Math Word Problems. Chapter 1 introduces systems of linear equations, the Gauss-Jordan method to find solutions of these systems which transforms the augmented matrix associated with a linear system into reduced echelon form, where the | {
"domain": "projectxitalia.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771782476948,
"lm_q1q2_score": 0.8223056988533766,
"lm_q2_score": 0.8333246015211008,
"openwebmath_perplexity": 872.5357602429608,
"openwebmath_score": 0.4449801445007324,
"tags": null,
"url": "http://projectxitalia.it/kvyn/linear-algebra-problems-and-solutions-pdf.html"
} |
java, multithreading
You might also want to check what happens when a task never returns. There may be other edge cases as well.
Numbered variables
Variables named 1 and 2 are a potential code smell. In general when you have this, you should consider if you could actually either name the variables better or switch to a collection (e.g. an array or something that implements the Collection interface).
A side benefit of switching to a collection is that it frees you up in case the requirements change from two to another number.
This is not to say that there are no circumstances under which numbered variables are OK. Only that when you consider using them, you should consider if they really make sense.
Modularization
To make testing easier, I would move the main code outside of the main method. So instead of editing the main method for each test, your tests would create the appropriate tasks and pass them to the task runner. The task runner could then enshrine the logic of | {
"domain": "codereview.stackexchange",
"id": 39754,
"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, multithreading",
"url": null
} |
deep-learning, natural-language-processing, tensorflow, word-embedding, hidden-layers
For the 2 words above, when turning them into syllable-based embeddings, it's good because the 2 words will be related to each other due to the sharing syllables: bio, and lo.
However, it's hard to understand the autoencoder, it turns an index value into vector, then feed these vectors to DNN. Autoencoder can turn vectors back to words too.
How does autoencoder make words related to each other? The information you are probably missing is that word embeddings are learned on the basis of context. For example, you might try to predict a vector for a word from the wordvectors of the other words in the same sentence.
This way word vectors of words that occur in similar contexts will turn out to be similar. You can think of it as word vectors not encoding the word themselves but the contexts in which they are used. Of course ultimately that is the same. | {
"domain": "ai.stackexchange",
"id": 1406,
"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": "deep-learning, natural-language-processing, tensorflow, word-embedding, hidden-layers",
"url": null
} |
genetics, dna, synthetic-biology, diy-biology
Once you have the bacteria, you'll need to grow them. You need bacterial media, which might be obtainable because it's relatively safe. LB media is a mixture of yeast extract, tryptone, and salt. If you want solid plates you'll need agar too. You can probably get the media sterile enough by boiling it. You'll need some ampicillin or kanamycin to make sure only bacteria with your desired gene is allowed to grow, again Sigma Aldrich might sell it to you.
Of course you can't just put DNA into bacteria, the bacteria must be competent. You can make chemically competent cells by carefully treating them with calcium chloride and magnesium chloride. You'll also need dry ice, these need to be kept very cold. So now you can add your plasmid your competent cells, heat shock them in water at precisely 37°C for precisely 60 seconds, and plate them on your agar media. Then you need to incubate them at 37°C overnight. | {
"domain": "biology.stackexchange",
"id": 3401,
"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, dna, synthetic-biology, diy-biology",
"url": null
} |
c#, strings, regex
In regards to tiding up your code, there are some options you can use but the one that suits your needs is the following one:
Dictionaris
Although you may already know, a dictionary is a class that returns a value if the key supplied exists in said dictionary, with it your regex declarations would look like in the following:
private Dictionary<Regex, string> formatDictionary = new Dictionary<Regex, string>()
{
{new Regex(".bmp.8...."),"bmp(8-bit)"},
{new Regex(".bmp.24...."),"bmp(24-bit)"},
{new Regex(".png.24...."),"png(24-bit)"},
{new Regex("raw"),"Raw"},
{new Regex("....setup"),"Trace & setup"},
{new Regex(".csvd...."),"csv data"},
} | {
"domain": "codereview.stackexchange",
"id": 18140,
"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#, strings, regex",
"url": null
} |
javascript, beginner, minesweeper
function insertHTML(id, html) {
let el = document.getElementById(id);
el.innerHTML = html;
}
run = () => {
field.gameover = false;
let cols = document.getElementById("cols").value;
field.cols = cols;
let rows = document.getElementById("rows").value;
field.rows = rows;
field.mines = document.getElementById("mines").value;
field.markedMines = 0;
field.updateShowCounter();
if ((field.cols * field.rows < field.mines) || cols <= 1 || rows <= 1 || cols > 100 || rows > 100 || field.mines < 1) {
alert("so nicht Kevin")
field.gameover=true;
} else {
let html = field.printTable(cols, rows);
field.buildArray(cols, rows);
while (field.countMines(cols, rows) < field.mines) field.setMine(cols, rows);
field.countNeighbours(cols, rows);
insertHTML('table', html);
}
}
// Run everything when the document loads.
window.onload = run;
html {
font-family: sans-serif;
} | {
"domain": "codereview.stackexchange",
"id": 36552,
"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, beginner, minesweeper",
"url": null
} |
java, asynchronous, error-handling, http, guava
Below is my DataClient class which will be called by customer and they will pass DataKey object to getData method.
public class DataClient implements Client, DataFetcher {
private final AsyncRestTemplate restTemplate = new AsyncRestTemplate(new HttpComponentsAsyncClientHttpRequestFactory());
@Override
public ListenableFuture<DataResponse> getData(DataKey key) {
final SettableFuture<DataResponse> responseFuture = SettableFuture.create();
// given a userId, find all the hostnames
// so it can also have four hostname or one hostname or six hostname as well in the list
LinkedList<String> listOfHostnames = getHostnamesInfo(key.getUserId()); | {
"domain": "codereview.stackexchange",
"id": 13125,
"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, asynchronous, error-handling, http, guava",
"url": null
} |
solar-eclipse, python
I would also like to point out that uncertainties, mostly in Earth's rotation speed, make it very difficult to know where eclipses occured on the surface of the Earth for dates in the far past. The uncertainty becomes very large outside the range BC2000 - AD3000. This is the reason why NASA hasn't computed eclipse paths outside that range. According to research, the uncertainty could be as large as over 4 hours (several thousands of kilometers for eclipse paths) for dates before BC4000. See this explanation on NASA's Eclipse Web Site. | {
"domain": "astronomy.stackexchange",
"id": 2592,
"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-eclipse, python",
"url": null
} |
to distinct eigenvalues are orthogonal. Moreover, a Hermitian matrix has orthogonal eigenvectors for distinct eigenvalues. We prove that eigenvalues of orthogonal matrices have length 1. 3. As a consequence, if all the eigenvalues of a matrix are distinct, then their corresponding eigenvectors span the space of column vectors to which the columns of the matrix belong. The eigenfunctions are orthogonal.. What if two of the eigenfunctions have the same eigenvalue?Then, our proof doesn't work. $\endgroup$ â Raskolnikov Jan 1 '15 at 12:35 1 $\begingroup$ @raskolnikov But more subtly, if some eigenvalues are equal there are eigenvectors which are not orthogonal. 3 Answers. 1) Therefore we can always _select_ an orthogonal eigen-vectors for all symmetric matrix. I need help with the following problem: Let g and p be distinct eigenvalues of A. We prove that eigenvectors of a symmetric matrix corresponding to distinct eigenvalues are orthogonal. However, since any proper covariance matrix is | {
"domain": "painbenit.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877044076955,
"lm_q1q2_score": 0.8206852117674522,
"lm_q2_score": 0.8354835432479661,
"openwebmath_perplexity": 630.5071021837142,
"openwebmath_score": 0.8961015939712524,
"tags": null,
"url": "https://www.painbenit.com/paymaster-services-uathy/are-eigenvectors-always-orthogonal-7b9981"
} |
python, selenium
class SearchResults:
def __init__(self, driver: WebDriver):
self.driver = driver
def get_structured_elements(self) -> Iterable[PrimaryResult]:
rows = self.driver.find_elements_by_xpath(
'//table[1]/tbody/tr[position() > 1]'
)
for row in rows:
yield PrimaryResult.from_row(row)
# class ContentFilterPlugin(HttpProxyBasePlugin):
# HOST_WHITELIST = {
# b'ocsp.digicert.com',
# b'ocsp.sca1b.amazontrust.com',
# b'big5.oversea.cnki.net',
# b'gwz.fudan.edu.cn'
# }
# def handle_client_request(self, request: HttpParser) -> Optional[HttpParser]:
# host = request.host or request.header(b'Host')
# if host not in self.HOST_WHITELIST:
# raise HttpRequestRejected(403) | {
"domain": "codereview.stackexchange",
"id": 41580,
"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, selenium",
"url": null
} |
quantum-field-theory, potential, symmetry-breaking
If we view $V(\phi)$ as the potential of a full, UV-complete theory, then $\phi$ is an operator in Hilbert space, and $|\phi(x)|^2 \equiv\phi(x)^\dagger \phi(x)$.
If we view $V(\phi)$ as an effective potential and $\phi$ as a background scalar field, as often is the case when studying spontaneous symmetry breaking, then we can view $\phi$ as a complex classical scalar field, and $|\phi(x)|^2 = \phi(x)^*\phi(x)$ where $*$ denotes complex conjugation. | {
"domain": "physics.stackexchange",
"id": 15185,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, potential, symmetry-breaking",
"url": null
} |
$r = 8$
$b = 4$
$y = 3$
I'm making this answer a community wiki, since I made a mistake at the end of my original answer and it was Van.Graaf who delivered the final punch.
Reasoning:
Let's consider all the tri-colored triangles (e.g. one vertex red, one vertex blue, one vertex yellow) and apply triangle inequalities. The sum of lengths of all the red-blue segments must be no greater than the sum of all lengths of all the red-yellow segments and all the blue-yellow ones.
What is the sum of lengths of all the red-blue segments? It is $51y$ (each red-blue pair is counted $y$ times and the sum of pair lengths is $51$). Of red-yellow segments — $39b$, of blue-yellow — $r$. Therefore, the inequalities are:
$51y \le 39b + r$
$39b \le 51y + r$
$r \le 51y + 39b$
$r + b + y = 15$
The only triple $(r, b, y)$ which satisfies the above set of constraints is $(8, 4, 3)$.
Here's the space of possible solutions, with blue on the $x$ axis and yellow on the $y$ axis: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575116884778,
"lm_q1q2_score": 0.8010128083906934,
"lm_q2_score": 0.8152324915965392,
"openwebmath_perplexity": 455.0723516940438,
"openwebmath_score": 0.7615922689437866,
"tags": null,
"url": "https://puzzling.stackexchange.com/questions/30717/red-blue-and-yellow-points/30730"
} |
biochemistry, molecular-biology
For example, $k_1$ may be spoken of as having a value of
$10^9 \text{ M}^{-1}\text{ s}^{-1}$ (
here
and
here),
or as having a value of
$10^9 \text{ L mol}^{-1}\text{s}^{-1}$, and $k_p$ may be spoken of as having a value of $10^6 \text{ s}^{-1}$.
By the laws of
dimensional analysis,
it is meaningless to compare quantities of different units.
It is absurd, for example, it ask if pH 7 is greater than (or less than) $10^\text{o}\text{C}$,
or if 2 mol is greater than (or less than) 5 seconds.
So too with rate constants: it is meaningless to ask if a second-order rate constant is greater than or less than (or is equal to) a first-order rate constant.
The application of dimensional analysis to situations often encountered in enzyme kinetics is well described in
Fundamentals of Enzyme Kinetics
(Cornish-Bowden, 2013, 4th Ed, Section 1.3) and the relevant section seems to be freely accessible via
Google Books.
For example, we can multiply and divide quantities of different dimensions, but we | {
"domain": "biology.stackexchange",
"id": 11798,
"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": "biochemistry, molecular-biology",
"url": null
} |
single-cell, genotyping, demultiplexing
Title: Definition of genotype in demuxlet I am reading the Online methods of the demuxlet paper.
The genotype $g$ is taken from the set $\{0, 1, 2\}$, defined as "the true genotype of the sample corresponding to $c$-th droplet at $v$-th variant".
What is the mapping between these values and the corresponding genotype?
Each variant is modeled using a binomial with $n=2,p=\frac{g}{2}$, so I would assume that 1 is heterozygous, 0 is homozygous REF and 2 homozygous ALT. Is this assumption correct? The genotypes $\{0,1,2\}$ are mappings to the genotypes AA (homref), AB (heterozygous), BB (homalt) (from supplementary resources). This is also mapped to the number of alterations (e.g., 0 -> 0 alterations -> homref). | {
"domain": "bioinformatics.stackexchange",
"id": 2321,
"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": "single-cell, genotyping, demultiplexing",
"url": null
} |
c++, reinventing-the-wheel, vectors
pointer at(size_type index)
{
assert(index < m_size); // maybe throw instead
return m_buffer + index;
}
const_pointer at(size_type index) const
{
assert(index < m_size); // maybe throw instead
return m_buffer + index;
}
private:
static pointer allocate(std::size_t size)
{
return static_cast<pointer>(::operator new (sizeof(value_type) * size));
}
static void deallocate(pointer buffer)
{
delete static_cast<void*>(buffer);
}
std::size_t m_size;
Ty* m_buffer;
};
template<class Ty>
inline void swap(memory_block<Ty>& a, memory_block<Ty>& b)
{
a.swap(b);
}
template<class Ty>
class vector
{
public:
using size_type = std::size_t;
using value_type = Ty; | {
"domain": "codereview.stackexchange",
"id": 33146,
"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++, reinventing-the-wheel, vectors",
"url": null
} |
thermodynamics, energy, free-energy, molecular-dynamics
I think "total energy" would be the internal energy. It would be great if someone could please confirm/debunk that--I don't know if the situation is distinct for distinct ensembles, for example. Whatever the case, I don't know how it relates to the free energy. I would like to know if I have enough information to calculate the free energy.
If anyone could please point me in the right direction, I would appreciate it. I can't find anything online and maybe that's because I don't even know where to start looking. The sum of the potential and kinetic energies is the internal energy, E (or U).
However, you don't necessarily need to know the entropy to calculate the free energy. If you perform an equilibrium molecular dynamics simulation, you can derive the free energy from the equilibrium constant.
See, for instance:
https://onlinelibrary.wiley.com/doi/full/10.1002/jcc.21776 | {
"domain": "chemistry.stackexchange",
"id": 14147,
"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, free-energy, molecular-dynamics",
"url": null
} |
fluid-dynamics, turbulence
depends on the geometry. In some standard cases, e.g., flow in round pipes, it is known that transition to turbulence happens at $Re$~1000; but this does not say that in a different setup a value as small as $Re$~10, in case of a cigarette, would not be enough to make the flow turbulent. So whether in a particular setup the Reynolds number is sufficient for transition to turbulence is up to an experiment (or a detailed simulation). For a cigarette, experimental results, e.g., in the picture, clearly demonstrate that initially laminar rise of hot air plume from a cigarette transitions to disordered, turbulent, motion of air a few cm away from the tip of the cigarette. | {
"domain": "physics.stackexchange",
"id": 37943,
"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": "fluid-dynamics, turbulence",
"url": null
} |
performance, c, multithreading, ffi
pthread_t threadA[NTHREADS];
int iterA[NTHREADS];
aList arglistA[NTHREADS];
int N1[NTHREADS];
int N2[NTHREADS];
/* get the value of the scalar input */
n = mxGetPr(prhs[0]);
p = mxGetPr(prhs[1]);
cycles = (int)mxGetScalar(prhs[2]);
N = mxGetM(prhs[0]);
/* create the output matrix */
plhs[0] = mxCreateDoubleMatrix(N,1,mxREAL);
/* get a pointer to the real data in the output matrix */
X = mxGetPr(plhs[0]);
memcpy(X,n,N*sizeof(double));
for(i=0;i<NTHREADS;i++){
N1[i] = i*(N/NTHREADS);
N2[i] = (i+1)*(N/NTHREADS);
arglistA[i].X = X;
arglistA[i].p = p;
arglistA[i].cycles = cycles;
arglistA[i].X = (double*)mxCalloc(N2[i]-N1[i],sizeof(double));
memcpy(arglistA[i].X, &X[N1[i]], (N2[i]-N1[i])*sizeof(double));
arglistA[i].N2 = N2[i]-N1[i];
arglistA[i].N1 = 0;
}
/* Spawn the threads */
for(i=0;i<NTHREADS;i++){
iterA[i] = pthread_create(&threadA[i],NULL,bino_process,(void*)&arglistA[i]);
} | {
"domain": "codereview.stackexchange",
"id": 20707,
"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, c, multithreading, ffi",
"url": null
} |
electromagnetic-radiation, x-rays
Title: Dose calculation of X-Ray tubes I am working on a X ray tube project and I want to calculate approximate dose. Do you know any equation ?
I have found one on internet but I think this is wrong:
$$D=g\cdot kV^2\cdot \dfrac{mAs}{d^2}= \left[\dfrac{Sv}{h}\right]$$
So here is $g$-factor a constant and how can I find it (I mean if it is what is it for this equation, if it is not then how can I calculate it, because as well as I know $~g~$-factor depends on the angle of the anode and these things). And here the $~d^2~$ stands for distance but this the distance of what ? The distance between the tube and the object or the distance between cathode (filament) and anode (tungsten) ?
And can I calculate $~mAs (I\cdot t)~$ by $~\dfrac{kV}{R}~$ of the filament ? This seems to be some engineering-type formula. From a different questions site, and it is difficult to make sense of. | {
"domain": "physics.stackexchange",
"id": 64834,
"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, x-rays",
"url": null
} |
mobile-robot, slam, localization, ekf, data-association
This stackoverflow post helped me understand this algorithm a lot better, but now, i am just not sure how to provide the observed feature with my own lidar scan data.
Any help is appreciated, thank you. It should be processed features. Extracting features from raw data is usually called as front-end in SLAM. The easiest forms of features in cased of 2D LiDAR are corners, edges, and lines. You can run RANSAC algorithm to find line segments. Corners are found by intersection of lines and edges are ends of lines. Corners should be enough for a uni project.
ICP can be utilized to register raw scans but that becomes a different type of SLAM. | {
"domain": "robotics.stackexchange",
"id": 1738,
"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": "mobile-robot, slam, localization, ekf, data-association",
"url": null
} |
mathematics, error-correction, pauli-gates
$$
\Omega_{a,b}\Omega_{g,h}=f_{a,b,g,h,u,v}\Omega_{u,v}
$$
to find the complex structure constants $f_{a,b,g,h,u,v}$?
I have seen references, such as ZX, that use $\Omega_{a,b}\approx Z^aX^b$ notation, but those representations are never scaled by complex values to ensure they are Hermitian, nor have I seen an explicit matrix index representation for them. If you write $Z^aX^b$, there's an implicit "add a phase $i$ to make it Hermitian if necessary", although I guess there are a couple of different conventions you might use the determine the sign used. So long as you're clear about the convention it doesn't really matter because you've got the extra $\pm 1$ freedom to add in to adjust for it.
As for an explicit matrix index representation,
$$
A_{a,b,k,l}=i^{a\cdot b}(-1)^{a\cdot k}\delta_{b\oplus l=k}
$$ | {
"domain": "quantumcomputing.stackexchange",
"id": 1014,
"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": "mathematics, error-correction, pauli-gates",
"url": null
} |
Theorem (Easy CRT) $\rm\ \$ If $\rm\ p,\:q\:$ are coprime integers then $\rm\ p^{-1}\$ exists $\rm\ (mod\ q)\ \$ and
$\rm\displaystyle\quad\quad\quad\quad\quad \begin{eqnarray}\rm n&\equiv&\rm\ a\:\ (mod\ p) \\ \rm n&\equiv&\rm\ b\:\ (mod\ q)\end{eqnarray} \ \iff\ \ n\ \equiv\ a + p\ \bigg[\frac{b-a}{p}\ mod\ q\:\bigg]\ \ (mod\ p\:\!q)$
Proof $\rm\ (\Leftarrow)\ \ \ mod\ p\!:\:\ n\equiv a + p\ (\cdots)\equiv a\:,\$ and $\rm\ mod\ q\!:\:\ n\equiv a + (b-a)\ p/p \equiv b\:.$
$\rm\ (\Rightarrow)\ \$ The solution is unique $\rm\ (mod\ p\!\:q)\$ since if $\rm\ x',\:x\$ are solutions then $\rm\ x'\equiv x\$ mod $\rm\:p,q\:$ therefore $\rm\ p,\:q\ |\ x'-x\ \Rightarrow\ p\!\:q\ |\ x'-x\ \$ since $\rm\ \:p,\:q\:$ coprime $\rm\:\Rightarrow\ lcm(p,q) = p\!\:q\:.\quad$ QED
Applying this to your example we find | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692271169855,
"lm_q1q2_score": 0.8281840114425634,
"lm_q2_score": 0.8479677545357569,
"openwebmath_perplexity": 601.7476887601476,
"openwebmath_score": 0.8529961705207825,
"tags": null,
"url": "http://math.stackexchange.com/questions/149709/hcf-lcm-and-remainders"
} |
• Is the limit of constant functions always constant? (if it exists) – avati91 Oct 5 '14 at 11:42
• @avati91 'Limit' always refers to a definition of convergence or a topology, e.g. pointwise convergence or convergence in some norm. The answer to your question depends on the notion of convergence which is used, but in most cases the answer would be yes (again, on each component of the domain of definition). – Thomas Oct 5 '14 at 15:20
• @avati91, yes, the weak limit of constant functions here is constant. Take a decreasing sequence $\epsilon_n$ that tends to zero. We know that $u\ast \rho_{\epsilon_n}$ converges to $u$ in $L^p_{\text{loc}}(U)$. But unless the numbers $c_{\epsilon_n}$ form a convergent sequence, this $L^p_{\text{loc}}(U)$ convergence cannot happen. Therefore, the constants $c_{\epsilon_n}$ must converge as numbers. Then it is easy to see that the limit of $u\ast \rho_{\epsilon_n}$ in $L^p_{\text{loc}}(U)$ is $\lim_n c_{\epsilon_n}$. – Chuwei Zhang Jan 26 '16 at 3:18 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668695588647,
"lm_q1q2_score": 0.8067047268298045,
"lm_q2_score": 0.822189121808099,
"openwebmath_perplexity": 243.8495989098854,
"openwebmath_score": 0.9688162207603455,
"tags": null,
"url": "https://math.stackexchange.com/questions/958969/weak-derivative-zero-implies-constant-function"
} |
coordinate systems. Subsection 13. java /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. -coordinates and transform it into a region in uv. CuO is the only known binary multiferroic compound, and due to its high transition temperature into the multiferroic state, it has been extensively studied. Even though the well-known Archimedes has derived the formula for the inside of a sphere long before we were born, its derivation obtained through the use of spherical coordinates and a volume integral is not often seen in undergraduate textbooks. The matrix will contain all partial derivatives of a vector function. The hard way. The numbers in an ordered pair are called the coordinates. Solution We cut V into two hollowed hemispheres like the one shown in Figure M. In such cases spherical polar coordinates often allow the separation of variables simplifying the solution of partial differential equations and the evaluation of | {
"domain": "ol3roma.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9915543738075945,
"lm_q1q2_score": 0.8174988355515703,
"lm_q2_score": 0.824461932846258,
"openwebmath_perplexity": 585.6846455806344,
"openwebmath_score": 0.8959506750106812,
"tags": null,
"url": "http://ol3roma.it/jacobian-of-spherical-coordinates-proof.html"
} |
newtonian-mechanics, reference-frames, centripetal-force, centrifugal-force
Title: Is the centre of rotation in non-inertial rotating frame different from the actual centre? (Is my animation correct)
(Sorry for confusing question, here's the actual explanation)
If Im sitting on the edge of a rotating merry-go-round, then from my perspective the world is rotating around me. Now, there is a fixed centre around which Im 'actually' rotating from someone else's perspective.
But from my perspective, is the world rotating around that same centre as well?
OR
Is am 'I' the centre around which the world is rotating?(mind that Im sitting on 'edge')
OR
Is is somewhere between me and the actual centre?
If I'm sitting on the edge of a rotating merry-go-round, then from my perspective the world is rotating around me. | {
"domain": "physics.stackexchange",
"id": 93522,
"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, reference-frames, centripetal-force, centrifugal-force",
"url": null
} |
ros, ros-kinetic, add-message-files
but when I try to implement the subscriber:
void FlightControl::fused_gps_callback(const drone_sdk::custom_gps::ConstPtr& msg)
{
// collect data here
}
I get the following error:
error: ‘custom_gps’ in namespace ‘drone_sdk’ does not name a type
void FlightControl::fused_gps_callback(const drone_sdk::custom_gps::ConstPtr& msg)
My publisher works fine and I can see an output on rostopic echo. Also in my CMakeLists file, I believe I've added the dependency
using the following line: add_dependencies(flight_planner drone_sdk_generate_messages_cpp)
Here's what my CMAKE file looks like:
cmake_minimum_required(VERSION 2.8.3)
project(dji_flight_planner)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11) | {
"domain": "robotics.stackexchange",
"id": 32653,
"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-kinetic, add-message-files",
"url": null
} |
Proof
$1 \Rightarrow 2$
Suppose that $X$ is pseudocompact. Suppose $\mathcal{O}=\left\{O_1,O_2,O_3,\cdots \right\}$ satisfies the hypothesis of condition $2$. If there is some positive integer $m$ such that $O_n=O_m$ for all $n \ge m$, then we are done. So assume that $O_n$ are distinct for infinitely many $n$. According to condition $2$ in Theorem 1, $\mathcal{O}$ must not be a locally finite family. Then there exists a point $x \in X$ such that every open set containing $x$ must meet infinitely many $O_n$. This implies that $x \in \overline{O_n}$ for infinitely many $n$. Thus $x \in \bigcap \limits_{n=1}^\infty \overline{O_n}$. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787868650146,
"lm_q1q2_score": 0.8047802154199303,
"lm_q2_score": 0.8152324848629215,
"openwebmath_perplexity": 107.99715693191011,
"openwebmath_score": 0.9666374921798706,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/the-sorgenfrey-line/"
} |
quantum-mechanics, pauli-exclusion-principle
\end{align}$$
So here, evidently the two particles are not allowed to occupy the same state (among other restrictions). | {
"domain": "physics.stackexchange",
"id": 25930,
"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, pauli-exclusion-principle",
"url": null
} |
qiskit, circuit-construction, grovers-algorithm
Title: Is there an efficient way to create entangled states using Qiskit? I am trying to implement Grover's search using Qiskit. And I would like to create entangled states so I could search for the index of a specific value in a list. For example, if the third element in the list has value 7, then the corresponding state should be $|3\rangle|7\rangle$. One way to do that is to construct a particular circuit for each element after the hadamard transform but it seems to be hard. Is there an efficient way in Qiskit to do that so I will not need to construct the circuit for every element in the list? Thank you for your help! Entanglement
As to how to create entangled states, the most easy way to do this is with the following circuit:
qc = QuantumCircuit(4)
qc.h(0)
qc.cx(0, 1)
qc.cx(1, 2)
qc.cx(2, 3) | {
"domain": "quantumcomputing.stackexchange",
"id": 2841,
"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": "qiskit, circuit-construction, grovers-algorithm",
"url": null
} |
electrons, quantum-spin, dirac-equation
(In the nonrelativistic approximation).
Writing:
$$ \vec{E} = -\frac{dV(r)}{dr} \frac{\vec{r}}{r}$$
we obtain:
$$E_{int} =-\frac{g q}{2m^2 c^2} \frac{dV(r)}{r dr} \vec{S} \cdot (\vec{v} \times \vec{r}) = -\frac{g q}{2m^2 c^2} \frac{dV(r)}{r dr} \vec{S} \cdot (\vec{p} \times \vec{r}) = -\frac{g q}{2m^2 c^2} \frac{dV(r)}{r dr} \vec{S} \cdot \vec{L}$$
It is worthwhile to mention that there are many classical models which correctly describe the classical dynamics of spinning particles, such as the Bargmann-Michel-Telegdi equation. . These models describe all position and spin dynamics of an electron in the classical limit. | {
"domain": "physics.stackexchange",
"id": 44849,
"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, quantum-spin, dirac-equation",
"url": null
} |
data-structures, search-trees
What am I doing wrong? It seems you are doing nothing wrong. Like you say, for a B-tree of order $n$ the number of children is between $\lceil n/2 \rceil$ and $n$, the number of keys is one less.
For $n=5$, keys are between $2$ and $4$. When you add a key to a node of size $4$, you get two new nodes of size $2$ and one new key which is pushed upwards. When this happens at the root, a new root with a single key is formed.
Your example. Add $T$ to the tree. At the root $G$ go right, to $\{H,K,N,Q\}$. With $T$ this becomes $\{H,K,N,Q,T\}$ which is too heavy and we split into $\{H,K\}$ and $\{Q,T\}$. Middle key $N$ is pushed upwards to the root. In the new configuration the root $\{G,N\}$ with two keys has three children $\{A,C,E\}$, $\{H,K\}$ and $\{Q,T\}$. | {
"domain": "cs.stackexchange",
"id": 2870,
"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, search-trees",
"url": null
} |
c#, asynchronous, wpf, mvvm, system.reactive
private async Task<List<Item>> InternalGetRemoteItems()
{
var conferences = await _remoteClient.GetItems().ConfigureAwait(false);
return conferences;
} | {
"domain": "codereview.stackexchange",
"id": 11316,
"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#, asynchronous, wpf, mvvm, system.reactive",
"url": null
} |
filters, fourier
So to be clear, my question is: why did they multiply the low-pass filter by $2\cos(Tn)$ instead of $e^{jTn}$ to translate it in the frequency domain? Multiplying the impulse response by $e^{jTn}$ would give a complex impulse response and a complex-valued filter output. Seems that they were aiming for a real-valued output. They did this by summing two filters, one with the pass band at $T - W \le \omega \le T + W$ and the other with the pass band at $-T - W \le \omega \le -T + W$. If there is overlap between the two pass bands then the frequency response of the composite filter will have a weird shape like: | {
"domain": "dsp.stackexchange",
"id": 3207,
"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, fourier",
"url": null
} |
clojure, web-scraping
(get-in [0 :attrs :src])
(#(str "http:" %))
(http-client/get {:as :byte-array})
:body)]
(with-open [out out-stream]
(.write out image)))) | {
"domain": "codereview.stackexchange",
"id": 6669,
"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": "clojure, web-scraping",
"url": null
} |
interactions
See also an illustration for evolution of static field of a uniformly moving charge in this answer to another question.
Having said this, I have to note that this is the most straightforward interpretation of the theory of electromagnetism. The other is Wheeler-Feynman absorber theory, in which the field is indeed created by both emitter and absorber, but this is actually somewhat tricky and experimentally indistinguishable from what I've said above. | {
"domain": "physics.stackexchange",
"id": 19196,
"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": "interactions",
"url": null
} |
method. Lagrange interpolation polynomial for function y ! f•1(y) is P 3(y) = (•1) (y •2)(y •10)(y •35). Lagrange S Interpolation Formula Example Solved Problems. Backward difference 3. Gauss Forward Interpolation Formula. The higher order forward differences can be obtained by making use of forward difference table. Other examples of Newton’s third law are easy to find: As a professor paces in front of a whiteboard, he exerts a force backward on the floor. This method is numerical method. Next, a list of situations in everyday life will be presented in which what is posed by Newton’s third law is reflected : If you have ever jumped from a raft into the water, you will have seen it fall back as your body moves forward. The formula is called Newton's (Newton-Gregory) forward interpolation formula. Take a problem for forward interpolation from your text book and solve it by backward interpolation. I have been looking at various difference and divided-difference interpolation algorithms. | {
"domain": "agenziafunebretassoni.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180685922242,
"lm_q1q2_score": 0.8081836820353325,
"lm_q2_score": 0.8198933425148213,
"openwebmath_perplexity": 1146.4404937222164,
"openwebmath_score": 0.7646142244338989,
"tags": null,
"url": "http://tanb.agenziafunebretassoni.it/newton-forward-and-backward-interpolation-solved-examples.html"
} |
3 describes an ellipse. Find the points at which this ellipse crosses the x -axis and show that the tangent lines at these points are parallel. When the center of the ellipse is at the origin and the foci are on the x-axis or y-axis, then the equation of the ellipse is the simplest. Subtracting the first equation from the second, expanding the powers, and solving for x gives. #N#Equation of a translated ellipse -the ellipse with the center at ( x0 , y0) and the major axis parallel to the x -axis. By using a transformation (rotation) of the coordinate system, we are able to diagonalize equation (12). If you translate the ellipse a bit so the center of rotation is inside the ellipse but not on the ellipse’s dead center, and if you kept the graphs after each rotations rather than erase them, you will get a Christmas wreath. Because the equation refers to polarized light, the equation is called the polarization ellipse. Several examples are given. I first solved the equation of the ellipse | {
"domain": "istitutocomprensivoascea.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9883127409715956,
"lm_q1q2_score": 0.8148262326780249,
"lm_q2_score": 0.824461932846258,
"openwebmath_perplexity": 356.1735119431403,
"openwebmath_score": 0.8166592717170715,
"tags": null,
"url": "http://ovzj.istitutocomprensivoascea.it/equation-of-a-rotated-ellipse.html"
} |
c#, sql, form
new SqlParameter("@SurName", SurName),
new SqlParameter("@COTProofType", COTProofType),
new SqlParameter("@COTDate", COTDate),
new SqlParameter("@PropRespMtrRead", PropRespMtrRead),
new SqlParameter("@PropRespMtrBRead", PropRespMtrBRead),
new SqlParameter("@PrevAdd1", PrevAdd1),
new SqlParameter("@PrevAdd2", PrevAdd2),
new SqlParameter("@PrevAdd3", PrevAdd3),
new SqlParameter("@PrevAdd4", PrevAdd4),
new SqlParameter("@PrevPostcode", PrevPostcode),
new SqlParameter("@FwdName", FwdName),
new SqlParameter("@FwdAdd1", FwdAdd1),
new SqlParameter("@FwdAdd2", FwdAdd2),
new SqlParameter("@FwdAdd3", FwdAdd3),
new SqlParameter("@FwdAdd4", FwdAdd4),
new SqlParameter("@FwdPostcode", FwdPostcode),
new SqlParameter("@PayArranged", PayArranged), | {
"domain": "codereview.stackexchange",
"id": 13914,
"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#, sql, form",
"url": null
} |
quantum-mechanics, angular-momentum, lie-algebra, representation-theory, commutator
Title: Eigenspaces of angular momentum operator and its square (Casimir operator) The casimir operator $\textbf{L}^2$ commutates with the elements $L_i$ of the angular momentum operator $\textbf{L}$:
$$
[\textbf{L}^2, L_i] = 0.
$$
However, the $L_i$ do not commute among themselves:
$$
[L_i, L_j] = i\hbar\epsilon_{ijk}L_k.
$$
This makes sense so far, but it leaves me wondering how their eigenspaces relate to each other. I remember some theorem that diagonalizable, commuting matrices share their eigenspaces. If those operators could be expressed as complex matrices (in the finite-dimensional case), they surely are diagonalizable. So it follows that $\textbf{L}^2$ has the same eigenspaces as the three $L_i$, but that would imply that they commute among themselves, which is not the case. | {
"domain": "physics.stackexchange",
"id": 24322,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, angular-momentum, lie-algebra, representation-theory, commutator",
"url": null
} |
absolute-magnitude
Assuming the radius changes with luminosity too as $r(L)$, I would try $r(L)=r_0 L^a$ where $a\approx 0.6$ (but this is guesswork) and the sun has radius $r_0$ pixels.
So trying to put this together, we get the pixel brightness as $$V = V_0 (L/ r(L)^2)^{1/\gamma} = V'_0 L^{(1-2a)/\gamma}$$ where $V_0$ and $V'_0$ are the pixel brightnesses used for the sun in this model. Basically this squashes the actual luminosity with $a$ (representing using bigger spots for brighter stars, not requiring as intense pixels) and $\gamma$ (to correct for the screen and the eye). What values to use will largely be trial and error unless you want to try to use screen photometry equipment.
So the full formula converting from absolute magnitude to pixel value would be: $$V = V_0 10^{0.4(4.83 - M)(1-2a)/\gamma}.$$ | {
"domain": "astronomy.stackexchange",
"id": 3919,
"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": "absolute-magnitude",
"url": null
} |
energy, photons, thermal-radiation
Title: Black body radiation and number of photons emitted Usually the black body radiation (at a certain temperature $T$) is given by
$$\rho ( \nu ) = \frac{8 \pi h \nu^3}{c^3 \left( e^{h \nu / (k_B T)} - 1 \right)}$$
This quantity $\rho ( \nu )$ should be the density of energy, that is: the energy per unit volume and per unit frequency, so its unit measure should be
$$\mathrm{\frac{J}{Hz \cdot cm^3}}$$
As adviced in a comment to this answer, the density of photons should be easily obtained from $\rho ( \nu )$. If each photon has energy $h \nu$, from the density of energy (per unit frequency, per unit volume) the corresponding density of photons (number of photons per unit frequency, per unit volume) should be
$$n( \nu ) = \frac{\rho ( \nu )}{h \nu}$$ | {
"domain": "physics.stackexchange",
"id": 32196,
"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": "energy, photons, thermal-radiation",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.