text stringlengths 1 1.11k | source dict |
|---|---|
quantum-mechanics, electromagnetism, harmonic-oscillator, quantum-electrodynamics, commutator
$$\langle\alpha e^{i\omega_{n} t}|\hat{E}|\alpha e^{i\omega _{n}t}\rangle=-\sqrt{\frac{2}{\epsilon_{0}V}}\sin(k_{n}z)\langle\alpha e^{i\omega_{n} t}|\hat{P}|\alpha e^{i\omega_{n} t}\rangle=\sqrt{\frac{4\omega_{n}\hbar}{\epsilon_{0}V}}|\alpha|\sin(k_{n}z)\cos(\omega_{n} t-\theta-\pi/2)$$
for $\alpha=re^{i\theta}$
we see that the amplitude of a coherent state oscillates in time, returning the classical standing wave image, where a real valued $\alpha$ corresponds to the assumption that $\langle E(t)\rangle$ is at the maximum value of its oscillation at $t=0$.
So in conclusion, my confusion was mistaking this oscillation in the gif as oscillation of a light wavepacket between the mirrors of the cavity, when it in fact (in the context i'm considering) represents the oscillation of the amplitude of the semi-classical electric field. Finally, the quadrature operators are equivalent to the field operators up to a constant. | {
"domain": "physics.stackexchange",
"id": 92697,
"lm_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, electromagnetism, harmonic-oscillator, quantum-electrodynamics, commutator",
"url": null
} |
Case 2: $n_2(G) = 3$. Since $n_2(G) = |G:N_G(S)|$ where $S \in Syl_2(G)$, the subgroup $N_G(S)$ has index $3$.
Case 3: $n_2(G) = 5$. Then as in case 2, the normalizer of any Sylow $2$-subgroup has index $5$.
Case 4: $n_2(G) = 15$. Here, I use the following theorem, proved earlier in the chapter.
Suppose that $G$ is a finite group such that $n_p(G) > 1$, and choose distinct Sylow $p$-subgroups $S$ and $T$ of $G$ such that the order of $|S \cap T|$ is as large as possible. Then $n_p(G) \equiv 1$ mod $|S:S \cap T|$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9888419664501421,
"lm_q1q2_score": 0.8014355578159268,
"lm_q2_score": 0.8104789086703225,
"openwebmath_perplexity": 43.63598246465338,
"openwebmath_score": 0.9426373243331909,
"tags": null,
"url": "https://math.stackexchange.com/questions/1531251/if-g-120-then-g-has-a-subgroup-of-index-3-or-5-or-both"
} |
general-relativity, differential-geometry
\begin{equation}
ds^2 = \left[ 1 - \frac{2m(r)}{r} \right]^{-1} dr^2 + r^2 d\phi^2,
\end{equation}
where $m(r)$ is the mass enclosed by the sphere of radius $r$.
I then created a surface in three-dimensional flat space, using coordinates $(x', y', z')$. Assuming it was rotationally symmetric (like the spacetime), I just chose the height $h$ of the surface at each point above the $x'$-$y'$ plane. Now switch to polar coordinates $(r', \phi')$, and the line element of the surface is
\begin{equation}
ds'^2 = \left[ 1 + \left( \frac{dh} {dr'} \right)^2 \right] dr'^2 + r'^2 d\phi'^2,
\end{equation}
where $h(r')$ is some function that I can solve for just by equating the terms in the two line elements. This will involve a little integration of $m(r)$, but it's not too hard numerically. The result is a surface in flat 3-d space with the same intrinsic metric as the slice through the center of the warped spacetime. | {
"domain": "physics.stackexchange",
"id": 32855,
"lm_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, differential-geometry",
"url": null
} |
c#, programming-challenge
if (number == 0)
return 0;
while (number % 2 == 0)
number = number >> 1;
while (number > 0)
{
if(number%2 == 0)
{
currGapSize++;
}
else
{
maxGapSize = Math.Max(currGapSize, maxGapSize);
currGapSize = 0;
}
number = number >> 1;
}
return maxGapSize;
} | {
"domain": "codereview.stackexchange",
"id": 44166,
"lm_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#, programming-challenge",
"url": null
} |
physical-chemistry, thermodynamics, phase
So in summary, vapor pressure is the maximum gas pressure possible at that temperature. The liquid always tries to expand and attain vapor pressure, and in case the inside pressure is greater than the vapor pressure, the inside of the liquid can't do so, otherwise it would boil. However, the surface of the liquid, due to imbalanced forces, can do it at any point by evaporating, and thus forming gas above it till vapor pressure is attained. | {
"domain": "chemistry.stackexchange",
"id": 8468,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, thermodynamics, phase",
"url": null
} |
$$\begin{cases} a^2 = |z-1|^2 = \rho^2 + 1 - (z + \bar{z})\\ b^2 = |z-\omega|^2 = \rho^2 + 1 - (z\omega + \bar{z}\omega^2)\\ c^2 = |z-\omega^2|^2 = \rho^2 + 1 - (z\omega^2 + \bar{z}\omega) \end{cases} \implies a^2 + b^2 + c^2 = 3(\rho^2 + 1)$$ Thanks to the identity $$\omega^2 + \omega + 1 = 0$$, all cross terms involving $$\omega$$ explicitly get canceled out.
Doing the same thing to $$a^4 + b^4 + c^4$$, we get \begin{align}a^4 + b^4 + c^4 &= \sum_{k=0}^2 (\rho^2 + 1 + (z\omega^k + \bar{z}\omega^{-k}))^2\\ &= \sum_{k=0}^2\left[ (\rho^2 + 1)^2 + (z\omega^k + \bar{z}\omega^{-k})^2\right]\\ &= 3(\rho^2 + 1)^2 + 6\rho^2\end{align} Combine these, we obtain
$$16S'^2 = 3(\rho^2+1)^2 - 12\rho^2 = 3(1 - \rho^2)^2$$ Since $$M$$ is inside triangle $$ABC$$, we have $$\rho^2 \le 1$$. As a result,
$$S' = \frac{\sqrt{3}}{4}(1-\rho^2) \le \frac{\sqrt{3}}{4} = \frac13 S$$
Solution 2 - using circle inversion. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713887451681,
"lm_q1q2_score": 0.8470020955475573,
"lm_q2_score": 0.8596637487122111,
"openwebmath_perplexity": 183.64810865693417,
"openwebmath_score": 0.955951452255249,
"tags": null,
"url": "https://math.stackexchange.com/questions/3004081/m-is-a-point-in-an-equalateral-abc-of-area-s-s-is-the-area-of-the-tria"
} |
### Show Tags
30 Nov 2017, 23:30
D
Side of the cube =1 cm
Distance between the opposite vertices = sqrt(3)
Hence the distance between the vertex to the center of the cube =sqrt(3)/2
Sent from my iPhone using GMAT Club Forum
_________________
Help with kudos if u found the post useful. Thanks
Kudos [?]: 38 [0], given: 89
VP
Joined: 22 May 2016
Posts: 1131
Kudos [?]: 403 [1], given: 645
If the volume of a cube is 1 cubic centimeter, then the distance from [#permalink]
### Show Tags
01 Dec 2017, 07:47
1
KUDOS
Bunuel wrote:
If the volume of a cube is 1 cubic centimeter, then the distance from any vertex to the center point inside the cube is
(A) 1/2 cm
(B) √2/2 cm
(C) √2 cm
(D) √3/2 cm
(E) √3 cm
From one vertex of a cube to the center is half the length of the "space" diagonal that runs from one vertex, through the center, to a vertex on the opposite side.
The length of the space diagonal, D, is found with a variation on the Pythagorean theorem:
$$L^2 + W^2+ H^2 = D^2$$ | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 1,
"lm_q1q2_score": 0.8056321889812553,
"lm_q2_score": 0.8056321889812553,
"openwebmath_perplexity": 5146.861288203336,
"openwebmath_score": 0.651248574256897,
"tags": null,
"url": "https://gmatclub.com/forum/if-the-volume-of-a-cube-is-1-cubic-centimeter-then-the-distance-from-254559.html"
} |
Start by considering how the three A's are arranged relative to B's:
Case 1. You can have the three A's as the first three letters followed by a B, and you don't care how the remaining 8 letters are arranged:: AAABxxxxxxxx.
Case 2. The first N letters can be anything, followed by the pattern BAAAB, and then the remaining 7-N letters can be anything; for example if N=2: xxBAAABxxxxx. This is valid for N=0 to N=7.
Case 3. The first 8 letters can be anything, followed by BAAA for the last four letters: xxxxxxxxBAAA.
For case 1 the number of ways that the last 8 letters can be arranged, given that they consist of 3 A's and 5 B's is:
$
\left( \array 8 \\ 3 \array \right) = \frac {8 \cdot 7 \cdot 6}{3!} = 56.
$
For case 2 the number of ways that the remaining 7 letters can be arranged, given that there are 3 A's and 4 B's, is:
$
\left( \array 7 \\ 3 \array \right) = \frac {7 \cdot 6 \cdot 5}{3!} = 35.
$ | {
"domain": "askmehelpdesk.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462201288631,
"lm_q1q2_score": 0.8493015600022202,
"lm_q2_score": 0.8596637577007393,
"openwebmath_perplexity": 671.7576856578618,
"openwebmath_score": 0.7662773132324219,
"tags": null,
"url": "https://www.askmehelpdesk.com/showthread.php?t=774505&s=4a9447fb39bd8f5a08cf16583b410828&p=3583346"
} |
HP 11C real root finder [Newton Method]
01-09-2014, 11:59 PM
Post: #1
Carlos CM (Mexico) Junior Member Posts: 35 Joined: Dec 2013
HP 11C real root finder [Newton Method]
LBL 0
RCL 1
GSB 1
RCL 1
GSB 2
/
CHS
RCL 1
+
STO 3
RCL 1
-
ABS
RCL 2
X>Y?
RTN
RCL 3
STO 1
GTO 0
LBL 1
f(x)=0 code
LBL 2
f'(x)=0 code
R1: old value (or initial value)
R2: Tolerance of error (0.001, 0.0001, 0.000000001 etc)
THE RESULT:
R3: new value (root)
EXAMPLE
Find the root of f(x)=x^3 - 3x^2-6x+8
rewritten as f(x)= [(x-3)x-6]x +8
f(x) code:
LBL1
ENTER
ENTER
ENTER
3
-
*
6
-
*
8
+
RTN
f'(x)= 3x(x-6)-6
f'(x) code
LBL 2
ENTER
ENTER
6
-
*
3
*
6
-
RTN
The roots are [-2, 1, 4]
give a initial value, for example: -3
-3 STO 1
give a tolerance of error, for example: 0.0001
0.0001 STO 2
BEGIN THE PROGRAM...
GSB 0
runnning...
when the error < TOL the program stop and display:
0.0001
you can find the root in the register 3
RCL 3
DISPLAY: -2.0001
try with initial value = 2 | {
"domain": "hpmuseum.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9838471620993537,
"lm_q1q2_score": 0.8616405575001446,
"lm_q2_score": 0.8757870029950159,
"openwebmath_perplexity": 5919.442975938707,
"openwebmath_score": 0.4317140281200409,
"tags": null,
"url": "https://www.hpmuseum.org/forum/thread-383.html"
} |
mechanical-engineering, design, gears
Title: Does the rack for a rack and pinion often have or need to have the involute profile? I am looking at designing a rack and pinion system that will be laser cut out of some plastic. While the cad system that I am using has a spur gear generator, I was looking at the design of the rack gears. I thought that it needed an involute type profile, but many of the references that I see have a flat profile instead of an involute type profile. For example, this metal rack gear from McMastercarr has a seemingly flat profile. | {
"domain": "engineering.stackexchange",
"id": 3261,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, design, gears",
"url": null
} |
arduino, communication
master code=>
The Arduino IDE isn't showing any bug, but the code is not working at all. Although I am giving a pulse in pin 7 of the Nano, the LED is remaining off in the Uno. I am at a loss now. I have a lot to do after this and my project submission is knocking at the door. Please help me as soon as possible. I had connected some pins the wrong way.
I had connected the "EN" pin with 5V even after pairing. I was out of my brain. As soon as it came to my sight I disconnected the "EN" pin from 5V. After a few seconds it started to work.... | {
"domain": "robotics.stackexchange",
"id": 1370,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "arduino, communication",
"url": null
} |
Dragon Curve” by Todd Rowland, the original Polynomial Trees by Michael Trott (check also his recent posts (1, 2, 3) about other creative ways of doodling in Mathematica ), and the classic “Limits of Tree Branching” by Stephen Wolfram.Finally, if you liked Theodore Gray’s “Tree Bender”, here you will find my adapted CDF for exploring binary trees with color and with meaningful parameters to describe them precisely.That’s all for today! Enjoy, and let me know if you had been lucky enough to find a tree worthy of worship ;-). | {
"domain": "wolfram.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765598801371,
"lm_q1q2_score": 0.8208479341266143,
"lm_q2_score": 0.8376199673867851,
"openwebmath_perplexity": 14498.064466761258,
"openwebmath_score": 0.5283409953117371,
"tags": null,
"url": "http://community.wolfram.com/groups/-/m/t/108323?source=frontpage"
} |
we will use the tangent line to approximate the value of a function near at a Regular Point of a Surface. interval , then has both a This becomes 3x^2 -12x= 0 We will also determine the local extremes of the In this section we learn to reverse the chain rule by making a substitution. numbers x = 0,2. In this section we learn the Extreme Value Theorem and we find the extremes of a The first derivative can be used to find the relative minimum and relative maximum values of a function over an open interval. Since we know the function f(x) = x2 is continuous and real valued on the closed interval [0,1] we know that it will attain both a maximum and a minimum on this interval. Critical points are determined by using the derivative, which is found with the Chain Rule. This video explains the Extreme Value Theorem and then works through an example of finding the Absolute Extreme on a Closed Interval. need to solve (3x+1)e^{3x} = 0 (verify) and the only solution is x=\text {-}1/3 (verify). In | {
"domain": "pamelalandau.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787868650145,
"lm_q1q2_score": 0.8000875813218201,
"lm_q2_score": 0.8104789040926008,
"openwebmath_perplexity": 284.3046166581633,
"openwebmath_score": 0.7920138239860535,
"tags": null,
"url": "https://www.pamelalandau.com/dumka-election-jzxqnnl/extreme-value-theorem-open-interval-db6691"
} |
water, distillation, chemistry-in-fiction
Thx All it does is distill water while keeping heat within the system. There isn't much detail provided about it but heres what I can say. | {
"domain": "chemistry.stackexchange",
"id": 4668,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "water, distillation, chemistry-in-fiction",
"url": null
} |
python, tkinter, shuffle
Constants are uppercase by convention
A constant is a value that never changes, as a convention they are uppercase, for example WORDS.
Multiline widgets
There is no need to make a new widget for each line, you can use the same widget for many lines. | {
"domain": "codereview.stackexchange",
"id": 17364,
"lm_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, tkinter, shuffle",
"url": null
} |
python, beginner, python-2.x
Lastly, you may want to represent a binary number using the most natural way - as a number. Aside from space consideration, most languages (including Python) have standard binary (often called bitwise) operations. | {
"domain": "codereview.stackexchange",
"id": 6541,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-2.x",
"url": null
} |
java, android
Title: Review my PuzzlesView Android component I've began to read the book Clean Code by Robert Martin, I had a strong desire to learn how to write code that's easy for others to understand. Please criticize my code.
PuzzlesView.java
// Using of PuzzlesView:
// dimension = new Dimension(rows, columns)
// puzzlesView.set(bitmap, dimension);
// after the setting the puzzlesView will scale the bitmap to its size,
// divide the scaled bitmap by puzzles and show mixed puzzles.
// if you want to mix the puzzles again, then use the call mix()
// puzzlesView.mix();
public class PuzzlesView extends View {
private final int LATTICE_WIDTH = 2;
private final float ALLOWABLE_ERROR = 0.4f; | {
"domain": "codereview.stackexchange",
"id": 3940,
"lm_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, android",
"url": null
} |
reinforcement-learning, policy-gradients
Policy gradient methods also include Actor-Critic approaches which learn both the policy and an associated value function (usually state value $V(s)$). This is a more advanced algorithm than REINFORCE, in that it can be applied to continuous (non-episodic) problems, and updates estimates on every step. One popular Actor-Critic approach is A3C | {
"domain": "datascience.stackexchange",
"id": 3458,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reinforcement-learning, policy-gradients",
"url": null
} |
spectroscopy, x-rays, x-ray-crystallography
Update
The way of getting a spectrum by scanning the energy with a monochromator, as described above, is rather slow. In some cases one might be interested how a spectrum changes, e.g., in a chemical reaction. In this case it is preferred to have "white" light at the point of reaction. One could than diffract the white beam and put "several" detectors in the opening angle. A second approach, from which I know that it is done, is the following: The diffraction is before the sample, but the energy resolved diverging beam is refocused onto the sample, such that at the sample one has white light. After transmission, the different energies diverge again. As the energies have defined angles, an angle resolved intensity measurement can be recalculated in the according spectrum. (E.g. a CCD and one knows which pixel, refers to which angle and, therefore, energy). Note that these are setups for transmission and require samples that are transparent in the energy region of interest. | {
"domain": "physics.stackexchange",
"id": 21374,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spectroscopy, x-rays, x-ray-crystallography",
"url": null
} |
ros, kinect, turtlebot, ros-hydro, 3d-visualization
process[camera/depth_points-10]: started with pid [9950]
process[camera/register_depth_rgb-11]: started with pid [10021]
process[camera/points_xyzrgb_sw_registered-12]: started with pid [10090]
process[camera/depth_registered_rectify_depth-13]: started with pid [10174]
process[camera/points_xyzrgb_hw_registered-14]: started with pid [10249]
process[camera/disparity_depth-15]: started with pid [10310]
process[camera/disparity_registered_sw-16]: started with pid [10358]
process[camera/disparity_registered_hw-17]: started with pid [10391]
process[depthimage_to_laserscan-18]: started with pid [10438]
terminate called after throwing an instance of 'openni_wrapper::OpenNIException'
what(): virtual void openni_wrapper::OpenNIDevice::startImageStream() @ /tmp/buildd/ros-hydro-openni-camera-1.9.2-0precise-20140720-0559/src/openni_device.cpp @ 224 : starting image stream failed. Reason: Failed to send a USB control request! | {
"domain": "robotics.stackexchange",
"id": 18902,
"lm_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, kinect, turtlebot, ros-hydro, 3d-visualization",
"url": null
} |
# Reconstructing the results of a 6-team soccer tournament
6 teams played in a "round-robin" soccer tournament, in which each team played each other team once. Each game had 3 possible outcomes: team 1 won, draw, or team 2 won. The winning team received 3 points, while the losing team received 0 points. In case of a draw, both teams received 1 point. At the end of the tournament each team obtained a different number of points and that number was prime. The team that came last drew with the team that came second. Based on this information, can you reconstruct the result of each game? A solution exists and it is unique.
Bonus question: what happens if we remove the sentence about the last team? Do more solutions appear and can you find them?
Here is a similar question: Reconstructing the results of a 5-team soccer tournament
Good luck!
First: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750525759487,
"lm_q1q2_score": 0.8095422299995939,
"lm_q2_score": 0.8198933403143929,
"openwebmath_perplexity": 1018.8767921454651,
"openwebmath_score": 0.38719791173934937,
"tags": null,
"url": "https://puzzling.stackexchange.com/questions/92000/reconstructing-the-results-of-a-6-team-soccer-tournament"
} |
c++, linked-list
if (curr == nullptr) {
out << "The sorted list is empty";
}
while (curr) {
out << curr->data << " ";
curr = curr->next;
}
out << std::endl;
}
// MUTATORS
/** Creates a new Node (dynamically allocated) where Node member data = item.
Inserts in the correct location of the sorted list (ascending order), and increases m_numItems by 1.
@return true if the new Node with item was added successfully, otherwise returns false. */
bool SortedList::insert(int item) {
Node* curr_node = m_head;
if (curr_node == nullptr) {
insertFront(item);
++m_numItems;
return true;
}
Node* prev_node = nullptr;
while (curr_node != nullptr) {
; if (item <= curr_node->data) {
if (curr_node->prev == nullptr) {
insertFront(item);
}
else {
insertBefore(curr_node, item);
} | {
"domain": "codereview.stackexchange",
"id": 44009,
"lm_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++, linked-list",
"url": null
} |
python, python-3.x, parsing, meta-programming
if self.skip_error:
self.errors.append(err)
self.feed(1)
else:
panic(*err, self.text)
class MatchRuleWrapper:
"""
Encapsulates a parser rule definition and tests it against the
parser stack, if a match is found, it calls its
callback function that does its thing on the parser stack.
"""
def __init__(self, func, rules, priority=0):
self.func = func
self.rules = rules
self.priority = priority
def __call__(self, parser, *args):
n = len(parser.stack)
if len(self.rules) > n or len(self.rules) > n:
return | {
"domain": "codereview.stackexchange",
"id": 37840,
"lm_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, parsing, meta-programming",
"url": null
} |
a simple formula. You can specify the order of the Taylor polynomial. n are zero, rewrite the series and pick one in which the terms are nonzero. Uniqueness of the Taylor series. We are working with infinite sums of complicated functions and are answering questions about convergence. This program makes use of C concepts like For loop. “Any time. Of course, the statement "if f has a power series representation" is an important one. Binomial series Hyperbolic functions. One can attempt to use the Taylor series as-is and generalize the form of the coefficients, or one can use manipulations such as substitution, multiplication or division, addition or subtraction of standard Taylor series (such as those above) to construct the Taylor series of a function, by virtue of Taylor series being power series. is that Trump used his power to get Ukraine to. If a function f has derivatives of all orders at a, then the Taylor series for f about x = a is:. We can then find the expression exp(M) if | {
"domain": "yiey.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130567217291,
"lm_q1q2_score": 0.8464479516882558,
"lm_q2_score": 0.8558511396138365,
"openwebmath_perplexity": 416.5164752725799,
"openwebmath_score": 0.9066948294639587,
"tags": null,
"url": "http://vvge.yiey.pw/power-series-and-taylor-series.html"
} |
beginner, url-routing, react.js, cordova, jsx
When building componentized UIs, it's best to think of the entire thing as a bunch of very small things. Think "Home has a header, content, footer, sidebar. About has a header, content, footer, and no sidebar" and not "Home and About are pages, therefore I make a Page component". The advantage of the former is if I needed a sidebar for About, I can just pop it in there. If I want to remove the header from Home, I can just take it out. | {
"domain": "codereview.stackexchange",
"id": 18841,
"lm_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, url-routing, react.js, cordova, jsx",
"url": null
} |
machine-learning, overfitting, oversampling
Title: A question about overfitting and SMOTE So I understand that overfitting is when you have for example a good accuracy for the training dataset and bad one for the testing dataset, but why would I even check the accuracy for the training dataset?
If I have a good accuracy on the testing dataset that means I'm most likely not overfitting, right? (Assuming that we make sure that the model doesn't train on any testing data)
I have another question:
Can oversampling using SMOTE cause overfitting (good accuracy on the testing dataset but in reality it is overfitting?)
SMOTE draws a line and makes new points on it so it doesn't duplicate the data.
First point: in general it's risky to use accuracy in order to measure performance, especially if there is class imbalance. F1-score would be a better option in general. | {
"domain": "datascience.stackexchange",
"id": 11404,
"lm_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, overfitting, oversampling",
"url": null
} |
c, homework
Title: C inner product function without using array subscripting As part of a question designed to help us understand the relationship between pointers and arrays in C, I've been asked to write an inner product function that doesn't use any array subscripting. Here's what I came up with, but it looks like the kind of complicated 'clever' coding that we've traditionally been told NOT to write.
Any feedback on it, or how it could be done better / more efficiently would be much appreciated.
int inner_product(const int *a, const int *b, int n) {
const int *p, *q;
int result = 0;
for(p = a, q = b; p < a + n, q < b + n; p++, q++) {
result += *p * *q;
}
return result;
}
Edit - Inner product is simply summing the product of the indexes, so a[1,2,3] b[2,3,4] would be 1*2 + 2*3 + 3*4 I have a few comments on style. (By which I really mean, 100% opinion... :D) | {
"domain": "codereview.stackexchange",
"id": 2167,
"lm_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, homework",
"url": null
} |
# Is there a name for the curve traced by the midpoint of two moving points on a circle with different speed?
I'm curious about what I did in Geogebra while I was experimenting with animation. Here it is:
1. Construct a circle with radius $$r$$
2. Define two points $$A(r\cos a\theta , r \sin a\theta)$$ and $$B(r\cos b\theta, r \sin b\theta)$$. Let $$(r,0)$$ be the initial position of both $$A$$ and $$B$$.
3. Get the midpoint of $$AB$$. Name this point $$M$$.
4. Change $$\theta$$ continuously starting from $$0$$ until $$A$$ and $$B$$ are both at $$(r,0)$$ again.
The midpoint, by doing the fourth step, seem to make some form of curve. I noticed that the curved traced by the midpoint does not change as long as $$a/b$$ does not change, even if $$a$$ and $$b$$ does so. Also, it doesn't matter if the values of $$a$$ and $$b$$ are swapped, but to avoid such ambiguities, we will avoid swapping of values and $$a$$ is always greater than $$b$$.
For the file, see this graph in Desmos. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.971129093889291,
"lm_q1q2_score": 0.866063644099297,
"lm_q2_score": 0.8918110368115781,
"openwebmath_perplexity": 281.0224501229029,
"openwebmath_score": 0.9765288233757019,
"tags": null,
"url": "https://math.stackexchange.com/questions/4192587/is-there-a-name-for-the-curve-traced-by-the-midpoint-of-two-moving-points-on-a-c"
} |
quantum-mechanics, hamiltonian, perturbation-theory, eigenvalue
$$H\approx\frac{1}{2}\omega_1\sigma_{1z}'+\frac{1}{2}\omega_2\sigma_{2z}'+\frac{1}{4}\omega_{J_{12}}\sigma_{1z}'\sigma_{2z}'$$
where the prime indicates the transformed basis.
If, for example, a perpendicular magnetic field was applied to enact some pulse, it would be fixed by the external apparatus, and hence be proportional to $\sigma_x$, not to $\sigma_x'$. The effect of pulses not being applied in the primed basis is that there will be some mixing of states to first order in the perturbation, and the result will deviate from the ideal pulse sequence, in which the pulses are also carried out in the primed basis. When we ultimately perform readout, the results will differ from the ideal case in that there will be a small proportion of the wrong result mixed in. | {
"domain": "physics.stackexchange",
"id": 93832,
"lm_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, hamiltonian, perturbation-theory, eigenvalue",
"url": null
} |
ros2, clion, ros-crystal
source ~/ros2_ws/install/local_setup.sh
sh ~/CLion/CLion-2018.3.4/clion-2018.3.4/bin/clion.sh
I also do not disable BUILD_TESTING since I thought that I was supposed to have BUILD_TESTING enabled when developing for ROS.
Lastly, I reload the CMake project in ros2_ws, and get the following output:
/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/jhassold/ros2_ws
-- Found ament_cmake: 0.6.0 (/home/jhassold/ros2_ws/install/share/ament_cmake/cmake)
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Configuring Fast CDR
-- Version: 1.0.8
-- To change de version modify the file configure.ac
CMake Warning (dev) at CMakeLists.txt:5 (add_subdirectory):
Policy CMP0013 is not set: Duplicate binary directories are not allowed.
Run "cmake --help-policy CMP0013" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The binary directory
/home/jhassold/ros2_ws/build/src/eProsima/Fast-CDR/src/cpp | {
"domain": "robotics.stackexchange",
"id": 32769,
"lm_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, clion, ros-crystal",
"url": null
} |
quantum-field-theory, momentum, conservation-laws, feynman-diagrams, dirac-delta-distributions
Regarding the second rule, I am unsure why any of the momentum would be "undetermined", or why the momentum of one propagator/external line would be more "undetermined" than any other. Could someone clear this up slightly for me?
Momentum-space Feynman rules are almost always used in calculations, and this entails transforming the propagators (from the field contractions) to momentum space. However, the integrals over spacetime that arise from the Dyson series expansion of the S-matrix still remain - interchanging the order of integration (as physicists do) and performing these spacetime integrals furnishes the delta functions at vertices that effect momentum conservation. | {
"domain": "physics.stackexchange",
"id": 75465,
"lm_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, momentum, conservation-laws, feynman-diagrams, dirac-delta-distributions",
"url": null
} |
Given the density $\rho(x,y,x)$ of any object $C$, it's mass $m$ is calculated as $$m = \int\int\int_{C} \, \rho(x,y,z) \, dx \, dy \, dz$$ Since in your case $C$ has constant density, you end up with $$m = \int\int\int_{C} \, \rho \, \, dx \, dy \, dz = \rho \, \int\int\int_{C} \, \, dx \, dy \, dz = \rho \, \text{Volume}(C) = \rho \, V$$ where by $V$ I have denoted the volume of the cylinder $C$. We assume, that $V=V(t)$ changes with time, while $C$ is absorbing water. Since $\rho$ stays fixed, then the mass of $C$ also changes with time, i.e. $m = m(t) = \rho V(t)$. Fortunately, $C$ is a cylinder of fixed radius, so $V = \pi\,r^2 h$, where $h$ is the height of the cylinder. Then the height $h = h(t) = \frac{1}{\pi r^2} \, V(t)$ aslo changes with time. In terms of the mass $$h(t) = \frac{1}{\pi r^2} \, V(t) = \frac{1}{\pi \rho \, r^2} \, m(t)$$ The area of the cylinder is easy to compute $$S(t) = \pi r^2 + 2 \pi r \, h(t) = \pi r^2 + 2 \pi r \, \frac{1}{\pi \rho \, r^2} \, m(t) = \pi | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429156022934,
"lm_q1q2_score": 0.8187115690849198,
"lm_q2_score": 0.8311430457670241,
"openwebmath_perplexity": 194.05761481039136,
"openwebmath_score": 0.915837287902832,
"tags": null,
"url": "https://math.stackexchange.com/questions/1947290/creating-an-ode-for-a-growing-cylinder"
} |
genetics, evolution, dogs
On the one hand, an Australian Broadcasting Corporation documentary claims that canid eyebrows are adapted for social interaction: they have specialized muscles (which are not present in other carnivorous mammals such as cats), and ... | {
"domain": "biology.stackexchange",
"id": 8175,
"lm_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, evolution, dogs",
"url": null
} |
turing-machines, computability, undecidability
Consider the two languages above. I want to know which ones are decidable.
I know that $L_1$ is decidable, because $M$ has only a finite amount of possible configurations with the input string $w$, so we can create a Turing Machine (TM) for to check 1 step past the number of combinations and decide.
However, for $L_2$, can we do that? I feel like $L_2$ is undecidable, because we can there seems to be no limit to the possible configurations. The halting problem, $\mathsf{HALT}$ reduces to $\overline{L_2}$.
Given a TM $T$ and input $w$, create a new TM $N$ that on any input of length $n$, simulates $T$ on input $w$ for $n$ steps and then stops except that if $T$ ever halts before $n$ steps, $N$ will move its head to the right forever. | {
"domain": "cs.stackexchange",
"id": 16152,
"lm_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, computability, undecidability",
"url": null
} |
c#, object-oriented, multithreading, game
I mention it because it (disposing disposables) is IMO "good practice".
The code in GetPlayerChoice is IMO a horror show: masses of Invoke statements and Task instances with SpinWait instances.
You're installing vGrid[x, y].Click event handlers each time you call GetPlayerChoice (and I don't understand what happens to old, previous-installed Click event handlers).
The normal way to do this in a Windows Forms application would be: | {
"domain": "codereview.stackexchange",
"id": 6732,
"lm_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#, object-oriented, multithreading, game",
"url": null
} |
# Poisson Distribution Multiple Choice Questions With Answers | {
"domain": "zespolszkolbestwinka.pl",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808759252645,
"lm_q1q2_score": 0.8211028373091915,
"lm_q2_score": 0.8376199694135332,
"openwebmath_perplexity": 831.331338728126,
"openwebmath_score": 0.3959244191646576,
"tags": null,
"url": "http://bicl.zespolszkolbestwinka.pl/poisson-distribution-multiple-choice-questions-with-answers.html"
} |
neural-network, tensorflow, cnn, convolutional-neural-network, categorical-data
Title: Manual computation of the predictions in a convolutional neural network I am trying to manually compute the predictions of the Keras library for a convolutional neural network. However, I am struggling a lot to match my final result with the ones provided by Keras. I do appreciate it if you could help me with this question.
I have a $r\times c$ tensor that includes categorical values. I apply the one-hot encoding method to convert this tensor to zeros and ones, which results in a $r\times c \times m$ tensor (a multi-channel tensor). I am trying to develop a regressor CNN to predict some quantitative values. The model summary is as follows:
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d (Conv2D) (None, 27, 3, 10) 550 | {
"domain": "datascience.stackexchange",
"id": 11465,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, tensorflow, cnn, convolutional-neural-network, categorical-data",
"url": null
} |
analog-to-digital, bitdepth
Title: Number of bits after combination I have 8 digital complex input channels digitized with 8 bits each and I want to combine them with certain complex weights. In the easiest case where all weights would be 1 the combination would be just a sum of the 8 channels. The resulting number would be an 10 bit number. Is it correct to say that the resolution has improved? Would the summed 10-bit number be equivalent to a case in where the summation is done analogically and then digitized with a 10-bit ADC?
This is interesting because it means I could decrease intentionally the number of bits of individual channels to decrease the throughput with no loss. TL;DR: You're trying to invent oversampling (just not in time direction). That works, when the necessary conditions hold.
The resulting number would be an 10 bit number. Is it correct to say that the resolution has improved? | {
"domain": "dsp.stackexchange",
"id": 12552,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "analog-to-digital, bitdepth",
"url": null
} |
thermodynamics, statistical-mechanics, energy-conservation, entropy, equilibrium
Can someone present a thermodynamic or statistical-mechanical description of exergy and exergy destruction? The intuitive mechanical engineer explanation I've come across is that it is about the economics of energy use (for example: heating your house with a radiator would be a poor use of exergy), but I'd like something more mathematically rigorous if possible. Online references or a generalized example would be great too. If you call $ \chi $ the exergy (availability) then $ \chi = U + p_o V - T_o S $ where $p_o, T_o$ are the pressure and temperature of the environment (and are assumed to be constant). To find the maximum amount of useful work that can be extracted form the system it is sufficient to analyze reversible processes only so that $ dU=TdS-pdV $ and then the exergy change for reversible process is
$$ \chi_2 -\chi_1 = U_2 -U_1 + p_o (V_2 - V_1) - T_o (S_2 - S_1) $$.
from which we have $$ d\chi = (T-T_o)dS -(p-p_o)dV $$ | {
"domain": "physics.stackexchange",
"id": 10706,
"lm_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, statistical-mechanics, energy-conservation, entropy, equilibrium",
"url": null
} |
python, python-2.x, base64
if not (is_last_line and is_last_read):
# The very last line will already have a \n because of
# b2a_base64. The other lines will not so we add it
output.write('\n') I ended up using bytearray as an input and output buffer. If found that if the output was something that doesn't buffer output (like a socket), then writing 77 bytes at a time would be very slow. Also my original code rounded the read size to be advantageous for base64, but not advantageous for MongoDB. It's better for the read size to match the MongoDB chunk size exactly. So the input is read into a bytearray with the exact size passed in, but then read in smaller base64 size chunks.
def chunked_encode(
input, output, read_size=DEFAULT_READ_SIZE, write_size=(base64.MAXLINESIZE + 1) * 64):
"""
Read a file in configurable sized chunks and write to it base64
encoded to an output file. | {
"domain": "codereview.stackexchange",
"id": 32099,
"lm_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-2.x, base64",
"url": null
} |
The following example demonstrates these methods.
Example:Output:
#include <Eigen/Dense>
#include <iostream>
int main()
{
Eigen::MatrixXf m(2,2), n(2,2);
v << -1,
2;
m << 1,-2,
-3,4;
std::cout << "v.squaredNorm() = " << v.squaredNorm() << std::endl;
std::cout << "v.norm() = " << v.norm() << std::endl;
std::cout << "v.lpNorm<1>() = " << v.lpNorm<1>() << std::endl;
std::cout << "v.lpNorm<Infinity>() = " << v.lpNorm<Eigen::Infinity>() << std::endl;
std::cout << std::endl;
std::cout << "m.squaredNorm() = " << m.squaredNorm() << std::endl;
std::cout << "m.norm() = " << m.norm() << std::endl;
std::cout << "m.lpNorm<1>() = " << m.lpNorm<1>() << std::endl;
std::cout << "m.lpNorm<Infinity>() = " << m.lpNorm<Eigen::Infinity>() << std::endl;
}
const int Infinity
Definition: Constants.h:38
v.squaredNorm() = 5
v.norm() = 2.23607
v.lpNorm<1>() = 3
v.lpNorm<Infinity>() = 2
m.squaredNorm() = 30
m.norm() = 5.47723
m.lpNorm<1>() = 10
m.lpNorm<Infinity>() = 4 | {
"domain": "tuxfamily.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540686581883,
"lm_q1q2_score": 0.8096435507681924,
"lm_q2_score": 0.8267117855317474,
"openwebmath_perplexity": 4615.847297378101,
"openwebmath_score": 0.6433765888214111,
"tags": null,
"url": "http://eigen.tuxfamily.org/dox-devel/group__TutorialReductionsVisitorsBroadcasting.html"
} |
• @StephenK. "Isn't that inherent (or even given) based on the inference rule of generalization?" I suppose that you mean that there is a hidden universal quantifier binding $k$. In that case, the principle is saying that it is sufficient to prove an induction step for one value of $k$ in order to obtain that every natural number belongs to $B$. For example, use the second variation with $k$ being $1$. Then if $1\in B$, then $B=\mathbb{N}$. You can easily think of $B$ leading to absurd. – beroal Mar 14 '18 at 21:51 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551505674443,
"lm_q1q2_score": 0.8081819397512745,
"lm_q2_score": 0.8376199673867852,
"openwebmath_perplexity": 425.53600138940834,
"openwebmath_score": 0.9359627962112427,
"tags": null,
"url": "https://math.stackexchange.com/questions/2687243/variations-in-the-statement-of-strong-induction-equivalent-or-different"
} |
homework-and-exercises, quantum-field-theory, particle-physics
\end{matrix}\right),
$$
where
$$
\xi^+_p=\left(
\begin{matrix}
cos\frac{\theta}{2} \\
e^{i\phi}sin\frac{\theta}{2}
\end{matrix}\right)
$$
and
$$
\xi^{-}_p=\left(
\begin{matrix}
-e^{-i\phi}sin\frac{\theta}{2}\\
cos\frac{\theta}{2}
\end{matrix}\right).
$$
I read on Peskin Schroeder that
$$
u^{r \dagger}(\vec{p}) v^s (-\vec{p})=0
$$
so it may seems that all amplitudes of that form are zero in the center of mass... What am I missing? Your mistake is hiding in plain sight! In your amplitude you have contributions of the form
$$ \bar v ^{s_1} (\mathbf{p}) u ^ {s_2}(-\mathbf{p}) $$
But you then try to use a formula for $v^\dagger$ rather than $\bar{v}$! Remember that $\bar v$ differs from $v^\dagger$ by a (crucial) factor of $\gamma^0$. This has the effect of making
$$\bar v ^{s_1} (\mathbf{p}) u ^ {s_2}(-\mathbf{p}) \neq 0 $$
In fact the vanishing combination involving barred rather than daggered variables is | {
"domain": "physics.stackexchange",
"id": 25763,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, quantum-field-theory, particle-physics",
"url": null
} |
3. Calculus!!
Consider the differential equation given by dy/dx = xy/2. A. Let y=f(x) be the particular solution to the given differential equation with the initial condition. Based on the slope field, how does the value of f(0.2) compare to
4. math
Consider the differential equation dy/dx = -1 + (y^2/ x). Let y = g(x) be the particular solution to the differential equation dy/ dx = -1 + (y^2/ x) with initial condition g(4) = 2. Does g have a relative minimum, a relative | {
"domain": "jiskha.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754470129648,
"lm_q1q2_score": 0.8809877289021665,
"lm_q2_score": 0.8947894562828416,
"openwebmath_perplexity": 1044.2009532301927,
"openwebmath_score": 0.8080105185508728,
"tags": null,
"url": "https://www.jiskha.com/questions/848377/consider-the-differential-equation-dy-dt-y-t-2-a-show-that-the-constant-function-y1-t-0"
} |
when simplifying. sec− π 12 Trigonometry, Loose-Leaf Edition Plus MyLab Math with Pearson eText -- 24-Month Access Card Package Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. The inverse trigonometric functions are the same as the trigonometric functions, except x and y are reversed. Solving equations with exponentials and a non-exponential term. Conditional equation: An equation in one Simplifying Trig Identities. Quiz worksheet proving trigonometric equation identities study com solving trigonometric equations she loves math trigonometric identities and examples with worksheets proving sum and difference identities worksheet geotwitter kids Quiz Worksheet Proving Trigonometric Equation Identities Study Com Solving Trigonometric Equations She Loves Math Trigonometric Identities And Examples With How do you use the sum and difference | {
"domain": "jimmec.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815523039175,
"lm_q1q2_score": 0.8040733530335388,
"lm_q2_score": 0.8128673155708975,
"openwebmath_perplexity": 564.1065187435921,
"openwebmath_score": 0.8320470452308655,
"tags": null,
"url": "http://jimmec.com/fvh/how-are-sum-and-difference-identities-used-in-solving-trigonometric-equations.html"
} |
graphs, space-complexity
I thought about using the $STCON$ problem for the whole nodes in the graph, but that will yield a space complexity of $O(n^2 \log^2n)$ (according to Savitch's theorem).
Then I thought about using a DFS traversal (it will be needed twice, actually), but I don't know how to prove it's space complexity. The idea here is to use a reachability-based approach. Given $u, v \in V$ we ask ourselves whether $u$ reaches $v$ in $G$. By definition, there exists a path that connects $u$ and $v$ if and only if there exists a path of length at most $D$; there are at most $d^D$ such paths.
Loop over all pairs of nodes and all paths to answer the original question. The total space required by this procedure is $\left \lceil \log(n^2d^D) \right \rceil$ plus a constant amount. | {
"domain": "cs.stackexchange",
"id": 11030,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs, space-complexity",
"url": null
} |
javascript, jquery
I wondered if this way is the best way of doing this. first-child & nth-child(2) goes to the same place, then each child after that - up to 4 has a different position to go to. Yes,
you could for starters derive the child position once with
var index = $('div.nav ul li').index( this )
Then you could adapt to index 0 and 1 in 1 if statement
Finally, you could just derive the index and have the animate statement only once.
Something like this in the end might do:
$('div.nav ul li').on('click', function() {
var index = $('div.nav ul li').index( this ), top;
if( index < 2 ){
top = '0';
}
if( index == 2 ){
top = $('div.features').offset().top + 'px';
}
if( index == 3 ){
top = $(document).height() + 'px';
}
if(top){
$("html, body").animate({
scrollTop: "0"
}, 'slow');
}
}); | {
"domain": "codereview.stackexchange",
"id": 9224,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery",
"url": null
} |
c, console, child-process, winapi
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int __declspec(dllexport) cmd_no_rsp(const char *command)
{
/// All commands that enter here must contain (and start with) the substring: "cmd.exe /c
/// /////////////////////////////////////////////////////////////////////////////////////////////////////////
/// char cmd[] = ("cmd.exe /c \"dir /s\""); /// KEEP this comment until format used for things like
/// directory command (i.e. two parts of syntax) is captured
/// ///////////////////////////////////////////////////////////////////////////////////////////////////////// | {
"domain": "codereview.stackexchange",
"id": 29736,
"lm_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, console, child-process, winapi",
"url": null
} |
special-relativity, spacetime, conventions, dirac-matrices, wick-rotation
$$
e_{m}{}^0=-\mathrm{i}\,\delta_m{}^0, \quad e_{m}{}^k=\delta_{m}^k \quad\text{and}\quad e=\mathrm{i},\tag{4.1}
$$
which gives for the Gamma matrices
$$
\gamma_{M(s=1)}^0=-\mathrm{i}\,\gamma_E, \quad \text{and}\quad \gamma_{M(s=1)}^k=\gamma_E^k.\tag{4.2}
$$
Conversely to convert from euclidean ($s=0$) to mostly minus ($s=d-1$) Minkowski signature we can use
$$
e_{m}{}^0=\delta_m{}^0, \quad e_{m}{}^k=-\mathrm{i}\,\delta_{m}^k \quad\text{and}\quad e=\mathrm{i}^{d-1},\tag{5.1}
$$
which gives for the Gamma matrices
$$
\gamma_{M(s=d-1)}^0=\gamma_E, \quad \text{and}\quad \gamma_{M(s=d-1)}^k=-\mathrm{i}\,\gamma_E^k.\tag{5.2}
$$ | {
"domain": "physics.stackexchange",
"id": 87736,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, spacetime, conventions, dirac-matrices, wick-rotation",
"url": null
} |
optics, refraction, lenses, dispersion
Additionally, with a block of parallel glass, if it were sufficiently thick and wide, although different frequencies would eventually "catch up" to each other and merge upon exit, this would occur only after a distance equal to the distance they were dispersed inside the glass right? So the human eye, if positioned close enough to the exit side of the glass, would be able to see a rainbow correct? They do. It's called chromatic aberration - each different frequency has a slightly different focus point, blurring the image by different amounts for the different colors. Modern lenses of high quality have multiple elements added specifically to address the issue of chromatic aberration. | {
"domain": "physics.stackexchange",
"id": 41279,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, refraction, lenses, dispersion",
"url": null
} |
php, bash, linux, console, awk
if [[ -e $uploadDataStore$theDirectory ]]; then
success=yes
else
randomColour
echo "Can't find a folder called $uploadDataStore$theDirectory"
echo
fi
done
declare -i NameCounter
declare -A fileNameToNumberMap
declare -A numberToFileNameMap
NameBuilder='Submit=Save+and+Process'
success=no
while [[ $success == "no" ]]; do
randomColour e
echo 'What is name of CSV file? (default = csvfile.csv)'
randomColour
read CSVFilename
if [[ $CSVFilename == "" ]]; then
CSVFilename=csvfile.csv
fi
CSVFilename=$uploadDataStore$theDirectory/$CSVFilename
if [[ -e $CSVFilename ]]; then
success=yes
else
randomColour
echo Counld not find file by name of $CSVFilename, try again
fi
done
tempfile=$(mktemp) | {
"domain": "codereview.stackexchange",
"id": 6222,
"lm_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, bash, linux, console, awk",
"url": null
} |
______________________________________________________________________________
Remark
The normal Moore space conjecture is the statement that every normal Moore space is metrizable. This conjecture had been one of the key motivating questions for many set theorists and topologists during a large part of the twentieth century. The bottom line is that this statement cannot not be decided just on the basis of the set of generally accepted axioms called Zermelo–Fraenkel set theory with the axiom of choice, commonly abbreviated ZFC. But Bing’s metrization theorem states that if we strengthen normality to collectionwise normality, we have a definite answer.
______________________________________________________________________________
Reference
1. Engelking, R., General Topology, Revised and Completed edition, Heldermann Verlag, Berlin, 1989.
2. Willard, S., General Topology, Addison-Wesley Publishing Company, 1970. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357561234474,
"lm_q1q2_score": 0.8282078861421961,
"lm_q2_score": 0.8459424295406088,
"openwebmath_perplexity": 474.6879401861211,
"openwebmath_score": 1.0000089406967163,
"tags": null,
"url": "https://dantopology.wordpress.com/category/metrizable-spaces/"
} |
nuclear-physics, radiation, parity
From wikipedia: The experiment's purpose was to establish whether or not
conservation of parity (P-conservation), which was previously
established in the electromagnetic and strong interactions, also
applied to weak interactions. If P-conservation were true, a mirrored
version of the world (where left is right and right is left) would
behave as the mirror image of the current world. If P-conservation
were violated, then it would be possible to distinguish between a
mirrored variation of the world and the mirror image of the current
world.
The experiment established that conservation of parity was violated
(P-violation) by the weak interaction. This result was not expected by
the physics community, which had regarded parity as a conserved
quantity. | {
"domain": "physics.stackexchange",
"id": 23009,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nuclear-physics, radiation, parity",
"url": null
} |
of strategies that your child can use. All problems are customizable (meaning that you can change all parameters). Now that you can do these difficult algebra problems, you can trick your friends by doing some fancy word problems; these are a lot of fun. How to solve word problems involving ages, of one person, of two or more persons using Algebra, multiple ages, grade 9 algebra word problems, algebra word problems that deal with the ages of people currently, in the past or in the future, with video lessons, examples and step-by-step solutions. Solving Word Problems in Algebra Inequality Word Problems. There's no algebra word problem too tough for How to Solve Word Problems in Algebra!--This text refers to the paperback edition. If you don’t have the equation, it’s hard to solve it. But really, formulas are designed to make life easier for you. I hate formulas!" Put numbers in place of the words to set up a regular math equation. The problems here only involve one variable; later we’ll | {
"domain": "zgsyedm.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138157595306,
"lm_q1q2_score": 0.8290697945628617,
"lm_q2_score": 0.8479677602988602,
"openwebmath_perplexity": 798.1152640371243,
"openwebmath_score": 0.3377313017845154,
"tags": null,
"url": "https://zgsyedm.com/moral-talk-cmuluwy/cc3551-how-to-solve-word-problems-in-algebra"
} |
angular-momentum, quantum-spin, field-theory, dirac-equation, higher-spin
not unique. Moreover, the dimension of these objects is not unique either. In my course, we chose the following solution: $$\alpha_i=\begin{pmatrix} 0& \sigma_i\\ \sigma_i &0 \end{pmatrix}$$ $$\beta= \begin{pmatrix} 1 & 0\\ 0 & -1\end{pmatrix}$$ where $\sigma_i$ are the Pauli matrices. $\sigma_i$ and $\beta$ are thus four dimensional matrices. It turns out that with the Dirac equation and this particular choice, the wave function which is a solution of the equation represents a particle with spin 1/2. My question is: if we had chosen a different solution for $\alpha_i$ and $\beta$ with matrices of higher dimensions, would we then possibly have, as a solution of the Dirac equation, wave functions that representation particles of spins that are different than 1/2? You can absolutely represent different kinds of particles if you choose different $\alpha$ or $\beta$ in your first-order wave equation. As a trivial example, consider using $8 \times 8$ block diagonal matrices with $\alpha$ | {
"domain": "physics.stackexchange",
"id": 71189,
"lm_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, quantum-spin, field-theory, dirac-equation, higher-spin",
"url": null
} |
c++, c++0x
Title: Typesafety with dlsym function loading Aim:
Use C++0x features to make function interposition safer. The problem is that it's easy to make a typo when wrapping and interposing on functions.
Prototype Implementation:
#define MAKE_WRAPPER(x) static const wrapper<decltype(::x), ::x> x(#x)
namespace {
template<typename Sig, Sig& S>
struct wrapper;
template<typename Ret, typename... Args, Ret(&P)(Args...)>
struct wrapper<Ret(Args...), P> {
typedef Ret(*real_func)(Args...);
real_func f;
wrapper(const std::string& sym) : f(NULL) {
dlerror();
void *ptr = dlsym(RTLD_NEXT, sym.c_str());
f = (real_func)ptr;
if (NULL == f) {
std::cerr << "dlsym(): " << dlerror() << std::endl;
}
std::cout << "constructing wrapper: " << this << " for: " << sym << "(at " << ptr << ")" << std::endl;
} | {
"domain": "codereview.stackexchange",
"id": 570,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++0x",
"url": null
} |
complexity-theory, many-body-systems
Title: What is the "physical" Hilbert space for non-local Hamiltonians? In their 2011 paper, D. Poulin and coauthors show that the size of "physically" accessible states in Hilbert space for local Hamiltonians is exponentially smaller than the total Hilbert space. Thus, there is an enormous space of states which take an exponentially long time to prepare, and are physically inaccessible by a quantum computer or any real-life quantum-mechanical system.
However, the result by Poulin, et al only holds or local Hamiltonians, so I am interested in what happens when you relax that assumption. | {
"domain": "quantumcomputing.stackexchange",
"id": 4979,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, many-body-systems",
"url": null
} |
programming-languages, functional-programming, data-types, ocaml
Xi, Hongwei, Chiyan Chen, and Gang Chen. “Guarded Recursive Datatype Constructors.” In Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 224–35. POPL ’03. New York, NY, USA: Association for Computing Machinery, 2003. https://doi.org/10.1145/604131.604150.
The implementation aspects seems to be based on this presentation from OCaml workshop
Jacques Garrigue, Jacques Le Normand. "Adding GADTs to OCaml: the direct approach." ACM SIGPLAN Workshop on ML 2011. https://www.math.nagoya-u.ac.jp/~garrigue/papers/ml2011.pdf
Also some work on mechanized formalization of GADTs
Jacques Garrigue, Xuanrui Qi. "Formalizing OCaml GADT typing in Coq." The ML 2021. https://www.math.nagoya-u.ac.jp/~garrigue/cocti/ml2021.pdf | {
"domain": "cs.stackexchange",
"id": 21395,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming-languages, functional-programming, data-types, ocaml",
"url": null
} |
turtlebot
Title: I am trying to start a robotics club
I am an IT guy. I have a 2 year degree in web design and computer networking. So I know C++ ,HTML, CSS, and PHP. When I found out that robots use the C++ I almost fell out of my chair. So I am trying to start a robotics club in NC. I have not been able to find robotics clubs in NC. Do you have any suggestion's? What is the hardest part of robotics?
Originally posted by hallman on ROS Answers with karma: 31 on 2015-03-30
Post score: 3
Original comments
Comment by Mehdi. on 2015-08-12:
why you almost fell out of your chair? is that so surprising?
The biggest upfront challenge is getting enough equipment available for a club to work on. A TurtleBot is excellent. I'd also recommend getting an Arduino. You can experiment with OpenCV with just a standard webcam.
Originally posted by Mark Silliman with karma: 81 on 2015-04-03
This answer was ACCEPTED on the original site
Post score: 3 | {
"domain": "robotics.stackexchange",
"id": 21298,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turtlebot",
"url": null
} |
# Math Help - [SOLVED] Finding Co-Ordinates of a Rectangle
1. ## [SOLVED] Finding Co-Ordinates of a Rectangle
Here's a question from a past paper which I have successfully attempted. My question is regarding part (iii). I have successfully figured out the co-ordinates by the following method:
Is my method correct, considering I did get the right answer?
But is there another simpler method to do this which would save time during an exam.
2. The diagonals bisect one another. The midpoint of $\overline{AC}$ is ?
3. Mid of AC is (6,6), the diagnols do bisect each other at the mid but we don't have the x-co-ordinates of B or D to equate the diagnols, or do we?
4. Originally Posted by unstopabl3
Mid of AC is (6,6), the diagnols do bisect each other at the mid but we don't have the x-co-ordinates of B or D to equate the diagnols, or do we?
But the y-coordinate of $B~\&~D$ is 6.
You are given the x-coordinate of $D$, so $Dh,6)" alt="Dh,6)" /> | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668723123672,
"lm_q1q2_score": 0.8507067781122616,
"lm_q2_score": 0.8670357735451835,
"openwebmath_perplexity": 2670.6624057447366,
"openwebmath_score": 0.9582180976867676,
"tags": null,
"url": "http://mathhelpforum.com/geometry/143843-solved-finding-co-ordinates-rectangle.html"
} |
object-oriented, swift, ios
static func band(for frequency: RadioFrequency) -> RadioBand? {
RadioBand.allCases.first { $0.allowedRange ~= frequency }
}
}
struct RadioStation {
let name: String
let frequency: RadioFrequency
var band: RadioBand? { RadioBand.band(for: frequency) }
init?(name: String, frequency: RadioFrequency) {
guard RadioBand.band(for: frequency) != nil else { return nil }
self.name = name
self.frequency = frequency
}
}
Minor details in the above: | {
"domain": "codereview.stackexchange",
"id": 37758,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, swift, ios",
"url": null
} |
asymptotes because. Passing the fast paced Higher Maths course significantly increases your career opportunities by helping you gain a place on a college/university course, apprenticeship or even landing a job. Find vertical asymptotes and holes. An asymptote is a line that the curve gets very very close to but never intersect. In this calculus worksheet, 12th graders answer questions about derivatives, increasing and decreasing functions, relative maximum and minimum and points of inflection. Voyager …. As $$x$$ increases, the slope of the tangent line increases. The first curve is a rotated cardioid (whose name means "heart-shaped") given by the polar equation. That tells us that our midline drooping down 4. Sketching Infinite Lines: the Conic tool applies tangency at each endpoint and selects the top vertex of the curve. The graph shown is the DERIVATIVE of f. CURVE SKETCHING BLAKE FARMAN Lafayette College Name: 1. So even 10 problems you should be able to get through in a few | {
"domain": "curaben.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9910145712474399,
"lm_q1q2_score": 0.8500606980030403,
"lm_q2_score": 0.8577681122619883,
"openwebmath_perplexity": 1251.2958620737718,
"openwebmath_score": 0.5482892990112305,
"tags": null,
"url": "http://vurg.curaben.it/curve-sketching.html"
} |
Intermediate Value Theorem Examples and Applications Mean Value Theorem Math Forum. The Mean Value Theorem First let’s recall one way the derivative re ects the shape of the graph of a function: since https://en.m.wikipedia.org/wiki/Mean_value_theorem_(divided_differences) Applications of the Quantile-Based Probabilistic Mean Value Theorem to Distorted Distributions. This Mean Value Theorem - An Application Worksheet is suitable for Higher Ed. In this mean value worksheet, students read a short story problem about driving from one The Mean Value Theorem for Integrals guarantees that for every definite integral, a rectangle with the same area and width exists. Moreover, if you superimpose this Calculus and Analysis > Calculus > Mean-Value Theorems > Eric W. "Mean-Value Theorem." Explore thousands of free applications across science, The Mean Value Theorem establishes a relationship between the slope of a tangent line to a curve and the secant line through points on a curve at the | {
"domain": "revistalaika.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812345563902,
"lm_q1q2_score": 0.8005721836300191,
"lm_q2_score": 0.8267117898012104,
"openwebmath_perplexity": 242.75090706058603,
"openwebmath_score": 0.8383251428604126,
"tags": null,
"url": "https://revistalaika.org/lamplough/application-of-mean-value-theorem.php"
} |
java, algorithm, strings, combinatorics
Now, if this was my problem, I would restructure it entirely.
I would have one method that loops through all the members of the input set, and checks to see whether there's an overlap at the 'end' of the String, then I would split that matching value and keep the unused prefix, and then recursively search the remaining values.... let's explain that with pseudo code:
function: searchSequence(target, values)
foreach (value : values)
if (lastPartOfValueStarts(value, target)
String matchingsuffix = matchingPartOf(value);
String notmatchingprefix = restOf(value);
Set candidates = values
candidates.remove(value)
candidates.add(nonmatchingprefix)
if (recursiveSearch(target, lengthOf(matchingsuffix)))
return true; | {
"domain": "codereview.stackexchange",
"id": 5420,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, strings, combinatorics",
"url": null
} |
python, beginner, game, python-3.x, rock-paper-scissors
# Simulate Initialization
playerA_choice = null
playerB_choice = null
# Simulate Players Choosing
playerA_choice = synonyms["stone"]
playerB_choice = synonyms["shears"]
# Main Logic
state = (playerA_choice, playerB_choice)
print(outcomes[state])
Details to handle input output should be at a higher layer of abstraction. It shouldn't matter to the game engine if the game is between a human and a computer, two humans, or two computers. It shouldn't matter if it is being played using a laptop or over the internet.
Data Structures
A good rule of thumb is to replace complex logic with a data structure, and
if choice == 'r' or choice == 'R' or choice == 'Rock' or choice == 'rock' or choice == '1': | {
"domain": "codereview.stackexchange",
"id": 12195,
"lm_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, game, python-3.x, rock-paper-scissors",
"url": null
} |
$(B)=1$
$(C)=(M(t))^2$
$(D)=\frac{M(t)}{M(-t)}$
My input: Since its given that random variables are i.i.d so $E(\dfrac{\require{\cancel}\cancel{e^{tX}}}{\cancel{e^{tY}}})=E(1)=1$
can I do that?
• What happens e.g. for $X:=1$ (constant random variable) and $Y:=2$ (also constant random variable)? Does the expression equal $1$? – saz Feb 4 '18 at 16:38
• You assumed $X=Y$ with probability $1$ when you did the cancellation. That is not necessarily true. – StubbornAtom Feb 4 '18 at 16:42
• @saz Oh yes i was thinking totally wrong. I took a case when they both take same probability. Silly me. – Daman Feb 4 '18 at 16:42
• @StubbornAtom i am showing new work wait. – Daman Feb 4 '18 at 16:42
• Another example: $X,Y \sim {\cal N}(0,1)$ iid. – GNUSupporter 8964民主女神 地下教會 Feb 4 '18 at 17:28 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540698633748,
"lm_q1q2_score": 0.8324227338687381,
"lm_q2_score": 0.8499711794579723,
"openwebmath_perplexity": 181.4668155222771,
"openwebmath_score": 0.8756843209266663,
"tags": null,
"url": "https://math.stackexchange.com/questions/2635731/let-x-and-y-be-independent-and-identically-distributed-random-variables-with"
} |
slam, navigation, ros-kinetic, stereo-camera, rtabmap
<param name="resolution" value="$(arg resolution)" />
<param name="verbose" value="$(arg verbose)" />
<param name="mat_resize_factor" value="1.0" />
<param name="quality" value="1" />
<param name="sensing_mode" value="0" />
<param name="frame_rate" value="$(arg frame_rate)" />
<param name="odometry_db" value="" />
<param name="openni_depth_mode" value="0" />
<param name="gpu_id" value="$(arg gpu_id)" />
<param name="confidence" value="100" />
<param name="gain" value="100" />
<param name="exposure" value="100" />
<param name="auto_exposure" value="true" />
<param name="depth_stabilization" value="1" />
<param name="pose_smoothing" value="false" />
<param name="spatial_memory" value="true" /> | {
"domain": "robotics.stackexchange",
"id": 31707,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, ros-kinetic, stereo-camera, rtabmap",
"url": null
} |
java, game, gui, community-challenge, javafx
//RENDER BATTLEFIELDS
@FXML
Pane opponentBattlefieldPane;
@FXML
Pane playerBattlefieldPane;
private void renderBattlefields() {
this.renderOpponentBattlefield();
this.renderPlayerBattlefield();
}
private void renderOpponentBattlefield() {
opponentBattlefieldPane.getChildren().clear();
opponentBattlefieldPane.getChildren().addAll(opponentBattlefieldData);
}
private void renderPlayerBattlefield() {
playerBattlefieldPane.getChildren().clear();
playerBattlefieldPane.getChildren().addAll(playerBattlefieldData);
}
//Called at the end of turn, and when a card is played
public void createData() {
this.createHands();
this.createBattlefields();
} | {
"domain": "codereview.stackexchange",
"id": 9595,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game, gui, community-challenge, javafx",
"url": null
} |
c#, entity-framework, winforms, socket
You will need to monitor the queue length. If it start to grow, then your server is being overwhelmed and you will need to execute some way of reducing the workload.
Remember that the pool of worker threads needs to access the queue so that only one thread can access the queue at a time. Some frameworks provide a thread safe queue ( very cool! ) but if you do not have one of these you will need to protect the queue with a mutex or similar - don't try to create your own thread safe queue ( that is a huge challenge ) | {
"domain": "codereview.stackexchange",
"id": 8177,
"lm_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#, entity-framework, winforms, socket",
"url": null
} |
beginner, haskell, interval
Title: Merge adjacent numeric intervals Given a list of pairs of integers that represent closed numeric intervals, I need to output a list of intervals where the adjacent intervals are merged together. The code assumes that the intervals do not overlap and that a <= b in all pairs (a, b).
Intervals (a,b) and (c,d) are adjacent if b + 1 == c.
merge [] = []
merge [x] = [x]
merge ((a, b):(c, d):xs)
| b + 1 == c = merge ((a, d):xs)
| otherwise = (a, b):(merge ((c, d):xs)) | {
"domain": "codereview.stackexchange",
"id": 14966,
"lm_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, haskell, interval",
"url": null
} |
python, performance, image, matrix, numpy
def feature(data, indices, fp, reference):
# fp is a tuple of 2 coordinates in a patch ((x1,x2),(y1,y2),ref),
# where ref is an index of a random reference matrix in reference only relevant in case x1=y1 and x2=y2
res = []
if fp[0] != fp[1]:
for i in indices:
x, y = i
res.append(srwd(data[x + fp[0][0]][y + fp[0][1]], data[x + fp[1][0]][y + fp[1][1]]))
else:
for i in indices:
x, y = i
res.append(srwd(data[x + fp[0][0]][y + fp[0][1]], reference[fp[2]]))
return res
for fp in feature_params:
feature_values = feature(data, indices, fp, reference)
#here work on feature_values
A final note about the dimensions of the actual problem: | {
"domain": "codereview.stackexchange",
"id": 24366,
"lm_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, image, matrix, numpy",
"url": null
} |
quantum-mechanics, double-slit-experiment, interference, quantum-eraser
Isn't the reason for the light not interfering in the first part of the experiment the fact that the two polarization filters set the light in orthonormal states that don't interact? I imagine that if after we polarize the light, we use another filter to determine the polarization angle, then we would have information about the path and collapse the wave function, but without the second polarization filter, we still don't have the path information, from my understanding.
When light doesn't interfere, I assumed that we would see the particle-lie behavior of light; then why don't we see two separate dots/lines on the screen, corresponding to the two slits, but rather a diffuse blob of light? | {
"domain": "physics.stackexchange",
"id": 98306,
"lm_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, double-slit-experiment, interference, quantum-eraser",
"url": null
} |
human-biology, human-anatomy
The people who say that it is as simple as "calories in, calories out" are right. They are right in the sense that, if you just observe a human being and measure their energy household, you will be able to document the amounts of energy consumed, expended and stored, and the energy consumed will equal the energy consumed plus the energy stored. | {
"domain": "biology.stackexchange",
"id": 3486,
"lm_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, human-anatomy",
"url": null
} |
pressure, optimization, solid-mechanics, material-science
The bottom line is if you make an object entirely out of graphene, in general a detailed analysis will be required to predict how rigid the object will be when subjected to external stresses. Under external stresses, some parts of the object may be under tensile stresses, other parts may be under compressive stresses, and there will be shearing stresses all around. Also, for an anisotropic material like graphene, the overall rigidity will also depend on how the graphene sheets are oriented with respect to the principal stress axes throughout the object. You can probably start to see now why multiple materials with different mechanical properties are used together in many engineering applications. | {
"domain": "physics.stackexchange",
"id": 40563,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pressure, optimization, solid-mechanics, material-science",
"url": null
} |
genetics, homework
Of the following this result completely rules out:
A hypothesis I.
B hypothesis II.
C hypothesis III.
D none of the hypotheses
The 3 hypotheses only talk about Japanese fish and west coast fish, there is no mention of mid Pacific fish, and, if it is talking about the North Pacific fish, the info state that "However, in the north Pacific, midway between the USA and Japan, 70% of the population is left-eyed and in Japanese waters all the starry flounder are left eyed."
From this we infer that: | {
"domain": "biology.stackexchange",
"id": 11837,
"lm_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, homework",
"url": null
} |
classification, nlp
My main goal is classifying text data by offensive/non-offensive text by using Machine Learning and Deep Learning algorithms. After weeks of online searching, I could not find a ready-to-use dataset. I considered manually labelling the data. However, I don't know where I should start.
What would be the best approach for making progress in this task? I also plan to do this in both English and German languages.
Also, below is a related article for fully understanding of the problem:
Deep learning for detecting inappropriate content in text Toxic comment classification challenge might be a good place to start. It contains a set of comments and 6 binary classifications indicting if it's a toxic comment and of which type.
I imagine this would be a sufficient start. | {
"domain": "datascience.stackexchange",
"id": 2806,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classification, nlp",
"url": null
} |
estimation, kalman-filters, sensor, state-space, bayesian-estimation
We know the rocket exists and is positioned somewhere behind this cloud.
Is it the (A) "boundary"/border of the cloud that can inform our state space of the rocket,
... or (B) the pixel intensity along the trajectory (suddenly shifting from blue to white) that can inform our state space of the rocket? | {
"domain": "dsp.stackexchange",
"id": 10959,
"lm_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, sensor, state-space, bayesian-estimation",
"url": null
} |
functional-programming, typescript, angular-2+, rxjs
can be simplified to:
.pipe(map(respData => {
return respData.map(element => {
return new University(element['state-province'], element.country, element.name);
});
})
Notice there is no need to declare the array- i.e. uniArr because the map method returns an array.
And that can be simplified because there is only a single statement being returned
.pipe(map(respData => {
return respData.map(
element => new University(element['state-province'], element.country, element.name)
);
})
And the return before the call to the map method could also be removed though it might make for a long line that some would split
.pipe(map(respData => respData.map(element => new University(
element['state-province'],
element.country,
element.name
))))
Using the map method approach there are no side-effects of the callback function and thus it is a pure function. This means it is simpler to test, and allows for fewer indentation levels. | {
"domain": "codereview.stackexchange",
"id": 43217,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "functional-programming, typescript, angular-2+, rxjs",
"url": null
} |
python, python-3.x, json, api, reddit
def process_guess(self, guess_body):
"""requires that guess_body is single character: modifies word_state to fill in guess matches"""
for i in range(0, len(self.secret)):
if self.secret[i] == guess_body:
self.word_state[i] = guess_body
def word_correct(self, guess):
return guess == self.secret
def record_mistake(self, mistake_body):
self.mistakes.append(mistake_body)
self.lives -= 1
def display_contents(self):
"""return a formatted markdown string containing a report on hangman attributes"""
reply = ''
reply += '\n\nlives: ' + str(self.lives) + '\n\n#'
for char in self.word_state:
reply += char + ' '
reply += '\n\nmistakes: '
reply += ', '.join(self.mistakes)
return reply | {
"domain": "codereview.stackexchange",
"id": 39784,
"lm_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, json, api, reddit",
"url": null
} |
java, enum, role-playing-game
Does anyone have any advice on how I can make this look better?
public enum ProfessionType {
BARBARIAN {
@Override
public int getWillModifier(int level) {
return badSaveModifier(level);
} | {
"domain": "codereview.stackexchange",
"id": 16493,
"lm_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, enum, role-playing-game",
"url": null
} |
c#, programming-challenge, winforms
if (NumToTest % 2 == 0)
{
return true;
}
else
{
return false;
}
With simply:
return NumToTest % 2 == 0;
C# offers a number of shortcuts for compile-time collection initialization, including for Dictionaries. Also, although your code will probably run just the once, it is usually a good idea to extract immutable data initialization out of methods, and initialize it once-per-process, e.g.
private static readonly IReadOnlyDictionary<int, string> Problems = new Dictionary<int, string>
{
{1, "foo"},
{2, "bar"},
...
};
Possibly pedantic, but you could also encapsulate the "problems" to include the function itself in the Dictionary. You would however need all the SolveX functions to return the same type (and weak types like object or the dynamic type should be avoided). AFAIK all the Euler solutions are integral, so long seems reasonable, (Although from memory you might also need to make use of BigInteger at some point when long is insufficient) | {
"domain": "codereview.stackexchange",
"id": 19369,
"lm_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#, programming-challenge, winforms",
"url": null
} |
javascript, performance, algorithm, integer, binary
// replacement functions
function BitMovers() {
const mask = createBitOrder(true, 8); // high to low
const read = BitStream(mask);
const write = BitStream(mask);
return {
moveBits(fromBuf, fromBit, numBits, toBuf, toBit) {
read.buf = fromBuf;
write.buf = toBuf;
read.pos = fromBit;
write.pos = toBit;
read.writeTo(write, numBits);
},
clearBits(buf, fromBit, numBits) {
write.buf = buf;
write.pos = fromBit;
write.clear(numBits);
},
}
}
const movers = BitMovers();
const bufA = [255,0,255,0];
const bufB = [0,0,0,0];
movers.moveBits(bufA, 4, 8, bufB, 20);
movers.clearBits(bufB, 1, 6);
<code id="info"> </code>
UPDATE
As requested in your comment
"Can you describe how/why you got mask and maskOut? Why do they have the values they do? And what do you mean by 'create bit order' exactly? " | {
"domain": "codereview.stackexchange",
"id": 40419,
"lm_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, performance, algorithm, integer, binary",
"url": null
} |
c#, authentication, asp.net-mvc-3, authorization
I can't really speak to whether it is a good separation of concerns, but it looks like a good solution to me. It's not unlike other MVC authentication approaches I've seen. I'm using something very similar in my apps in fact. | {
"domain": "codereview.stackexchange",
"id": 1057,
"lm_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#, authentication, asp.net-mvc-3, authorization",
"url": null
} |
fft, fourier-transform, finite-impulse-response, impulse-response, interpolation
1x
1
6
2x
1
6*2+1
3x
1
6*3+2
4x
1
6*4+3
...
... (remains the same)
...
This means PrePad is also scales in case of interpolation. Whole f is scaled it's obvious but is there any answer to tell how time extension affect the frequency in better sense?
The nature of this question ariesed for me to find IFFT of frequency of LTI system. I want to deform frequency respnse in sense that causes to IFFT give longer duration impulse response. Longer duration impulse response means less aliasing(If possible) and more accurate model of the system. Interpolating in time causes Frequncy domain to scale completly, also the boundaries of frequency domain changes accordingly, since nyquist frequiency will be changed.
On time extentioning, Nyquist doesn't changes, just frequency bins increases. Then if I only increase the resolution of frequency domain in my algorithm which determines the frequency domain. Time extension in impulse response or time domain have to automatically apply. | {
"domain": "dsp.stackexchange",
"id": 12326,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft, fourier-transform, finite-impulse-response, impulse-response, interpolation",
"url": null
} |
newtonian-mechanics, rotational-dynamics, energy-conservation, friction, work
Title: Why pure rolling's energy is conserved? Although there exists non-conservative force during pure rolling (for this, static friction), why is energy conserved? Is it just special feature of pure rolling? Energy is conserved simply because STATIC friction acts on the body.Static friction does no work.
Consider a thin disc rolling down an inclined plane.Friction acts on the bottom most point of contact which is instantaneously at REST.As no displacement is done while the force acts on the point of contact,work done by friction is zero.
Now by Work energy theorem we know that Change in Kinetic Energy=Work done by all the forces.As now we have established that only conservative force do work now,Change in kinetic energy=Work done by conservative forces which means mechanical energy in total remains conserved. | {
"domain": "physics.stackexchange",
"id": 48949,
"lm_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, rotational-dynamics, energy-conservation, friction, work",
"url": null
} |
to find the projectile motion, you can use the projectile motion calculator which is also known as horizontal distance calculator, maximum height calculator or kinematic calculator. Projectile Motion equations derivation – parabola. What is a projectile? A body in free fall that is subject only to the forces of gravity and air resistance Motion of bodies flung into the air Occurs in many activities, such as baseball, diving, figure skating, basketball, golf, and volleyball A special case of linear kinematics Equation (i) gives the time of flight of the projectile for velocity of projection u at an angle θ. From vertical equation of motion, we have: This is the typical equation for an object launched vertically against gravity or a projectile in a ballistic trajectory. v y 0 is the initial vertical velocity; g is the acceleration due to gravity If velocity makes an angle φ, from horizontal, then. the trajectory of the projectile, this time superimposing it with the trajectory you would | {
"domain": "ferall-racks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474904166247,
"lm_q1q2_score": 0.8179052450976197,
"lm_q2_score": 0.8267118004748677,
"openwebmath_perplexity": 455.15972771554755,
"openwebmath_score": 0.7767765522003174,
"tags": null,
"url": "http://www.ferall-racks.com/syzysci/equation-of-trajectory-for-horizontal-projectile.html"
} |
r, rna-seq, differential-expression, gene-expression
I personally prefer option 2, since it's quick and doesn't usually have any side-effects unless you use two-pass alignment or did the quantification with something like salmon. Option 3 is always tempting, but I have to say I've never been convinced that this consistently produces similar enough results to options 1 or 2. | {
"domain": "bioinformatics.stackexchange",
"id": 1383,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "r, rna-seq, differential-expression, gene-expression",
"url": null
} |
thermodynamics
Now the isothermal evolution behaves correctly, look how it cannot collide with the adiabatic evolution.
The work is the same as before, since an isochoric evolution has no work transfer. However, now we are absorbing heat from the surroundings in the isochoric evolution, and thereby we are not violating the 2nd law. | {
"domain": "chemistry.stackexchange",
"id": 17349,
"lm_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",
"url": null
} |
filters, audio
As a "workaround" I noticed if I offset the addition by as few as 8 or 16 samples on one of the signals (that is, a time delay on one of the streams; also 44100 samples/sec audio fwiw), then the frequency response of the mixed signal looks much more flat relative to my original signal (which is what I want -- the band stop is gone, though there's still clearly some interference pattern in the shared transition band). | {
"domain": "dsp.stackexchange",
"id": 7649,
"lm_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, audio",
"url": null
} |
matlab, sampling, nyquist, digital, reconstruction
I want to write a code like above for all 3 cases. And how can I find the Nyquist sampling rate for signal empirically ? Thank you all.
I know signals are not same. But I just want to do same thing on my signal. I've defined a sample rate, fs, in Hz to match your sine frequencies. The sin calculations would be in terms of normalized frequencies—f1/f2, for instance. Your variable t is the sample index, and I've defined numSamps as the number of samples to calculate.
fs = 130; % sample rate
numSamps = 21; % number of sample points to calculate
f1 = 30;
amplitude1 = 1;
f2 = 60;
amplitude2 = 1;
t = 0 : numSamps-1;
signal1 = amplitude1 * sin(2*pi*f1/fs*t);
signal2 = amplitude2 * sin(2*pi*f2/fs*t);
signal = signal1 + signal2;
plot(t, signal,'o');
grid on; | {
"domain": "dsp.stackexchange",
"id": 8667,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, sampling, nyquist, digital, reconstruction",
"url": null
} |
statistical-mechanics, field-theory, computational-physics
Get some [orthogonal] basis for representation of the field. Probably you already have one. Boundary and continuity conditions should give you some ideas. Probably instead of looking for a vector field basis it is worth to look for a basis of some three-dimensional function and consider it's gradient as your vector field. Plane waves is a nice basis for 3-D functions.
Sample uniformly from this basis.
(Trick is here!) Assign weights to sample elements in such a way that makes the sample consistent with your observations. Optimize some regularity function of weights (variation for example) keeping consistency with observations. | {
"domain": "physics.stackexchange",
"id": 56986,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, field-theory, computational-physics",
"url": null
} |
slam, navigation, rviz, rtabmap, rtabmap-ros
$rostopic hz /camera/left/image_rect_color | {
"domain": "robotics.stackexchange",
"id": 21842,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, rviz, rtabmap, rtabmap-ros",
"url": null
} |
c++, game, rock-paper-scissors
I would write it like this:
bool isUserInputValid(const std::string& playerSelection)
{
return std::find(std::begin(option), std::end(option), playerSelection) != std::end(option);
}
I should not use std::endl when "\n" is enough. The difference is that std::endl will flush the output buffer (Which is not needed, the standard library will flush when it needs to).
This is the source of most speed concerns from new learners.
There is no need for multiple statements. You can use a single statement (with one string per line) or a single raw string.
void promptUserInput()
{
std::cout << "Game Started! Enter your choice from below:" << std::endl;
std::cout << "Rock" << std::endl;
std::cout << "Paper" << std::endl;
std::cout << "Scissors" << std::endl;
}
I would write like this:
void promptUserInput()
{
std::cout << "Game Started! Enter your choice from below:\n"
<< " Rock\n"
<< " Paper\n"
<< " Scissors\n";
} | {
"domain": "codereview.stackexchange",
"id": 45171,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, game, rock-paper-scissors",
"url": null
} |
matlab, transfer-function, laplace-transform, state-space, time-domain
I got this,
$$\frac{\omega(s)}{V(s)}=\frac{0.01}{s^2+12s+20.02}$$
Which is different from direct laplace model above by a factor of 200.
If I model it normally without using modal form by choosing the rotational speed and electric current as the state variables.
$$\dot{x}(t) =
\left[\begin{matrix}-\frac{b}{J} & -\frac{K}{J} \\ \frac{K}{J} & -\frac{R}{L}\end{matrix}\right]
x(t)+
\left[\begin{matrix}0 \\ \frac{1}{L}\end{matrix}\right]
V(t)$$
$$y(t) =
\left[\begin{matrix}1 & 0\end{matrix}\right]
\left[\begin{matrix}\omega(t) \\ i(t)\end{matrix}\right]
$$
$$\dot{x}(t) =
\left[\begin{matrix}-10 & -0.02 \\ 1 & -2\end{matrix}\right]
x(t)+
\left[\begin{matrix}0 \\ 2\end{matrix}\right]
V(t)$$
$$y(t) =
\left[\begin{matrix}1 & 0\end{matrix}\right]
\left[\begin{matrix}\omega(t) \\ i(t)\end{matrix}\right]
$$
by running this code in MATLAB
J = 0.01; b = 0.1; K = 0.01; R = 1; L = 0.5;
ss_A = [-b/J K/J ; -K/L -R/L];
ss_B = [0 ; 1/L];
ss_C = [1 0];
ss_D = 0;
ss_motor = ss(ss_A,ss_B,ss_C,ss_D); | {
"domain": "dsp.stackexchange",
"id": 6791,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, transfer-function, laplace-transform, state-space, time-domain",
"url": null
} |
quantum-field-theory, particle-physics, statistical-mechanics, condensed-matter
Some objects are in fact one-loop exact (the beta function in supersymmetric Yang-Mills, the axial anomaly, etc.). This can be established non-perturbatively, but one is usually skeptical about these results, because of the usual subtleties inherent to QFT. The explicit two-loop computation of these objects helped convince the community that there is an overall coherent picture behind QFT, even if the details are sometimes not as rigorous as one would like.
In many cases, the counter-terms that arise in perturbation theory actually vanish to one loop (e.g., the wave-function renormalisation in $\phi^4$ in $d=4$). When this happens, you need to calculate the two-loop contribution in order to obtain the first non-trivial contribution to the beta function and anomalous dimension, so as to be able to tell, for example, whether the theory is IR/UV free. | {
"domain": "physics.stackexchange",
"id": 46250,
"lm_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, particle-physics, statistical-mechanics, condensed-matter",
"url": null
} |
c++, algorithm, graph, library, pathfinding
if (CLOSEDB.find(p_child) != CLOSEDB.end())
{
WeightType path_len = g + DISTANCEB(p_child);
if (best_cost > path_len)
{
best_cost = path_len;
p_touch = p_child;
}
}
}
}
}
else
{
HeapNode<NodeType, WeightType>* p_heap_node = OPENB.top();
NodeType* p_current = p_heap_node->get_node();
OPENB.pop();
delete p_heap_node;
CLOSEDB.insert(p_current);
typename coderodde::AbstractGraphNode<NodeType>::ParentIterator*
p_iterator = p_current->parents(); | {
"domain": "codereview.stackexchange",
"id": 13225,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, graph, library, pathfinding",
"url": null
} |
computational-chemistry
## Kinetic ##
1 2 3 4 5 6 7
1 29.0031999 -0.1680109 0.0000000 0.0000000 -0.0000000 -0.0045400 -0.0045400
2 -0.1680109 0.8081280 0.0000000 0.0000000 -0.0000000 0.1137475 0.1137475
3 0.0000000 0.0000000 2.5287312 0.0000000 0.0000000 0.0000000 0.0000000
4 0.0000000 0.0000000 0.0000000 2.5287312 0.0000000 0.1993355 -0.1993355
5 -0.0000000 -0.0000000 0.0000000 0.0000000 2.5287312 0.1672036 0.1672036
6 -0.0045400 0.1137475 0.0000000 0.1993355 0.1672036 0.7600319 0.0083249
7 -0.0045400 0.1137475 0.0000000 -0.1993355 0.1672036 0.0083249 0.7600319
## Potential ##
1 2 3 4 5 6 7 | {
"domain": "chemistry.stackexchange",
"id": 7126,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computational-chemistry",
"url": null
} |
acid-base, experimental-chemistry
Title: Comparison of acids to dissolve phosphates I am currently reading this German paper on the dissolution of phosphates by acids and chelants.
The authors do a "fast-test" of the dissolving power of different acids which goes as follows:
For each test, increasing quantities (10-50ml) of 0.1 n acids are
added to 100 mg of tricalcium phosphate and agitated for 1 hour. The
residue is filtrated and weighed.
For 0.1 n hydrochloric acid 20ml suffice for complete dissolution of
100mg tricalcium phosphate. Citric acid [...] shows >90% dissolution
with 40ml.
Not being a chemist I am having trouble interpreting this. What quantity is effectively being controlled by specifying 0.1 n acid? The paper is from the 60s. I thus suspect that n stands for normality but I am not sure.
What exactly is being measured? | {
"domain": "chemistry.stackexchange",
"id": 142,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, experimental-chemistry",
"url": null
} |
ros, rgbdslam-freiburg
[rosmake-1] Starting >>> visualization_msgs [ make ]
[rosmake-0] Finished <<< common_rosdeps ROS_NOBUILD in package common_rosdeps
[rosmake-0] Starting >>> octomap_ros [ make ]
[rosmake-3] Finished <<< dynamic_reconfigure ROS_NOBUILD in package dynamic_reconfigure
[rosmake-3] Starting >>> nav_msgs [ make ]
[rosmake-2] Finished <<< nodelet ROS_NOBUILD in package nodelet
[rosmake-2] Starting >>> nodelet_topic_tools [ make ]
[rosmake-1] Finished <<< visualization_msgs No Makefile in package visualization_msgs
[rosmake-1] Starting >>> actionlib_msgs [ make ]
[rosmake-0] Finished <<< octomap_ros ROS_NOBUILD in package octomap_ros
[rosmake-3] Finished <<< nav_msgs No Makefile in package nav_msgs
[rosmake-0] Starting >>> trajectory_msgs [ make ]
[rosmake-3] Starting >>> std_srvs [ make ]
[rosmake-2] Finished <<< nodelet_topic_tools ROS_NOBUILD in package nodelet_topic_tools
[rosmake-2] Starting >>> pcl_ros [ make ]
[rosmake-1] Finished <<< actionlib_msgs No Makefile in package actionlib_msgs | {
"domain": "robotics.stackexchange",
"id": 18122,
"lm_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, rgbdslam-freiburg",
"url": null
} |
optics
Now I am thinking about light coming in at an angle. I was thinking that the light that came in at an angle would have to take a longer optical path length so that it would act like a quarter wave for a longer wavelength. However I modeled this in OpenFilters and I saw that the opposite was true. Light incident at an angle seemed to be acting like a quarter wave for a shorter wavelength. I was wondering if anyone has a explanation or a good resource to read about the reflection of incident light at an angle and how interference effects work in that case. OpenFilters is wrong (or your programming or interpretation of it is). Interference depends on the difference in path lengths between substrate and coating, and that increases with shallower angles of incidence.
Don't use OpenFilters, use a puddle. | {
"domain": "physics.stackexchange",
"id": 31818,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.