text stringlengths 1 1.11k | source dict |
|---|---|
newtonian-mechanics, kinematics, potential-energy
Title: What's the accurate potential energy for an angular system?
In the above figure, at 'F' point there's a massive Iron (whose mass is $m$) attached with a string whose mass is negligible. And 3 m below from the point F there's a silver ball. The height of the table is 2 m. The depth of that table is 0 and that table is frictionless. Distance from the ball (on table) and edge of that table is 40 cm. Pendulum's string length is 3 m. At some moment, if we release the ball (which is attached with string) at 70 degree angle than it will hit the ball which is on top of that table. Let, radius of both ball is 0 m. After hitting the ball (which was on table) it will cross the table and fall some distance away. Now find the distance. | {
"domain": "physics.stackexchange",
"id": 83213,
"lm_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, kinematics, potential-energy",
"url": null
} |
quantum-field-theory, renormalization, fourier-transform, feynman-diagrams, integration
Title: A divergent Feynman loop in momentum space - how to describe it in position space? Consider the following loop diagram: | {
"domain": "physics.stackexchange",
"id": 42961,
"lm_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, renormalization, fourier-transform, feynman-diagrams, integration",
"url": null
} |
civil-engineering, chemical-engineering
\rho_{steel} &= 7.9 * 1000 kg/m^3 = 7900\text{ kg/m}^3 \\
\rho_{rubber} &= 1.52 * 1000 kg/m^3 = 1520\text{ kg/m}^3 \\
r &= \dfrac{\phi}{2} \\
r_{outer} &= \dfrac{0.079}{2} = 0.0395\text{ m} \\
r_{inner} &= \dfrac{0.075}{2} = 0.0375\text{ m} \\
r_{lining} &= \dfrac{0.069}{2} = 0.0345\text{ m} \\
A_{pipe} &= \pi(0.03952^2 - 0.0345^2) = 0.00116\text{ m}^2 \\
A_{steel} &= \pi(0.0395^2 - 0.0375^2) = 0.000484\text{ m}^2 \\
A_{lining} &= \pi(0.0375^2 - 0.0345^2) = 0.000679\text{ m}^2 \\
\text{steel:pipe} &= \dfrac{0.000484}{0.0011} = 0.417 \\
\text{lining:pipe} &= \dfrac{0.000679}{0.00116} = 0.585 \\
\rho_{pipe} &= \text{steel:pipe} * \rho_{steel} + \text{rubber:pipe} * \rho_{rubber} \\
&= 0.417 \cdot 7900 + 0.585 \cdot 1520 = 4184\text{ kg/m}^3
\end{align}$$
Correct Answer
According to the key, the answer is supposed to be 990 kg/m3 (neglecting the air in the tube). | {
"domain": "engineering.stackexchange",
"id": 3375,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "civil-engineering, chemical-engineering",
"url": null
} |
ros, debian, ros-diamondback, packages
Originally posted by Khiya on ROS Answers with karma: 49 on 2011-06-09
Post score: 1
You can also use the reinstall option, i.e. sudo apt-get --reinstall install ros-diamondback-<whatever you need>
Originally posted by dornhege with karma: 31395 on 2011-06-09
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 5795,
"lm_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, debian, ros-diamondback, packages",
"url": null
} |
c#, algorithm, graph
while (usedNames.Contains(male[randomName]))
{
randomName = random.Next(0, male.Length);
}
// Record the fact that we just used this name
usedNames.Add(male[randomName]);
maleIndividuals[i] = new Person
{
Name = male[randomName],
G = Gender.M
};
}
// Do the same thing with females
Person[] femaleIndividuals = new Person[random.Next(5, 15)];
for (int i = 0; i < femaleIndividuals.Length; i++)
{
int randomName = random.Next(0, female.Length);
while (usedNames.Contains(female[randomName]))
{
randomName = random.Next(0, female.Length);
}
usedNames.Add(female[randomName]);
femaleIndividuals[i] = new Person
{
Name = female[randomName],
G = Gender.F
};
} | {
"domain": "codereview.stackexchange",
"id": 30877,
"lm_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",
"url": null
} |
c, shell, posix
Title: A simple shell in C The M-Shell (msh) provides a basic command-line interface similar, and features some builtins (cd, exit, help, whoami, kill).
#ifdef _POSIX_C_SOURCE
#undef _POSIX_C_SOURCE
#endif
#ifdef _XOPEN_SOURCE
#undef _XOPEN_SOURCE
#endif
#define _POSIX_C_SOURCE 200819L
#define _XOPEN_SOURCE 700
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/wait.h>
#include <errno.h>
#include <pwd.h>
#include <libgen.h>
#define ARRAY_CARDINALITY(x) (sizeof (x) / sizeof ((x)[0]))
#define MSH_TOK_DELIM " \t\r\n\v\f"
static int msh_cd(const char *const *argv);
static int msh_help(const char *const *argv);
static int msh_exit(const char *const *argv);
static int msh_kill(const char *const *argv);
static int msh_whoami(const char *const *argv); | {
"domain": "codereview.stackexchange",
"id": 45383,
"lm_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, shell, posix",
"url": null
} |
neural-networks, reinforcement-learning, function-approximation
My understanding is that this is technically possible - but why is it not being done often or at all? The biggest problem with SVMs, random forests, gradient boosting and others for reinforcement learning (RL) is that they are not able to learn online, adjusting for new data as it arrives, and equally importantly forgetting older data. These algorithms learn from fixed datasets, and must be re-trained with whole new datasets if the target dataset changes, in scenarios also known as non-stationary problems.
This is a major issue in reinforcement learning for control problems (when you want to find an optimal policy). RL control problems always generate non-stationary target data, because they maintain a current policy - or for off-policy approches, current target policy. That current policy then changes over time as the agent improves its estimates (of e.g. the Q table), which means it is necessary to forget older training data and replace with newer. | {
"domain": "ai.stackexchange",
"id": 3351,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks, reinforcement-learning, function-approximation",
"url": null
} |
quantum-mechanics, wavefunction, quantum-interpretations, wavefunction-collapse
Thank you very much. If you treat the universe as an isolated system, then an outside observer will assign it a universal wavefunction which evolves under the Schrodinger equation and never collapses. The problem is that we -- by which mean the people who run experiments on quantum systems in the lab -- are not outside observers to the universe; we are definitely inside the universe. The universal wavefunction in principle contains the information about the quantum state of all the particles, including those which make up ourselves. But somehow you have to relate this to our subjective experience, and in particular, to the measurement outcomes that we observe when we run certain experiments in the lab. The Everett picture is one way to do this. I sometimes hear people say that Many-Worlds is a "logical consequence" of the universal wavefunction, but I strongly disagree; it is a proposal for how to assign physical meaning to the universal wavefunction. | {
"domain": "physics.stackexchange",
"id": 52056,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, wavefunction, quantum-interpretations, wavefunction-collapse",
"url": null
} |
algorithm, c, file, image, memory-management
Title: Two dimensional gaussian image generator in C This is a follow-up question for Image Processing Median Filter in C. I am attempting to create a two dimensional gaussian image like below in C.
The formula is as follows.
The experimental implementation
base.h: Contains the basic type implementation
/* Develop by Jimmy Hu */
#ifndef BASE_H
#define BASE_H
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define MAX_PATH 256
#define FILE_ROOT_PATH "./"
#define True true
#define False false
typedef struct RGB
{
unsigned char channels[3];
} RGB;
typedef struct HSV
{
long double channels[3]; // Range: 0 <= H < 360, 0 <= S <= 1, 0 <= V <= 255
}HSV;
typedef struct BMPIMAGE
{
char FILENAME[MAX_PATH];
unsigned int XSIZE;
unsigned int YSIZE;
unsigned char FILLINGBYTE;
unsigned char *IMAGE_DATA;
} BMPIMAGE; | {
"domain": "codereview.stackexchange",
"id": 41536,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, c, file, image, memory-management",
"url": null
} |
newtonian-mechanics, angular-momentum, rotational-dynamics, torque, gyroscopes
I apologize for the length of the excerpt, I tried to give as much context as possible.
Question 1: Where does the torque that rotates the inner gimbal come from if the pivots themselves cannot provide this torque?
Question 2: Which torque exactly is the author referring to in the last paragraph? The image shows a gimbal mounted gyroscope wheel. From outside to inside there is a yellow frrame and a red frame.
I define three axes:
Roll axis - the gyroscope wheel spins around the roll axis.
Pitch axis - motion of the red frame.
As you can see, the gimbal mounting ensures the pitch axis is perpendicular to the roll axis.
Swivel axis - motion of the yellow frame. | {
"domain": "physics.stackexchange",
"id": 63298,
"lm_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, angular-momentum, rotational-dynamics, torque, gyroscopes",
"url": null
} |
2. I'm thinking that if a function is greater than another, then the derivative of the larger function should be greater than (or equal to) the derivative of the smaller function as x gets large. Therefore, taking the derivatives and solving for x we get: $$\frac1x = \alpha x^{\alpha-1} \Rightarrow x = \left( \frac1\alpha \right)^{\frac1\alpha}.$$ So I thought I should let $c_\alpha = \left( \frac1\alpha \right)^{\frac1\alpha} - 1$ so that it satisfies conditions b and c, but it does not satisfy condition a. I need a hint.
• Your statement (2) is not correct. For example if $f(x)=x+x^{-1}$ and $g(x)=x$ then $f(x)>g(x)$ for all $x>0$, but $f'(x)<g'(x)$. Draw graphs of $f$ and $g$ on the same axes and you will understand what is happening here. – David Nov 14 '16 at 4:14
• @David: Thanks. I am looking at a graph of both functions. $f'(x) \rightarrow g'(x)$ as $x \rightarrow \infty$. This was the kind of idea I thought would be useful. – SOULed_Outt Nov 14 '16 at 4:20
PRIMER: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812345563902,
"lm_q1q2_score": 0.8152081576452754,
"lm_q2_score": 0.8418256452674008,
"openwebmath_perplexity": 163.09531005988887,
"openwebmath_score": 0.9372662305831909,
"tags": null,
"url": "https://math.stackexchange.com/questions/2013024/prove-that-ln-x-leq-x-alpha-for-large-x-and-that-there-exists-a-constant"
} |
c, programming-challenge, time-limit-exceeded
define variables in the smallest possible scope. With the right version of C, this also include defining variables as part of the for syntax. This makes the code much clearer as it is easier to see where the variable is used.
define a variable to refer to coord[j].
use += instead of repeating variable = variable + something.
At this stage, the code looks like :
int main(){
coordinate coord[100000];
int N, C;
scanf ("%d %d", &N, &C);
for (int i = 0; i < N; i++){
scanf ("%d %d %d %d", &coord[i].x1, &coord[i].y1, &coord[i].x2, &coord[i].y2);
}
for (int i = 0; i < C; i++){
int xi, xf;
scanf ("%d %d", &xi, &xf);
int nbacterias = 0; | {
"domain": "codereview.stackexchange",
"id": 12393,
"lm_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, time-limit-exceeded",
"url": null
} |
atmosphere, meteorology, temperature
Title: How does the pole-to-equator temperature gradient scale with height contours? Are the pole-to-equator temperature gradients lower at higher heights than at lower heights (like 850 mb/500 mb)?
If so, why is it the case? Especially given that the zonal circulation tends to be much higher at higher heights, so one could expect there to be less meridional heat transport.
(Bonus question: how is it different in other planetary atmospheres?) It depends on the season. The figures below shows zonal mean temperature for June-July-August from ECMWF ERA-40 reanalysis. As you can see, at 100 hPa, the equator is actually colder than the sunlit hemisphere.
June-July-August
December-January-February | {
"domain": "earthscience.stackexchange",
"id": 0,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "atmosphere, meteorology, temperature",
"url": null
} |
So we have
$x=\sin\left(\frac{\pi}{3}\right)\cos\left(\arctan\ left(\frac{-1}{3}\right)\right)+\sin\left(\arctan\left(\frac{-1}{3}\right)\right)\cos\left(\frac{\pi}{3}\right)$
Simplifying we get
$x=\frac{\sqrt{3}}{2}\cos\left(\arctan\left(\frac{-1}{3}\right)\right)+\frac{1}{2}\sin\left(\arctan\l eft(\frac{-1}{3}\right)\right)$
Now it can be shown that $\cos\left(\arctan(x)\right)=\frac{1}{\sqrt{1+x^2}}$
and $\sin\left(\arctan(x)\right)=\frac{x}{\sqrt{x^2+1}}$
So we have that
$x=\frac{\sqrt{3}}{2}\cdot\frac{1}{\sqrt{1+\left(\f rac{-1}{3}\right)^2}}+\frac{1}{2}\frac{\left(\frac{-1}{3}\right)}{\sqrt{1+\left(\frac{-1}{3}\right)^2}}$
$~=\frac{\sqrt{3}}{2}\cdot\frac{3\sqrt{10}}{10}+\fr ac{1}{2}\cdot\frac{-\sqrt{10}}{20}$
$=\frac{\left(3\sqrt{3}-1\right)\sqrt{10}}{20}\quad\blacksquare$
4. To Jhevon and Mathstud28: | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692298333415,
"lm_q1q2_score": 0.863413973396932,
"lm_q2_score": 0.8840392909114836,
"openwebmath_perplexity": 656.1596088478168,
"openwebmath_score": 0.9137446880340576,
"tags": null,
"url": "http://mathhelpforum.com/trigonometry/43635-trigonometry-problem.html"
} |
rust, tcp, redis
Ok(Command::Echo(cmd)) => "$".to_string() + &cmd + "\r\n",
Ok(Command::Set(key, value, expiry)) => {
let mut storage = storage.lock().unwrap();
let expiry =
expiry.map(|t| time::Instant::now() + time::Duration::from_millis(t as u64));
storage.insert(key, (expiry, value));
"+OK\r\n".to_string()
}
Ok(Command::Get(key)) => {
let storage = storage.lock().unwrap();
match storage.get(&key) {
Some((expiry, v)) => {
if let Some(expiry) = expiry {
if time::Instant::now() >= *expiry {
"$-1\r\n".to_string()
} else {
"$".to_string() + &v + "\r\n"
}
} else {
"$".to_string() + &v + "\r\n"
}
}
None => "$-1\r\n".to_string(), | {
"domain": "codereview.stackexchange",
"id": 45544,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rust, tcp, redis",
"url": null
} |
c++, c++11
std::cout << "\nTesting the range-based gcd():\n";
std::vector<int> v;
std::set<int> s;
std::list<int> li;
// Test gcd() with the vector
try {
std::cout << gcd(v.begin(), v.end()) << "\n";
} catch (const std::invalid_argument& e) {
std::cout << "Correctly caught exception (empty vector): " << e.what() << "\n";
}
// Add one element to v
v.push_back(4);
try {
std::cout << gcd(v.begin(), v.end()) << "\n";
} catch (const std::invalid_argument& e) {
std::cout << "Correctly caught exception (only one element in vector): " << e.what() << "\n";
}
// Add second element to v
v.push_back(8);
std::cout << gcd(v.begin(), v.end()) << "\n";
// Add third element to v
v.push_back(8);
std::cout << gcd(v.begin(), v.end()) << "\n";
// Add fourth element to v
v.push_back(14);
std::cout << gcd(v.begin(), v.end()) << "\n"; | {
"domain": "codereview.stackexchange",
"id": 18574,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11",
"url": null
} |
A compactness argument should do the trick. I assume each tile type has positive area.
A configuration of tiles is specified by giving a type, position (of a given reference point) and angle of rotation for each tile. Since there are only a finite number of tiles and each has positive area, only finitely many tiles can intersect a bounded region. Allowed configurations of tiles with reference points in, let's say, a closed unit square form a compact metric space $K$. Tiling the plane with such unit squares, we get a configuration space $\Omega$ for the infinite plane that is a closed subset of the cartesian product of copies of $K$. By Tychonoff's theorem this is a compact metrizable space. Given sequence of configurations $\omega_n$, each consisting of a finite arrangement of non-overlapping tiles that cover, say, $[-n,n] \times [-n,n]$, some subsequence will have a limit $\omega$, and that limit must be a tiling of the whole plane.
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936073551713,
"lm_q1q2_score": 0.809111067383558,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 235.18530900534924,
"openwebmath_score": 0.828284740447998,
"tags": null,
"url": "http://math.stackexchange.com/questions/809548/tiling-arbitrarily-large-portions-of-the-plane-implies-tiling-the-plane"
} |
python, beginner, pyqt
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.Title.setText(_translate("MainWindow", "Mastermind!"))
self.groupBox.setTitle(_translate("MainWindow", "Guess History"))
self.Result_Output.setText(_translate("MainWindow", "Result"))
self.pushButton.setText(_translate("MainWindow", "Submit!"))
self.label.setText(_translate("MainWindow", "A random 4 digit code has been created! "))
self.label_2.setText(_translate("MainWindow", "Put 4 numbers in the boxes bellow and read the result!! "))
self.actionNew_Game.setText(_translate("MainWindow", "New Game"))
self.actionNew_Game.setStatusTip(_translate("MainWindow", "Start a new game?"))
self.actionNew_Game.setShortcut(_translate("MainWindow", "Ctrl+N")) | {
"domain": "codereview.stackexchange",
"id": 37872,
"lm_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, pyqt",
"url": null
} |
stress-energy-momentum-tensor
More generally, one can also always find a local orthonormal reference frame in which the stress-energy tensor is diagonal (i.e., its off-diagonal components are all zero.) In this reference frame, the determinant of the stress-energy tensor would just be the product of the energy density $\rho$ with the three pressures $P_x$, $P_y$, and $P_z$. Any situation in which the determinant vanishes is one in which at least one of these quantities is zero, but you can't necessarily say much more than that. And there are plenty of types of matter for which this product is non-zero — radiation, for example, or dust moving with some kind of Maxwell-Boltzmann distribution of velocities. | {
"domain": "physics.stackexchange",
"id": 94574,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stress-energy-momentum-tensor",
"url": null
} |
javascript, css, gui
var currentOnload = window.onload;
window.onload = function() {
currentOnload && currentOnload();
newOnload();
};
}
In loadTabs, if you make the first change to selectTab that I mentioned, you'll need to change to onclick.value = "selectTab(this.parentNode);";.
Right now you're reassigning all the children of the tab to the <a>. That's fine, but if you're just trying to set the text, you can use textContent instead. Again, this is a behavioural change.
function loadTabs() {
var elems = document.querySelectorAll(".tabs > ul > li");
for (var i = 0; i < elems.length; i++) {
var a = document.createElement('a');
var href = document.createAttribute('href');
href.value = "#";
var onclick = document.createAttribute('onclick');
onclick.value = "selectTab(this.parentNode);";
a.setAttributeNode(href);
a.setAttributeNode(onclick); | {
"domain": "codereview.stackexchange",
"id": 25916,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, css, gui",
"url": null
} |
When finding the volume, it's a good practice to draw the graph, so you can better visualize the problem.
$x^2+y^2+z^2=1$ is a sphere with center origin and radius 1, and $z=x^2+y^2$ is a paraboloid.
This is an interesting problem. You will need to find the volume as the sum of two triple integrals.
The two sections of the volume are divided by the plane $z=\frac{-1+\sqrt 5}{2}$. So, you have to find the volume below and above that plane, separately, and add them up to get the whole volume of the solid.
I have attached the xz-trace coordinates (in the plane y=0) so you can understand the limits. The yz-trace coordinates look the same. I've also attached an edited graph of the same, showing the 2 sections of volume that you need to find. Note that the vertex of the parabola is the origin.
To make it easier, you can use cylindrical coordinates to find the lower region and spherical coordinates for the upper region.
#### Attached Files: | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9664104972521579,
"lm_q1q2_score": 0.8074200585587448,
"lm_q2_score": 0.8354835350552603,
"openwebmath_perplexity": 660.4378842674521,
"openwebmath_score": 0.8229450583457947,
"tags": null,
"url": "https://www.physicsforums.com/threads/volume-inside-two-3d-surfaces.604997/"
} |
lstm
history = model.fit(X_train_scaled_reshaped,
y_train_reshaped,
batch_size = batch_size,
epochs = nb_epochs,
validation_split=0.3) What you are up against is this fundamental property of most tradable, liquid financial price series, and that is, they are Brownian Motion. In discrete time, it's also known as random walk.
The most important property of Brownian Motion is that it's memoryless, whose mathematical expression is
$E[p_{t+1} | p_{-{\infty} : t}] = p_t$
Recurrent neural net, particularly the LSTM flavor, is very powerful in capturing and modeling a long memory process. In fact, it was invented to deal with state that depends on itself many time steps ago (that famous LSTM paper was dated 20 yrs ago[1]). | {
"domain": "datascience.stackexchange",
"id": 2493,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lstm",
"url": null
} |
exoplanet
Title: Axial tilt of exoplanets Some directly imaged exoplanets have had their rotation measured but has the axial tilt of any exoplanet been measured? If not, when might we get the first measurement of axial tilt of an exoplanet? According to the paper https://arxiv.org/abs/1707.06278, the "James Webb Space Telescope should be able to constrain the obliquities of nearby warm Jupiters to be small (if <=10degrees) or to directly measure them if significantly non-zero (>=30degrees) using the technique of eclipse mapping." | {
"domain": "astronomy.stackexchange",
"id": 5618,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "exoplanet",
"url": null
} |
javascript, optimization, jquery, object-oriented
Title: Should I differentiate object types by calling methods via variables? I have three JavaScript objects. The first one serves merely as a prototype. The other two are implementation of a specific type.
var MainPrototype = {};
var SpecificType = $.extend(Object.create(MainPrototype));
var OtherSpecificType = $.extend(Object.create(MainPrototype));
I am missing the option of a parent-method and am trying to implement some specifics for each specific type.
I started of by comparing the types within the main prototype object, yet I found the nesting if-else clausing worrysome and in case that new types would be introduced, I guess the code will get ugly fast. I also does not feel right to put the specifics into the main function.
var MainPrototype = {
function: bind() {
//generic stuff | {
"domain": "codereview.stackexchange",
"id": 7056,
"lm_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, optimization, jquery, object-oriented",
"url": null
} |
If $\sim$ is an equivalence class over $A$, then in many places we write $A/{\sim}$ as the set of equivalence classes.
This notation is similar, and on purpose, to the notation from algebra when writing $V/W$ for the quotient subspace, or $G/H$ for the quotient group, or $R/I$ when taking a quotient of a ring by an ideal.
The reason is that all those quotients actually induce an equivalence relation, and we have a natural structure on the set of equivalence classes.
-
I honestly don't know what could be wrong in this answer, and I would be very glad if someone would tell me. Perhaps something is wrong with the user posting it instead... – Asaf Karagila Dec 16 '13 at 21:30
– Daniel Fischer Dec 17 '13 at 10:43 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773707973303964,
"lm_q1q2_score": 0.82479842924695,
"lm_q2_score": 0.8438951025545426,
"openwebmath_perplexity": 150.6104752798788,
"openwebmath_score": 0.9577948451042175,
"tags": null,
"url": "http://math.stackexchange.com/questions/369635/what-is-the-standard-notation-for-a-set-of-equivalence-classes"
} |
quantum-chemistry, computational-chemistry, theoretical-chemistry, multi-reference
A configuration is a certain occupation of (molecular) orbitals. Mathematically configurations can be represented in 2 ways. The first one is the Slater Determinant (SD), an anti-symmetrized product of spin-orbitals. Slater Determinants, however, are not eigenfunctions of the spin operator $\hat S^2$, but the electronic wave function needs to fulfill this requirement. Therefore one constructs spin-adapted Configuration State Functions (CSF) as certain linear-combinations of SDs. Using CSFs instead of SDs usually makes a calculation more stable. "Configuration" is a more general term, which does not explicitly say whether an SD or CSF is considered.
Multi-configurational just means the method considers more than one configuration. | {
"domain": "chemistry.stackexchange",
"id": 16622,
"lm_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-chemistry, computational-chemistry, theoretical-chemistry, multi-reference",
"url": null
} |
f(x)} is said to be analytic if it can be represented by the an infinite power series ∑ n = 0 ∞ c n (x − a) n {\displaystyle \sum _{n=0}^{\infty }c_{n}(x-a)^{n}} The Taylor expansion or Taylor series representation of a function, then, is. Then we will refactor the Taylor Series into functions and compare the output of our Taylor Series functions to functions from Python's Standard Library. xn x 2( 1;1) ex = 1 + x + x2. To get the Maclaurin series, we look at the Taylor polynomials for f near 0 and let them keep going. Uniqueness of the Taylor series. The Taylor's theorem states that any function f(x) satisfying certain conditions can be expressed as a Taylor series: assume f (n) (0) (n = 1, 2,3…) is finite and |x| < 1, the term of f (n) (0) n! x n becomes less and less significant in contrast to the terms when n is small. The position in thousands of feet of a car driving along a straight road at time in minutes is given by the function y pictured below (t) that is 14+ 10+ 10 2 6 Let | {
"domain": "visitlocorotondo.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130576932457,
"lm_q1q2_score": 0.8085918259981172,
"lm_q2_score": 0.8175744695262777,
"openwebmath_perplexity": 521.1226257899933,
"openwebmath_score": 0.8538424372673035,
"tags": null,
"url": "http://qtxi.visitlocorotondo.it/taylor-series.html"
} |
hash, linear-algebra, hashing
Consider a 2 dimensional vector space, Given that r.v < 0 if the angle between the two vectors are less than 90degrees and >0 when they are above 90 degrees. This would mean that the probability of the blue vector dot product with another data point giving a r.v > 0 is zero. This would mean that i can only draw vectors in the negative space? $r \cdot v$ can be negative even if all elements of $v$ are positive: consider, e.g., $r = (2,-3)$ and $v=(1,1)$. Then $r \cdot v = -1$.
Also, using random projections is not the same as defining a hash to be 1 if the dot-product is $\ge 0$ and 0 if it is $<0$. You can still use a random projection without using that particular hash function. I haven't looked at the sparselsh code, but it's also possible that it could be using a random projection but without using that specific hash function. | {
"domain": "cs.stackexchange",
"id": 8917,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "hash, linear-algebra, hashing",
"url": null
} |
rust
Or:
res.splice(0..0, first);
Or:
res = vec![first, rest].into_iter().flatten().collect();
But it seems odd that you are assembling the Vec this way. Usually we try to assemble it from beginning to end. I'd look to see if there is a better way to structure to code to avoid this. | {
"domain": "codereview.stackexchange",
"id": 42123,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rust",
"url": null
} |
frequency-spectrum, frequency, power-spectral-density, frequency-domain, measurement
Title: Spectrum in real life with Spectrum in theory as you know it is possible to measure the power spectral density ($|X(f)|^2$) of a certain voltage signal $x(t)$ through a Spectrum Analyzer.
As far as I'm concerned, the simplest spectrum analyzer does not perform the Fourier transform X(f) of the input signal to evaluate the power spectral density. On the contrary, it simply selects each harmonic of the input signal through a tuned filter (or a tuned demodulator) and measures the power of the selected harmonics. The measured power is plotted against all the possible frequencies in the display.
This is what I've seen when I used a 2GHz sine wave as input signal. | {
"domain": "dsp.stackexchange",
"id": 10216,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "frequency-spectrum, frequency, power-spectral-density, frequency-domain, measurement",
"url": null
} |
electric-fields
Title: Calculating electric field in cylindrical symmetry- - Trying to understand electric field/potential in 3D with cylindrical coordinates Trying to work through this question I am sure that I am doing something wrong.
We start with a uniform electric field
$$ E = E_o \hat{i} $$
and then find that the potential is given by
$$ V=-E_0 x + A$$
where A is a constant
In cylindrical coordinates this gives
$$ V(r,\phi,z)= -E_0 r \cos(\phi) $$
And hence the electric field in cylindrical coordinates is given by
$$ -\nabla V = -\left({\partial V \over \partial r}\hat{r} + {1\over r}{\partial V \over \partial \phi}\hat{\phi}+ {\partial V \over \partial z}\hat{z}\right) \\= +E_0 \cos(\phi) \hat{r}-E_0 {1\over r}r\sin(\phi)\hat{\phi} \\ = E_0 (\cos(\phi)\hat{r} -\sin(\phi)\hat{\phi})$$
Now my confusion is in the following step where I try to calculate the magnitude of the electric field in the cylindrical coordinate system.... | {
"domain": "physics.stackexchange",
"id": 57300,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-fields",
"url": null
} |
quantum-mechanics, quantum-field-theory, particle-physics, field-theory, vacuum
Where $|0\rangle$ is the vacuum state. But, could I write equation (2) as:
$${\rm amplitude} = 4\sqrt{\pi}f(x)\exp\{-\frac{1}{2}\int\ d^3d^3yf(x)\Omega_{x, y}f(y)\}\tag3$$
In analogy with harmonic ($4\sqrt{\pi}f(x) =$ norm of state in Harmonic oscillator times the 1-degree Hermite's polynomial) and with $\Omega_{x, y}$ is the kernel that you can see in Eq. (3) of Interaction term in QFT Your best bet might be Itzykson & Zuber's overdetailed QFT text, insert in 3.1.2. They explain that your overly naive expression (1) yields eigenstates of $\hat \phi (x)_-$, not $\hat \phi (x)$. The answer you are citing distinctly warns you this is not a field operator eigenstate. (By the way, your $|f(x)\rangle$ should really be $|f\rangle$, as it covers all xs. The argument is the function, not its value at some x.)
Rather than perish in a nightmare of sequential Fourier transforms, rampant indexing and normalizations to enforce Lorentz invariance and Hermiticity, I'll give you an easy hint. | {
"domain": "physics.stackexchange",
"id": 52977,
"lm_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, quantum-field-theory, particle-physics, field-theory, vacuum",
"url": null
} |
planet, exoplanet, kepler
An early paper by Morton & Johnson (2011) claimed on the basis of a population synthesis approach, that that astrophysical false positives were limited to less than 10%. However, a recent paper by Coughlin et al. (2014) discusses how instrumental effects can be tested for by comparing the transit periods with the periods of other known objects in the Kepler field of view. They claim that around 30% of the KOIs may in fact be false positives. Either way it looks like the big majority of the KOIs are indeed exoplanets, but identifying which ones aren't will require detailed follow-up. | {
"domain": "astronomy.stackexchange",
"id": 706,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planet, exoplanet, kepler",
"url": null
} |
where $\rm X$ is block diagonal
$$\mathrm X = \begin{bmatrix} \mathrm X_1 & & & \\ & \mathrm X_2 & & \\ & & \ddots & \\ & & & \mathrm X_n\end{bmatrix}$$
and each $\rm X_i$ block is $3 \times 3$. Let
$$\mathrm y := \mathrm X \mathrm b = \begin{bmatrix} \mathrm X_1 & & & \\ & \mathrm X_2 & & \\ & & \ddots & \\ & & & \mathrm X_n\end{bmatrix} \begin{bmatrix} \mathrm b_1\\ \mathrm b_2\\ \vdots \\ \mathrm b_n\end{bmatrix} = \begin{bmatrix} \mathrm X_1 \mathrm b_1\\ \mathrm X_2 \mathrm b_2\\ \vdots \\ \mathrm X_n \mathrm b_n\end{bmatrix} =: \begin{bmatrix} \mathrm y_1\\ \mathrm y_2\\ \vdots \\ \mathrm y_n\end{bmatrix}$$
Hence, we have a least-squares problem in $\mathrm y \in \mathbb R^{3n}$
$$\text{minimize} \quad \| \mathrm A \mathrm y - \mathrm c \|_2^2$$
A minimizer is a solution to the normal equations
$$\mathrm A^{\top} \mathrm A \mathrm y = \mathrm A^{\top} \mathrm c$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795091201804,
"lm_q1q2_score": 0.8329071721307445,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 250.18042372480343,
"openwebmath_score": 0.8794247508049011,
"tags": null,
"url": "https://math.stackexchange.com/questions/2283631/minimize-axbd-c-2-enforcing-x-to-be-a-diagonal-block-matrix"
} |
javascript, css, comparative-review, vue.js
flex-direction: row;
align-items: flex-start;
width: 100%;
}
.point {
width: 38px;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
color: #28a745;
}
.step-indicator {
width: 15px;
height: 15px;
border-radius: 100px;
box-sizing: border-box;
}
.not-started {
background: #ecedee;
border: none;
}
.progressing {
background: #ecedee;
border: 4px solid #28a745;
}
.done {
background: #28a745;
border: 4px solid #28a745;
}
.bar {
width: 100%;
height: 16px;
display: grid;
align-items: center;
}
.bar-eform {
width: 80%;
}
.bar-verification {
width: 20%;
}
.bar-bg {
height: 4px;
background-color: #ecedee;
position: relative;
}
.bar-arrow {
position: absolute;
top: 0;
left: 0;
height: 4px;
background-color: #28a745;
}
.page-indicator {
color: #28a745;
font-size: 14px;
} | {
"domain": "codereview.stackexchange",
"id": 42862,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, css, comparative-review, vue.js",
"url": null
} |
c#, .net, escaping, utf-8
Title: Wielding .NET masterfully to encode non-alphanumeric characters into utf-8 hex representation I have these two methods that work, but I also hate because they almost certainly can be improved. I'm hoping to gain some guidance from others who are more knowledgable of .NET's offering for encodings and byte manipulation.
Given a string, any character that is not a-z, A-Z, 0-9 is replaced by hex values enclosed in square brackets.
abc123 => abc123
abc-123 => abc[2D]123
abc[]123 => abc[5B][5D]123
abc©def => abc[C2][A9]def | {
"domain": "codereview.stackexchange",
"id": 43359,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, .net, escaping, utf-8",
"url": null
} |
) coordinate plane ), 2 differentiability Implies Continuity if a is! The dots with a continuous derivative: not all continuous functions have continuous derivatives human. Weierstrass ' function is differentiable at 0 as well as the proof of an example of a in the is... Hand derivative at ( x ) is the function must be differentiable there the discontinuous partial derivatives Your. The movable blue point illustrate the partial derivatives differentiable functions,... what is function! As well as the proof of an example of a ( at x = a ) = is. Series everywhere continuous NOWHERE differentiable functions are continuous functions NOWHERE differentiable functions...... Functions Using the mean value theorem differentiability is a function is differentiable on an interval is differentiable is. Videos on differentiable vs. non-differentiable functions, as well as the proof of an of. Of its graph when we are able to find the derivative function discontinuous function a! < b, you very much for | {
"domain": "misscarrington.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759621310288,
"lm_q1q2_score": 0.8297646021024566,
"lm_q2_score": 0.8459424373085145,
"openwebmath_perplexity": 284.12264156151207,
"openwebmath_score": 0.8485810160636902,
"tags": null,
"url": "https://www.misscarrington.com/28q0pdz3/fec186-differentiable-vs-continuous-derivative"
} |
waves, water
Title: What does it mean for waves to "feel" the bottom? While typically waves are said to "feel" the bottom when the depth of the water is less than half the wavelength, what does it mean for the waves to "feel"?
Furthermore, why does this happen at the depth of half the wavelength? In water wave physics, when we say that the wave "feels" the bottom, we mean that the water depth affects the properties of the wave.
The dispersion relationship for water waves is:
$$
\omega^2 = gk \tanh{(kd)}
$$
where $\omega$ is the wave frequency, $k$ is the wavenumber, $d$ is the mean water depth, and $g$ is gravitational acceleration. We distinguish "shallow" and "deep" water waves by the value of $kd$, which includes both the wavenumber and the water depth:
Shallow water waves when $kd < 0.3$;
Intermediate water waves when $0.3 < kd < 3$;
Deep water waves when $kd > 3$. | {
"domain": "earthscience.stackexchange",
"id": 240,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, water",
"url": null
} |
• @TomTseng: The homogeneous equation is solved using the geometric ansatz $t_k=c\lambda^k$, which yields the characteristic equation $\lambda=\frac23\lambda^2+\frac13$, with solutions $\lambda=1$ and $\lambda=\frac12$. For more on all this, see Wikipedia. May 11, 2016 at 7:41
• @TomTseng: I added a solution for the general case from any node to any other node. May 11, 2016 at 8:50 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9881308782546027,
"lm_q1q2_score": 0.8418408722975804,
"lm_q2_score": 0.8519528038477824,
"openwebmath_perplexity": 111.70108168262418,
"openwebmath_score": 0.9141199588775635,
"tags": null,
"url": "https://math.stackexchange.com/questions/1780501/what-is-the-expected-number-of-steps-in-a-random-walk-from-leaf-to-leaf-in-a-ful"
} |
cosmology, coordinate, units
A comoving coordinate system is one in which particles that don't move through space have fixed coordinates, even is that space is expanding (or contracting, or otherwise warping).
In contrast, the particles' physical coordinates are the actual distances you would measure between them if you froze space and started laying out measuring rods.
Expansion, scale factor, and redshift
Cosmological distances are often measured in megaparsec (Mpc), i.e. one million parsec, or roughly 3.3 million lightyears. | {
"domain": "astronomy.stackexchange",
"id": 2707,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, coordinate, units",
"url": null
} |
algorithm
The objective is to group all the 'Actions' in 'Operations' that minimize the total cost. For example, a group composed by actions {3, 7, 9} needs the resources {1, 2, 3, 4, 6} and therefore has a cost of 5, but a group composed by actions {4, 7, 9} needs the resources {2, 4} and therefore has a cost of 2.
It is needed to get done all the actions the most economically.
Which algorithm can solve this problem? I have finally abandoned the idea of doing it with an exact method and I have passed to the heuristic. I have mixed multi-boot, local search and certain random movements. Apparently this is called Greedy Randomized Adaptative Search Procedures (GRASP)
Hypothesis: the best solution is reached filling the 'operations' with the maximum of 'Actions' per 'Operation'. Other combinations are more expensive | {
"domain": "ai.stackexchange",
"id": 1676,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm",
"url": null
} |
pcl, arm-navigation, pr2
#8 message_filters::SimpleFilter<sensor_msgs::PointCloud2_<std::allocator<void> > >::signalMessage (this=<optimized out>, event=...)
at /opt/ros/fuerte/include/message_filters/simple_filter.h:135
#9 0x000000000043b365 in tf::MessageFilter<sensor_msgs::PointCloud2_<std::allocator<void> > >::testMessage (this=0x7a2970, evt=...)
at /opt/ros/fuerte/stacks/geometry/tf/include/tf/message_filter.h:413
#10 0x000000000043bf91 in tf::MessageFilter<sensor_msgs::PointCloud2_<std::allocator<void> > >::add (this=0x7a2970, evt=...)
at /opt/ros/fuerte/stacks/geometry/tf/include/tf/message_filter.h:255
#11 0x0000000000438408 in operator() (a0=..., this=0x7c05f8)
at /usr/include/boost/function/function_template.hpp:1013
#12 message_filters::CallbackHelper1T<ros::MessageEvent<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, sensor_msgs::PointCloud2_<std::allocator<void> > >::call (this=0x7c05f0, event=..., nonconst_force_copy=<optimized out>) | {
"domain": "robotics.stackexchange",
"id": 13041,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pcl, arm-navigation, pr2",
"url": null
} |
c, linux
if (ac != 5)
print_usage_exit();
pipe_or_die(pipefd);
child_pid = fork();
if (child_pid == -1)
perror("fork");
else if (child_pid == 0)
{
infile_fd = open_or_die(av[1], O_RDONLY, 0000);
close(pipefd[0]);
execute_pipeline(av[2], infile_fd, pipefd[1], envp);
}
else
{
outfile_fd = open_or_die(av[ac - 1], O_WRONLY | O_CREAT | O_TRUNC, 0666);
close(pipefd[1]);
execute_pipeline(av[3], pipefd[0], outfile_fd, envp);
}
return (EXIT_SUCCESS);
}
``` Error handling
The way you handle error is quite unusual. Why use write() instead of fprintf(stderr, ...)? Why have some error messages stored in a variable like g_empty_string, but other errors messages are passes as literals, like "pipex: "? Why try to open() first and only if it fails check if filename is empty?
On Linux, I recommend you use err() to report errors and exit with an error code in one go. For example: | {
"domain": "codereview.stackexchange",
"id": 42216,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, linux",
"url": null
} |
Since there are $$n + 2k$$ zeros and only $$n + k$$ rows, pigeon hole principle tells us that there exists one row that contains at least $$2$$ zeros. We remove that row.
Now there remains $$n + (k - 1)$$ rows and at most $$n + 2(k - 1)$$ zeros, so the induction hypothesis finishes the rest.
For $$k = n$$, we have shown that if there are $$3n$$ zeros in $$2n$$ rows, then we may remove $$n$$ rows such that there remains at most $$n$$ zeros.
Then simply remove all the columns containing at least a zero. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936073551712,
"lm_q1q2_score": 0.836451196660832,
"lm_q2_score": 0.8499711718571775,
"openwebmath_perplexity": 135.28335202806545,
"openwebmath_score": 0.7736309170722961,
"tags": null,
"url": "https://math.stackexchange.com/questions/3846102/using-pigeon-hole-principle"
} |
laser, cold-atoms
Title: Frequency modulation in laser locking - what frequency? In laser locking, e.g. using the PDH technique, the light (say of frequency $f$) is modulated so as to add two symmetric sidebands of frequency $\Omega$.
I know the maths, I understand how this leads to the error signal etc.
Physically and intuitevely, how would I choose the modulation frequency $\Omega$?
I.e. : it should not be the same as the carrier light because... / it should be far or close to it because... I am no expert on this but after reading about the technique I would offer a couple of suggestions. | {
"domain": "physics.stackexchange",
"id": 27588,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "laser, cold-atoms",
"url": null
} |
water, quantum-chemistry, computational-chemistry, theoretical-chemistry, group-theory
And this is where it gets interesting.
I’ll once again point to Professor Klüfers’ web scriptum for the basic and inorganic chemistry course in Munich, section about localising molecular orbitals. If you don’t understand German, all you need to do is look at the pictures and understand that wenig means a little in this context. | {
"domain": "chemistry.stackexchange",
"id": 14974,
"lm_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, quantum-chemistry, computational-chemistry, theoretical-chemistry, group-theory",
"url": null
} |
quantum-mechanics, string-theory, particle-physics, quantum-spin, quantum-teleportation
Never answered question: The original particle's superpositioned state is destroyed in the quantum teleportation process. This is mentioned in the beginning of the document you link, actually. You can't clone the state without destroying the source - this is actually a theorem called the No-cloning Theorem. | {
"domain": "physics.stackexchange",
"id": 824,
"lm_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, string-theory, particle-physics, quantum-spin, quantum-teleportation",
"url": null
} |
Binomial Theorem. 5x 3 9y 2 is a binomial in two variables x and y.
In the binomial expansion of (x a) n, the general term is given by Tr+1 = (-1)r nCrxn-rar. 1+1.
(x+y) 0 = 1 (x+y) 1 = x + y (x+y) 2 = x 2 + 2xy + y 2 Probability submenu, choice 3. x!
Chapter 14 The binomial distribution.
For example, to calculate the probability that two carriers of a recessive disease will have four children, two affected and two healthy, in any order. Therefore, the number of terms is 9 + 1 = 10.
The total number of terms in the binomial expansion of (a + b)n is n + 1, i.e. The variables m and n do not have numerical coefficients.
To determine the expansion on we see thus, there will be 5+1 = 6 terms. For the binomial distribution, you specify the the number of replicates (n), the size or the number of trials in each replicate (size), and the probability of the outcome under study in any trial (prob). All the binomial coefficients follow a particular pattern which is known as Pascals Triangle. | {
"domain": "calleemason.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357573468175,
"lm_q1q2_score": 0.8115607360678023,
"lm_q2_score": 0.8289388104343893,
"openwebmath_perplexity": 440.7888487863707,
"openwebmath_score": 0.8252242207527161,
"tags": null,
"url": "https://www.calleemason.com/echinacea/top/19941721e3b81979bca09b1541a7d874"
} |
general-relativity, binary-star, pulsar
$$\frac{3}{5x}\left[1+\frac{5}{3}xt-\left(1-\frac{8}{3}xt\right)^{5/8}\right]\text{.}$$
$K$ is not actually constant, being a function of the eccentricity $e$, although the rate of change of $e$ is tiny, on the order of $10^{-11}\,\mathrm{yr}^{-1}$, and we can ignore it on the scales we're talking about. Additionally, the proportionality formula is based on a orbital average of radiation reaction at 2.5-th post-Newtonian order. | {
"domain": "astronomy.stackexchange",
"id": 608,
"lm_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, binary-star, pulsar",
"url": null
} |
python, performance, programming-challenge, computational-geometry
Please note that I am not looking for a different calculating method (I am sure there is one, but, for me, Project Euler is about finding your own methods. Using yours would, to me, be cheating.)
Abandon this attitude! A key part of programming — just as important as coding — is developing a wide repertoire of algorithms and techniques that you can apply to problems you face. Although for your own intellectual satisfaction it's great to discover algorithms on your own, you should always go on to compare your solution to the best solutions discovered by others, so that you can improve your repertoire for the next problem.
In particular, when you want to speed up a program, it's counterproductive to say, "I don't want to implement a different algorithm, I just want to speed up the code I wrote". The biggest speedups come from finding better algorithms.
You say that your program "runs fine" but that doesn't seem to be true. Project Euler says: | {
"domain": "codereview.stackexchange",
"id": 3658,
"lm_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, programming-challenge, computational-geometry",
"url": null
} |
$$i + 1 = 2^{T-1} + j$$
Finally, let's compare that to the equation of the global index of the left-child node:
\begin{align} i' &= 2^T - 1 + 2j\\ &= 2*2^{T-1} + 2*j - 1\\ &= 2*(2^{T-1} + j) - 1\\ &= 2*(i + 1) - 1 \text{//NOTE: Here we use i + 1 = 2^{T-1} + j mentioned above}\\ &= 2i + 2 - 1\\ &= 2i + 1\\ \end{align}
Although the question was why the $$2n + 1$$ formula works, note that I used $$i$$ instead of $$n$$! Let me know if there is anything unclear.
• The reason why your edit has remained in review for this long is because it changed the answer quite substantially, so I would either reject it (with reason 'clearly conflicts authors intent') or leave it up to the author (or another reviewer). I've chosen the latter here, although it seems the author also did not make a decision. So I'm making a decision now. The suggested changes are too substantial for an edit, so I suggest you write your own answer, instead (which you did :) ). – Discrete lizard May 22 '19 at 16:56 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846640860382,
"lm_q1q2_score": 0.8276571054622156,
"lm_q2_score": 0.8459424353665382,
"openwebmath_perplexity": 423.32611352125036,
"openwebmath_score": 0.9204259514808655,
"tags": null,
"url": "https://cs.stackexchange.com/questions/87154/why-does-the-formula-2n-1-find-the-child-node-in-a-binary-heap/87163"
} |
ice bear 150cc scooter top speed
amazon bathroom vanity mirrors | {
"domain": "staroutlet.shop",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773708026035286,
"lm_q1q2_score": 0.8058050146987202,
"lm_q2_score": 0.8244619263765707,
"openwebmath_perplexity": 595.9332064337948,
"openwebmath_score": 0.9296665787696838,
"tags": null,
"url": "https://rttmvo.staroutlet.shop/en/integrals.html"
} |
c#, beginner, sharepoint
case SharePointEventArgs.ExceptionLevel.Info:
CLog(LogType.Info, e.Message);
break;
case SharePointEventArgs.ExceptionLevel.Error:
CLog(LogType.Error, e.Message, e.Exception);
break;
}
}
}
}
VCECurrentOpportunities class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using code.runner.intranet.Dal;
using code.runner.intranet.Entity;
using code.runner.intranet.Events;
using Microsoft.SharePoint;
using Newtonsoft.Json.Linq; | {
"domain": "codereview.stackexchange",
"id": 14409,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner, sharepoint",
"url": null
} |
molecular-biology, cell-biology, cell-signaling
For example in the paper, they treat brain slices from wild-type mice with exogenous insulin, and they report that the phosphorylation of the insulin receptor exceeds the basal state.
Any insights are appreciated. I think these excerpts are helpful in understanding the authors' use of basal, both in reference to insulin levels and insulin receptor phosphorylation -- | {
"domain": "biology.stackexchange",
"id": 12121,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "molecular-biology, cell-biology, cell-signaling",
"url": null
} |
homework-and-exercises, newtonian-mechanics, vectors
I do not understand, however, why he is using $\cos{(\pi +\theta)}$. I want to understand why my solution is incorrect and yields a different answer. What is my mistake and what is the proper intuition for understanding this problem if I have done so incorrectly?
Solutions I have viewed:
This Youtube Video
This online blog
This online blog A South Easterly wind comes from the South East your diagram seems to show a North Easterly wind. As the ship is steaming into the wind the apparent velocity should be greater than the true velocity. | {
"domain": "physics.stackexchange",
"id": 67806,
"lm_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, newtonian-mechanics, vectors",
"url": null
} |
electrostatics, electricity
Title: How do substances get charged on rubbing them together? How do substances get charged on rubbing them together? Also why do only some substances get charged on rubbing? It is called triboelectric effect:
It happens because: | {
"domain": "physics.stackexchange",
"id": 34250,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, electricity",
"url": null
} |
deep-learning, reinforcement-learning, python, dqn
Am I missing something else?
Perhaps I should note that my math skills are not that strong, but I try my best.
Any input is appreciated. Your problem is not that the environment is stochastic or dynamic. In fact you are using the terms slightly incorrectly. These terms do not usually refer to the fact that starting state can differ or goal locations can move episode-by-episode. They typically refer to behaviour of state transitions.
Although in your case you could view the initial state as stochastic, this is not a big deal, and not likely to be the cause of your problems.
From your questions, it seems to me that you are not really running a DQN algorithm yet. It is not 100% clear what your neural network is predicting, but my best guess is that you have 4 outputs to select "best" action and are treating the neural network as a classifier. This training approach seems closest to Cross Entropy Method (CEM) due to how you are selecting "successful" navigation only. | {
"domain": "ai.stackexchange",
"id": 1217,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, reinforcement-learning, python, dqn",
"url": null
} |
cc.complexity-theory, space-bounded, pcp
Title: Connection between PCP and L=SL The book by Arora and Barak contains in chapter notes on PCP
We note that Dinur's general strategy is somewhat reminiscent of the zig-zag construction of expander graphs and Reingold's deterministic logspace algorithm for undirected connectivity described in Chapter 20, which suggests that more connections are waiting to be made between these different areas of research. (pg 494)
What precisely is meant by this reminiscence? Is there a common property/lemma than can be "factored out" of these two proofs? The precise answer to your question is given by Oded Goldreich in his article "Bravely, Moderately: A Common Theme in Four Recent Works".
Here is the link: https://www.wisdom.weizmann.ac.il/~oded/p_brave.html | {
"domain": "cstheory.stackexchange",
"id": 1669,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, space-bounded, pcp",
"url": null
} |
# Seating couples around 2 tables
Here's my question and possible answer.
How many possible ways can you arrange 8 married couples between 2 circular tables of 8 identical chairs each such that:
1) each couple must sit at the same table, and,
2) at each table, men and women must sit in adjacent chairs (NOTE: a couple can sit next to each other but doesn't have to).
My solution:
Number of ways = (number of ways to split 8 couples into 2 tables of 4 couples each) * (number of arrangements at each table)
$=\frac{8!}{4!4!}*$(4 men and 4 women sitting alternately in 2 ways)
$=\frac{8!}{4!4!}\!\cdot\! 4!\!\cdot\!4!\cdot\!2$
$=2 * 8!$
Can someone verify this solution or provide the correct one?
First, pick $4$ couples out of the $8$ couples to sit at one table: $8 \choose 4$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429604789204,
"lm_q1q2_score": 0.8453443027461173,
"lm_q2_score": 0.8596637559030338,
"openwebmath_perplexity": 351.51287212726595,
"openwebmath_score": 0.7613790035247803,
"tags": null,
"url": "https://math.stackexchange.com/questions/2494317/seating-couples-around-2-tables"
} |
Itself a function is refers to whether the graph of is increasing decreasing... The standard interpretations in a similar manner they represent tangent lines to 1: … Author has 857 and! Z = f ( x 2 + y2 ) linear differential equation of a function of two or variables... Equation for the plane tangent to the left is intended to show you the geometric interpretation the geometric.! ) variables, is itself a function of many variables opinions expressed in this page not... D expect: you simply take the derivatives in is given by z= f ( x = 1\ ) of. Values and function into the formulas above next, we define the partial derivatives work exactly like ’... X 2 + y2 ) and SOC... for, we 'll how... … Author has 857 answers and 615K answer views second derivative itself two. Finally, let ’ s briefly talk about getting the Equations of the function a on. Matrix was developed in the planes x=a and y=b ( blue ) of Minnesota \:. For each these derivative of a function is the left is intended to show | {
"domain": "tigereyefoundation.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.983847162336162,
"lm_q1q2_score": 0.8020641668766434,
"lm_q2_score": 0.8152324848629214,
"openwebmath_perplexity": 382.6464825278451,
"openwebmath_score": 0.8907991647720337,
"tags": null,
"url": "https://tigereyefoundation.org/1sdl6l46/e9b73e-geometric-interpretation-of-second-order-partial-derivatives"
} |
Some radicals have exact values. One rule is that you can't leave a square root in the denominator of a fraction. Cube Roots . In the first case, we're simplifying to find the one defined value for an expression. This website uses cookies to ensure you get the best experience. Leave a Reply Cancel reply. Quotient Rule . That is, we find anything of which we've got a pair inside the radical, and we move one copy of it out front. Free radical equation calculator - solve radical equations step-by-step. where a ≥ 0, b > 0 "The square root of a quotient is equal to the quotient of the square roots of the numerator and denominator." Neither of 24 and 6 is a square, but what happens if I multiply them inside one radical? In this case, the index is two because it is a square root, which … Generally speaking, it is the process of simplifying expressions applied to radicals. So let's actually take its prime factorization and see if any of those prime factors show up more than once. That is, the | {
"domain": "labonska.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812318188365,
"lm_q1q2_score": 0.8230961304135535,
"lm_q2_score": 0.8499711718571774,
"openwebmath_perplexity": 632.3590035240143,
"openwebmath_score": 0.8792956471443176,
"tags": null,
"url": "http://labonska.com/ne76nu/how-to-simplify-radicals-dbdaa0"
} |
lowpass-filter, phase, group-delay
Title: once again,confusion between phase and group delay Despite,reading up on this I'm unable to find crystal clear clarity on the differences b/w phase and grpdelay functions and interpretation of grpdelay's output. I have designed a low pass butterworth filter having a cut off frequency of 0.04Hz. There is a delay in my filtered output compared to my original signal. I wish to know this delay. I used the grpdelay function in matlab (grpdelay(b,a,N/2) ). And this is the output i got..
I read that grpdelay is supposed to give the phase responses as a function of frequencies. In my image, the cursor points to the cut-off freq. How exactly do I know the delay in my filtered output through this? Is it the corresponding value on the Y-axis?
Plotting the phasedelay(b,a), gave this as the output..Here,the phasedelay value at cut-off is different. | {
"domain": "dsp.stackexchange",
"id": 1931,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lowpass-filter, phase, group-delay",
"url": null
} |
# Math Help - Card probability question
1. ## Card probability question
Hey everyone, a co-worker and I were playing a board game and afterward were trying to calculate the probability of drawing cards. Neither of us could come up with an answer and so I thought I'd ask here before I go mad trying to puzzle it out.
The way it works is this. There are 29 cards in the deck. 27 of them are unique (let's pretend they're marked 1 thru 27. And the other 2 cards are marked "A". So they match each other but none of the others. We were simply trying to figure out if you were to draw 5 cards at random from the deck. What are the odds that you'll draw the 2 "A" cards?
If anyone can help with the math on this one, my sanity would greatly appreciate it.
2. Hello, Allan!
I simplified the wording of the problem.
There are 29 cards in the deck: 2 A's and 27 Others. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754461077708,
"lm_q1q2_score": 0.8388118174626422,
"lm_q2_score": 0.8519528094861981,
"openwebmath_perplexity": 326.15777395864103,
"openwebmath_score": 0.7226982712745667,
"tags": null,
"url": "http://mathhelpforum.com/statistics/105540-card-probability-question.html"
} |
catkin, ros-groovy, ros-hydro
Originally posted by silgon on ROS Answers with karma: 649 on 2014-07-19
Post score: 1
catkin_make is a fairly thin layer over cmake/make invocations. This means the above command is simply invoking make install on the cmake generated Makefiles. The install prefix is the one for the catkin_make/cmake invocation that generated these make files. If you built your project with catkin_make build ... before and then invoke your command above, cmake will not be rerun to regenerate the files (catkin does not currently keep track of which arguments you passed previously).
In short, the following invocation should probably do the right thing:
catkin_make -DCMAKE_INSTALL_PREFIX=/opt/ros/groovy install --force-cmake
Originally posted by demmeln with karma: 4306 on 2014-07-19
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by silgon on 2014-07-19:
Got it. Cmake was taking the cache. Thanks! | {
"domain": "robotics.stackexchange",
"id": 18678,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "catkin, ros-groovy, ros-hydro",
"url": null
} |
performance, statistics, fortran
Link in case you are curious about smearing I don't know, I might be totally mistaken, but from parsing your code and what it supposedly does, I think it could be simplified quite a lot. When thinking about performance, one of the main resources to treat carefully is the memory, you should minimize its access where ever possible.
One point, which totally confused me here, was the matrix multiplication you set up with a matrix of just duplicated entries. I also would change some commenting and don't see the point in splitting this routine up. Especially your last routine should be covered by a forall loop. Thus, I'd suggest something like this:
!> Using a comment to describe the purpose of this module.
!! Deploying an underscore to separate words
module smearing_module
use, intrinsic :: iso_c_binding, only: c_double, c_int
implicit none
private ! Make everything private | {
"domain": "codereview.stackexchange",
"id": 15535,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, statistics, fortran",
"url": null
} |
performance, beginner, unit-testing, scala, gui
def generateLetters(details: List[Map[String,String]],
docPack: WordprocessingMLPackage): Unit = {
import scala.collection.JavaConverters._
val destination: String = gui.destinationFolder
val template: MainDocumentPart = docPack.getMainDocumentPart
val duplFileChecker = PathValidator()
@tailrec
def fileName(name: String, counter: Int): String = {
val increment = counter + 1
if (duplFileChecker.validate(destination+"/"+name+".docx")) {
if (duplFileChecker.validate(destination+"/"+name+increment+".docx"))
fileName(name,increment)
else destination+"/"+name+increment+".docx"
} else destination+"/"+name+".docx"
}
for(smap <- details) {
val fname = smap.collectFirst({
case (k: String,v: String) if k == gui.fNameColumn => v
}) match {
case Some(file) => file
case None => "Output"
} | {
"domain": "codereview.stackexchange",
"id": 27091,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, beginner, unit-testing, scala, gui",
"url": null
} |
c++
using detail::midpoint;
}
// Tests
#include <gtest/gtest.h>
using toby::midpoint;
#include <climits>
TEST(midpoint, int)
{
EXPECT_EQ(midpoint(0, 0), 0);
EXPECT_EQ(midpoint(0, 1), 0);
EXPECT_EQ(midpoint(0, 2), 1);
EXPECT_EQ(midpoint(1, 3), 2);
EXPECT_EQ(midpoint(4, 1), 2);
EXPECT_EQ(midpoint(INT_MIN, 0), INT_MIN/2);
EXPECT_EQ(midpoint(INT_MAX, 0), INT_MAX/2);
EXPECT_EQ(midpoint(INT_MAX, -INT_MAX), 0);
} | {
"domain": "codereview.stackexchange",
"id": 41529,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++",
"url": null
} |
addition. Note: vectors are shown in bold. Resolution of a Vector into Two Components: We can also use the parallelogram law to determine the components of a vector along any two arbitrary axes. Theory. Parallelogram Law of vectors If two vectors are acting simultaneously at a point, then it can be represented both in magnitude and direction by the adjacent sides drawn from a point. It states that ‘If two vectors are completely represented by two adjacent sides of a parallelogram, then the diagonal of the parallelogram from the tails of two vectors gives their resultant vector’. State Parallelogram law of addition of vectors. Theory What does the Parallelogram Law of Vectors state? They are represented in magnitude and direction by the adjacent sides OA and OB of a parallelogram OACB drawn from a point O.Then the diagonal OC passing through O, will represent the resultant R in magnitude and direction. Draw the second vector using the same scale from the tail of the first vector. The | {
"domain": "com.pk",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241974031598,
"lm_q1q2_score": 0.8035104450724879,
"lm_q2_score": 0.8289388083214156,
"openwebmath_perplexity": 365.09818191082644,
"openwebmath_score": 0.7945579886436462,
"tags": null,
"url": "https://dogar.com.pk/maybe-tomorrow-hdijkrw/archive.php?3ad215=parallelogram-law-of-vector"
} |
newtonian-gravity, earth, estimation, tidal-effect
(image from Wikipedia - Tidal force - Explanation)
According to Wikipedia (Tidal force - Sun, Earth, and Moon)
the tidal acceleration at the surface of the earth caused by another body is
$$a_\text{tide,max} = Gm\frac{2r}{d^3}$$
where
$m$ is the mass of the other body,
$d$ is the distance between the earth and the other body,
$G=6.67\cdot 10^{-11}\text{m}^3\text{/kg s}^2$ is Newton's gravitational constant,
$r=6.37\cdot 10^6\text{ m}$ is the radius of the earth. | {
"domain": "physics.stackexchange",
"id": 80450,
"lm_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-gravity, earth, estimation, tidal-effect",
"url": null
} |
February 06, 2020, at 03:24 PM by 12.45.189.170 -
(:toggle hide gekko button show="Show GEKKO (Python) Code":)
(:div id=gekko:)
(:source lang=python:)
import numpy as np
from gekko import GEKKO
import matplotlib.pyplot as plt
m = GEKKO(remote=False)
m.time = np.arange(0,2.01,0.05)
K = 30
y = m.Var(2.0)
z = m.Var(-1.0)
t = m.Var(0.0)
m.Equation(t.dt()==1)
m.Equation(y.dt()==z)
m.Equation(z.dt()+(0.9+0.7*t)*z+K*y==0)
m.options.IMODE = 4; m.options.NODES = 3
m.solve(disp=False)
plt.plot(m.time,y.value,'r-',label='y')
plt.plot(m.time,z.value,'b--',label='z')
plt.legend()
plt.xlabel('Time')
plt.show()
(:sourceend:)
(:divend:)
February 06, 2020, at 03:08 PM by 12.45.189.170 -
Changed lines 17-18 from:
**Second Order ODE Example**
to:
'''Second Order ODE Example'''
Changed line 27 from:
**Modified Form for Solution**
to:
'''Modified Form for Solution'''
February 06, 2020, at 03:08 PM by 12.45.189.170 -
Changed lines 17-18 from: | {
"domain": "apmonitor.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9504109770159683,
"lm_q1q2_score": 0.8078219427160057,
"lm_q2_score": 0.8499711832583696,
"openwebmath_perplexity": 1245.0420723087434,
"openwebmath_score": 0.5146600604057312,
"tags": null,
"url": "https://apmonitor.com/wiki/index.php/Apps/2ndOrderDifferential?action=diff"
} |
quantum-field-theory, special-relativity, quantum-spin, fermions, classical-field-theory
Now, in the case of a Dirac field $\Psi$, this current has an extra term:
$$j^{(\rho\sigma)\mu}=x^\rho T^{\mu\sigma}-x^\sigma T^{\mu\rho}-i \bar{\Psi}\gamma^\mu S^{\rho\sigma}\Psi\ \ \ \ \ \ \ \ \ \ \ (2)$$
Now, since I expected spin to correspond to rotations, I expected that upon quantising the Dirac field, we would define a spin operator of the form
$$-i\int d^3x\ \bar{\Psi}\gamma^0 S^{ij}\Psi\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (3)$$
in analogy with the case discussed above. What actually happens is that Maggiore instead takes [p.90, eq.(4.40) and p.31, eq.(2.86)]:
$$-i\int d^3x\ \bar{\Psi}\gamma^0 S^{i0}\Psi\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (4)$$
to be the spin operator, with $S^{i0}$ having $\frac{1}{2}\sigma^i$ on its diagonal. But I know that for indices, say, $\rho=i, \sigma=0$, this is a boost, not a rotation. | {
"domain": "physics.stackexchange",
"id": 73469,
"lm_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, special-relativity, quantum-spin, fermions, classical-field-theory",
"url": null
} |
c++, algorithm, graph, pathfinding, opencv
// std::cerr << "Current = " << current.x << ", " << current.y << std::endl;
}
std::cerr << "Time elapsed: " << timer.getElapsedTimeInMilliSec() << " ms";
// Recover Path
cv::cvtColor(image, image, CV_GRAY2BGRA);
int cn = image.channels();
if (std::find_if(visited.begin(), visited.end(), CompareID(start)) != visited.end())
{
std::cerr << "Path found!" << std::endl;
std::pair <double, vertex> currentPair = *std::find_if(visited.begin(), visited.end(), CompareID(start)); | {
"domain": "codereview.stackexchange",
"id": 10064,
"lm_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, pathfinding, opencv",
"url": null
} |
ros, bluetooth, rosjava, android
Originally posted by chris_amelinckx with karma: 61 on 2014-11-19
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by hiro64 on 2014-12-01:
Hi there,
When you pair the devices and make sure the Internet Access profile is enabled on Android, do you just connect to the PC as usual by inputting the ROS_MASTER_URI in the android app? When I do this, the android topics still don't appear when using rostopic list in the PC.
Comment by chris_amelinckx on 2014-12-01:
Yes, however check that:
Your local ROS_IP environment setting is set to the IP address of the ad-hoc bluetooth network. (blueman generates a random one for you, you can override it also)
On your android app, you would connect using http://{THAT_SAME_IP}:11311 (or whichever port number used) | {
"domain": "robotics.stackexchange",
"id": 20072,
"lm_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, bluetooth, rosjava, android",
"url": null
} |
Happy $\pi$-day! Is it true that $\sum_{p \;\text{prime} } \frac{1}{{\pi}^p} < \pi -\lfloor \pi \rfloor$?
Today is a $$\pi$$-day and I made this exercise for that purpose (and not only for that!):
Let: $$\phi = \sum_{p \;\text{prime} } \frac{1}{{\pi}^p}$$ By applying only knowledge of calculus and, more generally (if needed), real analysis of functions of one variable, and without computational software, determine is it true that we have: $$\phi< \pi - \lfloor\pi\rfloor$$ Where $$\lfloor\pi\rfloor=3$$ is the floor function of $$\pi$$.
Is this possible to solve with, for example, some of the formulas for infinite product for $$\pi$$ or Taylor series for $${\sin}^{-1}$$, without any numerical estimates?
Or, if estimates are needed, what is the worst one you need to apply to solve this? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551576415562,
"lm_q1q2_score": 0.8181660688916341,
"lm_q2_score": 0.8479677622198947,
"openwebmath_perplexity": 621.8117307218866,
"openwebmath_score": 0.99110347032547,
"tags": null,
"url": "https://math.stackexchange.com/questions/3580298/happy-pi-day-is-it-true-that-sum-p-textprime-frac1-pip"
} |
c#, asp.net-core, yaml
Feedback
Please tell me what you think, any weaknesses of my approach, code smells, or maybe a better solution. All kind of constructive feedback appreciated. I had a wrong concept about GitLab artifacts. After a good read on GitLab docs, especially the section distinguishing artifacts and cache, I deduced that I should use cache instead of artifacts as it was designed precisely for storing restored dependencies. Artifacts are meant for passing build output and binaries.
I also removed the restore stage, placing the dotnet restore command in a global before_script. Cache can fail and in such scenario the script should gracefully fallback to default 'download-from-internet' behaviour. With --no-restore option enabled it would not happen. Thus, I removed that option from dotnet build command. It won't make a noticeable difference with successfully download cache as a dependency restore with already downloaded packages will execute in next-to-no-time. | {
"domain": "codereview.stackexchange",
"id": 34118,
"lm_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#, asp.net-core, yaml",
"url": null
} |
quantum-mechanics, hilbert-space, phase-space, coherent-states
Delbourgo, Robert, and J. R. Fox. "Maximum weight vectors possess minimal uncertainty." Journal of Physics A: Mathematical and General 10.12 (1977): L233. | {
"domain": "physics.stackexchange",
"id": 56526,
"lm_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, hilbert-space, phase-space, coherent-states",
"url": null
} |
electromagnetism, electricity, electric-fields, electrical-resistance, dissipation
However I notice if I set these equations equal to each other and simplify I get the following.
$$\frac{\omega\epsilon'' + \sigma}{\omega\epsilon'} = \frac{\epsilon''}{\epsilon'}$$
$$(\omega\epsilon'' + \sigma) \epsilon' = (\omega\epsilon')\epsilon''$$
$$\omega\epsilon'\epsilon'' + \sigma\epsilon' = \omega\epsilon'\epsilon''$$
$$\sigma\epsilon' = \omega\epsilon'\epsilon'' - \omega\epsilon'\epsilon''$$
$$\sigma\epsilon' = 0$$
But this can't possibly be correct can it? This would imply that either $\epsilon'$ or $\sigma$ must always be 0. However if $\epsilon'$ is ever 0 then both equations becomes undefined. Also if $\sigma$ is always 0 then the material would have to be a perfect resistor for the equations to make sense and also why even including conductivity as a variable at all in that case?
I am convinced I must be doing something wrong but I have no idea what that could be. Initial answer:
The second equation is an approximation used when conductivity ($\sigma$) is very small. | {
"domain": "physics.stackexchange",
"id": 71506,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, electricity, electric-fields, electrical-resistance, dissipation",
"url": null
} |
php, ajax, quiz
if($_SERVER['REQUEST_METHOD'] === 'GET')
{
if(isset($_GET['gamesettings'])){///check certian user defined game options are set
require 'classes/Database.php';
date_default_timezone_set("UTC");
$_SESSION['app_start'] = new DateTime('NOW');////store time at which game/first question starts
$_SESSION['app_index'] = 0;
if($_GET['app'] === 'aural') {
$db = new Database();
$gameData = getGameData($db);///just an example
//etc...
//query database for game data, i.e. the questions,
echo json_encode($gameData['questions]);//then send back to browser
$_SESSION['right_answers'] = $gameData['answers'];///store the right answers to varify against user answers later
}
}
}
?>
<?php
/* post_game_data.php
*
* user answers question in a textbox etc.
* then clicks a submit button which posts the answer to
* this file via ajax again
*/
session_start(); | {
"domain": "codereview.stackexchange",
"id": 5748,
"lm_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, ajax, quiz",
"url": null
} |
automotive-engineering, aerospace-engineering, stresses, safety
Adding that structure to the seat will inevitably result in a seat that is more expensive, heavier and physically larger. Just replacing all of the seats on pasenger aircraft would be cost-prohibitive on its own, but a larger seat means there can be fewer seats/plane which drives the actual cost even higher. Finally, the seats would be heavier. Heavier seats mean greater fuel consumption also resulting in higher costs.
Finally, there's the behavioral aspect of shoulder belts. Passengers won't like them, especially on long flights. Flight attendants already have their hands full trying to get people to wear lap belts, a more restrictive belt will only aggravate that problem. | {
"domain": "engineering.stackexchange",
"id": 1371,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "automotive-engineering, aerospace-engineering, stresses, safety",
"url": null
} |
python, beginner, python-3.x, linux, child-process
should be written with doubled parentheses:
print(('\t' + partition))
print((physical_drives()))
For Python 3 support, I have checked the print() documentation, but have been unable to find a reference for including function calls and string concatenation in double parentheses when calling print(). lsblk
The -s option to lsblk was introduced to util-linux rather recently, in release 2.22. You may experience compatibility issues on slightly older GNU/Linux installations.
But I don't see why you would want the -s option at all — it just gives you an inverted device tree. For example, on my machine:
$ lsblk -o name -n -s -l
sda1
sda
sda2
sda
sr0
vg-root
sda3
sda
vg-var
sda3
sda
vg-data
sda3
sda
In the output, sda appears multiple times. To understand the output, you need to drop the -l flag so that the list appears in tree form:
$ lsblk -o name -n -s
sda1
└─sda
sda2
└─sda
sr0
vg-root
└─sda3
└─sda
vg-var
└─sda3
└─sda
vg-data
└─sda3
└─sda | {
"domain": "codereview.stackexchange",
"id": 35181,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-3.x, linux, child-process",
"url": null
} |
vba, winapi
'Close workbook to allow Excel to reset its memory of delimiter
'Show alerts if more workbooks open
If Workbooks.Count = 1 Then Application.DisplayAlerts = False
Application.Quit
End Sub
Part 2 downloads.
Option Explicit
'Set Locale Info
Private Declare Function SetLocaleInfo _
Lib "kernel32" Alias "SetLocaleInfoA" ( _
ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String) As Boolean
Private Declare Function GetUserDefaultLCID% Lib "kernel32" ()
Private Const LOCALE_SLIST = &HC
Private Const LOCALE_NAME_MAX_LENGTH = 85
Private Const LOCALE_NAME_USER_DEFAULT = vbNullString
'Get Locale Info
Private Declare Function GetLocaleInfoEx _
Lib "kernel32" ( _
ByVal lpLocaleName As String, _
ByVal LCType As Long, _
ByVal lpLCData As String, _
ByVal cchData As Long) As Long
Private Declare Function GetLastError Lib "kernel32" () As Long | {
"domain": "codereview.stackexchange",
"id": 19625,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vba, winapi",
"url": null
} |
c++, c++11, multithreading
// Now .wait() or .get() those results as you please.
And the point remains: you should think in terms of tasks… not threads. You’ll notice in the code above that there is not a single mutex or lock in sight, and zero chance of deadlock (unless the scan functions are not actually independent). The interface is almost impossible to misuse.
The standard library futures are still very simplistic—we are waiting on executors before improving them—but there are other libraries out there with better futures. Still, even the standard futures, limited as they are, are far easier to compose than threads.
Even if you want to keep your interface, startScan() should return a future so calling code can know when it’s done, and can query whether it succeeds or not:
auto main() -> int
{
auto scanner = type_derived_from_thread_manager{}; | {
"domain": "codereview.stackexchange",
"id": 45077,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, multithreading",
"url": null
} |
performance, c, random, statistics, simulation
/* get the answer */
scanf("%d", &answer);
/* return result */
if (answer == 1) return true;
else if (answer == 2) return false;
/* return false in case they type something else */
return true;
}
options.h:
#include <stdio.h>
#include <stdbool.h>
/* for type bool */
/* ask the user for options */
/* do powerballs have to match */
bool askIfPowerballsShouldMatch(void);
/* Does the user want to use the same ticket
* everyday or have a new ticket generated every
* day? */
bool getTicketOption(void);
output.c:
#include <stdio.h>
/* for printf() */
/* print the array */
void printArray(int array[])
{
printf("%d %d %d %d %d %d\n", array[0], array[1], array[2], array[3], array[4], array[5]);
return;
}
output.h
/* print an array */
void printArray(int array[]);
makefile:
all:
gcc -Wall main.c options.c calc.c output.c -o powerballSim
test:
clear
gcc -Wall main.c options.c calc.c output.c -o powerballSim
./powerballSim | {
"domain": "codereview.stackexchange",
"id": 25188,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, c, random, statistics, simulation",
"url": null
} |
observational-astronomy, amateur-observing, satellite
Consider satellites to be visible only when altitude ≥ 30 degrees and in direct
Sunlight or Earth's penumbra
magnitude 5
satellites cross sky in 4 minutes
6-9 satellites visible at any time during 1-hour starting (ending) at 12-degree -evening (morning) twilight
spatial density on sky ~ 7E-4 deg-2
angular speed across sky ~ 0.5 - 1 degree / sec
In regards to radio astronomy, the NRAO were happy enough with SpaceX Starlink, though there might be concerns with other constellations such as Oneweb.
NRAO Statement
Oneweb concerns
In reference to the previous point, all of this comes with the caveat that Starlink is potentially only one of perhaps 4 or 5 LEO constellations. Even if SpaceX acts responsibly you still have to convince all of the others to do so as well, which might be difficult.
SpaceX and AAS are working together on ways of reducing the impact of Starlink to astronomy. AAS on mitigating Satellites Constellations impact | {
"domain": "astronomy.stackexchange",
"id": 4269,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "observational-astronomy, amateur-observing, satellite",
"url": null
} |
electricity, electric-current
Title: Confusion regarding drift velocity We define drift speed of an electron as the average speed of the electron inside the conductor, which is the distance travelled by the electron between two collisions divided by the average collision time or relaxation time.
$$v_d=\frac{s}{\tau}$$
Using the laws of motion for uniform acceleration, we may write the drift velocity to be
$$\mathbf{v_d}\tau=\mathbf{u}\tau+\frac{1}{2}\frac{e\mathbf{E}}{m}\tau^2$$
Now as the average velocity of an electron would be almost zero after any collision, we may say that $\mathbf{u}$ is zero, and hence we may also write
$$\mathbf{v_d}=\frac{1}{2}\frac{e\mathbf{E}}{m}\tau$$
However in Fundamentals of Physics by Resnik and Halliday the drift velocity (which it states is the average velocity of any electron in the conductor) is given as
$$\mathbf{v_d}=\frac{e\mathbf{E}}{m}\tau$$
Meanwhile in Concepts of Physics by prof. H.C.Verma it is given
$$\mathbf{v_d}=\frac{1}{2}\frac{e\mathbf{E}}{m}\tau$$ | {
"domain": "physics.stackexchange",
"id": 62994,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electricity, electric-current",
"url": null
} |
differential-geometry, gauge-theory, topology
Now let $P$ be an in general nontrivial PFB, $(U,\sigma)$ a local section over $U\subseteq M$, $P_U=\pi^{-1}(U)$ the PFB restricted to $U$.
Proposition: There is a bijective correspondance between local sections $(U,\sigma^\prime)$ (with the same domain $U$) and vertical automorphisms $f\in\mathrm{Aut}_V(P_U)$.
Proof: First let a local section $(U,\sigma^\prime)$ be given, then there is a unique $G$-valued function $\varphi:U\rightarrow G$ given by $\sigma^\prime(x)=\sigma(x)\varphi(x)$. Since $(U,\sigma)$ is equivalent to a local trivialization, it gives an isomorphism $P_U\cong U\times G$ mapping $p$ to $(x,g)$, where $x=\pi(p)$ and $g$ is given by $p=\sigma(x)g$. Now define $f:P_U\rightarrow P_U$ by $f(p)=f(x,g)=(x,\varphi(x)g)$, where we made use of the identification $P_U\cong U\times G$. | {
"domain": "physics.stackexchange",
"id": 94943,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "differential-geometry, gauge-theory, topology",
"url": null
} |
# What is the optimal strategy in a game where players subtract 7 or add or divide by 2?
I made up a nim type game where players start with a relatively high number and then for each turn if the number is odd, the player either subtracts 7 from the number or alternately if the number is even divides by 2 or if the number is odd adds 2. The player may not choose a negative number, though. The player to reach 7 wins.
Example: if the number is 11 the player may either subtract 7 to get 4 or add 2 to get 13. If the number is 16 the player may subtract 7 to get 9 or divide by 2 to get 8. Example game:
Player 1: 18/2=9 Player 2: 9+2=11 Player 1: 11-7=4 Player 2: 4/2=2 Player 1: 2/2=1 Player 2: 1+2=3 Player 1: 3+2=5 Player 2: 5+2=7
Player 2 wins.
How can we predict whether at any large number the player with the move is in a winning or losing position? Is it possible that for numbers over a certain limit the best strategy for both players will be to always add 2 to keep from losing? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877054447312,
"lm_q1q2_score": 0.814256393753489,
"lm_q2_score": 0.8289388019824946,
"openwebmath_perplexity": 574.6434669318679,
"openwebmath_score": 0.7228440046310425,
"tags": null,
"url": "https://math.stackexchange.com/questions/1773538/what-is-the-optimal-strategy-in-a-game-where-players-subtract-7-or-add-or-divide"
} |
quantum-mechanics, energy, wavefunction, path-integral, discrete
Rewrite this as
$$ = \left( \frac{m \omega}{\pi \hbar} \right)^\frac12 e^\frac{-i \omega T} 2 \left( 1 - e^{-2 i \omega T} \right)^{-\frac12} \exp{ \left( - \frac{m \omega}{2 \hbar} \left( \left(x_i^2 + x_f^2\right) \frac{ 1 + e^{-2 i \omega T} }{ 1 - e^{- 2 i \omega T}} - \frac{4 x_i x_f e^{-i \omega T}}{1 - e^{ - 2 i \omega T} }\right) \right) }\\
\equiv \left( \frac{m \omega}{\pi \hbar} \right)^\frac12 e^\frac{-i \omega T } 2 ~ R(T)~. $$
The $e^{-in\omega T }$ Fourier modes of R(T) then multiplying this 0-point energy prefactor may be compared to the standard Hilbert space eigenstate expansion of the resolvent, to reassure you of the standard quantized spectrum of the quantum oscillator,
$E_n = \left( n + \tfrac12 \right) \hbar \omega~. $ | {
"domain": "physics.stackexchange",
"id": 47886,
"lm_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, energy, wavefunction, path-integral, discrete",
"url": null
} |
ros, nav2d-exploration, nav2d
Title: how to use nav2d with my own lidar and slam algorithm?
i'm trying to do this job,here is the scene:
I want to take my lidar move around a house ,and i hope nav2d could give me a path about how to move to the most proper frontiers,my slam algorithm is cartographer not karto.
now i've already run the tutorial3.launch,but i still don't know how to achieve it with my own lidar and slam algorithm...for example i don't know how to modify tutorial3.launch to make it work.
Originally posted by xbc on ROS Answers with karma: 1 on 2017-04-06
Post score: 0
You actually just have to replace the Karto-Mapper with your own mapping algorithm. Make sure that your mapper provides the map via a service of type GetMap, so that the navigator can use it to plan exploration on it.
Originally posted by Sebastian Kasperski with karma: 1658 on 2017-04-07
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 27538,
"lm_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, nav2d-exploration, nav2d",
"url": null
} |
c++, c++11, template, event-handling, variadic
void operator() (Args... args)
{
if (_t && _callback)
{
(_t->*_callback)(std::forward<Args>(args)...);
return true;
}
return false;
} | {
"domain": "codereview.stackexchange",
"id": 4828,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, template, event-handling, variadic",
"url": null
} |
ros, ros-hydro, roscd, catkin
Comment by Morpheus on 2014-03-23:
Are you saying that I need to comment out ROS_WORKSPACE & ROS_PACKAGE_PATH in my bash.rc file?
Comment by demmeln on 2014-03-28:
In hydro, working only with catkin packages, there is usually no need to set any of these environment variables manually. If you have set up your workspace correctly, you need to only source one setup.*sh file, namely the one from your devel or install space of that workspace. | {
"domain": "robotics.stackexchange",
"id": 17382,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-hydro, roscd, catkin",
"url": null
} |
As we know that
\begin{aligned} \hat\theta^{MAP}&=\arg \max\limits_{\substack{\theta}} \log P(\theta|\mathcal{D})\\ &= \arg \max\limits_{\substack{\theta}} \log \frac{P(\mathcal{D}|\theta)P(\theta)}{P(\mathcal{D})}\\ &=\arg \max\limits_{\substack{\theta}} \log P(\mathcal{D}|\theta)P(\theta) \\ &=\arg \max\limits_{\substack{\theta}} \underbrace{\log P(\mathcal{D}|\theta)}_{\text{log-likelihood}}+ \underbrace{\log P(\theta)}_{\text{regularizer}} \end{aligned}
The prior is treated as a regularizer and if you know the prior distribution, for example, Gaussin ($$\exp(-\frac{\lambda}{2}\theta^T\theta)$$) in linear regression, and it's better to add that regularization for better performance.
I think MAP is much better.
MAP is better compared to MLE, but here are some of its minuses: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9566342049451595,
"lm_q1q2_score": 0.8311494090724967,
"lm_q2_score": 0.8688267728417087,
"openwebmath_perplexity": 607.4326683531538,
"openwebmath_score": 0.8023701906204224,
"tags": null,
"url": "https://stats.stackexchange.com/questions/95898/mle-vs-map-estimation-when-to-use-which/117025"
} |
electromagnetism, special-relativity, speed-of-light, one-way-speed-of-light
You are saying that it is a scalar and independent of frames, but this thing cannot be said by using only electrodynamics. You have to supplement Maxwell's equations with some other kinematical laws to speak about this. For example
$$\frac{E^2-(pc)^2}{c^4}=m^2 $$
is a scalar according to special relativity but it is not a scalar according to Newton's laws (supplemented with Galilean relativity). Using Newton's laws(supplemented with Galilean relativity) we expect that the 1-way and 2-way speed's both should be same. But Newton's laws are inconsistent with Maxwell's equations. To make it consistent we need to use special relativity. But due to the way we define synchronisation in special relativity we cannot find the 1-way speed of light.
My question is that if there is experimental proof of $μ_o$ and $ϵ_o$ being scalars, and if there are such experiments, can they be considered as proof for the one-way speed of light to be a scalar. | {
"domain": "physics.stackexchange",
"id": 99073,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, special-relativity, speed-of-light, one-way-speed-of-light",
"url": null
} |
c++, c++11, node.js, c++17, c++14
node_msgpack::pack (84.68%): 17.91% of the execution time is in calling dest.push_back(fixmap_t(n));. If we expand it, we see that the time is almost all spent in the std::copy in msgpack_byte::container::check_expand().
node_msgpack::pack (62.96%): 19.33% of the time is spent in msgpack::pack for strings... specifically in msgpack_byte::container::check_expand().
node_msgpack::pack (41.88%): 36% of the time is spent in dest.shrink_to_fit() (which uses memcpy).
node_msgpack::pack (18.65%): spends all its time in container::check_expand() again.
So... it looks like we're spending a lot of time expanding the container (and hence copying elements after reallocation). Then we call shrink_to_fit() and shrink the container (and copy all the elements again)! | {
"domain": "codereview.stackexchange",
"id": 41293,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, node.js, c++17, c++14",
"url": null
} |
python, algorithm, tree, graph
if visited[k[0]-1] == False:
to either
if visited[k[0]-1] is False:
or
if not visited[k[0]-1]:
The DFS is far more complicated than necessary:
We don't need visited: given that we know that the graph is a tree, it suffices to track the previous vertex.
I'm used to DFS tracking vertices, not edges.
There's no reason for dfs to take profit as an argument: the profit that can be made in a rooted subtree is independent of the profit made getting there.
Rewriting with those notes in mind, we can reduce it to
def start(self, power):
return max(self.dfs(u, power, None) for u in range(1, self.nodes+1))
def dfs(self, u, power, prev):
return max((edge[2] + self.dfs(edge[0], power - edge[1], u)
for edge in self.graph[u]
if edge[0] != prev and edge[1] <= power),
default=0) | {
"domain": "codereview.stackexchange",
"id": 35691,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, algorithm, tree, graph",
"url": null
} |
# Thread: an identity of floor function
1. ## an identity of floor function
Prove that $\; n =\sum_{k=0}^{\infty} \left\lfloor \frac{n+2^k}{2^{k+1}} \right\rfloor, \; \forall n \in \mathbb{N}.\;$ where $\lfloor x \rfloor$ is the floor of $x$
2. Very nice! I can prove it, but I can't give any "deep" reason why it should be true. I'm sure there is a deep idea behind this formula.
By induction on $n$ : it's trivial for $n=1$, so suppose it holds for $n-1$. Write $n$ in binary as $n=2^{m_1}+\dots + 2^{m_s}$, with $m_1>\dots >m_s \geq 0$. We want to show that
$1 = \sum_{k=0}^{\infty} \left(\left\lfloor \frac{n+2^k}{2^{k+1}} \right\rfloor - \left\lfloor \frac{n-1+2^k}{2^{k+1}} \right\rfloor\right)$.
Now for any positive $a, d$, we have
$\left \lfloor \frac{a}{d}\right\rfloor - \left \lfloor \frac{a-1}{d}\right\rfloor = \left\{\begin{array}{l} 1 \mbox{ if }d|a, \\ 0 \mbox{ otherwise}.\end{array}$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.980875959894864,
"lm_q1q2_score": 0.8019391469420278,
"lm_q2_score": 0.8175744739711883,
"openwebmath_perplexity": 261.1951808423473,
"openwebmath_score": 0.9724364876747131,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/152852-identity-floor-function.html"
} |
reinforcement-learning, q-learning
When Q learning is described as "model free", it means that the agent does not need access to (or use) a predictive model of the environment. It cannot refer to state transitions and rewards in advance, but has to experience them in order to learn.
This does not mean that you have to avoid using a learning data model (such as a neural network) in order to generalise to new unseen data.
So, yes, Q learning can interpolate from unseen states and predict their Q value. To do this, you replace the state/action table with a supervised learning method based on descriptions of state $s$ and action $a$ as inputs, that you train as a regression model to predict $Q(s,a)$ (as a variant you can also have just state as input and predict $Q(s,a)$ for all possible actions as a vector in one go).
However, Q learning with a neural network suffers from instability. See Deep Mind's DQN paper for example of a system that solves that instability. In short: | {
"domain": "datascience.stackexchange",
"id": 2940,
"lm_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, q-learning",
"url": null
} |
z-axis has radius R. For that, let’s consider a solid, non-conducting sphere of radius R, which has a non-uniform charge distribution of volume charge density. asked by Julie on September 28, 2016; Physics. Login Forgot Password?. a right circular cylinder of radius R and height h with charge uniformly distributed over its surface D. A hollow cylindrical conductor (inner radius = a, outer radius = b) carries a current i uniformly spread over its cross section. The flow of a viscous fluid, which is at rest at infinity, outside a long cylinder of radius a rotating with a steady angular velocity ω is an exact realization of. For a radius r R , a Gaussian surface will enclose less than the total charge and the electric field will be less. 8 cm is positioned with its symmetry axis along the z-axis as shown. For each of the independent situations described in parts (a) and (b), find the time derivative of the total electromagnetic field. We can construct a Gaussian surface in the shape of a | {
"domain": "jeanettekastrup.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668706602659,
"lm_q1q2_score": 0.8044521851504527,
"lm_q2_score": 0.8198933425148213,
"openwebmath_perplexity": 335.5221574838748,
"openwebmath_score": 0.9066055417060852,
"tags": null,
"url": "http://npxs.jeanettekastrup.de/an-infinitely-long-solid-cylinder-of-radius-r-is.html"
} |
thermodynamics, energy-conservation, entropy, universe
we know that we don't know what the 70% of the energy of the Universe is. Also, a comprehensive description of the thermodynamics of the Universe is impossible with the current standard Cosmological model and Einstein's General Relativity. In particular it's very complicated, and incomplete, as I said, to talk about what is now the energy of the Universe. Hence, its thermodynamical evolution has very low sense, with the current knowledge. It's only a speculative subject. | {
"domain": "physics.stackexchange",
"id": 10701,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, energy-conservation, entropy, universe",
"url": null
} |
cosmology, big-bang, cosmological-inflation
All the universe has to do is be a way that allows it to appear to us the way it actually does appear to us. You can try to ask for more and consider many many theories that tell you more but if they all predict the same future for us now how is any one of them better than any other? | {
"domain": "physics.stackexchange",
"id": 22710,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, big-bang, cosmological-inflation",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.