text stringlengths 1 1.11k | source dict |
|---|---|
python, python-3.x, opencv, captcha
# Sort the detected letter images based on the x coordinate to make sure
# we are processing them from left-to-right so we match the right image
# with the right letter
letter_image_regions = sorted(letter_image_regions, key=lambda x: x[0])
# Save out each letter as a single image
for letter_bounding_box, letter_text in zip(letter_image_regions, captchaCorrectText):
# Grab the coordinates of the letter in the image
x, y, w, h = letter_bounding_box
# Extract the letter from the original image with a 2-pixel margin around the edge
letter_image = gray[y - 2:y + h + 2, x - 2:x + w + 2]
# Get the folder to save the image in
save_path = os.path.join(OUTPUT_FOLDER, letter_text)
# if the output directory does not exist, create it
if not os.path.exists(save_path):
os.makedirs(save_path) | {
"domain": "codereview.stackexchange",
"id": 34381,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, opencv, captcha",
"url": null
} |
in between. And we can say this generally that, that this derivative will have some maximum value. So this is its, the absolute value, maximum value, max value, m for max. We know that it will have a maximum value, if this thing is continuous. So once again we're going to assume that it is continuous, that it has some maximum value over this interval right over here. Well this thing, this thing right over here, we know is the same thing as the n plus 1 derivative of the error function. So then we know, so then that, that implies, that implies that, that implies that the, that's a new color, let me do that in blue, or that green. That implies that the, the, the end plus one derivative of the error function. The absolute value of it because these are the same thing is also, is also bounded by m. So that's a little bit of an interesting result but it gets us no where near there. It might look similar but this is the n plus 1 derivative of the error function. And, and we'll have to think | {
"domain": "khanacademy.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9916842215225259,
"lm_q1q2_score": 0.8176058814950825,
"lm_q2_score": 0.8244619242200082,
"openwebmath_perplexity": 186.0128677335484,
"openwebmath_score": 0.8011569976806641,
"tags": null,
"url": "https://www.khanacademy.org/math/old-integral-calculus/power-series-ic/taylor-and-maclaurin-polynomials/v/proof-bounding-the-error-or-remainder-of-a-taylor-polynomial-approximation"
} |
magnetic-fields, temperature, magnetic-moment
b) This is most likely a misprint, as silver has a much more complicated electronic structure than sodium; I'll answer the question for sodium atoms.
As you wrote, the splitting of the ground state in an external magnetic field is referred to as the Zeeman effect. Since $l=0$, there's no spin-orbit coupling and thus no difference between the weak and strong Zeeman effect. In the present case, the energy difference between the two states into which the ground state splits takes the simple form $\mu_Bg_SB$, where $\mu_B$ is the Bohr magneton, $g_S$ is the $g$-factor for the electronic spin, $g_S\approx2.002319$, and $B$ is the magnetic field strength. From the given Boltzmann distribution, the corresponding difference in occupation numbers is
$$
\frac{\mathrm e^{\frac{\mu_Bg_SB}{2kT}}-\mathrm e^{-\frac{\mu_Bg_SB}{2kT}}}{\mathrm e^{\frac{\mu_Bg_SB}{2kT}}+\mathrm e^{-\frac{\mu_Bg_SB}{2kT}}}=\tanh\frac{\mu_Bg_SB}{2kT}\;.
$$ | {
"domain": "physics.stackexchange",
"id": 31130,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields, temperature, magnetic-moment",
"url": null
} |
python, algorithm, matrix, mathematics, machine-learning
Title: Greedy adaptive dictionary (GAD) for supervised machine learning For my project in machine learning supervised, I have to simplify a training-data and I have to use this technique at page 5 of the document.
Pseudocode algorithm
My code (numbers are the steps):
import numpy as np
import math
def GAD(X):
# 1. Initialize
l=0
D=[]
I=[]
R = np.copy(X) | {
"domain": "codereview.stackexchange",
"id": 29232,
"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, algorithm, matrix, mathematics, machine-learning",
"url": null
} |
Infrared | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9511422269175634,
"lm_q1q2_score": 0.8006959283520777,
"lm_q2_score": 0.8418256551882382,
"openwebmath_perplexity": 375.9126764125209,
"openwebmath_score": 0.890861451625824,
"tags": null,
"url": "https://www.physicsforums.com/threads/the-double-dual-of-a-vector-space-is-nothing-more-than-the-orginal-vs.990597/"
} |
evolution, dna, food, digestion
Source
You must have noticed, in the diagram above, the minute difference between starch, cellulose and glycogen (BTW glycogen is another polysaccharide), but even that difference is enough for enzymes to tear apart one and pass on the other molecule.
The above explanation was necessary to tell why the answer is no. If we eat something, enzymes are needed to break it down. But if enzymes cannot recognize something, then they can simply not work on it. So, if you even want to eat space grass, forget about being able to digest it. Because even if we confirm that life on earth came from space through meteorites billions of years ago, then also during this time period of billions of years both that life of space and this life on earth would have evolved so much that they might not match, even chemically!
Hope this helps. Tell me if you want any more details :) | {
"domain": "biology.stackexchange",
"id": 5461,
"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": "evolution, dna, food, digestion",
"url": null
} |
python, beginner, validation, integer
There's no reason to assign the result to user_in and then to a. If you want it to be in a variable called a, just assign it to a to begin with.
Also, you should catch the specific exception that you are looking for, in this case ValueError. Catching every exception is almost never a good idea, because this code could fail for reasons other than the user entering something invalid. For example, if you inadvertently used input as a variable elsewhere in the same function, this call of it will probably raise a TypeError or NameError, and you'll want to see that error, not an infinite loop of "Invalid input, please try again". | {
"domain": "codereview.stackexchange",
"id": 35930,
"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, validation, integer",
"url": null
} |
java, algorithm, game, simulation
Title: WaTor Code in Java I just coded a version of WaTor, a population simulation game in which fish and sharks move around, breed, and eat each other. I am wondering how I did and if there are better ways to do some of the things I am doing, specifically on the move methods for the sharks and the fish.
Animal
package WaTor;
abstract class Animal {
private int x;
private int y;
private int type;
private int SIZE;
Animal(int xcoord, int ycoord, int t, int size) {
x=xcoord;
y=ycoord;
type=t;
SIZE = size;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public int getType() {
return type;
}
public void moveX(int dx) {
x = x + dx;
if(x > SIZE - 1) {
x = 0;
}
if(x < 0) {
x = SIZE - 1;
}
}
public void moveY(int dy) {
y = y + dy;
if(y > SIZE - 1) {
y = 0;
}
if(y < 0) {
y = SIZE - 1;
}
}
public void moveUp() {
moveX(-1);
}
public void moveDown() {
moveX(1);
} | {
"domain": "codereview.stackexchange",
"id": 14163,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, game, simulation",
"url": null
} |
quantum-mechanics, homework-and-exercises, operators, momentum, coordinate-systems
Title: Eq. (2.4.7) of Weinberg, "Lectures on QM" from eq. (2.4.6) Could anyone please tell me the proof of (2.4.7), using (2.4.6)?
Substituting (2.4.7) into the right equation of (2.4.4), we get:
$$P_1 = -i \hbar \left( \frac{\partial}{\partial x_{1e}} + \frac{\partial}{\partial x_{1N}} \right).$$
Also, substituting the right equation of (2.4.3) into the RHS of the right equation of (2.4.7), we get:
$$(-i \hbar \bf \nabla _{X} \rm )_1 = - i \hbar \frac{\partial}{\partial X_1} = - i \hbar \frac{\partial}{\frac{m_e \partial x_{1e} + m_N \partial x_{1N}}{m_e + m_N}} = - i \hbar (m_e + m_N) \frac{\partial}{m_e \partial x_{1e} + m_N \partial x_{1N}}.$$
Why we can say these are equal? When we say two operators $A_1$ and $A_2$ are equal, we mean that for any wave function $\psi$, we have
$$A_1\psi = A_2\psi.$$
I will answer your question in the one-dimension case. The generalization to three-dimension case is straightforward. | {
"domain": "physics.stackexchange",
"id": 40840,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, homework-and-exercises, operators, momentum, coordinate-systems",
"url": null
} |
biochemistry, sensation, perception, olfaction
I'm not familiar enough with the literature to know if the similar smelling things have similar ORN activation patterns, but my guess would be that they do. If you have a population of different ORs that your odorant is binding to, a slightly different odorant will probably bind to a similar subset of ORs, just off by a few if its missing or has gained a functional group that is in the binding pocket of some of the ORs. This probably means that if you are presented with a chemical that you have never smelled before, it will probably activate a similar ORN population as other similar chemicals, and your brain will probably say it smells like one of those similar chemicals. | {
"domain": "biology.stackexchange",
"id": 1276,
"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, sensation, perception, olfaction",
"url": null
} |
drcsim
Originally posted by mquigley with karma: 46 on 2013-02-07
This answer was ACCEPTED on the original site
Post score: 3 | {
"domain": "robotics.stackexchange",
"id": 3017,
"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": "drcsim",
"url": null
} |
human-biology, physiology, pathology
Let's consider the "blue fugates" of Kentucky. The ancestors of this family have different shades of blue skin tones. Dr. Madison Cawein discovered that the family had a high concentration of FE$^{3+}$ brown methemoglobin. This form is useless to the body so the enzyme diaphorase reduces the methemoglobin to FE$^{2+}$ (hemoglobin that can carry oxygen) [2].
Basically the skin color comes down to light diffraction not the blood changing from red to blue. | {
"domain": "biology.stackexchange",
"id": 3339,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology, physiology, pathology",
"url": null
} |
qiskit, programming, entanglement-swapping
00-01-10: 0.125
00-10-01: 0.25
01-00-10: 0.125
01-10-00: 0.25
10-00-01: 0.125
10-01-00: 0.125
(two states are repeated so its probability is higher) Appendix C in this paper provides an algorithm to do this based on a variant of the Fisher-Yates shuffle. The paper provides all the details you need to implement the algorithm in easy to follow steps. | {
"domain": "quantumcomputing.stackexchange",
"id": 3528,
"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, programming, entanglement-swapping",
"url": null
} |
stereochemistry
Title: If a molecule with 3 chiral centers that are all R, is it the same as the S version? Consider a molecule with 3 chiral centers all marked R. Is this molecule the same as the S version? No I don't think both will be the same.They will be enantiomers or non superimposable mirror images of each other.I am sharing a simple trick to find the isomers of a compound with 3 chiral centres instead-
RRR and its enantiomer SSS
SRR and its enantiomer RSS
SSR and its enantiomer RRS
SRS and its enantiomer RSR
With makes a total of 8! You can generalize the formula by 2 raised to the power n (where n is number of chiral centres) | {
"domain": "chemistry.stackexchange",
"id": 13527,
"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": "stereochemistry",
"url": null
} |
stoichiometry
Now, for your equations: #1 is not balanced: you have two total hydrogens on the left and four on the right. #2 is balanced right and left, but the middle has too many hydrogens.
I think you overthought the reaction. It might be two-step, but that intermediate step is very difficult to investigate and can be swept under the carpet. But its better to overthink and walk back than to underthink and miss the boat. | {
"domain": "chemistry.stackexchange",
"id": 13070,
"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": "stoichiometry",
"url": null
} |
ros2, ros-humble, rclcpp
In case of the DEBUG loglevel, some messages for rcl and rclcpp are still shown, e.g.:
ros2 run demo_nodes_cpp list_parameters --ros-args --log-level DEBUG --disable-stdout-logs
If you don't need DEBUG loglevel for rcl and rclcpp (e.g. you only need DEBUG for your nodes), then the stray stdout logmessages can avoided by specifying non-DEBUG loglevels for rcl and rclcpp:
ros2 run demo_nodes_cpp list_parameters --ros-args --log-level DEBUG --disable-stdout-logs --log-level rcl:=INFO --log-level rclcpp:=INFO
Longer answer:
Setting up a second logger is straightforward, as one can just call rclcpp::get_logger('<logger-name>'). | {
"domain": "robotics.stackexchange",
"id": 38624,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2, ros-humble, rclcpp",
"url": null
} |
c++, beginner, object-oriented, game
}
}else if(number == 10){
random = 0;
random = rand() % 50 + 1;
if(ten1 > random){
cout << "I'd be delighted to visit!";
tenv = 1;
}else if(ten1 <= random){
cout << "I haven't really considered your program, coach." << endl;
}
}
}else{
cout << "You don't have enough minutes to complete this action..." << endl;
}
}else if(number == scholarship){
if(minutes > 9){
minutes = minutes - 10;
cout << "Who will you offer a scholarship coach?" << endl;
cin >> number;
if(number == 1){
if(ones == 0){
ones = 1;
rands = 0;
rands = rand() % 150 + 1;
if(onel > rands){
cout << "I'd be glad to join your program!" << endl;
addrat = addrat + twoc;
}else{ | {
"domain": "codereview.stackexchange",
"id": 39714,
"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, object-oriented, game",
"url": null
} |
c#, event-handling, delegates, e-commerce
But that's more code than we need, now that we're following the convention.
.NET provides a helper class:
//
public event EventHandler<OrderSubmittedEventArgs> OrderSubmitted;
You also ask another question - why use an event rather than a multicast delegate?
You can think of an event as a multicast delegate, but with restrictions.
Only the object that owns the event can invoke it.
Another object can add or remove a listener, but cannot modify it in any other way
For example:
class TestClass
{
public EventHandler ThisDelegate;
public event EventHandler ThisEvent;
private void TryThis()
{
if (this.ThisEvent != null)
{
// I can fire my own event
this.ThisEvent(this, EventArgs.Empty);
}
// I can clear my own event
this.ThisEvent = null;
}
} | {
"domain": "codereview.stackexchange",
"id": 4478,
"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#, event-handling, delegates, e-commerce",
"url": null
} |
ros, answers.ros.org
Title: Direct Message other people on ROS Answers?
I was wondering if the administrators could permit direct messages to people on ROS answers (based on people accepting requests or some other form of privacy protection of course). Because some times, you are stuck at a single point and it makes sense to directly interact with someone who has solved the problem before without having to use answers and comments which are way less efficient and might be spam-like to others.
Cheers! | {
"domain": "robotics.stackexchange",
"id": 18510,
"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, answers.ros.org",
"url": null
} |
newtonian-mechanics, energy, metric-tensor
Note that the kinetic energy is in term of $v^2$ rather than $v$, and the formula for kinetic energy is derived without Pythagorean theorem (which implies the two needn't to be consistent). So if Pythagorean theorem is not in its now form, does kinetic energy no more follows an algebraic summation, and we can no more decompose a motion? To answer the question in your title, resolution of vectors into unique components depends only (1) on the fact of the vector space over the underlying field; as long as one has a basis (any $N$ linearly independent vectors where $N$ is the space's dimension), unique resolution of a vector into components with respect to this basis is defined. | {
"domain": "physics.stackexchange",
"id": 24737,
"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, energy, metric-tensor",
"url": null
} |
discrete-signals, 2d, separability
Title: Mathematical Approach to Detect If a 2D Signal Is Separable In the Special 2-D Sequences page the following examples are demonstrated,
2D dirac
2D diagonals
2D unit step function | {
"domain": "dsp.stackexchange",
"id": 7998,
"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": "discrete-signals, 2d, separability",
"url": null
} |
experimental-physics, radiation, experimental-technology
For typical lab experiments these two will be the smallest efficiencies. But there is also
fraction of interactions that make it to your central anode... that's probably very close to 1 but you didn't specify your application, so here you go
Geiger tunes are slow, can take 100 or more microseconds for a pulse, so at rates approaching kilohertz and above you start to miss counts to pile up
depending on your readout, dead time, i.e. how long after a pulse till you can record another one. Related to pile up but a distinct cause that can depend on your electronics
in an actual setting, never neglect silly mistakes, e.g. your tube and readout needs to be powered up, the tube in proper working condition, etc. | {
"domain": "physics.stackexchange",
"id": 91357,
"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": "experimental-physics, radiation, experimental-technology",
"url": null
} |
$$\left\{\begin{array}{ccccc} d + r &=& x+y+u&&\\ 2d+s+r+y &=& 1 + 2z&&\\ \\ 0&\leqslant &r &\leqslant& d/4 \\ 0&\leqslant& s&\leqslant&d/3\\ r &\leqslant& x &\leqslant & u + d/3\\ 0&\leqslant &y &\leqslant& x-r\\ 0&\leqslant &u &\leqslant& x\\ 0&\leqslant& z&&\\ 1 &\leqslant& 5d/4 + r + y + z&& \end{array}\right.$$
You can check that the following is a solution with $d<1/2$:
$$\left\{\begin{array}{ccc} d&=&9/20\\ r&=&9/80\\ x&=&11/40\\ y&=&13/80\\ u&=&1/8\\ s&=&3/20\\ z&=&13/80 \end{array}\right.$$
• This is a really nice approach, and again, I'm very intrigued by how the solution changes when allowing for planes to travel arbitrarily fast supposing they have enough fuel. I'll make note of my assumptions in the question. Thanks. Aug 7, 2018 at 2:25 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9848109516378094,
"lm_q1q2_score": 0.8028498836448035,
"lm_q2_score": 0.815232489352,
"openwebmath_perplexity": 499.15102663797273,
"openwebmath_score": 0.635242760181427,
"tags": null,
"url": "https://math.stackexchange.com/questions/2872604/getting-an-airplane-around-the-world"
} |
turing-machines, reductions, halting-problem
If $N$ accepts at least one string, it accepts every string, so $L(N)$ is either $\emptyset$ or $\Sigma^{\ast}$, nothing in between.
$\langle N \rangle$ is an encoding of a Turing Machine, and what we want to know is whether we can decide if $\langle N \rangle$ is in $L$ or not.
So the argument is by contradiction. Imagine that we did have a TM $X$ that decided $L$, then we could give it $\langle N \rangle$ and, as it decides $L$, it would say, correctly, $\mathrm{Yes}$ or $\mathrm{No}$.
But if it says $\mathrm{Yes}$, then we know that $M$ halts on $x$, because that's how we built $N$, and similarly if it answers $\mathrm{No}$, $M$ doesn't halt on $x$.
So having $X$ (i.e. being able to decide $L$) allows us to decide the Halting Problem, and hence we have a contradiction.
Note that we're not trying to 'run' $N$, we're asking if there can possibly be an $X$ that looks at $\langle N\rangle$ and says something about it (for every $N$). | {
"domain": "cs.stackexchange",
"id": 3767,
"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, reductions, halting-problem",
"url": null
} |
quantum-field-theory, field-theory, classical-field-theory
$$
It then follows from the Legendre transform above that this solution for the full quantum effective action is the one-point function:
$$
\frac{\delta W(J)}{\delta J}\Big|_{J=0}=\bar{\varphi}.
$$
Everything would be consistent if in our original path integral we were computing quantum fluctuations around the full quantum corrected background, i.e. if we expanded $\phi=\bar{\varphi}+\tilde{\phi}$ and integrated over $\tilde{\phi}$ in the defining path integral of $W(J)$. This is a non-trivial requirement, but it is understood how to do this. | {
"domain": "physics.stackexchange",
"id": 46789,
"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, field-theory, classical-field-theory",
"url": null
} |
But I don't know if a proof by contradiction is the best way to go. It would be sufficient to show that the squareroot of any prime is irrational.
3. Originally Posted by mart1n
Hey; I need help with the following problem:
"Prove that there are infinitely many positive integers 'n' such that sqrt(n) is irrational."
I think I'm supposed to do this with a proof by contradiction, but I'm even struggling with that distinction... which part do I negate? the infinite part or the irrational part?
I'm really struggling with my proofs involving irrationality... if anyone could give general tips concerning irrationals in proofs, I would also greatly appreciate it.
Thanks,
Martin
As hallsoflvy already mentioned, it suffices to prove that Sqrt(p) is irrational for any prime p. The following are highlights of the proof:
== Supose Sqrt(p) = a/b, with a, b coprime integers (i.e., the fraction a/b is reduced) | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850852465429,
"lm_q1q2_score": 0.8213514103360107,
"lm_q2_score": 0.8354835432479663,
"openwebmath_perplexity": 503.57267518049093,
"openwebmath_score": 0.9038679599761963,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/106694-proof-infinite-n-s-s-t-sqrt-n-irrational.html"
} |
c#, beginner, object-oriented, design-patterns, interview-questions
// Perform test
// Expected to throw ArgumentException
testBank.Withdraw(testAccount, testMoneyWithdraw);
}
[TestMethod]
public void BankAccountDepositPass()
{
// Setup test variables
decimal testMoneyDepositAmount = 300;
// Setup test objects
var testBank = new Bank(_testBankName);
var testPerson = new Person(_testPerson1Name);
var testMoneyDeposit = new Money(testMoneyDepositAmount);
var testMoneyAccount = new Money(_testMoneyAccount1Amount);
var testAccount = new Account(testMoneyAccount, testPerson);
// Perform test
testBank.Deposit(testAccount, testMoneyDeposit);
// Assert
Assert.AreEqual(
testAccount.Money.Value,
_testMoneyAccount1Amount + testMoneyDepositAmount
);
} | {
"domain": "codereview.stackexchange",
"id": 27452,
"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, object-oriented, design-patterns, interview-questions",
"url": null
} |
machine-learning, deep-learning, classification, statistics, pytorch
I was wondering how to extend my set-up to make it a proper statistical experiment set-up, with the goal of getting stable accuracy and loss results ie I want to be able to say that my model gives consistently the same results. I was thinking along the lines of running the testing step say 10 times and averaging the error? Or do you see some deficiency in the training that I could improve to improve stability?
Thanks in advance The learning rate is one of those first and most important parameters of a model, and one that you need to start thinking about pretty much immediately upon starting to build a model. It controls how big the jumps your model makes, and from there, how quickly it learns.
There are learning rate technique called Cyclical Learning Rates. | {
"domain": "datascience.stackexchange",
"id": 9013,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning, classification, statistics, pytorch",
"url": null
} |
quantum-gate, quantum-algorithms, simons-algorithm
Incidentally, for what you tried to prove, is it clear that because, in a certain basis, all the lengths of those basis states are preserved, that the lengths of all possible superpositions of those states are also preserved? | {
"domain": "quantumcomputing.stackexchange",
"id": 3213,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, quantum-algorithms, simons-algorithm",
"url": null
} |
python, optimization, performance, mathematics
The comment on what the function does was changed to a documentation string (which can be viewed with obj.list_to_int.doc and which intelligent editors will display on use of the method).
As id() is not using self at all you can make it a staticmethod:
@staticmethod
def id(lst):
"""returns modulus 2 (1,0,0,1,1,....) for input lists"""
return [int(lst[i])%2 for i in range(len(lst))]
It is unclear how gf2pim is used after the creation of obj doesn't do anything since gf2pim has no __init__(). It is probable that the creation of an gf2pim object can be diverted to the user of this module.
After cleaning things up that way there can probably be done more, but here is where I would start. | {
"domain": "codereview.stackexchange",
"id": 4053,
"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, optimization, performance, mathematics",
"url": null
} |
c#, language-design, lexical-analysis
public Lexer(string sourceRaw)
{
this.sourceRaw = sourceRaw;
tokens = new List<Token>();
}
bool IsEnd
{
get { return charIdx >= sourceRaw.Length; }
}
char? NextChar()
{
try {
return sourceRaw[charIdx++];
} catch (IndexOutOfRangeException) {
return null;
}
} | {
"domain": "codereview.stackexchange",
"id": 43246,
"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#, language-design, lexical-analysis",
"url": null
} |
genetics, molecular-genetics, human-genetics, literature
In The dimorphism in human normal cerumen, Matsunaga summarizes 30 years of research into the earwax of Japanese families, with two major observations:
Dry earwax parents never have wet earwax children, suggesting the genetics underlying the wet phenotype are dominant to those underlying the dry phenotype.
Because the allele for wet earwax is relatively rare in the sampled families, it is likely that most wet earwax parents are heterozygotes. Following from this, if the trait is monogenic with two allele variants, we expect a 3:1 ratio of wet to dry children in wet × wet parent crosses, and a 1:1 ratio of wet to dry children wet × dry parent crosses. Indeed, this is observed. | {
"domain": "biology.stackexchange",
"id": 10495,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "genetics, molecular-genetics, human-genetics, literature",
"url": null
} |
java, algorithm, unit-testing, interview-questions
If your intention is that two trees are equal if they contain the same elements then I strongly suspect that the code is buggy. It seems quite implausible that every possible ordering of insertions would result in an identical structure. | {
"domain": "codereview.stackexchange",
"id": 15962,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, unit-testing, interview-questions",
"url": null
} |
analytical-chemistry, stoichiometry
$$[\ce{H3O+}] = K_\mathrm{a}\sqrt{K_\mathrm{h}} = K_\mathrm{a}\sqrt{\frac{K_\mathrm{w}}{K_\mathrm{a}K_\mathrm{b}}} = \sqrt{\frac{K_\mathrm{w}K_\mathrm{a}}{K_\mathrm{b}}} \label{9}\tag{9}$$
An equation for $\mathrm{pH}$ is obtained trivially by taking negative decimal logarithm on both parts of \eqref{9}. | {
"domain": "chemistry.stackexchange",
"id": 11204,
"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": "analytical-chemistry, stoichiometry",
"url": null
} |
algorithms, graphs, shortest-path
The shortest path between node 1 and node 4 is: 1 -> 2 -> 5 -> 4 whose cost is 4.
If I try to execute BFM on this graph, assuming nodes are added in the queue with this order: 1,3,2,4,5; the result is not what I'm expecting because the algorithm terminates returning the path 1 -> 3 -> 4, whose cost is 5.
This is the pseudocode I'm using:
bfm(GRAPH G, NODE r, NODE s, integer[] T)
integer[] d <- new integer[1...G.n]
boolean[] b <- new integer[1...G.n] | {
"domain": "cs.stackexchange",
"id": 9138,
"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, graphs, shortest-path",
"url": null
} |
quantum-state, quantum-algorithms, textbook-and-exercises, deutsch-jozsa-algorithm, terminology-and-notation
Title: Shouldn't the input state of Deutsh-Jozsa's algorithm look like $|0\rangle^{\otimes n}\otimes |1\rangle$ rather than $|0\rangle^{\otimes n}|1\rangle$? According to this wikipedia page the initial state in Deutsch–Jozsa algorithm is written as follows:
$$|0\rangle^{\otimes n} |1\rangle$$
shouldn't it look like this?:
$$|0\rangle^{\otimes n} \otimes |1\rangle$$ This is just a convention. People tend to write $|01 \rangle$ instead of $|0 \rangle \otimes |1\rangle $, but they mean the same thing. In this case,
$$ \overbrace{|0\rangle \otimes |0\rangle \otimes \cdots \otimes |0\rangle}^{n \ \ times} \otimes|1\rangle = |0\rangle^{\otimes n} \otimes |1\rangle = |0\rangle^{\otimes n} |1\rangle$$
So it is just a matter of notation. | {
"domain": "quantumcomputing.stackexchange",
"id": 2377,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-state, quantum-algorithms, textbook-and-exercises, deutsch-jozsa-algorithm, terminology-and-notation",
"url": null
} |
quantum-mechanics, scattering, perturbation-theory, second-quantization, x-rays
${\widehat a^\dagger }_{{k_F},{\lambda _F}}$ creates a photon in the mode (${\bf k_{F}}, \lambda_{F})$)
I wonder why the field final state contains the creation operator? I thought that the final state should have been written like this $ \left| F \right\rangle = \left| {\Psi _0^{{N_{el}}}} \right\rangle \left| {{N_{EM}} - 1} \right\rangle$ because the field lost one photon. May it mean just that a field loses the photon in mode (${\bf k_{in}}, \lambda_{in})$) and creates a photon in mode $({\bf{k}_F},{\lambda _F})$ after scattering?
I thought that the final state should have been written like this $
\left| F \right\rangle = \left| {\Psi _0^{{N_{el}}}} \right\rangle
\left| {{N_{EM}} - 1} \right\rangle$ because the field lost one
photon. | {
"domain": "physics.stackexchange",
"id": 67006,
"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, scattering, perturbation-theory, second-quantization, x-rays",
"url": null
} |
# Proof: uniqueness of elementary measure
The following proof is a solution to exercise 1.1.3 of the book “An introduction to measure theory” by Terence Tao.
A box $B\in\mathbb{R}^d$, $d\in\mathbb{N}$, is a Cartesian product $B:={\sf X}_{i=1}^d I_i$, where each interval $I_i$ is $I_i=(a, b)$ or $I_i=(a, b]$ or $I_i=[a, b)$ or $I_i=[a, b]$ for $a,b\in\mathbb{R}$ with $a\le b$. An elementary set $E=\cup_{i=1}^n B_i\subseteq\mathbb{R}^d$ is a finite union of disjoint boxes $B_i\in\mathbb{R}^d$. Let $\mathcal{E}(\mathbb{R}^d)$ denote the collection of elementary sets in $\mathbb{R}^d$. The measure $m:\mathcal{E}(\mathbb{R}^d)\rightarrow R^{+}\cup\left\{0\right\}$ is defined as $m(E)=\displaystyle\lim_{N\rightarrow\infty}\frac{1}{N^d}\#\left(E\cap\frac{1}{N}\mathbb{Z}^d\right)$, where $\#(\cdot)$ denotes set cardinality and $\displaystyle\frac{1}{N}\mathbb{Z}^d:=\left\{\frac{\mathbf{z}}{N}:\mathbf{z}\in\mathbb{Z}^d\right\}$. | {
"domain": "papamarkou.blog",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806557900713,
"lm_q1q2_score": 0.8213539269860421,
"lm_q2_score": 0.8376199572530448,
"openwebmath_perplexity": 2770.544067615771,
"openwebmath_score": 0.9897416234016418,
"tags": null,
"url": "https://papamarkou.blog/category/solutions/books/an-introduction-to-measure-theory/"
} |
c#, design-patterns, entity-framework
isDisposed = true;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
~RepositoryBase()
{
Dispose(false);
}
}
Service classes
These are the only classes that will interact with the generic repository and will be used in the UnitOfWork class. Below is part of one of my service classes, i have left out some code to improve readability, all other services are very similar to this one.
public class GroupService
{
IUnitOfWork unitOfWork;
IRepository<Group> groupRepository;
public GroupService(IRepository<Group> groupRepository, IUnitOfWork unitOfWork)
{
this.groupRepository = groupRepository;
this.unitOfWork = unitOfWork;
}
public Group GetById(int id)
{
return groupRepository.GetSingle(g => g.Id == id);
} | {
"domain": "codereview.stackexchange",
"id": 7201,
"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#, design-patterns, entity-framework",
"url": null
} |
estimation, kalman-filters, bayesian-estimation
You may see that the model can effectively track changes in the parameters.
There are other alternatives to this dynamic model but I think this is a simple and effective one.
You may also use the Unscented Kalman Filter. I implemented it at Extended Kalman Filter (EKF) for Non Linear (Coordinate Conversion - Polar to Cartesian) Measurements and Linear Predictions.
The code is available at my StackExchange Signal Processing Q76443 GitHub Repository (Look at the SignalProcessing\Q76443 folder). | {
"domain": "dsp.stackexchange",
"id": 10722,
"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": "estimation, kalman-filters, bayesian-estimation",
"url": null
} |
python, python-3.x, pandas
Title: Applying function to entire dataframe I'm wondering if there is a faster way to do the following code, which works fine. It needs to be applied to every row of the DataFrame df. class_dct contains a different NLTK NaiveBayes classifier for each of 9 regions.
for region in regions:
new_app=[]
for title in df.booktitle:
nlp_genre=class_dct['Classif_%s'% region].classify(features(title))
new_app.append((title,region,nlp_genre)) I guess the Python interpreter will optimise most or all of this on its own, but you could try a list comprehension and removing an intermediate variable:
new_app = [(title, region, class_dct['Classif_%s'% region].classify(features(title))) for title in df.booktitle] | {
"domain": "codereview.stackexchange",
"id": 25973,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, pandas",
"url": null
} |
formal-languages, automata, nondeterminism
Title: Computational power of deterministic versus nondeterministic min-heap automata This is a follow-up question of this one.
In a previous question about exotic state machines, Alex ten Brink and Raphael addressed the computational capabilities of a peculiar kind of state machine: min-heap automata. They were able to show that the set of languages accepted by such machines ($HAL$) is neither a subset nor a superset of the set of context-free languages. Given the successful resolution of and apparent interest in that question, I proceed to ask several follow-up questions.
It is known that deterministic and nondeterministic finite automata have equivalent computational capabilities, as do deterministic and nondeterministic Turing machines. However, the computational capabilities of deterministic push-down automata are less than those of nondeterministic push-down automata. | {
"domain": "cs.stackexchange",
"id": 40,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, automata, nondeterminism",
"url": null
} |
c++, error-handling, graphics, opengl, shaders
int success;
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
if (!success)
{
int len;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
if (len == 0)
{
glDeleteShader(shader);
shader = 0;
throw std::runtime_error("Could not compile shader and could not obtain any log");
}
std::vector<char> log(len);
glGetShaderInfoLog(shader, log.size(), &len, log.data());
glDeleteShader(shader);
shader = 0;
throw std::runtime_error({log.begin(), log.end()});
}
}
shader_program::Shader::~Shader()
{
// No need to delete not created shader
if (shader != 0)
{
glDeleteShader(shader);
}
}
unsigned int shader_program::Shader::getId() const
{
return shader;
} | {
"domain": "codereview.stackexchange",
"id": 43991,
"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++, error-handling, graphics, opengl, shaders",
"url": null
} |
algorithm, kotlin
val resultingWorldState = initialState.applyAction(action)
assertTrue { resultingWorldState == expectedWorldState }
}
@Test
fun testGoapNodeNeighboursSimple() {
val actionPool = listOf(
GoapAction("WorkForMoney", emptyMap(), mapOf(Pair("HasMoney", true)), 5, { true }, { true }, { }),
GoapAction("GetBread", mapOf(Pair("HasMoney", true)), mapOf(Pair("HasBread", true), Pair("HasMoney", false)), 5, { true }, { true }, { }),
GoapAction("MakeToast", mapOf(Pair("HasBread", true)), mapOf(Pair("HasToast", true), Pair("HasBread", false)), 5, { true }, { true }, { })
)
val forState = WorldState(mutableMapOf(
Pair("HasToast", false),
Pair("HasBread", false),
Pair("HasMoney", false)
))
val node = GoapNode(forState, actionPool)
val neighbours = node.neighbours()
assertTrue { neighbours.size == 1 }
} | {
"domain": "codereview.stackexchange",
"id": 36121,
"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": "algorithm, kotlin",
"url": null
} |
beginner, c, homework, simulation
//Method to sort a queue by arrival time , uses selection sort algorithm
void SortQueueByArrival(Queue* const queueToSort, AlgorithmToCall currentState)
{
if (!QueueIsEmpty(queueToSort))
{
for (Procedure* firstIterator = queueToSort->ptrHead; firstIterator != queueToSort->ptrTail; firstIterator = firstIterator->nextProc)
{
for (Procedure* secondIterator = firstIterator->nextProc; secondIterator != NULL; secondIterator = secondIterator->nextProc)
{
if (firstIterator->arrivalTime > secondIterator->arrivalTime)
SwapContents(firstIterator, secondIterator); //If the first iterator's arrival time is higher than the second's we call SwapContents with first and second iterator as parameters
else if (firstIterator->arrivalTime == secondIterator->arrivalTime) //Else we check if both iterator's arrival time is the same
{ | {
"domain": "codereview.stackexchange",
"id": 28112,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, c, homework, simulation",
"url": null
} |
c++, performance, c++17, memory-optimization
I don't know why you are printing the maximum number here.
Player *player;
This is declared without being initialized. This is one clue that you have a section of code that really should be broken out into a separate function. E.g.: Player* player = load_player();
All the way from here----
Player_database database(player_data_file);
menu_options choice = main_menu(database, std::cout, std::cin);
switch (choice) {
case LOGIN: {
player = prompt_login(database, std::cout, std::cin, quit_prompt_msg);
break;
}
case REGISTER: {
player = prompt_register_account(database, std::cout, std::cin, quit_prompt_msg);
break;
}
default: {
player = nullptr;
}
} | {
"domain": "codereview.stackexchange",
"id": 41439,
"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++, performance, c++17, memory-optimization",
"url": null
} |
electrostatics, charge, gauss-law, conductors
So we proved that in electrostatic conditions , charge cannot reside inside a conductor using
1. A physical assumption &
2. A law of nature .
Now dealing with your question , assuming electrostatic condition has been achieved , there must be no $\vec E$ inside the conductor , I am assuming not a hollow sphere . Thus net charge inside any gaussian surface you imagine is $0$ .
Now imagining this physically , suppose the whole sphere is made up of very very thin infinitesimal shells , you can assume condition to be like this in every infinitesimal shell (assume these to bespheres).
But you know net charge of an isolated system is conserved ,
so on the outermost surface there will be net charge = the charge you put inside in the first place.
Equal in terms of magnitude and sign .
And it'll also be uniformly distributed . Why ? | {
"domain": "physics.stackexchange",
"id": 7691,
"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, charge, gauss-law, conductors",
"url": null
} |
python, python-3.x
def tests():
"""
Tests for choose_players_to_penalize()
"""
assert sorted(choose_players_to_penalize(team1)) == sorted([(24075, -2),
(139989, -1)])
assert sorted(choose_players_to_penalize(team2)) == sorted([(139989, -2),
(88472, -1)])
assert sorted(choose_players_to_penalize(team3)) == sorted([(88472, -2),
(139989, -1)])
assert sorted(choose_players_to_penalize(team4)) == sorted([(160699, -3),
(24075, -2),
(88472, -1)])
assert sorted(choose_players_to_penalize(team5)) == sorted([(24075, -3),
(139989, -3), | {
"domain": "codereview.stackexchange",
"id": 40478,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x",
"url": null
} |
c#, performance, programming-challenge, array
In general. the \$k_{th}\$ round, equalizing everything to \$c_k\$, takes \$k (c_k - c_{k-1})\$ jobs.
This observation hints a solution: cumulatively compute \$\sum_{k=1} k(c_k - c_{k-1})\$ for as long as it is less than the amount of jobs. The resulting time complexity is linear in the number of CPUs; of course the sorting phase would dominate. | {
"domain": "codereview.stackexchange",
"id": 43137,
"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#, performance, programming-challenge, array",
"url": null
} |
javascript, array, iteration
Title: Iterating through two objects with different structures in parallel I have two objects, one input = Array<Type> and one stored = Array<{..., Type}>
What's the best (cleanest) way to put the elements in the first array into the sub-elements of the second? We can assume they're of the same size.
My current code below works, but looks bad due to the double iterator usage.
var count = 0;
stored.forEach((obj)=> {
obj.value = input[count];
count++;
});
Is there some sort of prototyping that I can use to shorten the code up? You don't need the count variable to increment the index, Array.forEach accepts a second ( optional ) parameter which is the current index that you can use :
stored.forEach((obj, index) => {
obj.value = input[index];
});
OR
stored = stored.map((obj, index) => ({...obj, value: input[index]}))
example :
let stored = [{ name : 'a', value: 2 }, {name : 'b', value: 4 }, { name : 'c', value: 6 }];
let input = [10, 11, 12]; | {
"domain": "codereview.stackexchange",
"id": 33616,
"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, array, iteration",
"url": null
} |
The integral above equals $1$ because the integrand is the density function of a $N(t/2,\lambda^2/2)$ distribution.
• At the end, did you intend $N(2 \mu,2 \lambda^2)$ for the mean and variance rather than $t/2, \lambda^2 /{2}$? – Henry Jun 5 '18 at 16:31
• Sorry, I was referring to the density function inside the final integral (the one that equals 1). The distribution of $Z$ is definitely $N(2\mu,2\lambda^2)$. – Flowsnake Jun 5 '18 at 16:33
• So was I. I think a density $f_Z(t)= \frac{1}{\sqrt{4\pi\lambda^2}}e^{-(t-2\mu)^2/4\lambda^2}$ suggests a normal distribution for $Z$ with a mean of $2 \mu$ and a variance of $2 \lambda^2$ – Henry Jun 5 '18 at 16:37
• The density function I was referring to was, $\frac{1}{\sqrt{\pi\lambda^2}}e^{-(x-t/2)^2/\lambda^2}$, which is the density of a $N(t/2,\lambda^2/2)$. – Flowsnake Jun 5 '18 at 16:49 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138138113964,
"lm_q1q2_score": 0.8658941332765748,
"lm_q2_score": 0.8856314813647587,
"openwebmath_perplexity": 250.59321952227083,
"openwebmath_score": 0.9188310503959656,
"tags": null,
"url": "https://math.stackexchange.com/questions/2808027/finding-the-probability-density-function-of-z-x-y"
} |
newtonian-mechanics, forces, potential-energy
Consider the system consisting of the dumbbell and the earth. Now I have two objects modeled as point particles, one external force: the force of your hand, and one internal force: the mutual gravitational attraction between the Earth and the dumbbell. The internal work done in lifting the dumbbell (that is, increasing the distance between them) is $W_\mathrm{internal} = -mgh$. The minus sign comes from the fact that the displacement is in the direction opposite to the direction of the force. (Gravity down, displacement up.) so the change in potential energy of the system is $$\Delta\mathrm{(P.E.)} = -W_\mathrm{internal} = -(-mgh) = mgh$$ The external force of your hand on the dumbbell plays no role at all. | {
"domain": "physics.stackexchange",
"id": 15652,
"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, forces, potential-energy",
"url": null
} |
python, performance, python-3.x, windows, com
def get_software_updates(update_seeker, installed):
# Search installed/not installed Software Windows Updates
search_string = "IsInstalled=%d and Type='Software'" % installed
search_update = update_seeker.Search(search_string)
_ = win32com.client.Dispatch("Microsoft.Update.UpdateColl")
updates = []
categories = []
update_dict = {}
# compiles the regex pattern for finding Windows Update codes
updates_pattern = re.compile(r'KB+\d+')
for update in search_update.Updates:
update_str = str(update)
# extracts Windows Update code using regex
update_code = updates_pattern.findall(update_str)
for category in update.Categories:
category_name = category.Name
print("[*] Name: " + update_str + " - " +
"url: " + "https://support.microsoft.com/en-us/kb/{}".format(
"".join(update_code).strip("KB")) + " - " +
"Category: " + category_name) | {
"domain": "codereview.stackexchange",
"id": 21164,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-3.x, windows, com",
"url": null
} |
neuroscience, neurophysiology, vision, light, color
Title: Do color-blind people have more rod cells in their retinae than the normally sighted? All types of color-blindness are said to be caused by the defect or lack of cone cells in the eyes[1]. Since cone cells sense color[2] and rod cells can only sense light intensity[3], the lack of cone cells would mean that the eye cannot detect color. However, rod cell function better in low light than cone cells. Color-blind people have fewer cone cells than other people. My question is, is it possible that they also have more rod cells than other people? | {
"domain": "biology.stackexchange",
"id": 11802,
"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": "neuroscience, neurophysiology, vision, light, color",
"url": null
} |
observational-astronomy, milky-way, radio-astronomy
The original source is The galactic system as a spiral nebula Oort, J. H.; Kerr, F. J.; Westerhout, G. MNRAS 118, (1958) p. 379 TLDR: these wedges are bits where things are moving around the centre of the galaxy at about the same speed as us, so we can't understand what is there.
As it states on page 4 of the paper you have linked,
the great gap between 315 and 340, where, except at small R, the differential rotation is too small to separate the various arms
The method used to deduce this structure is described on page 2: | {
"domain": "astronomy.stackexchange",
"id": 3238,
"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": "observational-astronomy, milky-way, radio-astronomy",
"url": null
} |
meteorology, troposphere, stratosphere, synoptic, vorticity
Title: How do tropopause folds form and do they have any impact on synoptic scale weather? What is the process that creates a tropopause fold? Do these features have any significant impact(s) on weather patterns or the atmosphere? I am not not an expert in meteorology, but do study the chemistry involved in these types of events. My understanding is that the folds in the tropopause generally occur below the front of the jet stream, when the potential vorticity is strong enough to transport stratospheric air down through the tropopause/inversion.
Please see the relevant quote from Q. J. R. Meteorol. Soc. (2004), 130, pp. 1195–1212 doi: 10.1256/qj.03.21
Convective mixing in a tropopause fold
By H. J. REID and G. VAUGHAN∗
Institute of Mathematical and Physical Sciences, University of Wales, Aberystwyth, UK
"Mixing between stratospheric and tropospheric air can occur most readily in deep
intrusions of stratospheric air into the troposphere, such as tropopause folds (Danielsen | {
"domain": "earthscience.stackexchange",
"id": 168,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "meteorology, troposphere, stratosphere, synoptic, vorticity",
"url": null
} |
## [1] 358260.6
sum(f1$residuals^2) ## [1] 2132108 sum(f2$residuals^2)
## [1] 1823473 | {
"domain": "gagolewski.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713896101315,
"lm_q1q2_score": 0.8100794250053307,
"lm_q2_score": 0.8221891283434876,
"openwebmath_perplexity": 6347.572649086363,
"openwebmath_score": 0.8177797198295593,
"tags": null,
"url": "https://lmlcr.gagolewski.com/finding-the-best-model.html"
} |
electromagnetism, electromagnetic-radiation, education
By the time magnetism and time-dependent phenomena are introduced, starting in chapter 5 of Classical Electrodynamics, the reader is expected to have developed a significant degree of facility with the mathematics of potential theory, as studied in the first four chapters. The problems in Classical Electrodynamics are infamous for their level of difficulty, and for many of them it may be challenging to even figure out how to start them without either guidance or extensive experience in the subject matter. By chapter 6, the book assumes that the reader has a clear understanding of how to set up and deal with a fairly wide class of mathematical problems, and if you jump into the book at this stage without experience doing graduate-level statics problems, you will probably find yourself completely at sea.
*If you do not understand this sentence, that is a pretty strong indication that you are not ready for the later chapters of Jackson's book. | {
"domain": "physics.stackexchange",
"id": 74032,
"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, electromagnetic-radiation, education",
"url": null
} |
turing-machines, kolmogorov-complexity
Although it is not important for the above argument, let us anyway talk about the function CORR, which checks whether a statement $s$ and a proof $p$ in $F$ are correct. Often, a formal system consists out of a finite set of axioms and a list of deduction rules. A deduction rule transforms a few statements into another statement. A proof encodes which statements should be used, which deduction rule should be applied, and perhaps some auxiliary information (e.g. what variables are substituted). It is easy to believe that such procedures can be checked by an algorithm. In fact, there exist theorem provers like COQ and isabelle/HOL that do such things. To write such a procedure, one just needs to know the axioms and deduction rules, and the size of their description is denoted $f$ in the above argument. | {
"domain": "cstheory.stackexchange",
"id": 5505,
"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, kolmogorov-complexity",
"url": null
} |
qiskit, programming, circuit-construction, noise
for cases like this where you don't want to transpiler to optimize the circuit for you and you want to send the circuit to the backend in a raw form (it will still fit it to the backend based on its constraints) you can use optimization_level=0 kwarg for transpile() and execute(). This disables all the optimization passes and will just run the transforms necessary to run on the device (basis gate transformation, layout, routing) For example, when using execute() it would be: qiskit.execute(circuit, backend, optimization_level=0) | {
"domain": "quantumcomputing.stackexchange",
"id": 2062,
"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, programming, circuit-construction, noise",
"url": null
} |
cc.complexity-theory, computability
Title: Complexity relative to the graph of the Busy-Beaver function This question is inspired by the comments made on this other question that I asked, and by an attempt to provide an explicit example of a complexity question beyond the Turing degree $\mathbf{0}$. (And like the former question, I'm not sure whether this is more appropriate here or on MathOverflow.)
Let $\Gamma_{\mathrm{BB}}$ be the graph of the Busy-Beaver function, i.e., $\Gamma_{\mathrm{BB}}$ is the set of $(n,v)$ such that $v = \mathrm{BB}(n)$ (I hope the exact details of how the Busy-Beaver function is defined aren't relevant for the question I'm about to ask! but let's say that $\mathrm{BB}(n)$ is the maximal number of execution steps that a Turing machine with $n$ states can take and eventually halt). Now consider Turing machines with $\Gamma_{\mathrm{BB}}$ as an oracle: i.e., they are allowed to ask the question “is $v = \mathrm{BB}(n)$?” at any point in their computation. | {
"domain": "cstheory.stackexchange",
"id": 4978,
"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": "cc.complexity-theory, computability",
"url": null
} |
Using Weierstrass substitution we have $$\frac{2t}{1+t^2}+\frac{1-t^2}{1+t^2}=1$$ where $t=\tan\frac x2$
$$\implies 2t+1-t^2=1+t^2\iff t^2-t=0\iff t=1,0$$
If $\displaystyle\tan\frac x2=0\iff \frac x2=n180^\circ\iff x=n360^\circ$ where $n$ is any integer
If $\displaystyle\tan\frac x2=1\iff \frac x2=m180^\circ+45^\circ\iff x=m360^\circ+90^\circ$ where $m$ is any integer
• @user107827, Try this method when $$\sin x+\cos x=-1$$ – lab bhattacharjee Dec 26 '13 at 13:46
Using Double-Angle Formulas,
$$\sin x+\cos x=1\implies 2\sin\frac x2\cos\frac x2=1-\cos x=2\sin^2\frac x2$$
$$\implies \sin\frac x2\left(\cos\frac x2-\sin\frac x2\right)=0$$
$$(i)\sin\frac x2=0\implies \frac x2=n\pi\text{ where }n \text{ is any integer}$$
$$(ii) \cos\frac x2-\sin\frac x2=0\implies\cos\frac x2=\sin\frac x2\iff \tan\frac x2=1$$ Find the rest in my other answer | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9407897426182322,
"lm_q1q2_score": 0.8255211565269579,
"lm_q2_score": 0.8774767826757123,
"openwebmath_perplexity": 335.9067422759995,
"openwebmath_score": 0.8092725276947021,
"tags": null,
"url": "https://math.stackexchange.com/questions/618192/how-to-solve-sin-x-cos-x-1/618226"
} |
ros, c++, rqt-gui, rqt
Originally posted by Chuck Claunch on ROS Answers with karma: 206 on 2012-12-04
Post score: 1
Original comments
Comment by 130s on 2012-12-04:
What OS, version of ROS (Fuerte/Groovy etc.) btw?
Comment by Chuck Claunch on 2012-12-05:
It's Ubuntu 12.04 and Fuerte.
So it turns out it was really just me not understanding that I needed to do a rosspin to get the callbacks to run. So I set up a timer in Qt and ran the spinOnce() function inside that to get my stuff running. It works now!
Originally posted by Chuck Claunch with karma: 206 on 2012-12-05
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 11976,
"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, c++, rqt-gui, rqt",
"url": null
} |
newtonian-mechanics, friction, centripetal-force
Title: Friction of a Car in Motion It is commonly known that friction opposes motion. For example, if a block is sliding down a wooden surface with no forces other than friction acting on it, friction acts in the direction opposite to the block's velocity.
Let's say a car is driving at constant speed along a perfectly circular loop road. Centripetal acceleration works toward the center of the circle, but the car is moving forward along the loop, perpendicularly to the car's acceleration. As we have already established, friction should be in the opposite direction of the car's motion. But no- apparently it acts as the centripetal force that is perpendicular to the velocity.
What is going on with this discrepancy?
Edit: new comment | {
"domain": "physics.stackexchange",
"id": 90000,
"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, friction, centripetal-force",
"url": null
} |
black-holes, astrophysics, astronomy, imaging
The latter property is key. When viewing such a plasma, the brightness depends on the density of the plasma and the path length of the sightline we have into it.
This matters greatly near a black hole, because the densest plasma will be nearest the black hole but any light that is emitted and heads inside the location of the "photon sphere" at $1.5 r_s$ will end up in the black hole, possibly after orbiting many times, and is lost. Light emitted outwards from dense plasma inside or at the photon sphere may orbit many times and then escape from the edge of the photon sphere. Light emitted just outside the photon sphere can be bent towards us on trajectories that graze the photon sphere.
The result is a concentration of light rays that appear to emerge from the photon sphere and which we view as a circular ring. The ring is intrinsically narrow but is made fuzzy in the Event Horizon Telescope images by the limited (but amazing) instrumental resolution. | {
"domain": "physics.stackexchange",
"id": 57317,
"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": "black-holes, astrophysics, astronomy, imaging",
"url": null
} |
ros2
then add this under return launch.LaunchDescription([
spawn_entity,
They are in my launch file above. Use the ctrl F to find them as well!
Please let me know if you encounter any issue with this
Comment by Darkproduct on 2021-08-24:
I can open Gazebo and spawn my model just fine. The only thing I can't find is this nice view where you can see and possibly modify the speed and the PID values in Gazebo.
Comment by kak13 on 2021-08-24: | {
"domain": "robotics.stackexchange",
"id": 36808,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
cryogenics
Title: How does a liquefied gas work as a coolant? What makes liquefied Helium a better coolant than other liquefied gases (like Nitrogen, for example)? Is it because it has a lower boiling point (in which case, will it cool any substance it's in contact with till it reaches that point?)
A clear explanation is highly appreciated. You are correct.
The boiling temperature of helium is lower than of any other gas, and you can use it to cool other substances to that temperature.
If you drop a small item into a bucket of cold water, the item will cool to the temperature of the water. At the same time the water temperature will rise a little as it absorbs the heat of the object dropped into it. If the water is at boiling temperature, its temperature cannot rise until it has evaporated completely. Hence water at 100C can cool things to 100C, without any rise of its temperature. | {
"domain": "physics.stackexchange",
"id": 21495,
"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": "cryogenics",
"url": null
} |
java, spring
private Book getBestSellerOrCategorizedBook(Document document, int iteratedBook) {
Elements siteElements = document.select("div.grid__col.grid__col--20-80-80.b-products-wrap > ul > li:nth-child(" + iteratedBook + ")");
String author = siteElements.select(" > div > div.b-products-list__desc-wrap > div > div.b-products-list__main-content > div.b-products-list__desc-prime > div.b-products-list__manufacturer-holder").select("a").first().text();
String title = siteElements.select(" > div > div.b-products-list__desc-wrap > div > div.b-products-list__main-content > div.b-products-list__desc-prime > div.b-products-list__title-holder > a").first().text();
String price = siteElements.select(" div.b-products-list__price-holder > a").first().text();
String productID = siteElements.first().attr("data-ppc-id");
String bookUrl = createBookUrl(title, productID); | {
"domain": "codereview.stackexchange",
"id": 35872,
"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, spring",
"url": null
} |
filters, signal-detection, radar, matched-filter, waveform-similarity
Though the exact form of the pulses may not be known, a Taylor expansion performed in the vicinity of any pulse centre ('location'), $\rho_k$, for $k = 1,...,N$ results in a first-order approximation of the form of that pulse to be given by
$$
c_k(x) := c_k(x; \rho_k, \gamma) = \frac{1}{\pi}\left[ \frac{\gamma}{(x-\rho_k)^2 + \gamma^2} \right]
$$
which happens to be the pdf of the Cauchy distribution whose 'shape' is well-known, dictated in terms of 'height' and 'width' by the parameter $\gamma$, and in which the value of $\gamma$ is known a priori in the problem being considered. In the ideal case we would impose $\gamma=0$ and the pulse would take the form of the Dirac delta function but, in practice, we may only set $\gamma$ as close to zero as to not inhibit the computational work.
So, were $N$ and the set $\left\{ \rho_k \right\}_{k=1}^N$ to be known, ex post a first-order approximation to the signal $q(x)$ for $x \in [a,b]$ is
$$
q(x) \approx c(x) := \sum_{k=1}^{N} c_k(x)
$$ | {
"domain": "dsp.stackexchange",
"id": 11296,
"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, signal-detection, radar, matched-filter, waveform-similarity",
"url": null
} |
python, programming-challenge, python-2.x
Title: Project Euler # 22: Names scores Problem 22, here, asks the following:
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score.
For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 × 53 = 49714.
What is the total of all the name scores in the file?
My solution is as follows:
import re
import string
def create_names_list(file_name):
#create a names list parsing
names = open(file_name).read()
names = re.findall(r'"(.*?)"', names)
names.sort()
return names
def name_weights(file_name):
#fetch name-list
names = create_names_list(file_name) | {
"domain": "codereview.stackexchange",
"id": 15990,
"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, programming-challenge, python-2.x",
"url": null
} |
electromagnetism, electromagnetic-radiation, reflection, polarization, boundary-conditions
My question is, how do we know in either case (1) or (2), individually, that the reflected and transmitted fields are polarized in the same direction as the incident field? For example, how do we know that with an incident $E$-field that is initially s-polarized, both the transmitted and reflected $E$-fields will also be entirely s-polarized?
The boundary conditions at the interface don't seem to give the necessary rationale for why this is so. As an example, consider again case (1), where the incident $E$-field is s-polarized. In this case, the boundary conditions for the $E$-field are, evaluated at the interface,
$$(\mathbf{E}_i)_{\parallel}+(\mathbf{E}_r)_{\parallel}=(\mathbf{E}_t)_{\parallel} \tag{1}$$
$$\epsilon_1(\mathbf{E}_i)_{\bot}+\epsilon_1(\mathbf{E}_r)_{\bot}=\epsilon_2(\mathbf{E}_t)_{\bot} \tag{2}$$ | {
"domain": "physics.stackexchange",
"id": 30199,
"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, electromagnetic-radiation, reflection, polarization, boundary-conditions",
"url": null
} |
imu
Alas, the gyros are not perfect. Say that the gyros have bias errors, then these bias errors will also be integrated with time to result in the Euler angled "drifting". For this reason, an extended Kalman filter is often used to calculate the orientation of the IMU, aided by other measurements (magnetometer, accelerometer, and a GPS, for example). But that's another topic :) | {
"domain": "robotics.stackexchange",
"id": 1428,
"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": "imu",
"url": null
} |
6 commutator inside it contains its commutator with the whole group. the commutator $[H,G]$ (which coincides with the commutator $[G,H]$) is contained in $H$. proving normality
7 conjugates of generating set inside given a generating set for the whole group and a generating set for the subgroup, every conjugate of an element in the latter by an element in the former, as well as by its inverse, is in the subgroup. given a generating set $A$ for $G$ and $B$ for $H$, we have $aba^{-1} \in H$ and $a^{-1}ba \in H$ for all $a \in A, b\in B$. normality testing problem For finite groups, we need only check conjugates by elements in the generating set and not by their inverses. | {
"domain": "subwiki.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429147241161,
"lm_q1q2_score": 0.8332896003093418,
"lm_q2_score": 0.8459424334245618,
"openwebmath_perplexity": 1976.1152039348233,
"openwebmath_score": 0.859880268573761,
"tags": null,
"url": "https://groupprops.subwiki.org/w/index.php?title=Normal_subgroup&mobileaction=toggle_view_mobile"
} |
machine-learning, classification, accuracy, confusion-matrix
The choice of an evaluation measure depends on the task: for instance, if predicting a FN has life-threatening consequences (e.g. cancer detection), then recall is crucial. If on the contrary it's very important to avoid FP cases, then precision makes more sense (say for instance if an automatic missile system would mistaken identify a commercial flight as a threat).
The most common case though is certainly F1-score (or more generally F$\alpha$-score), which is suited to most binary classification tasks. | {
"domain": "datascience.stackexchange",
"id": 7607,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, classification, accuracy, confusion-matrix",
"url": null
} |
c++, api, stream
riffcpp::FourCC riffcpp::Chunk::id() {
m_stream.seekg(m_pos);
riffcpp::FourCC read_id;
m_stream.read(read_id.data(), read_id.size());
return read_id;
}
std::uint32_t riffcpp::Chunk::size() {
std::streamoff offs{4};
m_stream.seekg(m_pos + offs);
uint32_t read_size;
m_stream.read(reinterpret_cast<char *>(&read_size), 4);
return read_size;
}
riffcpp::FourCC riffcpp::Chunk::type() {
std::streamoff offs{8};
m_stream.seekg(m_pos + offs);
riffcpp::FourCC read_type;
m_stream.read(read_type.data(), read_type.size());
return read_type;
}
std::vector<char> riffcpp::Chunk::data() {
std::streamoff offs{8};
m_stream.seekg(m_pos + offs);
std::uint32_t data_size = size();
std::vector<char> read_data;
read_data.resize(data_size);
m_stream.read(read_data.data(), data_size);
return read_data;
}
riffcpp::ChunkIt riffcpp::Chunk::begin(bool no_chunk_id) {
std::streamoff offs{no_chunk_id ? 8 : 12};
return riffcpp::ChunkIt(m_stream, m_pos + offs);
} | {
"domain": "codereview.stackexchange",
"id": 34051,
"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++, api, stream",
"url": null
} |
satisfiability, boolean-algebra, propositional-logic
Anyways, on to my question. I don't understand why 2QBF != QBF. It seems to me for any formula $F$ and variables $x$, $y$ ranging over the booleans that $\forall x \exists y \ F$ is equivalent to $\exists y \forall x \ F$.
To demonstrate my thinking, I will consider the Shannon expansion of the universal quantifier.
\begin{align}
\forall x \exists y \ F \iff& (\exists y \ F[x \to T]) \land (\exists y \ F[x \to F]) \\\\
\exists y \forall x \ F \iff& \exists y \ (F[x \to T] \land F[x \to F])
\end{align}
Suppose $\exists y \ (F[x \to T] \land F[x \to F])$ is satisfiable. Then the same assignment would extend to both $\exists y \ F[x \to T]$ and $\exists y \ F[x \to F]$.
Suppose $\exists y \ (F[x \to T] \land F[x \to F])$ is unsatisfiable. Then at least one of $\exists y \ F[x \to T]$ or $\exists y \ F[x \to F]$ is also unsatisfiable.
Thus $\forall x \exists y \ F \iff \forall y \exists x \ F$. | {
"domain": "cs.stackexchange",
"id": 14837,
"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": "satisfiability, boolean-algebra, propositional-logic",
"url": null
} |
thermodynamics, temperature
Title: Chardonnay, air versus water I have a household fridge with a normal freezer section.
I have two identical bottles of inexpensive white wine at room temperature.
I have a mixing bowl, I put a liter or so of tap water in it.
I open the door once fairly briefly and
With bottle A I do this,
With bottle B I do this,
Later - say 10 to 20 minutes later (long before anything has frozen) - I pour the wine in to glasses.
Which wine got colder more quickly?
Part B (a completely different problem):
That was room temperature water. Say I have a bowl of water that is already about as cold as the air in the freezer (is that possible? how cold is air in a freezer?) In that case, which one wins?
(ie, which "transmits cold" to the bottle faster, air or water at same temperature?)
Please note that as it says above
long before anything has frozen
Ice is not involved here. | {
"domain": "physics.stackexchange",
"id": 40355,
"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, temperature",
"url": null
} |
Map terms[2]:
Term Meaning Example ([ilmath]T[/ilmath] is linear map)
Homomorphism Any linear transform [ilmath]T:(U,F)\rightarrow(V,F)[/ilmath]
Endomorphism Any linear operator [ilmath]T:(W,F)\rightarrow(W,F)[/ilmath]
Monomorphism (Embedding) Any injective linear transform [ilmath]T:(U,F)\rightarrow(V,F)[/ilmath] where [ilmath]T[/ilmath] is injective
Epimorphism Any surjective linear transform [ilmath]T:(U,F)\rightarrow(V,F)[/ilmath] where [ilmath]T[/ilmath] is surjective
Isomorphism Any bijective linear transform [ilmath]T:(U,F)\rightarrow(V,F)[/ilmath] where [ilmath]T[/ilmath] is a bijection
Automorphism Any bijective linear operator [ilmath]T:(W,F)\rightarrow(W,F)[/ilmath] where [ilmath]T[/ilmath] is a bijection
## Notations
Given a linear map [ilmath]T[/ilmath] it can be cumbersome to write [ilmath]T(v)[/ilmath] over and over again, so quite often we will write:
$Tv$ to mean $T(v)$
We will fall back to using brackets where needed though, for example: | {
"domain": "kisogo.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474905736684,
"lm_q1q2_score": 0.8156793293998338,
"lm_q2_score": 0.8244619177503205,
"openwebmath_perplexity": 2650.0816623552646,
"openwebmath_score": 0.959328293800354,
"tags": null,
"url": "https://www.maths.kisogo.com/index.php?title=Linear_transform"
} |
atomic-physics, terminology, notation, x-rays
I have checked many resources including the original paper in Nature from Siegbahn, which turned out to a single column paper. Didn't find a clear cut explanation when should we use alpha, beta and gamma. Additionally, what is the rule for associating a number with the Greek letter. Thanks. It is based on intensity: K$_\alpha$ is the strongest line, K$_\beta$ the second strongest, K$_\gamma$ the third strongest. Yes, in this case it is from the next higher shell (from $2p$, $3p$, $4p$ etcetera).
For L$_\alpha$ and L$_\beta$, again L$_\alpha$ is the stronger one, but the intensities are more similar than between the two strongest K lines. And both of these are transitions from $3d$ orbitals to $2p$. The difference is due to spin-orbit coupling between $2p_{1/2}$ and $2p_{3/2}$. And the much weaker third line L$_\gamma$ is due to transitions to a $2s$ hole. Manne Siegbahn could not know this in 1916. | {
"domain": "physics.stackexchange",
"id": 71635,
"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, notation, x-rays",
"url": null
} |
Note how the Distributive Law for integers is replaced by the Distributive Law for gcds and ideals in the $$2$$nd last equality in the proofs.
• +1 Another one of those disappointingly rare occasions on which someone who knows does the translation between different points of view so that the generalisation more general formulation has a clear context. – Mark Bennet Feb 23 '15 at 23:20
Another elementary proof, which uses only euclidean division.
Let $p$ dividing $ab$, but not $a$. Consider the following set of natural numbers: $$E=\bigl\{\,n\in \mathbf N^{*}\:;\:p\mid nb\,\bigr\}.$$ $E$ is not empty since it contains $p$ and $a$. Hence it contains a smallest element, $n_0$.
Claim: $n_0$ divides all elements of $E$. Indeed, let $n$ be any element of $E$. We want to prove the remainder of the division of $n$ by $n_0$ is $0$. So let's write: $n=qn_0+r, \enspace 0\le r <n_0$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795098861571,
"lm_q1q2_score": 0.8114838315265747,
"lm_q2_score": 0.8221891370573388,
"openwebmath_perplexity": 394.0002927101561,
"openwebmath_score": 0.9711299538612366,
"tags": null,
"url": "https://math.stackexchange.com/questions/1162373/if-p-is-a-prime-and-p-mid-ab-then-p-mid-a-or-p-mid-b?noredirect=1"
} |
independent. To obtain the marginal probability function of , , we sum out the other variables () in and obtain the following: Thus we can conclude that , , has a Poisson distribution with parameter. weights, strengths, times or lengths. 4) P(X 2 A;Y 2 B) = P(X 2 A)P(Y 2 B): Loosely speaking, X and Y are independent if knowing the value of one of the random variables does not change the distribution of the other ran-dom variable. Intuitively, two random variables X and Y are independent if knowing the value of one of them does not change the probabilities for the other one, thus the conditional probability is the same as the unconditional probability,. Notice, again, that a function of a random variable is still a random variable (if we add 3 to a random variable, we have a new random variable, shifted up 3 from our original random variable). An exponential random variable is a continuous random variable that has applications in modeling a Poisson process. Likelihood ratio order of the | {
"domain": "windspielebrandenburg.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9914225145862879,
"lm_q1q2_score": 0.8151368109280316,
"lm_q2_score": 0.8221891261650247,
"openwebmath_perplexity": 324.79155855465274,
"openwebmath_score": 0.798759937286377,
"tags": null,
"url": "http://skmi.windspielebrandenburg.de/independent-exponential-random-variables.html"
} |
organic-chemistry, reaction-mechanism
Several ring expansion products carrying vinylic bromo functionality were synthesized by opening of the geminal dibromobicyclo[n.1.0]alkanes ring. Dibromocarbene was formed from bromoform and potassium tert-butoxide in hexane. Its reaction with various cyclic alkenes was the resultant dibromobicyclo[n.1.0]alkanes. Then, opening was performed using $\ce{AgNO3}$ in various solvent systems, such as acetic acid/DMSO, acetic acid/DMF, $\ce{CH3OH}$/acetone, and $\ce{H2O}$/DMF.
References:
Russell J. Hewitta, Joanne E. Harvey, “Synthesis of C-furanosides from a D-glucal-derived cyclopropane through a ring-expansion/ring-contraction sequence,” Chem. Comm. 2011, 47(1), 421–423 (DOI: 10.1039/C0CC02244F).
Mesut Boz, Hafize Çalişkan, Ömer Zaím, “Silver Ion-Assisted Ring Expansions in Different Solvent Systems,” Turk. J. Chem. 2009, 33(1), 73–78 (DOI: 10.3906/kim-0807-3). | {
"domain": "chemistry.stackexchange",
"id": 12104,
"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",
"url": null
} |
If you want the single equation number to be centered vertically on the group of aligned equations, it's best to use a single equation environment containing a split environment.
A couple of additional suggestions: (1) Use the macro \invexpsqrt{\gamma_D} consistently (the second line doesn't contain them in your MWE). (2) Don't use auto-sized parentheses and bracket as they're a bit too large for the job at hand; use \Bigl and \Bigr instead.
With these adjustments in place, there's enough room to place the equation number right where you want it to be. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9539661015270469,
"lm_q1q2_score": 0.8146038270707107,
"lm_q2_score": 0.853912760387131,
"openwebmath_perplexity": 870.7119069471171,
"openwebmath_score": 0.9991564750671387,
"tags": null,
"url": "https://tex.stackexchange.com/questions/180406/split-environment-not-vertically-centering-equation-number"
} |
electrostatics, electric-circuits, electrical-resistance, capacitance
Title: How big of a capacitor would I need to release 5 amps for 0.2 seconds? Just what the title says, 5 amps for 0.2 seconds. Please bear in mind that I have absolutely no grasp on electrical wiring, so I would appreciate simple terms.
What I need to do is release a burst of electricity for a short time. Not sure about Voltage, but the current should average around 5.2 amps. A 0.3 farad capacitor would be a bit large for my purposes, but if that's what I need, that's what I need. When a capacitor of capacitance C is charged to a voltage V, and discharged through a resistor R, then the current will decay exponentially:
$$I = I_0 e^{-t/RC}$$
The voltage on the capacitor will follow the same exponential decay,
$$V = V_0 e^{-t/RC}$$
To answer your question one would have to make some assumptions. You will have to do the calculation with your own numbers to get a solution to your problem. | {
"domain": "physics.stackexchange",
"id": 25889,
"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, electric-circuits, electrical-resistance, capacitance",
"url": null
} |
deep-learning, classification, comparison, terminology, prediction
between explanatory and predictive modeling, to discuss its sources, and to
reveal the practical implications of the distinction to each step in the modeling process.
What is the difference between classification and prediction?, from KDnuggets
If one does a decision tree analysis, what is the result? A classification? A prediction?
Gregory Piatetsky-Shapiro answers:
The decision tree is a classification model, applied to existing data. If you apply it to new data, for which the class is unknown, you also get a prediction of the class.
The assumption is that the new data comes from the similar distribution as the data you used to build your decision tree. In many cases this is a correct assumption and that is why you can use the decision tree for building a predictive model.
When Classification and Prediction are not the same?
Gregory Piatetsky-Shapiro answers: | {
"domain": "ai.stackexchange",
"id": 1678,
"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, classification, comparison, terminology, prediction",
"url": null
} |
conventions
In Lagrangian mechanics, we indeed take the generalized velocities $\dot{q} = (\dot{q}^1,\dots,\dot{q}^n)$ as that additional data, so that the $2n$-tuple $(q,\dot{q})$ describes the state completely. Along a trajectory that is a solution to the equations of motion, $\dot{q}(t) = \frac{\mathrm{d}}{\mathrm{d}t}q$ holds, i.e. $\dot{q}$ actually describes the velocity along the trajectory. The equations of motion are $n$ second-order differential equations, the Euler-Lagrange equations
$$ \frac{\partial L}{\partial q^i} - \frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial L}{\partial\dot{q}^i} = 0$$
for the Lagrangian $L(q,\dot{q},t)$.
In Hamiltonian mechanics, the generalized momenta $p = (p_1,\dots,p_n)$ are used instead of the velocities, and the equations of motion are $2n$ first-order differential equations
$$ \dot{p} - \frac{\partial H}{\partial q} \quad \wedge \quad \dot{q} = \frac{\partial H}{\partial p}$$ | {
"domain": "physics.stackexchange",
"id": 25761,
"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": "conventions",
"url": null
} |
Here's an example solution (I use +, - and blanks here instead of R, L and O since it's easier to grasp I think) which has a little bit of structure making it easy to verify the requirements.
1 2 3 4 5 6 7 8 9 A B C
+ + - + - - + -
+ + + - - - - +
+ - + + - - - +
EDIT: to explain once again what all this means, in the first weighing we pit coins 1, 4, 6 and 10 against coins 5, 7, 9 and 12. The second weighing has 2, 4, 5, 11 against 6, 7, 8, 10 and the last one has 3, 5, 6, 12 against 4, 8, 9, 11. So the weighings are always 4 against 4, and as mentioned, the result of weighing #1 don't matter at all for how we choose to handle the other weighings. It's all static.
If coin 1 is heavy, for example, we'll get "Left, balanced, balanced". No other coin can do that by being heavy (there's no other column like this one) and no other coin can do that by being light (since there's no column that goes "- blank blank"). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357573468176,
"lm_q1q2_score": 0.8301907546483563,
"lm_q2_score": 0.8479677564567912,
"openwebmath_perplexity": 388.32494794833383,
"openwebmath_score": 0.7293927669525146,
"tags": null,
"url": "http://math.stackexchange.com/questions/129532/a-logic-puzzle-involving-a-balance?answertab=active"
} |
angular-momentum, momentum, conservation-laws, symmetry, noethers-theorem
Title: Elementary argument for conservation laws from symmetries *without* using the Lagrangian formalism It is well known from Noether's Theorem how from continuous symmetries in the Lagrangian one gets a conserved charge which corresponds to linear momentum, angular momentum for translational and rotational symmetries and others.
Is there any elementary argument for why linear or angular momentum specifically (and not other conserved quantities) are conserved which does not require knowledge of Lagrangians? By elementary I mean, "if this is not so, then this unreasonable thing occurs".
Of course, we can say "if we want our laws to be the same at a different point in space then linear conservation must be conserved", but can we derive mathematically the expression for the conserved quantity without using the Lagrangian? | {
"domain": "physics.stackexchange",
"id": 98199,
"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": "angular-momentum, momentum, conservation-laws, symmetry, noethers-theorem",
"url": null
} |
that the first, third, and fifth tosses are Heads, and all the others are Tails? 0:45 Writing known components. An event with a probability of 1 can be considered a certainty: for example, the probability of a coin toss resulting in either "heads" or "tails" is 1, because there are no other options, assuming the coin lands flat. 001965401545233 0. An unfair coin has a probability of coming up heads of 0. They play the game with the following rules. A box contains 5 fair coins and 5 biased coins. Using your assumptions, and assuming independence of coin tosses, the probability of getting heads N times in a row is (0. Unfair coin probability? Two coins A and B are independent. The sample space is divided in two groups, "heads are more" and "tails are more". Your task is to determine which one is the unfair coin. However in this case since its an unfair coin, the probability of getting heads is 0. Then a second coin is drawn at random from the box (without replacing the first one. The | {
"domain": "7invaligia.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513926334712,
"lm_q1q2_score": 0.8260200873426787,
"lm_q2_score": 0.8376199572530448,
"openwebmath_perplexity": 318.3028339010285,
"openwebmath_score": 0.7951210737228394,
"tags": null,
"url": "http://7invaligia.it/fgoe/unfair-coin-probability.html"
} |
quickly evaluate the determinant of a square is... Matrix can be arbitrarily close to zero, a is actually not ill conditioned positive or negative according whether. Matrix as singular mind that the identity matrix papers, or in a number! Are given in Ostrowski 's papers, or |A| down the page for more examples and solutions two. The fact that it is denoted det ( a ) the value of word. Or nondegenerate matrix or nondegenerate matrix 1 ) in the same way in which that of other matrices found... And upper bounds we declared single two dimensional arrays Multiplication of size the! Having any inverse matrix a is not close to being singular without conveying information singularity! Are listed below cookies to ensure you get the best experience elements of the n-dimensional parallelepiped spanned by the.... J n times does not change the value of determinant remains same ( value does not ). Colleges and universities consider ACE credit recommendations in determining the applicability to their | {
"domain": "fashionhair.cz",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765610497293,
"lm_q1q2_score": 0.8079533569868047,
"lm_q2_score": 0.8244619199068831,
"openwebmath_perplexity": 556.6820512676209,
"openwebmath_score": 0.8155076503753662,
"tags": null,
"url": "http://fashionhair.cz/mantel-shelf-qlxa/d33066-identity-matrix-determinant"
} |
c#, mvc, asp.net-mvc-4, url-routing
Title: Extending the MVC Routecollection I'm currently developping an MVC framework on which I will be writing my websites. This is done through the usage of a starter kit.
In standard MVC, your routes are registered like the following:
/// <summary>
/// Registers the routes.
/// </summary>
/// <param name="routes">The <see cref="RouteCollection" /> to which the routes will be added.</param>
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
// All the required routes are placed here.
routes.MapRoute("Website", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
}
But since it's a framework, there's a need to add routes to the collection, so I started with an interface:
public interface IMvcRouteExtender
{
#region Methods | {
"domain": "codereview.stackexchange",
"id": 15541,
"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#, mvc, asp.net-mvc-4, url-routing",
"url": null
} |
classical-mechanics, fluid-dynamics, earth
What happens then?
I'm aware that a body would oscillate through the core - the water can not, if the ocean does not run dry assume - at least if the water coming in can mostly fill the diameter.
First, I thought the water will just fill the hole, and directly end up in an equilibrium regarding gravity and pressure. But that assumes the water, filling the diameter at the ocean ground will do so in the whole tunnel; But doesn't the stream of water get thinner, as it accelerates up to the center of the earth, and thicker from there? So will it oscillate for a while? | {
"domain": "physics.stackexchange",
"id": 14939,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, fluid-dynamics, earth",
"url": null
} |
navigation, gmapping
Title: What to do after installing Gmapping
Hello,
what is the next step after installing the Gmapping package from (GitHub)
i install it in a workspace,
my lidar is working with Rviz
,,
what is next ?
Originally posted by marawy_alsakaf on ROS Answers with karma: 101 on 2017-10-30
Post score: 0
Perhaps start playing with this package? Look at it's documentation here. It will give you info about the system. Then it's up to you to play with it.
Originally posted by l4ncelot with karma: 826 on 2017-10-31
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 29226,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, gmapping",
"url": null
} |
quantum-mechanics, research-level, bells-inequality
Also in the last reference by Brunner et al, they say that the CHSH inequality can also be viewed as a game. Is there a similar kind of game from which the $I_{3322}$ inequality can be derived.
P.S.- I am not a physicist, but a mathematician, so it would be be helpful if minimal physics is used.
Thank you. Bell inequalities are equivalent if you can map one to another by | {
"domain": "physics.stackexchange",
"id": 66434,
"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, research-level, bells-inequality",
"url": null
} |
general-relativity, black-holes, metric-tensor, coordinate-systems
$$0=[h(r',t')\partial_{t'},\partial_{r''}]=h \partial_{t'} u_{t'}+ h \partial_{t'} u_{r'}-u_{t'}\partial_{t'} h -u_{r'}\partial_{r'} h.$$
Such vector field you can find by requiring these two pairs to vanish independently:
$$0=h \partial_{t'} u_{t'} - u_{t'}\partial_{t'} h $$
$$0= h \partial_{t'} u_{r'}-u_{r'}\partial_{r'} h $$
These can be rewritten to the form :
$$ \partial_{t'} u_{t'} =H_{t'} u_{t'} $$
$$\partial_{t'} u_{r'}=H_{r'}u_{r'},$$
where $H_{i}=\partial_i h / h$ are known functions.These first order partial differential equations can be always solved, so indeed every vector field of the form $$\partial_{t''}=h(r',t')\partial_{t'}$$ leads to null coordinate also (assuming $h \neq 0$). Which one of all possible null coordinates you want is then up to you and the application. | {
"domain": "physics.stackexchange",
"id": 65474,
"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": "general-relativity, black-holes, metric-tensor, coordinate-systems",
"url": null
} |
python, excel, pandas, statistics, data-visualization
def makeSS(all30, all60, all90):
# creates (4) dataframes in pandas
# all30/df1 - 30day dataframe from all30 dict
# all60/df2 - 60day dataframe from all60 dict
# all90/df3 - 90 day dataframe from all90 dict
# df4 - separate sheet for chart data
df1 = pd.DataFrame(
all30,
index=['Created', 'Severity', 'Owner', 'Name', 'Closed',
'Resolution']).transpose()
df2 = pd.DataFrame(
all60,
index=['Created', 'Severity', 'Owner', 'Name', 'Closed',
'Resolution']).transpose()
df3 = pd.DataFrame(
all90,
index=['Created', 'Severity', 'Owner', 'Name', 'Closed',
'Resolution']).transpose()
df4 = pd.DataFrame({
'Created': (df1.count()['Created']),
'Closed': (df1.count()['Closed']),
'Owner': (df1['Owner'].value_counts().to_dict()),
'Resolution': (df1['Resolution'].value_counts().to_dict()), | {
"domain": "codereview.stackexchange",
"id": 36287,
"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, excel, pandas, statistics, data-visualization",
"url": null
} |
ros, tf-tutorial, transform-broadcaster, transform
Originally posted by ayush_dewan with karma: 1610 on 2013-02-15
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by Claudio on 2013-02-15:
Well guess what...
My code wasn't beeing executed...
I fiddled to get the config right, and now I have it.
Thanks! | {
"domain": "robotics.stackexchange",
"id": 12906,
"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, tf-tutorial, transform-broadcaster, transform",
"url": null
} |
genetics, cell-biology, bioinformatics, cancer
The image is from the Wikipeadiapage on EGFR.
You can see, that the ligand binds extracellular to the receptor, which is then phosphorylated, and then passes the signal downstream for example to Ras-Raf-Mek-Erk and then into the nucleur (in fact, activated Erk enters the nucleus).
This cascade also shows, why these receptors are often mutated in cancers: They are involved in the regulation of genes important for survival, proliferation and differentiation, which is very important for cancer cells. ErbB2 for example is mutated in about 30% of breast cancers. These mutations often lead to a constitutive active receptor which is permanently phosphorylated independent of ligand binding. This leads to a permanent activation of the downstream pathways which is obviously not a good thing, since these genes are normally under a very tight regulation. | {
"domain": "biology.stackexchange",
"id": 1757,
"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, cell-biology, bioinformatics, cancer",
"url": null
} |
php
$max1 = $offset;
$max2 = count($elements);
for ($i=0; ($i<$max1 && $i<$max2); $i++) {
unset($elements[$i]);
$offset--;
}
$max1 = $offset;
$max2 = count($elements);
for ($i=0; ($i<$max1 && $i<$max2); $i++) {
unset($elements[$i]);
$offset--;
}
var_dump($elements);
// Result: array(11) { [3]=> int(3) [4]=> int(4) [5]=> int(5) [6]=> int(6) [7]=> int(7) [8]=> int(8) [9]=> int(9) [10]=> int(10) [11]=> int(11) [12]=> int(12) [13]=> int(13) } | {
"domain": "codereview.stackexchange",
"id": 30546,
"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",
"url": null
} |
c++, performance, reinventing-the-wheel, c++20
16 | UtilityTimer() = default;
| ^~~~~~~~~~~~
UtilityTimer.h:16:9: warning: ‘UtilityTimer::end’ should be initialized in the member initialization list [-Weffc++]
main.cpp: In function ‘int main(int, char**)’:
main.cpp:51:32: warning: catching polymorphic type ‘class ShowHelpMessage’ by value [-Wcatch-value=]
51 | catch (ShowHelpMessage sh)
| ^~
main.cpp:56:29: warning: catching polymorphic type ‘class showVersions’ by value [-Wcatch-value=]
56 | catch (showVersions sv)
| ^~
main.cpp:60:31: warning: catching polymorphic type ‘class std::exception’ by value [-Wcatch-value=]
60 | catch (std::exception ex)
| ^~
g++-12 -std=c++20 -Wall -Wextra -Wwrite-strings -Wno-parentheses -Wpedantic -Warray-bounds -Wconversion -Weffc++ -Wuseless-cast -c -o ProgramOptions.o ProgramOptions.cpp | {
"domain": "codereview.stackexchange",
"id": 44065,
"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++, performance, reinventing-the-wheel, c++20",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.