text stringlengths 49 10.4k | source dict |
|---|---|
filters, impulse-response
Title: Why impulse response Why do people calculate impulse response? Generally systems are designed after modelling the possible input signals and calculating the appropriate filters for the desired outputs. Where does impulse response calculation become important? Having the impulse response allows one to simplify the input of a sampled linear time-invariant system down to one single unit-magnitude input sample.
It is usually fairly simple to build any time domain input from a single unit input (with a linear combination thereof), and thus, given the impulse response for that single input, the output for any time-domain-described input for that system. Other basis vectors are possible, but may require more or less work (computational effort) for a given type of description of the input. | {
"domain": "dsp.stackexchange",
"id": 1939,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, impulse-response",
"url": null
} |
machine-learning, feature-selection, regularization
Title: What is the $\ell_{2, 1}$ norm? I'm reading this paper and it says:
In this paper, we present a multi-class embedded feature selection method called as sparse optimal scoring with adjustment (SOSA), which is capable of addressing the data heterogeneity issue. We propose to perform feature selection on the adjusted data obtained by estimating and removing the unknown data heterogeneity from original data. Our feature selection is formulated as a sparse optimal scoring problem by imposing $\ell_{2, 1}$-norm regularization on the coefficient matrix which hence can be solved effectively by proximal gradient algorithm. This allows our method can well handle the multi-class feature selection and classification simultaneously for heterogenous data
What is the $\ell_{2, 1}$ norm regularization? Is it L1 regularization or L2 regularization? $\ell_{2,1}$ is a matrix norm, as stated in this paper.
For a certain matrix $A \in \mathbb{R}^{r\times c}$,
we have
$$\|A\|_{2,1} = \sum_{i=1}^r \sqrt{\sum_{j=1}^c A_{ij}^2}$$
You first apply $\ell_2$ norm along the columns to obtain a vector with r dimensions. Then, you apply $l_1$ norm to that vector to obtain a real number. You can generalize this notation to every norm $\ell_{p,q}$. | {
"domain": "ai.stackexchange",
"id": 1623,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, feature-selection, regularization",
"url": null
} |
php, object-oriented, mysql, json, mysqli
implode()'s default glue is an empty string, this parameter can be omitted when using a zero-width glue string.
autoloading seems like a topic worth a look. https://stackoverflow.com/q/12445006/2943403 | {
"domain": "codereview.stackexchange",
"id": 41697,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, object-oriented, mysql, json, mysqli",
"url": null
} |
ros, navigation, beginner
Original comments
Comment by MyloXyloto on 2012-03-25:
I not very familiar with Python. can you give me in C++ so i can directly compile it into arduino IDE ? Or you have servo motor subscriber example which is controlling by using ultrasonic sensor as a publisher ? Thnks in advance
Comment by mjcarroll on 2012-03-25:
From the tutorials, Servo Example: http://www.ros.org/wiki/rosserial_arduino/Tutorials/Servo%20Controller
Comment by mjcarroll on 2012-03-25:
From the tutorials: Rangefinder example: http://www.ros.org/wiki/rosserial_arduino/Tutorials/SRF08%20Ultrasonic%20Range%20Finder
Comment by MyloXyloto on 2012-03-26:
Thanks, but i already done this rosserial tutorials and it works perfectly. The main problem is to mix the Servo, Rangefinder, arduino and my main processor in C language. My main goal is to build an normal arduino obstacle avoidance robot which is implement by ROS.
Comment by MyloXyloto on 2012-03-26:
I believe, many people out there is not clear about this 'mixing' up method even though its a simple robot project. Sorry about that :)
Comment by mjcarroll on 2012-03-26:
So are you trying to do all of this on an Arduino? Or is there some interface to another computer?
Comment by MobileWill on 2013-10-25:
Have you taken a look at this https://github.com/hbrobotics/ros_arduino_bridge/
All the base code is done so it makes it much easier to get started and you can easily add support for different hardware.The readme gives a twist example, and it just enough to start playing with twist messages.
So, the topic /cmd_vel topic should have the message type Twist | {
"domain": "robotics.stackexchange",
"id": 8583,
"lm_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, navigation, beginner",
"url": null
} |
deep-learning, tensorflow, keras
train_data = pd.read_csv('spirals.csv').values
train_X = train_data[:,0:2]
train_y = train_data[:,2]
model = Sequential()
model.add(Dense(16, activation='relu', input_shape=(2,)))
model.add(Dense(16, activation='relu'))
model.add(Dense(16, activation='relu'))
model.add(Dense(16, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer=RMSprop(),
metrics=['accuracy'])
history = model.fit(train_X, train_y, batch_size=32, epochs=2000, verbose=0)
score = model.evaluate(train_X, train_y, verbose=0)
print(score) | {
"domain": "datascience.stackexchange",
"id": 1991,
"lm_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, tensorflow, keras",
"url": null
} |
Using modules, you can design your own trigonometric functions that use degree. Online calculator to convert radians to degrees (rad to deg) with formulas, examples, and tables. Online converter. Solution : Radian measure = (π/180) x degree measure. Most calculators have a special button to switch between degrees and radians. Use this page to learn how to convert between arcseconds and radians. If you are lost: Go back and review this Trigonometric Functions chapter. This free online Degree to Radian Calculator makes it easy to convert degrees to radians with just the press of a button. Since #2pi# radians is one revolution:. How do you convert 16 revolutions to radians? Trigonometry Graphing Trigonometric Functions Radian Measure. Degrees to radians conversion table. The Unit Circle Degrees & Radians Conversion Practice Convert each degree measure into radians. 1 arcsecond ≈ 4. Morse, San Francisco. Instructions: Use this radians to degrees calculator with steps to convert an angle in radians to degrees. Android M Calculator Has Radians and Degrees Toggle Flashed the M Developer Preview, and when I opened the calculator I noticed there was a toggle for radians and degrees. 29577951 degrees/radian. On a unit circle, the y (sin) distance of a 30 degree angle is the same as the x (cos) distance of a 60 degree angle. Now that you're done with the degrees, let's switch over to radians, or fractions of pi. Most calculators can be set to use angles measured with either degrees or radians. so share and like us on www. By Sharon K. But, if you are working with 2 radians, then if you want to turn it into a degree, you have to calculate 2 x 180 / π. Information: - The SI derived unit for frequency is the Hertz. Earth has an angular velocity of radians per hour. Each degree is divided into 60 minutes, and each minute further divided into 60 seconds. Get your calculator! ($29. radian measure = π × 225/180 = Step 3: Reduce or simplify the fraction of π if necessary. This is how easy it is. | {
"domain": "acku.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226294209298,
"lm_q1q2_score": 0.8010543385992038,
"lm_q2_score": 0.8198933315126792,
"openwebmath_perplexity": 708.4322502920514,
"openwebmath_score": 0.7919409275054932,
"tags": null,
"url": "http://ahiw.acku.pw/radians-to-degrees-calculator-with-steps.html"
} |
angular-momentum, rotational-dynamics, rotation
Title: Angular momentum-torque relationship in a rotating frame? I have read that $$\vec\tau=\frac{\mathrm{d}\vec L}{\mathrm{d}t}$$
holds true whenever the origin is not accelerating. But I cannot see why this holds true for a rotating frame of reference (such as one that rotates with the body), please can anyone explain why this is so? Also if possible please could you provide a source? When you calculate $\frac{\mathrm{d}\vec{L}}{\mathrm{d}t}$ of a particle of mass, m, having a linear momentum of $\vec{\mathrm{p}}$ in an inertial frame via a rotating frame or rotating body where the acceleration is directed towards the origin, you get this:$$\frac{\mathrm{d}\vec{L}_{inertial}}{\mathrm{d}t}=m\bigg(\vec{r}\times\frac{\mathrm{d^2}\vec{r}}{\mathrm{d}t^2}\bigg)+\frac{\mathrm{d}\vec{L}_{rotational}}{\mathrm{d}t}$$or$$\frac{\mathrm{d}\vec{L}_{rotational}}{\mathrm{d}t}=\frac{\mathrm{d}\vec{L}_{inertial}}{\mathrm{d}t}-m\bigg(\vec{r}\times\frac{\mathrm{d^2}\vec{r}}{\mathrm{d}t^2}\bigg)$$ | {
"domain": "physics.stackexchange",
"id": 21201,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "angular-momentum, rotational-dynamics, rotation",
"url": null
} |
c++, matrix
Title: 4x4 matrix multiplication I am very new to matrix math. I have the following that sets the rotation in a 4x4 matrix. It is pretty ugly, so can anyone suggest how I could clean this up?
I would like to not have to call MultiplyTwoMatrixes twice. A better way of copying the 3x3 matrix into the end 4x4 matrix would be nice as well.
void MultiplyTwoMatrixes(float aMatrix[9], float bMatrix[9], float product[9])
{
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
product[j + i * 3] = 0;
for (int k = 0; k < 3; k++)
{
product[j + i * 3] += aMatrix[k + i * 3] * bMatrix[j + k * 3];
}
}
}
}
void setrotation(float x, float y, float z)
{
const float* oldMatrix = node->GetTransform();
float xRot[9] = { 1, 0, 0, 0, cos(x), sin(x), 0, -sin(x), cos(x) };
float yRot[9] = { cos(y), 0 ,-sin(y), 0, 1, 0, sin(y), 0, cos(y) };
float zRot[9] = { cos(z), sin(z), 0, -sin(z), cos(z), 0, 0, 0, 1 };
float xyResult[9];
float xyzResult[9];
float newMatrix[16];
MultiplyTwoMatrixes(xRot, yRot, xyResult);
MultiplyTwoMatrixes(xyResult, zRot, xyzResult); | {
"domain": "codereview.stackexchange",
"id": 16098,
"lm_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++, matrix",
"url": null
} |
. . Find the sum of all multiples of 6 from 6 to 102 , inclusive. . Jump to Question. perfect thank you. 0 0 1 3 0 0 0. In simple words, Consecutive integers are integers that follow in sequence, where the difference between two successive integers is 1. Clearly, the numbers between 250 and 1000 which are divisible by 3 are 252, 255, 258, …., 999. . Julie S. Syracuse University . with first term a = 252, common difference = 3 and last term = 999. Use the following formula: n(n + 1)/2 = Sum of Integers. . Find the sum of all multiples of 4 that are between 15 and 521. The sum of 1+2+3+4+...496+497+498+499+500? Between 1 and 200, they are three digit numbers of which the first must be 1. home Front End HTML CSS JavaScript HTML5 Schema.org php.js Twitter Bootstrap Responsive Web Design tutorial Zurb Foundation 3 tutorials Pure CSS HTML5 Canvas JavaScript Course Icon Angular React Vue Jest Mocha NPM Yarn … What is the sum of the first 500 counting numbers? Python Program to return Sum of Prime Numbers from 1 to 100. What is the sum of first 550 odd numbers. s_n = n(a_1 + a_n)/2. Call out the result. If n is an integer, then n, n+1, and n+2 would be consecutive integers. This is an A.P. The sum of part of the series of natural numbers from n 1 to n 2 is the sum from 1 to n 2-1 less the sum from 1 to n 2. Input parameters & values: You need to set the "Use regular expression to parse number" checkbox and enter regular expression and match group, which will be used to extract the number. What is the sum of first 400 natural numbers? let the numbers be x & y x+y = 22 x= 22-y x^2+y^2=250.. plug value of x in the equation This is an A.P. The below workout with step by step calculation shows how to find what is the sum of natural numbers or positive integers from 1 to 250 by applying arithmetic progression. is 56. If n is an integer, then n, | {
"domain": "uffol.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407152622596,
"lm_q1q2_score": 0.8272265586479834,
"lm_q2_score": 0.8499711794579723,
"openwebmath_perplexity": 294.5674505644646,
"openwebmath_score": 0.5390487313270569,
"tags": null,
"url": "http://uffol.com/men-in-kbnu/7a4c40-sum-of-numbers-1-to-250"
} |
• ($$\implies$$ ) assume there exists some $$S \subset X$$ such that $$t=\sum_{x \in S}x$$ then we would have that $$\begin{equation*} s-t=\sum_{x \in S\cup \{ s-2t \} }x, \end{equation*}$$ $$\begin{equation*} s-t=\sum_{x \in X' \setminus( S\cup \{s-2t\})}x \end{equation*}$$ and we would have that $$S\cup \{ s-2t \}$$ and $$X' \setminus( S\cup \{s-2t\})$$ form a partition of $$X'$$
• ($$\impliedby$$) Suppose that there is a partition $$P_1',P_2'$$ of $$X'$$ such that $$\sum_{x \in P_1'}x= \sum_{x \in P_2'}x$$. Notice that this induces a natural partition $$P_1$$ and $$P_2$$ of $$X$$ such that WLOG we have that $$\begin{equation*} s-2t+\sum_{x \in P_1}x= \sum_{x \in P_2}x \end{equation*}$$ $$\begin{equation*} \implies s-2t+\sum_{x \in P_1}x+\sum_{x \in P_1}x= \sum_{x \in P_2}x+\sum_{x \in P_1}x = s \end{equation*}$$ $$\begin{equation*} \implies s-2t+2\sum_{x \in P_1}x = s \end{equation*}$$ $$\begin{equation*} \implies \sum_{x \in P_1}x = t \end{equation*}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9489172644875641,
"lm_q1q2_score": 0.8084327205328213,
"lm_q2_score": 0.8519528000888387,
"openwebmath_perplexity": 504.4573010784416,
"openwebmath_score": 0.8294658064842224,
"tags": null,
"url": "https://cs.stackexchange.com/questions/6111/how-can-i-reduce-subset-sum-to-partition"
} |
robotic-arm, ros, jetson
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
make[2]: *** [sip/qt_gui_cpp_sip/Makefile] Error 1
make[1]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'qt_gui_cpp':
Command '/home/ubuntu/ros_catkin_ws/install_isolated/env.sh make -j1 -l1' returned non-zero exit status 2 | {
"domain": "robotics.stackexchange",
"id": 18774,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "robotic-arm, ros, jetson",
"url": null
} |
# Can we deduce $f(x)=$const from $f(px)=f(x)$
Let $f:R\rightarrow R$ be a continuous function. There exists a $p>0$, s.t. $f(px)=f(x),p\neq1$ for all $x\in R$.
Can we prove that $f(x)$ is a constant function?
• What about $p=1$? – John Douma Jul 28 '16 at 14:27
• @JohnDouma Oh, I mean $p\neq 1$. Thank you for pointing out. – 1024 Jul 28 '16 at 14:31
• Sorry I missed that it has to be contiuous – Gregory Grant Jul 28 '16 at 14:35
• Wlog p<1. Otherwise $f(x)=f(\frac{1}{p}x)$. I think you can then establish that it's constant on $[0, \infty]$ . There's a lemma in real analysis which says that if $a_n \to a$ and $f$ is continuous then $f(a_n) \to f(a)$. So, you can consider the sequence $p,p^2,...$. But now repeating this for the same sequence scaled by some arbitrary factor (i.e $ap, ap^2,ap^3,...$) and since limits are unique, $f(1)=f(a)$ and so on. – daruma Jul 28 '16 at 14:40
• And repeat for [-\infty, 0] – daruma Jul 28 '16 at 14:41 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717452580316,
"lm_q1q2_score": 0.8221344921958249,
"lm_q2_score": 0.8333245870332531,
"openwebmath_perplexity": 158.07094611790342,
"openwebmath_score": 0.9509497284889221,
"tags": null,
"url": "https://math.stackexchange.com/questions/1873937/can-we-deduce-fx-const-from-fpx-fx/1873943"
} |
navigation, robot-localization
process_noise_covariance: [0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, | {
"domain": "robotics.stackexchange",
"id": 37837,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, robot-localization",
"url": null
} |
python, performance, strings, mathematics
k=200
t0 = time.time()
for i in range(1,k):
Cost_Func(pat,txt)
t1 = time.time()
for i in range(1,k):
KMPSearch(pat, txt)
t2 = time.time()
print("Cost_func:",(t1-t0)/k*10000,"KMP:",(t2-t1)/k*10000,k)
Is there a faster way to complete the Cost_Func(pt,STRING)?
For example, would library like NumPy help? Is there any other technique?
The source of the code of KMP function is taken from here. Without saying this lightly, this code is a proper nightmare. Here is a list of things that do not make your code faster:
Combining variable assignments on one line
Writing a list comprehension used for its side-effects and then throwing away the result of the comprehension
Removing all whitespace from comprehensions
Hyper-abbreviating variable names
So don't do any of those. Add type hints, follow PEP8 for your variable and function names and whitespace, add a __main__ guard, add unit tests, expand your first comprehension to a plain loop, replace pow() with the ** operator, loop more pythonically via zip, make compute_lps_array() return instead of mutate, and you get what I consider to be a bare-minimum first refactor:
from typing import Literal, Sequence
PatternT = Sequence[Literal['0', '1']]
def cost_func(pattern: PatternT, string: PatternT) -> list[int]:
x = y = 0
length = len(pattern)
const = 3
for i, (p, s) in enumerate(zip(pattern, string), start=1):
x += (11 * int(p)) ** i
y += (11 * int(s)) ** i | {
"domain": "codereview.stackexchange",
"id": 43484,
"lm_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, strings, mathematics",
"url": null
} |
# How to prove $8^{2^n} - 5^{2^n}$ is divisible by $13$ where $n\in\mathbb{N}-\{0\}$ with induction?
So the question is as above is shown:
How to prove $8^{2^n} - 5^{2^n}$ is divisible by $13$?
$n=1: 8^2 - 5^2 = 39$ is a multiple of $13$.
I.H.: Suppose $8^{2^n} - 5^{2^n}$ is divisible by $13$ is true $\forall n \in \mathbb{N}\setminus\{0\}$.
I got stuck on this $n= m + 1$ case.
$8^{2^{m+1}} - 5^{2^{m+1}}= 8^{2^m\cdot 2}- 5^{2^m\cdot 2}$
• Hint: Your last expression is of the form $A^2-B^2$ with $A=8^{2^m}$ and $B=5^{2^m}$ – Kelenner Sep 11 '17 at 13:33
• Oh, of course. Thx for the insight. – Anonymous196 Sep 11 '17 at 13:40
$\bmod 13\!:\,\ 8\equiv -5\,\Rightarrow\, 8^{\large 2}\!\equiv 5^{\large 2}\color{}{\Rightarrow}\, 8^{\large 2N}\!\equiv 5^{\large 2N}\,$ by the Congruence Power Rule.
Remark Replying to comments, below I show how the inductive proof of the linked Power Rule can be expressed without knowledge of congruences, using analogous divisibility rules. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822876987039989,
"lm_q1q2_score": 0.820685196942615,
"lm_q2_score": 0.8354835330070839,
"openwebmath_perplexity": 834.9521838044379,
"openwebmath_score": 0.9147459864616394,
"tags": null,
"url": "https://math.stackexchange.com/questions/2425275/how-to-prove-82n-52n-is-divisible-by-13-where-n-in-mathbbn-0/2425333"
} |
algorithms, recurrence-relation
$$
S(n) = n^{5/3} + n^{1/3}S(n^{2/3}),
$$
and so the same argument shows that $S(n) = O(n^{5/3})$ and so $T(n) = n^2 + O(n^{5/3})$. In the same way, we can get $T(n) = n^2 + n^{5/3} + O(n^{10/9})$, and so on. | {
"domain": "cs.stackexchange",
"id": 16852,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, recurrence-relation",
"url": null
} |
7. That's just a little insane.
Back to my original question:
What number is alterered identically by a power and a root?
There are not too many candidates.
Only 0 and 1. finis.
Why drag through messy algebra with ambiguous exponents when it's really just a definition / property question? | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587261496031,
"lm_q1q2_score": 0.8453744368862051,
"lm_q2_score": 0.8558511451289037,
"openwebmath_perplexity": 235.52257178263037,
"openwebmath_score": 0.8115619421005249,
"tags": null,
"url": "http://mathhelpforum.com/pre-calculus/141621-how-solve-x-equation.html"
} |
down). or non -linear regression must be preferred. For assistance in performing regression in particular software packages, there are some resources at UCLA Statistical Computing Portal. It penalizes the errors mode in case a new variable is added to the regression equation. It is also performed for the distribution analysis of the regression errors. Finally, review the section titled "How Regression Models Go Bad" in the Regression Analysis Basics document as a check that your OLS regression model is properly specified. e. Number of obs – This is the number of observations used in the regression analysis.. f. F and Prob > F – The F-value is the Mean Square Model (2385.93019) divided by the Mean Square Residual (51.0963039), yielding F=46.69. Suppose we have the following dataset that shows the total number of hours studied, total prep exams taken, and final exam score received for 12 different students: To analyze the relationship between hours studied and prep exams taken with the final exam score that a student receives, we run a multiple linear regression using hours studied and prep exams taken as the predictor variables and final exam score as the response varia… e. Variables Remo… But the value of R square (Zero) gives us a different interpretation. But is it Good or Bad contribution to GDP Once you are able to organize the waste, then making it more is not that annoying, but if the waste is spread around you, then trouble is in front, and you think a hundred times before adding it further. Hunters Run Condo Association, Roman Numbers 1 To 2000, Microneedling Stretch Marks, Jaifal English Name, How To Reply To Apology Email From Employee, 1 Samuel 30:8 Kjv, Cnidaria Germ Layers, Benefits Of Serviced Apartments, Sprinkler Plan Cad Block, Nonpareil Gummy Bears, " /> F f = 0.0000 R-squared g = 0.4892 Adj R-squared h = 0.4788 Root MSE i = 7.1482 . But we use a slightly different syntax to describe this line than the equation above. Linear Regression is the family of algorithms employed in supervised machine learning tasks (to lear n more about supervised learning, you can read my former article here).Knowing that supervised ML tasks are normally divided into classification and regression, we can collocate Linear Regression algorithms in the latter category. Or | {
"domain": "newsreportnakhonpathominside.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9706877726405083,
"lm_q1q2_score": 0.8046407573006413,
"lm_q2_score": 0.8289387998695209,
"openwebmath_perplexity": 898.321942536921,
"openwebmath_score": 0.4437622129917145,
"tags": null,
"url": "http://newsreportnakhonpathominside.com/overtraining-syndrome-ctkpbll/archive.php?id=ols-regression-results-explained-f40cd2"
} |
gravity, gravitational-waves, ligo
the left graph is total power (or really square root of that to simply plot amplitude, and on a strain scale) at each frequency. It includes all the power of the signal at that frequency, even if it was at different times. The waveforms spent more time (more cycles), at lower frequencies, that's why it looks that way -- the power at the lower energies integrated power for a longer period of time. It That's the problem with freq/ampl graphs, a freq may include longer periods of time. For instance, in the last detection for GW 151226 the lower frequencies around 30 Hz went on (yes, slowly increasing) for about a second or so. They explain it, in the quote below from the pdf of the paper, in the next paragraph after Fig. 1 (bold italization is mine for the relevant sentence). You really would like to see a 3D plot, with freq and time in two axis, and amplitude the z axis, you could then see the chirp as a ridge int he time freq plane as in the figure below from Matlab at https://www.mathworks.com/help/signal/examples/practical-introduction-to-time-frequency-analysis.html?requestedDomain=www.mathworks.com
From the pdf you referred us to, at http://journals.aps.org/prx/pdf/10.1103/PhysRevX.6.041015
"The amplitude of the signal is maximum at the merger, after which it decays
rapidly as the final black hole rings down to equilibrium. In the frequency domain, the amplitude decreases with frequency during inspiral, as the signal spends a greater number of cycles at lower frequencies. This is followed by a slower falloff during merger and then a steep decrease during the ringdown.
On your second question, no GW150914 has about an SNR of 0 dB at 20 Hz, and better at 30 Hz (at 30 it looks like about 3x$10^{-22}$ at 30, just sort of reading off the graph), so SNR of about $3^2$ or about 10 dB, so just detectable. At 20 Hz it was too low. They will extend the lower limit in later runs I understand. | {
"domain": "physics.stackexchange",
"id": 36704,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gravity, gravitational-waves, ligo",
"url": null
} |
history, parallax
Title: When was the parallax of a star first measured? Telescopes like Gaia measure the parallax of stars with a great precision. But for stars that are beyond 11 kpc, their parallax is still too small to be measured. With Earth-bound telescopes, only the nearest stars have a visible parallax. Was the parallax of any stars measured before the telescope era?
When was the parallax of a star measured for the first time? Telescopes were apparently invented in 1609, but didn't become advanced enough to measure stellar parallax until the 1830s.
Observation of stellar parallax would be a big step in proving the heliocentric theory, and I think that the lack of detectable stellar parallax was used as an argument against the heliocentric theory in ancient times. It was certainly used as an argument against the heliocentric theory in early modern times.
Stellar parallax is so small that it was unobservable until the 19th century, and its apparent absence was used as a scientific argument against heliocentrism during the early modern age. It is clear from Euclid's geometry that the effect would be undetectable if the stars were far enough away, but for various reasons, such gigantic distances involved seemed entirely implausible: it was one of Tycho Brahe's principal objections to Copernican heliocentrism that for it to be compatible with the lack of observable stellar parallax, there would have to be an enormous and unlikely void between the orbit of Saturn and the eighth sphere (the fixed stars).1
Source
After the Copernican theory gained popularity astronomers made many attempts to measure stellar parallax. | {
"domain": "astronomy.stackexchange",
"id": 4890,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "history, parallax",
"url": null
} |
homework-and-exercises, newtonian-mechanics, forces, vectors, statics
Now we know $T$ from doing the "V" formation, and recall at the end we noted how to rewrite it in terms of $\sin(\phi)$, which now cancel out giving us
$$F_\textrm{rock} = \frac{mg}{2\sin(\phi')}.$$
This is the exact same form of the equation as the "V" formation, just with $\phi$ and $\phi'$ switched! Now $\sin\left( \arctan\left( \frac{\sin(\phi)}{1+\cos(\phi)}\right) \right)$, is a slightly unsightly sight. But if you only consider, $0 \leq \theta \leq \pi$, as your range for $\theta$, which are limits of a triangle, then it simplifies to to $\sin\left(\frac{\phi}{2}\right)$. Now recalling that $2\phi = \pi - \theta$, then we can rewrite that as $\cos\left(\frac{\pi}{4} + \frac{\theta}{4}\right)$. Thus we have indeed arrived at
$$ F_\textrm{rock} = \frac{mg}{2\cos\left(\frac{\pi}{4} + \frac{\theta}{4}\right)}.$$
I haven't spent much time trying to make the math elegant, but you can see the agreement, which leads us to believe we have included all the physics in which the wikipedia article has.
Conclusion
As noted in the wikipedia, this formation is less effective at minimizing $F_\textrm{rock}$. The "V" formation, best case scenario of $\theta = 0$, halves weight; while for the death triangle you only get $\sqrt{2}/2$. Therefore, for safety reasons, where you want to put the smallest amount of weight on an anchor, it is advised to not use this method of anchoring (on top of apparently violating other tenants of climbing, e.g., redundancy). | {
"domain": "physics.stackexchange",
"id": 29365,
"lm_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, forces, vectors, statics",
"url": null
} |
protein-structure, structural-biology, pymol
Title: Putting labels of different sizes on one PyMOl Object I'm new to PyMol (and StackExchange!) and working on my first project. I have the structure of a protein as an object, called PolyA-M, and the idea is that the residues of it are shown as spheres of differing sizes based on a calcualted conservation value. I want to label each sphere with it's amino acid, but to have the label size corresponding to sphere size. Here is a sample of the code that might be used to label one amino acid.
alter ( resid 138 ), resn = "Q135"
alter ( name CB and resid 138 ), vdw = vdw * 0.8 * 0.679934640522875
set_color col138, [ 1.0, 0.181, 0.181 ]
show spheres, name CB and resi 138
show sticks, ( name CA or name CB ) and resid 138
set label_size, 14, PolyA-M
label PolyA-M and name CB and resid 138, "Q"
color col138, name CB and resi 138
In this case, residue 138 is medium sized sphere with a size 14 label Q that fits well. However, if later on in the code another residue is labelled as so:
alter ( resid 198 ), resn = "A208"
alter ( name CB and resid 198 ), vdw = vdw * 0.8 * 0.359803921568627
set_color col198, [ 1.0, 0.601, 0.601 ]
show spheres, name CB and resi 198
show sticks, ( name CA or name CB ) and resid 198
set label_size, 8, PolyA-M
label PolyA-M and name CB and resid 198, "A"
color col198, name CB and resi 198 | {
"domain": "bioinformatics.stackexchange",
"id": 1121,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "protein-structure, structural-biology, pymol",
"url": null
} |
java, concurrency, queue
This code doesn't seem to make sense. The only way you can get to the return here is if the queue is not empty, but it is empty.
K old = reverseLookup.remove(p.v);
if(old != null) {
map.get(old).remove(p.v);
// leave the old set, could be others - who cares if it's empty...
// leave keys, it will get cleaned up in time
}
This removes the old value. The comments here didn't help my understanding at first; I understand that you mean to say "don't clean up empty value sets for keys here". I don't see how it will get cleaned up in time.
Set<V> set = map.putIfAbsent(p.k, nextEmptySet);
This... adds the key - set mapping if it's not there. Then it returns the old value, which will be null if it added and the old value if it didn't add. Pretty clear.
if(set == null) {
set = nextEmptySet;
nextEmptySet = new HashSet<>();
keys.add(p.k);
}
If we just had to add a set for this key, make a new cached empty set... and add the key to the priority queue. Pretty clear.
set.add(p.v);
reverseLookup.put(p.v, p.k);
Add key -> value and value -> key mappings. Pretty clear.
...
After looking at this in a bit more detail, you could merge these two lines:
K old = reverseLookup.remove(p.v);
reverseLookup.put(p.v, p.k);
As put will return the old "value" (which is the "old key" in this case). | {
"domain": "codereview.stackexchange",
"id": 21073,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, concurrency, queue",
"url": null
} |
cell-culture
Title: Which human cell lines do not express the GLP-1 receptor? I need a human cell line that does not express the GLP-1 (glucagon like peptide-1) receptor.
I'm working with HeLa cells, do those express the GLP-1 receptor? Which other cell lines exist that don't express this specific receptor?
Are there any general resources where I could find this kind of information? AbCam suggests HeLa cells as positive controls for their antibody to GLP1R. They provide the following pictures of HeLa cells labeled with their antibody:
(The image of the right is treated with synthesized peptide.)
According to Wikipedia, GLP1R is also expressed in pancreatic beta cells and the brain. | {
"domain": "biology.stackexchange",
"id": 64,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cell-culture",
"url": null
} |
general-relativity, gravity, speed-of-light, gravitational-waves, causality
Title: What is the difference between gravitational waves and gravitational distortions in spacetime? I understand that gravitational waves can be caused by accelerating masses (e.g. The gravitational waves that were detected by two very massive black holes merging earlier this year) and that they are associated with the theoretical quantum particle, the graviton. | {
"domain": "physics.stackexchange",
"id": 33676,
"lm_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, gravity, speed-of-light, gravitational-waves, causality",
"url": null
} |
Example 9.10 LaplaceRT.edp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 // Parameters func gd = 1.; func g1n = 1.; func g2n = 1.; // Mesh mesh Th = square(10, 10); // Fespace fespace Vh(Th, RT0); Vh [u1, u2]; Vh [v1, v2]; fespace Ph(Th, P0); Ph p, q; // Problem problem laplaceMixte ([u1, u2, p], [v1, v2, q], solver=GMRES, eps=1.0e-10, tgv=1e30, dimKrylov=150) = int2d(Th)( p*q*1e-15 //this term is here to be sure // that all sub matrix are inversible (LU requirement) + u1*v1 + u2*v2 + p*(dx(v1)+dy(v2)) + (dx(u1)+dy(u2))*q ) + int2d(Th) ( q ) - int1d(Th, 1, 2, 3)( gd*(v1*N.x +v2*N.y) ) + on(4, u1=g1n, u2=g2n) ; // Solve laplaceMixte; // Plot plot([u1, u2], coef=0.1, wait=true, value=true); plot(p, fill=1, wait=true, value=true);
## Metric Adaptation and residual error indicator#
We do metric mesh adaption and compute the classical residual error indicator $\eta_{T}$ on the element $T$ for the Poisson problem.
First, we solve the same problem as in a previous example. | {
"domain": "freefem.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9884918526308095,
"lm_q1q2_score": 0.8081657130300763,
"lm_q2_score": 0.8175744806385542,
"openwebmath_perplexity": 2378.9853501231787,
"openwebmath_score": 0.5559412837028503,
"tags": null,
"url": "https://doc.freefem.org/models/StaticProblems/"
} |
perform a number of different calculations for preparing percent (%) solutions when starting with the solid or liquid material. The addition of moments of inertia for sub-bodies to give the full moment of inertia follows directly from the fact that the integral over the whole body is the sum of the integrals over the sub-bodes. 510 12 1 mm. The mass moment of inertia about a fixed axis is the property of a body that measures the body's resistance to rotational acceleration. Cost Per Mille (CPM) Calculator. See full list on risa. Math Calculator from Mathway will evaluate various math problems from basic arithmetic to advanced trigonometric expressions. These are useful for structural mechanics and dynamics performance prediction. An Example. For a beam spanning a 12-foot room and supporting a weight of 600 lbs. However, we know how to integrate over space, not over mass. Nickzom Calculator – The Calculator Encyclopedia is capable of calculating the young’s modulus. 1st moment of inertia. The moment of inertia of a composite area about any axis may be found by finding the moments of inertia of all parts about the axis by means of the transfer equation and then adding them. Solve advanced problems in Physics, Mathematics and Engineering. The greater its value, the greater the moment required to provide a given acceleration about a fixed pivot. The idea of point equivalent moment of inertia is concentrated on equation (2) and equation (3). However, since the beam and plates have different materials, we also need to take their different elastic moduli into account. of the composite section, measured in the direction indicated by the subscript. The links will open a new browser window. RPN Calculator. MI of a tube = pi. The testing of cornering performance was executed by using specifications 1 , 2, 3, and 4. Calculate the allowable strain based on the allowable stress for the material. To calculate the moment of inertia of this combined object, you need to sum the moments of inertia of the individual objects and also add on offset term given by the Steiner parallel axis theorem for each individual object. Cost Index. In other words, how much something's going to resist being angularly accelerated, so being sped up in its rotation, or slowed. Moments of Inertia of Common Shapes. Calculated cross section values: | {
"domain": "campusdergenerationen.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777179025415,
"lm_q1q2_score": 0.8044528205223533,
"lm_q2_score": 0.8152324938410784,
"openwebmath_perplexity": 673.9583066303479,
"openwebmath_score": 0.6343695521354675,
"tags": null,
"url": "http://campusdergenerationen.de/composite-moment-of-inertia-calculator.html"
} |
javascript, jquery, sqlite, cordova
The function findImgTag takes a string, looks for <img> tags, downloads the images to the device storage and replaces them with a local path for offline usage. The return value is the string with replaces <img> tags.
Sync++ is to keep track of the amount of entries for the function syncEnd. syncEnd just hides the mobileLoader when the database is synchronized with the server.
The function fileInfo downloads pictures that are not inside the HTML text.
To ensure that the data is successfully inserted into the table I make an other INSERT into a different table that lists when an entry was updated(server side timestamp) and when the last successful insert was (now).
I read on Stack Overflow that you shouldn't make nested transactions but I haven't found an other way to ensure the INSERT or UPDATE was successful since jQuery is asynchronous.
My question: Is there a better way to do the INSERT and UPDATE and are there any other improvements I could make to the code? Checking if variables are undefined, in my opinion, is better done like this:
if (content.content[0].kurzbeschreibung === void 0) | {
"domain": "codereview.stackexchange",
"id": 14864,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, sqlite, cordova",
"url": null
} |
ros
Title: How to start contributing?
I'm currently a college junior student in computer engineering and really interested in robotics / hardware control via software and want to get into ROS. I have some experience with using Arduino, knowledge of some hardware design in logic level, and wrote some codes for a avionics control unit, yet I found jumping into ROS to be, a bit, overwhelming.
Can someone provide some starter help? Like, where to start with, how to start with, and when to consider contributing? I have configured environment and is going through tutorial.
Thanks a lot!
Originally posted by UlyssesASL on ROS Answers with karma: 11 on 2016-10-29
Post score: 1
There are some pointers for getting involved here: http://www.ros.org/contribute/ and some more detailed pointers here: http://wiki.ros.org/Get%20Involved
If you can find some ROS packages that you use, I'd suggest looking at open tickets for it, or consider identifying a new feature you'd like to see and submitting a pull request to make the change. If you start with small things you can get feedback during the review process and work your way up to larger changes.
Originally posted by tfoote with karma: 58457 on 2016-10-29
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 26085,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
quantum-field-theory, correlation-functions, wick-theorem
Title: Which Wick contractions are allowed? TLDR:
Given a Lagragian $\mathcal{L}$ depending on some fields $\{\phi_a\}$, which contractions between the fields are permissible? | {
"domain": "physics.stackexchange",
"id": 68794,
"lm_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, correlation-functions, wick-theorem",
"url": null
} |
entomology, anatomy
Title: Why do dragonflies have these special little spots on their wings? The wings of several kinds of dragonflies I've seen here in Taiwan all have an apparently special little pigmented spot near the ends of each wing.
Does this spot have a name and a function?
below x2: Taken today in Hsinchu county, Taiwan. Note arrows. I've also asked Identify these two large dragonflies in Taiwan?
Click for full size
below left: from Identify this black dragonfly with bluish coloration along its flat top, yellow on it's mid-body and green on its head below right: from Identify this black dragonfly with a bright bluish-white band around its body
Click for full size
Pterostigma is what those spots are. Wikipedia article is at https://en.wikipedia.org/wiki/Pterostigma.
I read the summary of the technical article below.
The pterostigma are heavier than the rest if the wing, and so the insect can glide faster without a destabilising flutter beginning.
The author also believes that the pterostigma contribute to more efficient active flight.
Technical details at:
Norberg, R. Åke. "The pterostigma of insect wings an inertial regulator of wing pitch". Journal of Comparative Physiology A. 81 (1): 9–22.
doi:10.1007/BF00693547. | {
"domain": "biology.stackexchange",
"id": 10844,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "entomology, anatomy",
"url": null
} |
reductions, logic, proof-techniques, undecidability
In proving that the validity of predicate logic is undecidable, according to the approach I learned from school, which is based on that of the Huth & Ryan book (2nd edition, page 135), when constructing the reduction of PCP to Validity problem, the "finite binary strings" of the universe are interpreted with a "interpret function", which encodes binary strings into composites of functions of the model.
Then it goes on to show that, using the fact that the antecedent of $\varphi$ must hold for it to be non-trivial, both sub-formulae of the antecedent can be expressed with the said "interpret function". From there, it follows that the consequence holds, too, since it can also be expressed in a way with the interpret function that follows from the previous expressions with interpret.
My question is: what is the purpose of this "interpret function"? Why can't we just use the previously devised φ and get the same result? What do we get out of using interpret to express our elements?
And also, what if our universe contains some arbitrary elements; that is, what if they are not binary strings? Do we just construct some mapping of the two? Lets start with what exactly you are trying to prove.
You're dealing with a signature $\sigma$ which consists of one constant $e$, two function symbols $f_0,f_1$, and one binary predicate $P(s,t)$. We denote by $\mathcal{C}$ the set of all "yes" instances to the post correspondence problem, i.e. all sequences of ordered pairs of binary strings $(s_1,t_1),...,(s_k,t_k)$ such that there exists indices $i_1,...,i_n$ for some $n\in\mathbb{N}$ which satisfy $s_{i_1}\cdot...\cdot s_{i_n}=t_{i_1}\cdot...\cdot t_{i_n}$ ($\cdot$ stands for concatenation). | {
"domain": "cs.stackexchange",
"id": 7753,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reductions, logic, proof-techniques, undecidability",
"url": null
} |
quantum-mechanics, double-slit-experiment
But when we look at the superposition in your case, it contains contributions from the electron in one slit with one state of the counter; and an electron in the right slit with another state of the counter. Each of these possibilities has a nonzero probability amplitude – and nonzero probability – and once we open the (partly destroyed) sealed box, we measure which of the two outcomes has gotten realized. But we may still show that we will measure the strength of the interference pattern to be zero if the which-slit information was detected because the waves from the two slits just couldn't interfere with one another as they were entangled with different states of the counter. Only contributions to a wave in which all the remaining degrees of freedom are found in the same state may interfere. | {
"domain": "physics.stackexchange",
"id": 9939,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, double-slit-experiment",
"url": null
} |
special-relativity, classical-mechanics, energy, inertial-frames
Title: Is the change in kinetic energy of a particle frame independent? Intuitively, I would expect the change in kinetic energy of a particle to be frame independent. It just doesn't "feel" right that between two points in time-space, one frame should measure a change in kinetic energy of a particle different to another frame.
Is my intuition right?
Is the change in kinetic energy of a particle frame independent? Your intuition is incorrect, but you should get new intuition. The reason energy isn't conserved the same way in every frame is because the energy is not separate from the momentum. This is clearest in relativity, where the energy is the time-component of the energy-momentum vector. Then if you change frames, what you called energy partly becomes momentum, and it is the conservation law of the total energy-momentum vector which is frame independent.
When you have a vector conservation law, it is not true that the change in magnitude of every component is the same in every frame. For example, the change in x-momentum turns into the change in y-momentum if you rotate the x and y axes into each other.
Even without relativity, just with Galilean invariance, energy is mixed up with the momentum. The difference is that without relativity, the momentum is not mixed back, it is the same in all boosted frames.
So consider a change in velocity from 10 to 20 meters per second in a 2kg object. This means that you have put in 300 Joules of energy. This doesn't mean your muscles did 300 Joule's of work though, you can do this with an elastic collision where you do no net work. If you consider the frame where the object starts out moving at -5 meters per second, it ends up moving at 5 meters per second, and there is no change in the kinetic energy. If you just rebounded the object off a very massive wall, this is what would happen, and you would do no work in the process.
But in the collision with the wall, the very massive wall will end up with a tiny recoil, which will change the energy of its motion so that the overall motion is conserved.
Formally | {
"domain": "physics.stackexchange",
"id": 2719,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, classical-mechanics, energy, inertial-frames",
"url": null
} |
c, strings, beginner
bufEnd = buf + snprintf(buf, SIZE, "magnet:?xt=urn:btih:%s", argv[1]);
In this you have traversed argv[1] twice, once in the strlen call
and then again in snprintf. You could avoid one of these:
const char *limit = buf + sizeof buf;
char *in = buf;
in += snprintf(in, limit-in, "magnet:?xt=urn:btih:%s", argv[1]);
if (in >= limit) {
die(1, "buffer overflow detected");
}
This is more efficient and also avoids embedding the magic number 20
(embedded constants are usually best avoided). It uses the fact the
snprintf returns the number of bytes needed for the string it wanted
to print but doesn't overflow the buffer. So if it returns a number
greater than or equal to the space available , you know there was an
overflow. I also changed bufEnd to in, used limit to mark the
end of the buffer and added braces around the call to die
Within your while loop you also traverse each string twice. The
same technique as above can be used to avoid this. Also your check
for blank lines does not trap lines that contains white-space as well
as a \n. For that you might use:
const char *s = line + strspn(line, " \t\r\n");
if (*s == '\0')
continue; | {
"domain": "codereview.stackexchange",
"id": 5182,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, strings, beginner",
"url": null
} |
Find all School-related info fast with the new School-Specific MBA Forum
It is currently 06 Dec 2013, 20:50
# Events & Promotions
###### Events & Promotions in June
Open Detailed Calendar
# Neat Fact for Integral Solutions to a polynomial
Author Message
TAGS:
Verbal Forum Moderator
Joined: 10 Oct 2012
Posts: 614
Followers: 25
Kudos [?]: 389 [2] , given: 127
Neat Fact for Integral Solutions to a polynomial [#permalink] 02 Jul 2013, 01:09
2
KUDOS
Expert's post
Hello!
Consider any polynomial f(x) = A_1x^n+A_2x^{n-1}+.....A_n
Assumption : All the co-efficients for the given polynomial have to be integral,i.e. A_1,A_2,A_3....A_n are all integers.
Fact:Any integral solution(root) for the above polynomial will always be a factor(positive/negative) of the constant term : A_n
Example I : f(x) = 5x^2-16x+3. Thus, we know that if the given polynomial has any integral solutions, then it will always be out of one of the following : -3,-1,1,3
We see that only x=3 is a root for the given polynomial. Also, we know that product of the roots is\frac {3}{5}. Hence, the other root is \frac {1}{5}
Example II : Find the no of integral solutions for the expression f(x) = 3x^4-10x^2+7x+1
A. 0
B. 1
C. 2
D. 3
E. 4
For the given expression, instead of finding the possible integral solutions by hit and trial, we can be rest assured that if there is any integral solution, it will be a factor of the constant term ,i.e. 1 or -1. Just plug-in both the values, and we find that f(1) and f(-1) are both not equal to zero. Thus, there is NO integral solution possible for the given expression--> Option A.
Example III : Find the no of integral solutions for the expression f(x) = 4x^4-8x^3+9x-3 | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.983596967483837,
"lm_q1q2_score": 0.828017155738382,
"lm_q2_score": 0.8418256492357358,
"openwebmath_perplexity": 1458.0460442586082,
"openwebmath_score": 0.8213399648666382,
"tags": null,
"url": "http://gmatclub.com/forum/neat-fact-for-integral-solutions-to-a-polynomial-155227.html"
} |
z-transform, speech-processing, laplace-transform, bilinear-transform
Now we can apply the bilinear transform
$$s=\frac{2}{T}\frac{1-z^{-1}}{1+z^{-1}}$$ which gives
$$(s+2b)T=2\left(\frac{1-z^{-1}}{1+z^{-1}}+bT\right)\tag{1}$$
The formula in your question is
$$\frac{2(1+bT+(bT-1)z^{-1})}{T(1+z^{-1})}=\frac{2}{T}\left(\frac{1-z^{-1}}{1+z^{-1}}+bT\right)$$
which differs from (1) by a factor $1/T$. I can't explain this difference, but I'm pretty sure that the basic idea of the transformation is as I've described it above. | {
"domain": "dsp.stackexchange",
"id": 1949,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "z-transform, speech-processing, laplace-transform, bilinear-transform",
"url": null
} |
quantum-field-theory, particle-physics, scattering, antimatter, feynman-diagrams
Title: Little confusion in drawing Feynmam diagram If the arrows of both the outgoing solid lines of the Feynman diagram corresponding to the Bhabha scattering of $e^+$ and $e^-$ are just reversed, will it not describe the same thing? Doesn't both imply the same, namely that $e^+$ and $e^-$ comes out finally?
It will also give the same amplitude right? I hope this diagram I can draw in either of the ways, no problem. It does not matter whether I draw $e^+$ line above and $e^-$ line below or vice-versa. Am I right? But the books generally draw, $e^-$ as the upper outgoing line, if they use $e^-$ as the upper incoming line. Is this really necessary? What will go wrong if I draw $e^+$ as the upper line and $e^-$ as the lower line on the outgoing side when I use the opposite for the incoming lines?
I could not copy and paste any diagram, so the question size has become long.
There are two possible Feynman graphs for Bhabha scattering at tree level.
I have shown them below.
Are you asking what will go wrong if these two are modified like shown below.
If this is what you are asking then the only thing that we should be
concerned about is the conservation of charge at each vertex point.
We can clearly see that the charge is not conserved for the modified graph on the
left. So we cannot draw it that way.
But the modified graph for the annihilation process (right one) is consistent
with the conservation of charge so its OK to draw it that way. | {
"domain": "physics.stackexchange",
"id": 12062,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, particle-physics, scattering, antimatter, feynman-diagrams",
"url": null
} |
quantum-mechanics, wavefunction, schroedinger-equation, time, perturbation-theory
However, if we consider the static Schrödinger equation at $t_0$, then could we not use time-independent perturbation theory (with the perturbation given by $\delta v(t_0)$) to determine the state $\psi(t_0)$? In which case, $\psi(t_0)$ would be given by
$\psi(t_0) = \psi_0 + \frac{h'_{1,0}(t_0)}{\epsilon_0-\epsilon_1}\psi_1$.
So it appears the state is already a mixed state of both $\psi_0$ and $\psi_1$. In my mind, this seems to be in contradiction with the result from time-dependent perturbation theory, where $\psi(t_0)=\psi_0$.
I'm guessing there is some flaw in using time-independent perturbation theory at the initial time, but can someone explain to me why this is the case or what the problem is if it's not that? You're mixing up the time-dependent and time-independent Schrodinger equations.
Time-dependent perturbation theory pertains to the time-dependent Schrodinger equation and tells you how the time-dependent state $|\psi(t) \rangle$ evolves.
All states can be written as a linear combination of energy eigenstates, which are solutions of the time-independent Schrodinger equation. Time-independent perturbation theory tells you how the energy eigenstates are modified when the Hamiltonian is.
Suppose a system is originally in an energy eigenstate. When a perturbation instantly turns on, time-dependent perturbation theory tells us the energy eigenstates have changed. This doesn't mean the state of the system has instantly changed, it just means that the state isn't an energy eigenstate anymore. To actually compute the evolution of the state, you use time-dependent perturbation theory. | {
"domain": "physics.stackexchange",
"id": 55297,
"lm_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, schroedinger-equation, time, perturbation-theory",
"url": null
} |
Proof: First, let me show pointwise convergence. For any $x\in[0,a]$, \begin{align*} g_n(x)=&\,\frac{\left(\sqrt{4\pi^2 n^2+x}-\sqrt{4\pi^2 n^2}\right)\left(\sqrt{4\pi^2 n^2+x}+\sqrt{4\pi^2 n^2}\right)}{\sqrt{4\pi^2 n^2+x}+\sqrt{4\pi^2 n^2}}\\ =&\,\frac{(4\pi^2n^2+x)-(4\pi^2 n^2)}{\sqrt{4\pi^2 n^2+x}+\sqrt{4\pi^2 n^2}}\\ =&\,\frac{x}{\sqrt{4\pi^2 n^2+x}+\sqrt{4\pi^2 n^2}}\to0\quad\text{as $n\to\infty$,} \end{align*} given that the denominator diverges. Uniform converges follows from the fact that $0\leq g_n(x)\leq g_n(a)$ for each $x\in[0,a]$. $\blacksquare$
Claim 2: The sequence $(\sin\circ g_n)_{n\in\mathbb N}$ converges to $0$ uniformly on $[0,a]$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773708039218115,
"lm_q1q2_score": 0.8227758076769972,
"lm_q2_score": 0.8418256452674008,
"openwebmath_perplexity": 118.96218587498616,
"openwebmath_score": 0.9921542406082153,
"tags": null,
"url": "https://math.stackexchange.com/questions/1373162/how-to-prove-f-n-converge-uniformly"
} |
8. Sep 3, 2004
### arildno
Let's look at how you can directly compute p and q using "unit maths"
$$[v]=L^{1}T^{-1}$$
$$[a]=L^{1}T^{-2}$$
$$[t]=T^{1}$$
Hence, we require:
$$[v]=[a^{p}t^{q}]=[a^{p}][t^{q}]=[a]^{p}[t]^{q}$$
Or, filling in:
$$L^{1}T^{-1}=L^{1*p}T^{-2*p}T^{1*q}=L^{p}T^{q-2p}$$
Now, L and T are independent dimensions, so the powers must equal each other seperately:
L:
1=p
T:
-1=q-2p
Hence, you may solve for: p=1, and q=1
9. Sep 3, 2004
### HallsofIvy
It does not follow that the teacher "screwed up". In his post, tony873004 asserted that "The left side of the = is L / T^2" which was incorrect. If he gave that to his teacher when he was asking the problem, then his teacher was correct. I suspect he didn't show his teacher the original problem.
10. Sep 3, 2004
### HallsofIvy
tony873004: when you are asking us or your teacher for help (and you should certainly continue doing both) be sure to state the ENTIRE PROBLEM and show what you have already done.
11. Sep 3, 2004
### tony873004
Arildno's explanation made sense to me. It's still going to take a little time to digest this, but p=1 and q=1 are correct according to Webassign.net.
I did post the entire question. The $$L / T^2$$ was my screw-up, not the teacher's, but I made this mistake after talking to the teacher. He did see the assignment straight from the book. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692332287863,
"lm_q1q2_score": 0.8377557173887936,
"lm_q2_score": 0.8577681049901037,
"openwebmath_perplexity": 920.6471342439241,
"openwebmath_score": 0.8103834986686707,
"tags": null,
"url": "https://www.physicsforums.com/threads/what-does-dimensionally-mean.41582/"
} |
strings, array, vba, excel, hash-map
Title: Fastest function to `Remove Duplicate Lines` per each cell The below function is used to Remove Duplicate Lines per each cell.
It works without problem, but it is slow with a range of only one column and 17k rows.
Actually, (with the same range in addition to another two column) , I am using a different excellent code by @VBasic2008 Link which perform complex tasks than my function and it takes just 1.5 second to finish.
I do not know where is the bottleneck on my code and How to optimize it.
There is no problem to totally change my codes or provide a new one.
In advance, pleased for all your help.
Option Explicit
Option Compare Text
Function RemoveDuplicateLines(ByVal Text As String, Optional delimiter As String = vbLf) As String
Dim dictionary As Object
Dim x, part
Set dictionary = CreateObject("Scripting.Dictionary")
dictionary.CompareMode = vbTextCompare
For Each x In Split(Text, delimiter)
part = Trim(x)
If part <> "" And Not dictionary.Exists(part) Then
dictionary.Add part, Nothing
End If
Next
If dictionary.Count > 0 Then
RemoveDuplicateLines = Join(dictionary.keys, delimiter)
Else
RemoveDuplicateLines = ""
End If
Set dictionary = Nothing
End Function
Sub Remove_Duplicate_Lines()
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
.EnableEvents = False
End With
On Error GoTo Errorhandler
Dim ws As Worksheet: Set ws = sh2
Dim crg As Range
Set crg = ws.Range("O2:O" & ws.Cells(Rows.Count, "O").End(xlUp).Row) '#Column contains Combined URL
Dim arr: arr = crg.Value2
Dim i As Long
For i = LBound(arr) To UBound(arr)
arr(i, 1) = RemoveDuplicateLines(arr(i, 1))
Next i
crg.value = arr
Errorhandler:
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub Binding | {
"domain": "codereview.stackexchange",
"id": 43622,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "strings, array, vba, excel, hash-map",
"url": null
} |
Want to try more problems like this? Check out this exercise.
## Practice set 2: Integration by parts of definite integrals
Let's find, for example, the definite integral integral, start subscript, 0, end subscript, start superscript, 5, end superscript, x, e, start superscript, minus, x, end superscript, d, x. To do that, we let u, equals, x and d, v, equals, e, start superscript, minus, x, end superscript, d, x:
u, equals, x means that d, u, equals, d, x.
d, v, equals, e, start superscript, minus, x, end superscript, d, x means that v, equals, minus, e, start superscript, minus, x, end superscript.
Now we integrate by parts:
\begin{aligned} &\phantom{=}\displaystyle\int_0^5 xe^{-x}\,dx \\\\ &=\displaystyle\int_0^5 u\,dv \\\\ &=\Big[uv\Big]_0^5-\displaystyle\int_0^5 v\,du \\\\ &=\displaystyle\Big[ -xe^{-x}\Big]_0^5-\int_0^5-e^{-x}\,dx \\\\ &=\Big[-xe^{-x}-e^{-x}\Big]_0^5 \\\\ &=\Big[-e^{-x}(x+1)\Big]_0^5 \\\\ &=-e^{-5}(6)+e^0(1) \\\\ &=-6e^{-5}+1 \end{aligned}
Problem 2.1
• Current
integral, start subscript, 1, end subscript, start superscript, e, end superscript, x, cubed, natural log, x, space, d, x, equals, question mark
Want to try more problems like this? Check out this exercise.
## Want to join the conversation? | {
"domain": "khanacademy.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9950177310082957,
"lm_q1q2_score": 0.8457363849530595,
"lm_q2_score": 0.8499711699569787,
"openwebmath_perplexity": 3115.479590341644,
"openwebmath_score": 0.6810768246650696,
"tags": null,
"url": "https://en.khanacademy.org/math/ap-calculus-bc/bc-integration-new/bc-6-11/a/integration-by-parts-review"
} |
extinction
Title: Quesions about extinction power law I am curious to know If dust extinction were to vary as a power-law so that $A_{\lambda}$ proportionate to $\lambda^{\beta}$ , what value of beta
would give rise to Rv =3.1 which is the average in diffuse ISM. I can see a plot but I wanted to see how to derive Rv=3.1 mathematically The value is $\beta \simeq -1$ (e.g. see Cardelli et al. 1988). The extinction would not be well fitted by a power law, except over a very narrow wavelength range. | {
"domain": "astronomy.stackexchange",
"id": 3171,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "extinction",
"url": null
} |
c#, beginner, parsing, xml
/// <summary>
/// Root Element: <PBC>
/// Parents: <PBCVersion>, <ProjectName>, <ProjectVersion>,
/// <Targets>, <Packages>
/// Children: <Targets/Target>, <Packages/Package>
/// </summary>
[XmlRoot("PBC")]
public class PBC
{
[XmlElement("PBCVersion")]
public String szPBCVersion;
[XmlElement("ProjectName")]
public String szProjectName;
[XmlElement("ProjectVersion")]
public String szProjectVersion;
[XmlArray("Targets")]
[XmlArrayItem("Target")]
public List<Target> oTargetList = new List<Target>();
[XmlArray("Packages")]
[XmlArrayItem("Package")]
public List<Package> oPackageList = new List<Package>();
}
public class Target : Elements
{
[XmlElement("TargetName")]
public String szTargetName { get; set; }
}
public class Package : Elements
{
[XmlElement("PackageName")]
public String szPackageName { get; set; }
}
public class Elements
{
[XmlElement("CommandLine")]
public String szCommandLine { get; set; }
[XmlElement("BuildEnvTypeName")]
public String szBuildEnvTypeName { get; set; }
[XmlElement("RelativeOutputPath")]
public String szRelativeOutputPath { get; set; }
[XmlElement("RelativeLogPath")]
public String szRelativeLogPath { get; set; }
[XmlArray("Dependencies")]
[XmlArrayItem("BuildDependency")]
public List<BuildDependency> oBuildDependency = new List<BuildDependency>();
} | {
"domain": "codereview.stackexchange",
"id": 8380,
"lm_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, parsing, xml",
"url": null
} |
• "Intuitively" is meant to alert you to learn this kind of approximate reasoning/understanding.
• "not much different" means "different by at most a constant factor". This factor might be as large as $$999999999$$ or even much larger. As long as it is independent of $$n$$, it does not matter how large it is.
• Look at all the summands, $$\cdots,\ 2^{k-4}4,\ 2^{k-3}3,\ 2^{k-2}2,\ 2^{k-1}1$$, from the back to the front. Each summand is a product of a power of $$2$$ and another number. The power of $$2$$ shrinks to one half each time and the other number increases by $$1$$ each time. The shrinkage of the power of $$2$$ is so much more significant than the addition of $$1$$, the product shrinks very fast as well. It shrinks so fast that sum of all them is not much different from the first term (from the back).
Let us realize the intuition above by accurate computations. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540734789343,
"lm_q1q2_score": 0.8400586912832392,
"lm_q2_score": 0.857768108626046,
"openwebmath_perplexity": 432.0997895642418,
"openwebmath_score": 0.9314283728599548,
"tags": null,
"url": "https://cs.stackexchange.com/questions/150718/trying-to-understand-the-basic-about-recurrence-trees"
} |
javascript, node.js, interview-questions, roman-numerals
////////////////////////////////////////////
var romanNumber1 = new RomanNumber('XX');
var romanNumber2 = new RomanNumber(40);
console.log(romanNumber1.toInt()); // => 20
console.log(romanNumber1.toString()); // => ‘XX’
console.log(romanNumber2.toInt()); // => 40
console.log(romanNumber2.toString()); // => ‘XL’ | {
"domain": "codereview.stackexchange",
"id": 30104,
"lm_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, node.js, interview-questions, roman-numerals",
"url": null
} |
python, algorithm, mathematics, binary-search
Title: Compute the square root of a positive integer using binary search The requirement is to find the square root of a positive integer using binary search and the math property that square root of a number n is between 0 and n/2, and the required answer is "floored", meaning mySqrt(8) is to return 2.
Please comment on the efficiency, and if possible, the loop invariants in terms of correctness:
class Solution(object):
def mySqrt(self, x):
"""
:type x: int
:rtype: int
Loop invariant:
The answer is always in the range [low, high] inclusive,
except possibly:
1) low == high == mid, and mid * mid == x and
any of low, high, or mid can be returned as the answer.
2) if there is no exact answer and the floor is to be
returned, then low > high by 1. Since sq != x,
so either low or high is set inside the loop.
If low gets set and gets pushed up, it is pushed up too much.
So when low > high by 1, low - 1 is the answer and it is the same
as high, because low > high by 1.
If high gets set and gets pushed down, high can be
the correct answer. When low > high, it is by 1,
and high is the correct floor value to be returned.
(since there is no perfect square root and the floor is required)
0 <= low <= answer <= high <= n//2 + 1
where answer is floor(sqrt(x)) to be found,
except if low > high and the loop will exit.
Each loop iteration always makes the range smaller.
If the range is empty at the end, low is > high by 1, and high is
the correct floored value, and low is the ceiling value, so high is returned.
"""
low = 0;
high = x//2 + 1; | {
"domain": "codereview.stackexchange",
"id": 35629,
"lm_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, mathematics, binary-search",
"url": null
} |
Basically, you have proved $d(x,A)=0$ iff $x\in \overline{A}$ (i.e. every neighborhood of $x$ meets $A$), by using the intermediate equivalence between $x\in \overline{A}$ and the existence of $a_n\in A$ with $a_n\to x$.
As I mentioned in the comments, there is no need to introduce your function $f$, since $d(x,a_n)\to 0$ is equivalent to $\lim a_n=x$. Depending on your definition, this is either a tautology or a triviality. In any case I don't understand the objections in the comments about $\lim a_n$ which might not exist...of course it does, since $d(x,a_n)\to 0$...
-
And what should $\bar A$ be? – Pedro Tamaroff Jul 16 '12 at 21:41
@PeterTamaroff: I am sorry, $\overline{A}$ means the closure of $A$. – wildildildlife Jul 16 '12 at 21:43
Oh. That is something I am not introduced to yet. =/ – Pedro Tamaroff Jul 16 '12 at 21:46
@PeterTamaroff: don't worry, usually $\overline{A}$ is defined as $x\in \overline{A}$ iff every neighborhood of $x$ meets $A$, so this is just another way to say what Mendelson asked you to prove. – wildildildlife Jul 16 '12 at 21:47
So I can just say "...there is a sequence of points in $A$ such that $\lim\;d(x,a_n)=0$, which means $\lim\;a_n=x$." – Pedro Tamaroff Jul 16 '12 at 22:05 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347860767304,
"lm_q1q2_score": 0.8301724499963072,
"lm_q2_score": 0.8519528057272543,
"openwebmath_perplexity": 135.01636306305383,
"openwebmath_score": 0.9696429967880249,
"tags": null,
"url": "http://math.stackexchange.com/questions/171671/dx-a-0-iff-every-neighborhood-of-x-contains-a-point-of-a"
} |
string-theory, spacetime-dimensions, compactification, kaluza-klein, moduli
Title: Why don't the extra compact dimensions collapse on themselves? Why are the extra compact dimensions stable and do not collapse?
I know the anomaly cancellation is the reason why the extra dimensions are necessary.
But I can not visulize how the anomaly cancellation, leaves these extra compact windows open?
Is there any hypothetical mechanism based on anomaly cancellation to extend the size of these small windows, so that I can assign the stability of such extra small dimensions to quantum fluctuations in that context? Indeed Witten has showed that the original version of the KK theory is semi-classically unstable and decays into Minkowski spacetime.
Instability of the Kaluza-Klein vacuum
In the same paper he shows that Fermions are necessary for the stability of the KK vacuum.
In a second article, Witten argues for realistic KK theories descending from $11$ dimensional $\mathcal{N}=1$ Supergravity via compactification.(though still supersymmetric)
Search for a realistic Kaluza-Klein theory
Although as he claims, the quantum numbers of fermions are hard to achieve.
Later he shows that singular higher dimensional manifolds can accommodate chiral fermions. And such singularities can be resolved within string theory.
Chiral Fermions from Manifolds of $G_2$ Holonomy
Anomaly Cancellation On Manifolds Of $G_2$ Holonomy
Kowalski-Glikman then searches for SUSic vacuum solutions of such realistic KK theory and he concludes that there are these possibilities:
Either $M^{11}$ is stable(Minkowski)
or it decays into compactified $AdS(7)*S^4$ or $AdS(4)*S^7$ via spontaneous compactification, although he also claims that either both $AdS(7)*S^4$ and $AdS(4)*S^7$ are stable, or both are unstable.
Vacuum states in supersymmetric Kaluza-Klein theory
I think that the problem of stability is the most
important one. In fact if it turns out that only $M^{11}$ is
stable, then the Kaluza-Klein ideology will break down.
In other words it would be shown, that Kaluza-Klein
theory remains only a mathematical trick. | {
"domain": "physics.stackexchange",
"id": 93269,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "string-theory, spacetime-dimensions, compactification, kaluza-klein, moduli",
"url": null
} |
# How to create an arbitrary covariance matrix
For example, in R, the MASS::mvrnorm() function is useful for generating data to demonstrate various things in statistics. It takes a mandatory Sigma argument which is a symmetric matrix specifying the covariance matrix of the variables. How would I create a symmetric $n\times n$ matrix with arbitrary entries?
• I think this question would benefit from being edited to focus on "how can I create an arbitrary covariance matrix" and less on the coding aspect. There is certainly an on-topic underlying statistical issue here, as demonstrated by the answer. – Silverfish May 31 '16 at 22:23
• – amoeba Jun 2 '16 at 13:50
Create an $n\times n$ matrix $A$ with arbitrary values
and then use $\Sigma = A^T A$ as your covariance matrix.
For example
n <- 4
A <- matrix(runif(n^2)*2-1, ncol=n)
Sigma <- t(A) %*% A
• Likewise, Sigma <- A + t(A). – rsl May 31 '16 at 8:45
• @MoazzemHossen: Your suggestion will produce a symmetric matrix, but it may not always be positive semidefinite (e.g. your suggestion could produce a matrix with negative eigenvalues) and so it may not be suitable as a covariance matrix – Henry May 31 '16 at 10:30
• Yes, I noticed that R returns error in the event my suggested way produced unsuitable matrix. – rsl May 31 '16 at 18:32
• Note that if you prefer a correlation matrix for better interpretability, there is the ?cov2cor function, which can be applied subsequently. – gung May 31 '16 at 22:58
• @B11b: You need your covariance matrix to be positive semi-definite. That would put some limits on the covariance values, not totally obvious ones when $n \gt 2$ – Henry Jan 11 '18 at 9:26
I like to have control over the objects I create, even when they might be arbitrary.
Consider, then, that all possible $n\times n$ covariance matrices $\Sigma$ can be expressed in the form | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9609517083920618,
"lm_q1q2_score": 0.8049123405912413,
"lm_q2_score": 0.8376199694135332,
"openwebmath_perplexity": 635.9055183539502,
"openwebmath_score": 0.599940836429596,
"tags": null,
"url": "https://stats.stackexchange.com/questions/215497/how-to-create-an-arbitrary-covariance-matrix"
} |
homework-and-exercises, tensor-calculus, special-relativity, stress-energy-momentum-tensor
And also that there are tricks involved in getting the answer quickly, but if I multiply out the terms I get
$\left( g^{\mu \nu}g_{\mu \nu} - g_{\mu \nu}\frac{p^\mu n^\nu + p^\nu n^\mu}{p \cdot n} -g^{\mu \nu}\frac{p_\mu n_\nu + p_\nu n_\mu}{p \cdot n} + \frac{p^\mu n^\nu + p^\nu n^\mu}{p \cdot n}\frac{p_\mu n_\nu + p_\nu n_\mu}{p \cdot n}\right)$
Here's where my understanding breaks down, how do I evaluate
$g_{\mu\nu} p^\mu n^\nu$ in terms of raising and lowering, which index do I choose? It must be a scalar, since it is a double sum. $g_{\mu\nu} p^\mu n^\nu = p \cdot n$.
$\left( g^{\mu \nu}g_{\mu \nu} - g_{\mu \nu}\frac{p^\mu n^\nu + p^\nu n^\mu}{p \cdot n} -g^{\mu \nu}\frac{p_\mu n_\nu + p_\nu n_\mu}{p \cdot n} + \frac{p^\mu n^\nu + p^\nu n^\mu}{p \cdot n}\frac{p_\mu n_\nu + p_\nu n_\mu}{p \cdot n}\right)=\delta_\mu^\nu -2-2+ 4 \frac{(p\cdot n)^2}{(p \cdot n)^2} = \delta_\mu^\nu $
Which seems like it could be the right answer, but is it? | {
"domain": "physics.stackexchange",
"id": 6822,
"lm_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, tensor-calculus, special-relativity, stress-energy-momentum-tensor",
"url": null
} |
python, beginner, python-3.x, game, tic-tac-toe
print('That spot is already taken.')
else:
break
board[p1_row - 1][p1_col - 1] = 'X'
board[p2_row - 1][p2_col - 1] = 'O'
a1 = board[0][0]
a2 = board[1][0]
a3 = board[2][0]
b1 = board[0][1]
b2 = board[1][1]
b3 = board[2][1]
c1 = board[0][2]
c2 = board[1][2]
c3 = board[2][2]
if a1 == 'X' and a2 == 'X' and a3 == 'X' or b1 == 'X' and b2 == 'X' and b3 == 'X' or c1 == 'X' and c2 == 'X' and c3 == 'X' or a1 == 'X' and b1 == 'X' and c1 == 'X' or a2 == 'X' and b2 == 'X' and c2 == 'X' or a3 == 'X' or b3 == 'X' or c3 == 'X' or a1 == 'X' and b2 == 'X' and c3 == 'X' or c1 == 'X' and b2 == 'X' and a3 == 'X':
print()
print_board(board)
print()
print('Player 1 wins!')
win = True | {
"domain": "codereview.stackexchange",
"id": 41175,
"lm_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, game, tic-tac-toe",
"url": null
} |
c, haskell, ffi
if(!y) {
return 0;
}
for(int i=0; i<n; i++){
y[i] = arr[i]+1;
}
return y;
}
Who frees the memory?
However, there is still one problem. A user needs to know how add_one conjured that memory in order to use the correct free variant. That's something that can be handled with documentation. Still, there is no need for us to call calloc, we can just give the responsibility to the user:
double* add_one(double * dest, const double * src, size_t count){
for(size_t i = 0; i < count; ++i) {
dest[i] = src[i] + 1;
}
return dest;
}
Note that this uses const to make sure that we don't overwrite src by accident. We also use size_t to be ready for any kind of size the user might throw at us. The user is now responsible to allocate the memory, so they will also know how to free it.
We return the pointer because we followed memcpy's interface, but we could also just make it a void function instead.
Haskell part
Let's go to Haskell. We can see that there is something off: you import newForeignPtr, but you use newForeignPtr_. That's probably since newForeignPtr needs the aforementioned free function. That's in Foreign.Marshal.Alloc:
fptr <- newForeignPtr finalizerFree ptr
But before we delve into that, let us take a step back and look at the foreign import:
foreign import ccall "bar" c_bar :: CInt -> Ptr CDouble -> Ptr CDouble
Unfortunately, your c_bar does not have that type. Remember, whenever you see A -> B in a function, you should always get the same B if you've used the same A:
all (== foo a) [foo a,foo a,foo a,foo a,foo a] -- all the same | {
"domain": "codereview.stackexchange",
"id": 27583,
"lm_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, haskell, ffi",
"url": null
} |
Consider that $$x^4-x^3=x^4-x^3+O\left(\frac{1}{x^4}\right)\qquad\qquad \color{red}{\large (!!)}$$ and use series reversion and, in the real domain, you should get (using $$d=\sqrt[4]{C}$$) $$x=d+\frac{1}{4}+\frac{3}{32 d}+\frac{1}{32 d^2}+\frac{15}{2048 d^3}-\frac{77}{65536 d^5}-\frac{3}{4096 d^6}+O\left(\frac{1}{d^7}\right)$$ Trying for a small number $$C=100$$, this truncated formula will give $$x=\frac{16588752+66155123 \sqrt{10}}{65536000}=\color{red}{3.4452761}77$$ while the exact solution is $$\color{red}{3.445276105}$$.
Using this formula $$x^4-x^3-C=\frac{1989}{2097152 C}+O\left(\frac{1}{C^{3/2}}\right)\sim \frac 1 {1000 C}$$
• Series reversion looks like a very useful and general tool, but I could not understand how exactly you use it in this case. I have $y = x^4-x^3$, so $a_1=a_2=0, a_3=-1, a_4=1, a_5=...=0$, so all coefficients $A_i$ are divided by 0. Jan 22 at 20:12
How in general ...? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357216481429,
"lm_q1q2_score": 0.8264503093064334,
"lm_q2_score": 0.8418256472515683,
"openwebmath_perplexity": 765.2195740178446,
"openwebmath_score": 0.9857490658760071,
"tags": null,
"url": "https://math.stackexchange.com/questions/4360453/approximate-solution-to-an-equation-with-a-high-degree-polynomial"
} |
homework-and-exercises, electric-circuits, electrical-resistance
Title: What is the ohmic value of a resistor that will dissipate 1 W when the voltage across it is 2 V? I've been learning about Ohm's and Watt's law throughout this chapter so I'm already familiar with substituting Ohm's Law for part of Watt's law to get values. But nowhere in the chapter did it go over getting the ohmic value of the resistor. As far as I can tell $$ P = \frac{V^{2}}{R} $$ is the formula that I'll need to get it. I think my issue is basic algebra knowledge, how to get the V^2 to the other side. After trying to solve this the first time I checked my answer and realized I did it wrong and already know the answer is 4Ω :/ So, that kind of tells me it's someting like 2^2 V times 1 W. But I want to know how to do it correctly using the math. If I need ot show what I've tried already I can but using Latex is tough for me and takes a lot of time to write out the problem. I will if I need to though. You have the right equation - now just solve for $R$. This means you multiply both sides by $R$, and divide both sides by $P$. In steps, you started with
$$P = \frac{V^2}{R}$$
Multiply both sides by $R$:
$$P\ R = \frac{V^2}{R}R = V^2$$
Now divide both sides by $P$, to get
$$\frac{P}{P}R = \frac{V^2}{P}\\
R = \frac{V^2}{P}$$
Physics equations manipulate just like other equations... | {
"domain": "physics.stackexchange",
"id": 16829,
"lm_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, electric-circuits, electrical-resistance",
"url": null
} |
aqueous-solution, biochemistry, extraction, medicinal-chemistry
Reference:
Olufunsho Awodele, Ibrahim Adekunle Oreagba, Saidi Odoma, Jaime A. Teixeira da Silva, Vincent Oluseye Osunkalu, "Toxicological evaluation of the aqueous leaf extract of Moringa oleifera Lam.(Moringaceae)," Journal of Ethnopharmacology 2012, 139(2), 330–336 (DOI: https://doi.org/10.1016/j.jep.2011.10.008). | {
"domain": "chemistry.stackexchange",
"id": 15395,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "aqueous-solution, biochemistry, extraction, medicinal-chemistry",
"url": null
} |
newtonian-mechanics, forces, energy, work
... the potential energy should increase by $mgh$ joules as the kinetic energy is kept constant, meaning that there has to be some total work done on the object.
To specifically address this point, there is nothing that says a change in potential energy means the net work done on an object is not $0$. This example is clearly a counterpoint to this claim. | {
"domain": "physics.stackexchange",
"id": 84023,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, forces, energy, work",
"url": null
} |
algorithms, computational-geometry
Title: Calculating positions of nodes relative to a known point If I know all the distances between a set of nodes and I also know that one of the nodes is at location (0,0), using the distances between the nodes, can I calculate the absolute positions between all of the nodes? I feel that this will involve some form of trilateration but only a single node position is known. Will I need an iterative algorithm to eventually find a unique solution? I wrote an algorithm that determines a configuration if one exists, given a distance matrix. It repeatedly uses circle-circle intersection to triangulate new nodes based on their distance to the first, second and third. As others have mentioned in comments, the first three points have some degree of freedom, which I've made assumptions for, in line with yours.
The code assumes all points are unique and invariant to changes smaller than a certain $\epsilon$.
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <cmath>
using namespace std;
const double epsilon = 0.00001;
struct Point {
double x, y;
};
double dist(Point p, Point q) {
return sqrt((p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y));
}
vector<Point> intersections(Point p, Point q, double pr, double qr) {
double d = dist(p, q);
if(pr + qr < d) return vector<Point>();
if(min(pr, qr) + d + epsilon < max(pr, qr)) return vector<Point>();
double a = (pr * pr - qr * qr + d * d) / (2.0 * d),
h = sqrt(pr * pr - a * a); | {
"domain": "cs.stackexchange",
"id": 7625,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, computational-geometry",
"url": null
} |
c++, memory-management, pointers, weak-references
SharedPtr(SharedPtr&& other) noexcept
: _ptr{ std::exchange(other._ptr, nullptr) },
_ctrl_block{std::exchange(other._ctrl_block, nullptr)}
{
CHECK
}
~SharedPtr() { __remove_reference(); CHECK };
SharedPtr& operator=(const SharedPtr& other) noexcept
{
if (this == &other)
return *this;
__remove_reference();
_ptr = other._ptr;
_ctrl_block = other._ctrl_block;
__increment_reference();
CHECK
return *this;
}
SharedPtr& operator=(SharedPtr&& other) noexcept
{
if (this == &other)
return *this;
__remove_reference();
_ptr = std::exchange(other._ptr, nullptr);
_ctrl_block = std::exchange(other._ctrl_block, nullptr);
CHECK
return *this;
}
SharedPtr& operator=(std::nullptr_t)
{
if (_ptr == nullptr && _ctrl_block == nullptr)
return *this;
__remove_reference();
return *this;
}
T* get() const noexcept { return _ptr; }
T& operator*() const noexcept { return *_ptr; }
T* operator->() const noexcept { return _ptr; }
operator bool() const noexcept { return _ptr != nullptr && _ctrl_block != nullptr; }
size_t use_count() const noexcept { return (_ctrl_block) ? _ctrl_block->use_count() : 0; }
void reset() noexcept { this->__remove_reference(); }
bool Invariant() const noexcept; | {
"domain": "codereview.stackexchange",
"id": 43155,
"lm_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++, memory-management, pointers, weak-references",
"url": null
} |
python
Title: connect same ids with values in id rows (result of effectiveELD) I can't cope with reworking the result. If id is the same I want to stick those items.
with open(x,'r') as rf:
l = fr.readlines()
previous_line_id = ''
corrected_lines = []
for i in l:
i_split = i.split('\t')
id_ = i_split[0]
if id_ == previous_line
xxxxxxxxxx
else:
corrected_lines .append(i)
result:
WP_XXXXXXXX2.1 PF06325 Ribosomal protein L11 methyltransferase (PrmA) 5
WP_192XXXXXX.1 PF13489 Methyltransferase domain 4
XXXXXXX45.1 PF02310 B12 binding domain 12 <----------- DOUBLE IDS
XXXXXXX45.1 PF04055 Radical SAM superfamily 5 <-----------
WP_XXXXXXX29.1 PF13489 Methyltransferase domain 4
WP_0XXXXXXXX.1 PF13489 Methyltransferase domain 4
WP_XXXXXXX90.1 PF06325 Ribosomal protein L11 methyltransferase (PrmA) 5 <-------------- DOUBLE ID
WP_XXXXXXX90.1 PF06325 Ribosomal protein L11 methyltransferase (PrmA) 7 <--------------
WP_0XXXXXX62.1 PF13489 Methyltransferase domain 4 | {
"domain": "bioinformatics.stackexchange",
"id": 2050,
"lm_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",
"url": null
} |
nmr-spectroscopy
$$q_{ij} \equiv \left.\frac{\partial^2V}{\partial i\,\partial j}\right|_\text{at nucleus}$$
However, by a suitable transformation of coordinates, the cross derivatives $q_{ij}$ ($i \neq j$) can be set to zero (this essentially involves diagonalising the matrix $\mathbf{q}$). The remaining quantities $q_{xx}$, $q_{yy}$, $q_{zz}$ are referred to as the principal values, and without loss of generality we can adopt the convention $|q_{zz}| \geq |q_{yy}| \geq |q_{xx}|$. Since the electric potential obeys Laplace's equation $\nabla^2 V = 0$, this also means that $q_{xx} + q_{yy} + q_{zz}$ is necessarily equal to 0 (this is often referred to as "traceless", since the trace of the matrix $\mathbf{q}$ is 0). Therefore, there are only two independent parameters. These parameters are chosen to be $q_{zz}$, and $\eta$, a quantity called the biaxiality and defined as
$$\eta = \frac{q_{yy} - q_{xx}}{q_{zz}}.$$ | {
"domain": "chemistry.stackexchange",
"id": 8722,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nmr-spectroscopy",
"url": null
} |
python, game, tic-tac-toe, pygame, connect-four
#Continue button
if self._pygame_button('Continue',
store_data['continue'],
current_height,
-1):
store_data['continue'] = True
if game_flags['clicked']:
game_data['overlay'] = None
else:
store_data['continue'] = False
box_height.append(current_height)
current_height += box_spacing
#Instructions button
if self._pygame_button('Instructions' if game_data['move_number'] else 'Help',
store_data['instructions'],
box_height[0],
0 if game_data['move_number'] else 1):
store_data['instructions'] = True
if game_flags['clicked']:
game_data['overlay'] = 'instructions'
else:
store_data['instructions'] = False
#New game button
if self._pygame_button('New Game' if game_data['move_number'] else 'Start',
store_data['new_game'],
box_height[bool(game_data['move_number'])],
bool(game_data['move_number']) if game_data['move_number'] else -1):
store_data['new_game'] = True
if game_flags['clicked']:
game_flags['reset'] = True
game_data['overlay'] = None
else:
store_data['new_game'] = False
#Quit button
if self._pygame_button('Quit to Desktop' if game_data['move_number'] else 'Quit',
store_data['exit'],
current_height):
store_data['exit'] = True
if game_flags['clicked']:
game_flags['quit'] = True
else:
store_data['exit'] = False | {
"domain": "codereview.stackexchange",
"id": 16526,
"lm_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, game, tic-tac-toe, pygame, connect-four",
"url": null
} |
slam, navigation, rostopic
/camera/rectify_ir/parameter_descriptions
/camera/rectify_ir/parameter_updates
/camera/rectify_mono/parameter_descriptions
/camera/rectify_mono/parameter_updates
/camera/rgb/camera_info
/camera/rgb/image_color
/camera/rgb/image_color/compressed
/camera/rgb/image_color/compressed/parameter_descriptions
/camera/rgb/image_color/compressed/parameter_updates
/camera/rgb/image_color/compressedDepth
/camera/rgb/image_color/compressedDepth/parameter_descriptions
/camera/rgb/image_color/compressedDepth/parameter_updates
/camera/rgb/image_color/theora
/camera/rgb/image_color/theora/parameter_descriptions
/camera/rgb/image_color/theora/parameter_updates
/camera/rgb/image_mono
/camera/rgb/image_mono/compressed
/camera/rgb/image_mono/compressed/parameter_descriptions
/camera/rgb/image_mono/compressed/parameter_updates
/camera/rgb/image_mono/compressedDepth
/camera/rgb/image_mono/compressedDepth/parameter_descriptions
/camera/rgb/image_mono/compressedDepth/parameter_updates
/camera/rgb/image_mono/theora
/camera/rgb/image_mono/theora/parameter_descriptions
/camera/rgb/image_mono/theora/parameter_updates
/camera/rgb/image_raw
/camera/rgb/image_raw/compressed
/camera/rgb/image_raw/compressed/parameter_descriptions
/camera/rgb/image_raw/compressed/parameter_updates
/camera/rgb/image_raw/compressedDepth
/camera/rgb/image_raw/compressedDepth/parameter_descriptions
/camera/rgb/image_raw/compressedDepth/parameter_updates
/camera/rgb/image_raw/theora
/camera/rgb/image_raw/theora/parameter_descriptions
/camera/rgb/image_raw/theora/parameter_updates
/camera/rgb/image_rect_color | {
"domain": "robotics.stackexchange",
"id": 24343,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, rostopic",
"url": null
} |
performance, python-3.x, sorting
One can certainly do this.
The machine doesn't care.
But a maintenance engineer will.
You should minimally write some comments that motivate this design decision.
More likely, you want to group those four attributes into a
namedtuple,
@dataclass,
or other data structure, setting it to None in the False case.
By convention a pythonista will typically list all possible
attributes in the constructor, assigning None if not yet known,
as a handy list of "things to juggle in your mind" as you read the code.
Not following the convention is possible, but it can
lead to surprises.
total order
You define a partial order over value nodes.
def __gt__( ...
Now, I understand that this code happens to never ask if one is less than another.
But still, it's odd that you didn't throw in a
@total_ordering
decorator.
It feels like a giant hole in the sidewalk,
just waiting for some hapless maintenance engineer
to fall into.
And at this point, I'm hesitant to even broach the
topic of equality.
tuples for things that aren't lists
def unpack(self):
...
return [self.numL, self.numR] if ...
Prefer to return a 2-tuple here, please.
This is a situation where a C coder would use a struct.
A somewhat subtle aspect of writing pythonic code is
we use tuple for fixed number of items where
position dictates meaning.
For example, in an (x, y) point we wouldn't want
to mix up the two coordinates, as they mean different things.
Similarly a (name, height, weight) record should be a tuple.
In contrast, we use a list for arbitrary number of "same" thing,
such as a list of student names.
When unpacking a pair, we're returning (smaller, larger) numbers,
and we should not confuse the one with the other,
they're not interchangeable.
Different meanings are associated with each one.
re-testing same thing repeatedly
def solve( ...
while stack:
...
if isSorted(current_arr): | {
"domain": "codereview.stackexchange",
"id": 45316,
"lm_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, python-3.x, sorting",
"url": null
} |
If by 'a standard deck of cards' you mean a 52 card pack (no Jokers) with 4 suits each of 13 cards, the probability of picking a single card at random and it being a heart is 13/52 or 1/4 For a pack with jokers it would be 13/54 Ankit Pal B.E from University of Mumbai (Graduated 2020) 3 y Related. Explanations Question You draw a card at random from a standard deck of 52 cards. Find each of the following conditional probabilities: a) The card is a heart, given that it is red. b) The card is red, given that it is a heart. c) The card is an ace, given that it is red. d) The card is a queen, given that it is a face card. Explanation Verified. In a playing card there are 52 cards. Therefore the total number of possible outcomes = 52 (i) '2' of spades: Number of favourable outcomes i.e. '2' of spades is 1 out of 52 cards. Therefore, probability of getting '2' of spade Number of favorable outcomes P (A) = Total number of possible outcome = 1/52 (ii) a jack. But the coin has not changed - if it's a "fair" coin, the probability of getting tails is still 0.5. Dependent Events Two (or more) events are dependent if the outcome of one event affects the outcome of the other(s). Thus, one event "depends" on another, so they are dependent. Example I draw two cards from a deck of 52 cards.
mn
md
gv
ub
eg | {
"domain": "meinejuwelen.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180694313358,
"lm_q1q2_score": 0.8665908512950863,
"lm_q2_score": 0.8791467643431002,
"openwebmath_perplexity": 287.22561770834307,
"openwebmath_score": 0.39884233474731445,
"tags": null,
"url": "https://koytru.meinejuwelen.de/en/qhqi"
} |
We can get the results for all time by combining the solutions from the three parts.
$y\left( t \right) = \left\{ {\begin{array}{*{20}{l}} {0,}&{t < 0} \\ {\frac{1}{2}\left( {1 - {e^{ - 2t}}} \right),}&{0 \leq t \leq 1} \\ {{e^{ - 2\left( {t - 1} \right)}}\left( {\frac{1}{2}\left( {1 - {e^{ - 2}}} \right)} \right),}&{1 < t} \end{array}} \right.$
This result is shown below.
This problem is solved elsewhere using the Laplace Transform (which is a much simpler technique, computationally).
### Animation: The Convolution Integral
An interactive demonstration of the example above is available.
## Examples
When the functions f(t) and/or h(t) are defined in a piecewise manner it is often difficult to determine the limits of integration. To develop your ability to do this several examples are given below, each with a different number of "regions" for the convolution integral. The integrals are not actually performed, only the limits of integration for each region are given. To determine the integral you need only substitue in f(λ) and h(t-λ). In all cases there is a trivial region, t<0, where $\int_{ - \infty }^t {f\left( \lambda \right)h\left( {t - \lambda } \right)d\lambda } = 0$. Click on any of the examples below (the text at the left side of the page) to show or hide it. Each of the examples also has a link to an interactive demo which will allow you to vary t as well as to see the output of the convolution.
#### Simplest case: 2 regions
Convolution of two exponentials, $f(t)=e^{-t}, \quad h(t)=3\cdot e^{-3t}$. | {
"domain": "swarthmore.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631647185702,
"lm_q1q2_score": 0.8219606871112576,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 1049.9638259522103,
"openwebmath_score": 0.9963091015815735,
"tags": null,
"url": "https://lpsa.swarthmore.edu/Convolution/Convolution2.html"
} |
cell-biology, proteins, mitosis
Title: Purpose of intensive protein synthesis in G1 phase of mitosis What is the purpose of intensive protein synthesis in G1 phase of mitosis, and what purposes do these synthesized proteins serve? Why are lipids and carbohydrates not synthesized intensively as well? The G1 phase of eukaryotic cell cycle is part of interphase, which is when the cell is replicating its DNA ready for division. To understand the need for intense protein synthesis, we first need to understand how DNA is organised during mitosis.
Before DNA is condensed into chromosomes ready for nuclear division it is in the form of chromatin, a long fiber-like structure inside the nucleus. In order to condense into chromosomes, this chromatin must undergo a process of coiling and folding in order to create the chromosome 'X' structure we are familiar with.
A major part of this DNA 'miniaturization' is the folding of the double helix around proteins called Histones - this creates new structures called nucleosomes.
In order to fully condense the roughly 3 meters of DNA in the average human cell down to a singular chromosome, millions upon millions of these Histone proteins are required.
And that answers your question; intense protein synthesis during the G1 phase is required in order to produce the extremely large amount of Histone proteins that are needed for packaging DNA into chromosomes ready for cellular division.
As for carbohydrates, these are constantly being processed by the body in order for the production of ATP for use as energy. The use of said energy for mitosis is a just another constantly required use of ATP within the body. Therefore there isn't any noticeable increase in carbohydrate processing/production, as it is happening regardless of the cell's stage in its cycle.
-See the image below (from shmoop.com) that explains the process of getting DNA into a chromosome. | {
"domain": "biology.stackexchange",
"id": 7060,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cell-biology, proteins, mitosis",
"url": null
} |
comets, dust, albedo
Title: Is scattering efficiency of dust related to albedo? I know that the scattering cross-sections of dust in comets depend on the scattering efficiency. A higher scattering efficiency leads to an increase in brightness. Therefore, does it mean that this will also increase the albedo or these quantities are not related at all? There will be a relationship but not a simple one. If we model a uniform slab of material by a complex dielectric constant $n + ik$ then we can calculate three things; reflection, absorption and transmission. If we model a dust particle as a uniform sphere of the same, then the far field electric amplitude scattered from an incident plane wave on it will depend on the complex dielectric constant. The reason we can't just use reflection, absorption and transmission is that those are the amplitudes squared, and so phase information is lost, so you can't easily work your way backwards.
There is also the angular distribution to worry about, which will be different for each size and also for each complex index of refraction. So two identically shaped and sized dust particles; one from a high bulk albedo material and one from a low bulk albedo material could end up with a variety of different relative scattering efficiencies.
A cloud of either one might attenuate light from a star, depending on the details, and one might scatter light more strongly at some specific angle than the other.
There might be some rules of thumbs for certain kinds of dust particles made of materials most likely to be observed and discussed by astronomers, but I don't think there are any first-principles-based generalizations that always apply. | {
"domain": "astronomy.stackexchange",
"id": 5501,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "comets, dust, albedo",
"url": null
} |
$$Z(C_q) = \frac{1}{q} \sum_{k|q} \phi(k) a_k^{q/k}$$
and of the dihedral group
$$Z(D_q) = \frac{1}{2} Z(C_q) + \begin{cases} \frac{1}{2} a_1 a_2^{(q-1)/2} & q \quad \text{odd} \\ \frac{1}{4} \left( a_1^2 a_2^{(q-2)/2} + a_2^{q/2} \right) & q \quad\text{even.} \end{cases}.$$
This computation was done with the following Maple code.
with(numtheory);
pet_varinto_cind :=
proc(poly, ind)
local subs1, subs2, polyvars, indvars, v, pot, res;
res := ind;
polyvars := indets(poly);
indvars := indets(ind);
for v in indvars do
pot := op(1, v);
subs1 :=
[seq(polyvars[k]=polyvars[k]^pot,
k=1..nops(polyvars))];
subs2 := [v=subs(subs1, poly)];
res := subs(subs2, res);
od;
res;
end;
pet_cycleind_cyclic :=
proc(n)
local s, d;
s := 0;
for d in divisors(n) do
s := s + phi(d)*a[d]^(n/d);
od;
s/n;
end;
pet_cycleind_dihedral :=
proc(n)
local s;
s := 1/2*pet_cycleind_cyclic(n); | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9828232894783426,
"lm_q1q2_score": 0.857363304933064,
"lm_q2_score": 0.8723473630627235,
"openwebmath_perplexity": 632.1313096455588,
"openwebmath_score": 0.7259795069694519,
"tags": null,
"url": "https://math.stackexchange.com/questions/2992385/non-isomorphic-connected-unicyclic-graphs"
} |
solve the problem ) let x '' and y be! More difficult with higher dimensions, and so Cramer 's rule, you set up the as... Three equations in Two variables how to use cramer's rule ( 5 ) are given by 1 = 1! = 16 or inverse matrices to find the determinant above and replace the second column the! Four matrices \\ 3 x-7 y=24 \end { array } \right on Patreon { \begin { array }.. One using determinants ; this is called Cramer 's rule ) matrix, we introduce a theorem which us! + 2y + 4z = 12 equations solver: solving by Cramer 's,. Algebra ; Cramer ’ s rule to solve this task according to the task description, using any you! L } 2 x+5 how to use cramer's rule \\ 3 x-7 y=24 \end { array } \right introduce final... May know the second column by the constants on the right of the system 84. y = Δ 1.... + 3z = 4-3x + 4y – 2z = 8 2x – 2y + 4z = 12 answered! \End { array } \right Earn Money ; Log in ; join for FREE rule determinants. And so Cramer 's rule you are encouraged to solve a 3-x-3 system linear... Of Cramer 's rule to solve the system correctly and incorrectly respectively to follow a similar for. Now introduce a final method for solving systems of equations are also presented we will now a! Maths paradoxes Utilitarianism help Chain rule or product rule Continued Step 2 find the determinant: for,... To systems of linear equation + 2z = -6 6x + 2y + =... Encouraged to solve a system of how to use cramer's rule we use coefficient arrays to find the inverse of a matrix...: solve the problem ) contains several points 20 ( 4/5 ) =! Rule you are encouraged to solve a system of equations that uses determinants one of our FREE STEM... 0, so the system is either inconsistent or dependent ; Summer camps ; Class ; Earn Money Log... Instructs, we introduce a final method for solving systems of equations are also presented rules for 3 by systems... Main ( square ) matrix | {
"domain": "aroundtheglo.be",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426435557124,
"lm_q1q2_score": 0.8095687755828835,
"lm_q2_score": 0.8311430520409023,
"openwebmath_perplexity": 868.788986908307,
"openwebmath_score": 0.8262384533882141,
"tags": null,
"url": "http://aroundtheglo.be/furniture-assembly-uancaw/archive.php?9ee1b9=how-to-use-cramer%27s-rule"
} |
complexity-theory, context-free, formal-grammars
Example B in Knuth's paper does what is needed, almost.
Actually, Knuth computes only the length of these terminal strings,
but it is quite easy to modify his algorithm to actually compute one
such terminal string $\sigma(U)$ for each non-terminal $U$ (as I do it
in my own version below). We also define $\sigma(a)=a$ for every
terminal $a$, and we extend $\sigma$ as usual into a string
homomorphism.
Then we consider a directed graph where non-terminals are the nodes,
and there is an arc $(U,V)$ iff there is a rule $U\rightarrow \alpha
V\beta$. If several such rules can produce the same arc $(U,V)$, we
keep one such that the length $|\sigma(\alpha\beta)|$ is minimal.
The arc is labeled with that rule, and that minimal length
$|\sigma(\alpha\beta)|$ becomes the weight of the arc.
Finally, using Dijkstra's shortest path algorithm, we compute the
shortest path from the initial non-terminal $S$ to each non-terminal
of the grammar. Given the shortest path for a non-terminal $U$, the
rule labels on the arcs may be used to get a derivation
$S\overset{*}{\Longrightarrow}\alpha U \beta$. Then, to every rule of
the form $U\rightarrow\gamma$ in the grammar, we associate the
size-minimal terminal string $\sigma(\alpha\gamma\beta)$ which can be
derived using that rule.
To achieve low complexity, both Dijkstra's algorithm and Knuth's
extension are implemented with heaps, AKA priority queues. This gives
for Dijkstra's algorithm a complexity of $O(n\log n +t)$, and for
Knuth's algorithm a complexity $O(m \log n +t)$, where there are $m$
grammar rules and $n$ non-terminals, and $t$ is the total length of
all rules. The whole is dominated by the complexity of Knuth's algorithm since $m\geq n$.
What follows is my own work, before I produced the short answer above. | {
"domain": "cs.stackexchange",
"id": 3078,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, context-free, formal-grammars",
"url": null
} |
quantum-mechanics, wavefunction, hydrogen
$$
where the functions $\psi$ and $\phi$ satisfy
$$
- \frac{\hbar^2}{2 M} \nabla^2_{R} \psi = E_R \psi \\
- \frac{\hbar^2}{2 \mu} \nabla^2_{r} \phi - \frac{k e^2}{r}\phi = E_r \phi
$$
If we can find these solutions, then their product will satisfy the full 6-D Schrödinger equation with $E = E_R + E_r$. But the solutions to the first equation are just plane waves in $\mathbf{R}$, while the solutions to the second equation are the familiar solutions for the hydrogen atom. So the energy eigenstates of the system would be of the form
$$
\Psi(\mathbf{r}_e, \mathbf{r}_p) = e^{i \mathbf{k} \cdot \mathbf{R}} R(r) Y(\theta,\phi)
$$
with $\mathbf{R}$ and $\mathbf{r}$ defined in terms of $\mathbf{r}_e$ and $\mathbf{r}_p$ as above.
You could then construct a Gaussian wavepacket by taking a superposition of several such plane waves in $\mathbf{R}$. The resulting wavefunction could then be used to predict (say) the expected position of the electron, by calculating the integral
$$
\langle \mathbf{r}_e \rangle = \int \mathbf{r}_e \Psi^*(\mathbf{r}_e, \mathbf{r}_p) \Psi(\mathbf{r}_e, \mathbf{r}_p) \, d^3 \mathbf{r}_e \,d^3 \mathbf{r}_p
$$ | {
"domain": "physics.stackexchange",
"id": 77221,
"lm_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, hydrogen",
"url": null
} |
optimization, c, io, windows, sudoku
I also changed it from a char to an int, as that's what _getch returns.
if(kbhit() && isdigit(num = _getch()))
Your 'chrton` function implies that it can get values other than a digit, but here you clamp down. This seems wrong.
// Part 1 : validating hint numbers
Here you talk about validating hints, but you only read in solved boards. You will probably need to loosen the isdigit requirement before proceeding.
This is also a bad use of a comment. Given the length of the section, this suggests that most of the functionality should be in its own function
void validate_hint_numbers()
or
void fetch_valid_board()
That's self-commenting, making use of programmatic structure to separate into parts and names to indicate what it does.
int chrton (unsigned char chr)
I have no idea what that function does from the name. It would help if you could find a more descriptive name for it, e.g. sanitize_square_value.
You're also doing a lot of implicit casts. You convert the result of _getch() from an int to a char and then to an unsigned char. Based on that, you return an int which is immediately converted to a char again. I would think it would make more sense for chrton to take an int chr and return a char. | {
"domain": "codereview.stackexchange",
"id": 10582,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optimization, c, io, windows, sudoku",
"url": null
} |
c++, opengl
}
void Begin(const Spiky::Camera& camera)
{
//Clear all render targets
m_renderTargets.clear();
m_camera = camera;
//Update UBOs --> Common Uniforms
glBindBuffer(GL_UNIFORM_BUFFER, m_UBO_Viewport);
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(glm::mat4), glm::value_ptr(camera.Projection()));
glBufferSubData(GL_UNIFORM_BUFFER, sizeof(glm::mat4), sizeof(glm::mat4), glm::value_ptr(camera.View()));
glBufferSubData(GL_UNIFORM_BUFFER, 2 * sizeof(glm::mat4), sizeof(glm::mat4), glm::value_ptr(camera.Combined()));
glBufferSubData(GL_UNIFORM_BUFFER, 3 * sizeof(glm::mat4), sizeof(glm::vec2), glm::value_ptr(glm::vec2(1000.0, 900.0)));
glBindBuffer(GL_UNIFORM_BUFFER, 0);
}
void Render(const Spiky::Spatial& spatial, const Environment& environment)
{
m_renderTargets.push_back(Renderable(spatial.GetMesh(), environment,
spatial.GetTransform().GetModel(), spatial.GetMaterial()));
} | {
"domain": "codereview.stackexchange",
"id": 16115,
"lm_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++, opengl",
"url": null
} |
Example : $$A=\begin{bmatrix} 0.6551 & 0.4984 & 0.5853\\ 0.1626 & 0.9597 & .2238\\ 0.1190 & 0.3404 & 0.7513\\\end{bmatrix} eig(A) = \begin{bmatrix} 1.3665\\ 0.4732\\ 0.5264\\\end{bmatrix}$$ Use a preconditioner $K=\begin{bmatrix} 1.9000 & -0.5000 & -1.3000\\ -0.3000 & 1.2000 & -0.2000\\ -0.2000 & -0.5000 & 1.6000\\ \end{bmatrix}$
For the system $KAx=Kb \Longleftrightarrow A'x = b'$, $$A' = \begin{bmatrix} 1.0087 & 0.0245 & 0.0235\\ -0.0252 & 0.9341 & -0.0573\\ -0.0219 & -0.0349 & 0.9731\\ \end{bmatrix}; eig(A') = \begin{bmatrix} 0.9169\\ 0.9995 + 0.0035i\\ 0.9995 - 0.0035i\\ \end{bmatrix}$$ How K was obtained is a question that involves delving into the source of the matrix but that's not essential for the motivation of the topic. All that is important is that $K$ attempts to approximate the inverse of the matrix A.
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773707993078212,
"lm_q1q2_score": 0.8101805774057398,
"lm_q2_score": 0.828938799869521,
"openwebmath_perplexity": 457.78276779091334,
"openwebmath_score": 0.749267041683197,
"tags": null,
"url": "http://math.stackexchange.com/questions/155116/purpose-of-inverse-matrix/155123"
} |
orbit, gravity
Title: Is a perfectly circular orbit possible? Let's assume that there is a perfectly spherical planet and there is a moon which is also perfectly spherical. Let's assume that there is no atmospheric drag and no other gravitational pull. If the moon is put in a perfectly circular orbit around the planet somehow, would the moon eventually "fall" towards the planet and form an elliptical orbit or would it continue to follow the perfectly circular orbit?
Edit: What i actually wanted to ask is that would the gravity of the planet cause the moon to "fall" towards the planet or would the gravity allow the moon to continue its orbit without bending its path any further towards the planet. I know that no planet can be a true sphere or a cube due to the shapes of the particles. Short answer:
Yes. If you ignore the tidal effect and relativity and any change in mass (planets radiate light and lose atmosphere and add space dust and meteors all the time, so mass isn't constant), then in a two body system with no outside effects, the orbit would remain perfectly circular. There would be no outside force to affect the circular orbit. A circular orbit is impossible because nothing can be that exact, but on a computer simulation you could set it up and it would remain circular.
Long answer:
For your scenario to work you'd need to give both the planet and moon infinite hardness, so they wouldn't bend at all and fixed mass and space would need to be completely empty of anything else. Needless to say that's impossible. But only in Newtonian gravity.
Relativity creates a very very tiny decay in orbits, in your system of a planet/moon that would be close to negligible but there would be a very tiny spiraling inward. The relativistic effect on an orbit was first noticed with Mercury's orbit around the sun (and Mercury isn't falling into the sun, it was noticed by other effects - but lets not get into that here). | {
"domain": "astronomy.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": "orbit, gravity",
"url": null
} |
quantum-mechanics, visible-light, reflection
Title: Why is the light reflected at the same angle from mirror? From the school physics I know that the material objects bounce from the plane surface at the same angle, losing some kinetic energy. In the same school I was taught that the light (and waves in general) obeys this principle too.
Obviously, in the case of light the plane surface should be a perfect mirror. But I can't understand how should this work from the quantum point of view. Let's assume that our mirror consists of a single silver atom.
Why should the electrons of this atom re-emit consumed photons at some specific angle? That's a good question. Without realising it you have stumbled across the Huygens-Fresnel principle.
The starting point it that a single silver atom is far smaller than the wavelength of light, so any scattering from it will be isotropic i.e. it will scatter the light equally in all directions.
But suppose we have two silver atoms side by side. Each atom will scatter isotropically, so in effect we have two closely spaced emitters of light and the system behaves like a Young's slits setup. Now the light isn't simply isotropically scattered, but instead it's scattered into preferred directions. (I'm oversimplifying because two atoms would be too closely spaced to act as Young's slits, but bear with me.)
Now add lots of atoms in a row, and you get something like a diffraction grating. Add lots more to make a 2D surface, then add more layers of silver atoms below, and you're building up a system where the overall light scattering is the sum of individual scattering from huge numbers of individual silver atoms. This is basically the Huygen's construction, and if you do the sums for a surface you can show that the overall scattering is only non-zero when the angle of reflection is equal to the angle of incidence. Any optics textbook should have the calculation, or a quick Google found an example here. | {
"domain": "physics.stackexchange",
"id": 18664,
"lm_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, visible-light, reflection",
"url": null
} |
gazebo, simulation, spawn-model, simulator-gazebo, ros-fuerte
In second terminal:
$ rosrun gazebo spawn_model -file ~/object.urdf -urdf -z 1 -model my_object
loading model xml from file
waiting for service spawn_urdf_model
spawn status: SpawnModel: successfully spawned model
As I still have Electric installed, I have tried running the same code but with my ROS paths pointing to the Electric installation, and everything ran smoothly with no errors or warnings, and all transforms published.
Any ideas? Thanks for you help!
Ubuntu oneiric 11.10
EDIT/UPDATE:
Opps, as hsu reminded me - there aren't supposed to be any transforms published when simply generating Block.urdf with spawn_model. However, when I try other examples with multiple links and attempt to use 'robot_state_published', no transforms are published when using Fuerte (whereas, they work fine using Electric).
Looking closer at the simple Block.urdf example again, I've further noticed:
When I use Fuerte and run rxgraph, three nodes appear: /gazebo, /rosout and /empty_world_server but none of the of nodes have any arrows to each other or to themselves.
When I do the same but with Electric, the same three nodes appear, but topics are published to and from the nodes. Namely, the /rosout topic is published by both /empty_world_server and /gazebo and subscribed to by the /rosout node, in addition, /gazebo publishes and subscribes the clock to itself.
I've also noticed, from running $rostopics echo /gazebo/joint_states, that the joint states are published continuously by /gazebo for both Electric and Fruete
Originally posted by Angus on ROS Answers with karma: 438 on 2012-04-26
Post score: 1
Original comments
Comment by hsu on 2012-04-26:
I see, found the object.urdf in the tutorial. What transforms are you referring to?
After playing around with it a little more, I've found some answers: | {
"domain": "robotics.stackexchange",
"id": 9150,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, simulation, spawn-model, simulator-gazebo, ros-fuerte",
"url": null
} |
c++, neural-network
{
double tempval = (Beta * Outlayer[neuron].biasema) + ((1.0 - Beta) * Outlayer[neuron].biasderiv);
Outlayer[neuron].biasema = tempval;
}
} | {
"domain": "codereview.stackexchange",
"id": 40542,
"lm_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++, neural-network",
"url": null
} |
ros, rosbridge, websocket
Title: rosbridge cannot connect to secure websocket, timed out error
I am using rosbridge and roslibjs to connect to ros. I wrote an HTML page that publishes a simple std_msgs::String message. I need to serve this page through HTTPS, therefore I have to connect to rosbridge through the wss protocol. Using simple http and ws it all works, but then I switch to the secure protocol i get the following error in the javascript console:
WebSocket connection to
'wss://localhost:9090/' failed: Error
in connection establishment:
net::ERR_TIMED_OUT
I serve the web page using apache default-ssl site and start rosbridge as follows:
roslaunch rosbridge_server
rosbridge_websocket.launch ssl:=true
certfile:=/etc/ssl/certs/ssl-cert-snakeoil.pem
keyfile:=/etc/ssl/private/ssl-cert-snakeoil.key
authenticate:=false
To connect to rosbridge I use:
$(document).ready(function(){ var ros = new ROSLIB.Ros({
url : 'wss://localhost:9090' });
ros.on('connection', function() {
console.log('Connected to websocket server.'); });
ros.on('error', function(error) {
console.log('Error connecting to websocket server: ', error); });
ros.on('close', function() {
console.log('Connection to websocket server closed.'); });
});
I am running ROS Groovy on Ubuntu 12.04 on a x86 machine. I am using rosbridge version
0.5.6-1precise-20140906-1447-+0000 | {
"domain": "robotics.stackexchange",
"id": 21419,
"lm_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, rosbridge, websocket",
"url": null
} |
ros, object-recognition
Title: Which trac component to use when submitting tickets for object_recognition stack?
I'd like to submit feature requests for packages in stack object_recognition but cannot find any suitable component in https://code.ros.org/trac/wg-ros-pkg. Leaving it unspecified is not exactly what I want. Suggestions?
Originally posted by Julius on ROS Answers with karma: 960 on 2011-03-09
Post score: 0
The component should be the stack name, object_recognition, but it is not currently defined.
Try creating it yourself. If you don't have permission, add that to your question (as a comment) and someone with admin authority can do it for you.
Originally posted by joq with karma: 25443 on 2011-03-09
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by Julius on 2011-03-13:
Ticket has already found an owner and component is changed to object_recognition. Thanks.
Comment by tfoote on 2011-03-09:
I've created object_recognition as a component. If you opened a ticket it should get to the right place eventually.
Comment by Julius on 2011-03-09:
Yes, it's not defined. I followed your suggestion, opened a ticket and will see what happens and whether it's necessary to find someone taking care of it. Thanks. | {
"domain": "robotics.stackexchange",
"id": 5009,
"lm_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, object-recognition",
"url": null
} |
1111a+1222b+233c+34d+4e=a+10b+100c+1000d+10000e
Which can be rewritten as:
1110a+1212b+133c-966d-9996e=0
Solving this would not be super interesting. First you would isolate e, find out it has to be 1 or 2, and continue from there in much the same way was with the 3-digit problem. So I won’t spend more time on that. However, the general case could be fun. Where did 1111, 1222, 233, 34, and 4 come from? Well, each digit gets a 1 from the single digit strings. Then the first four get a ten from the double digit strings and the last four get a one. Then the first three get a 100 from the triple digit strings, the second through fourth get a ten, and the last three get a one. Finally, the first two get a 1000 for the four digit strings, the second and third get a 100, the third and fourth get a 10, and the last two get a 1. So a got one of each, b got to double up on everything except hundreds, c was excluded from getting a thousand but got two hundreds, three tens, and three ones, and so on.
This pattern could rather easily be adapted to any length of number. I hypothesize that with such generated numbers there’s some way to generate the solutions with single digits, but that will take more work.
## ASMS: Math
There are countless pictures floating around at any given time asking people to do a simple arithmetic problem. Usually the problem requires knowing the order operations are carried out in. Then an argument ensues in the comments, usually with some people sounding really sure that the order of operations only applies in the context of a class on the order of operations. (You could of course have an arithmetic that is strictly left to right, but the standard convention is what it is. Arguing that you’re ignoring the standard convention for the order of operations is as silly as picking a wrong answer and defending it with a nonstandard definition of the plus or times sign.)
I decided to make a somewhat better problem. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575137315161,
"lm_q1q2_score": 0.8250869175015055,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 725.4622217622605,
"openwebmath_score": 0.8384761214256287,
"tags": null,
"url": "https://nicholesuomi.wordpress.com/category/mathematics/"
} |
physical-chemistry, thermodynamics, gas-laws
Title: What will happen to the entropy and free energy of the gasses when the partition is removed?
Consider a container of volume $ 5.0$ L that is divided into two compartments of
equal size. In the left compartment there is nitrogen at $1.0$ $atm$ and $25 °C$; in the
right compartment there is hydrogen at the same temperature and pressure. What
will happen when the partition is removed?
$A) $The entropy decreases, and the free energy decreases.
$B)$ The entropy increases, and the free energy decreases.
$C) $The entropy increases, and the free energy increases.
$D) $The entropy decreases, and the free energy increases.
Logic tells that upon removing the partition, randomness increases and hence entropy increases. I am confused about free energy. First law of thermodynamics has to be applied , I think. But I can't seem to get the right direction. A Spontaneous process is characterized by an increase in the total entropy (for both system and surroundings).
Spontaneous processes are characterized by a decrease in free energy (analogous to the decrease in gravitational potential energy occurring for a ball rolling downhill). | {
"domain": "chemistry.stackexchange",
"id": 4658,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, thermodynamics, gas-laws",
"url": null
} |
quantum-field-theory, operators, conformal-field-theory, singularities
Title: OPE in the Free Boson Theory I am following the book by "Conformal Field Theory" by Di Francesco and authors. Consider a free boson theory with the action $$S = \frac{1}{2}g \int d^2x \partial_\mu \phi \partial^\mu \phi$$ Using the path integral approach, one can calculate the correlator $$ \left < \partial_z \phi(z) \partial_w \phi(w) \right > = -\frac{1}{4\pi g}\frac{1}{(z-w)^2}$$
Using the above expressions, the authors deduce the OPE as $$\partial \phi(z) \partial \phi(w) = -\frac{1}{4\pi g}\frac{1}{(z-w)^2} + \text{regular terms}$$
My question: In the above OPE, why can't we have a term like $$\frac{\mathcal{O}(w)}{(z-w)^n}$$ where $\mathcal{O}(w)$ is some operator satisfying $\left < \mathcal{O}(w) \right >=0$, and $n$ is any positive integer? It would still satisfy that the correlation function is $\left <\partial_z \phi(z) \partial_w \phi(w) \right > = -\frac{1}{4\pi g}\frac{1}{(z-w)^2}$. If they gave you the $-\frac{1}{4\pi g} \frac{1}{(z - w)^2}$ two-point function out of the blue and didn't tell you what theory it was from then, indeed, there would be no way to determine the OPE. But for the free boson theory, there are many ways to see that this is the only singular term. | {
"domain": "physics.stackexchange",
"id": 85088,
"lm_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, operators, conformal-field-theory, singularities",
"url": null
} |
python, performance, python-2.x, circular-list
sliced = other.data
#this is not correct. slice needs to take into account the offset from the ring in other
elif isinstance(other, type(self.data)):
sliced = other
else:
sliced = list(other)
if j-self.offset<0:
self.data[i-self.offset+len(self.data):j-self.offset+len(self.data)]=sliced
elif i-self.offset<0:
self.data[0:j-self.offset]=sliced[len(sliced)-(j-self.offset):len(sliced)]
self.data[i-self.offset+len(self.data):len(self.data)]=sliced[0:len(sliced)-(j-self.offset)]
else:
self.data[i-self.offset:j-self.offset]=sliced
if self.offset>i:
self.offset = self.offset+len(sliced)-j+i | {
"domain": "codereview.stackexchange",
"id": 21739,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-2.x, circular-list",
"url": null
} |
quantum-mechanics, quantum-field-theory, commutator
Title: Commutator of the Pauli-Lubanski with a vector $P^{\mu}$ The Pauli-Lubanski vector is defined as $W_{\mu} = -\frac{1}{2}\varepsilon_{\mu\nu\rho\sigma}J^{\nu\rho}P^{\sigma}$, where $\varepsilon_{\mu\nu\rho\sigma}$ is the 4-dimensional Levi-Civita symbol.
The commutation reltaions are $$\left[P^{\alpha}, J^{\nu \rho}\right]=i\left(g^{\nu \alpha} P^{\rho}-g^{\rho \alpha} P^{\nu}\right)$$ $$\left[P^{\alpha}, P^{\beta}\right]=0.$$
Calculating explicitly (applying the first commutator to $P^{\alpha}J^{\nu\rho}$) $$[W_{\mu},P^{\alpha}] = \frac{1}{2}\varepsilon_{\mu\nu\rho\sigma}(P^{\alpha}J^{\nu\rho}P^{\sigma} - J^{\nu\rho}P^{\sigma}P^{\alpha}) $$
$$= \frac{1}{2}\varepsilon_{\mu\nu\rho\sigma}[(J^{\nu\rho}P^{\alpha} + i\left(g^{\nu \alpha} P^{\rho}-g^{\rho \alpha} P^{\nu}\right))P^{\sigma} - J^{\nu\rho}P^{\sigma}P^{\alpha}]$$ | {
"domain": "physics.stackexchange",
"id": 65451,
"lm_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, commutator",
"url": null
} |
quantum-mechanics, quantum-interpretations, wave-particle-duality
Title: The Dual Nature of Dual Nature When we say that light behaves as a particle and as a wave, we say that light is an electromagnetic wave, and it's a photon. Both EM waves and photons have physical definition. On the contrary an electron wave is just the probability amplitude, in other words the definition for the so called wave nature of electron is not physical as it is for a photon.
My question is how can we physically define the photon? Is a photon just a lump in the electromagnetic wave, or is it a point on the wave?
When we say that light behaves as a particle and as a wave, we say that light is an electromagnetic wave, and it's a photon.
The discussion about light or more broad about electromagnetic radiation needs a focus about what are EM radiation, EM waves and photons. In a nutshell
light is not a particle, it consists of photons
the photon has an oscillating magnetic and an oscillating electric field component, both perpendicular to each other and to the direction of propagation
the synchronous acceleration of the - emitting this time - electrons give us a technical solution for electromagnetic waves (radio waves)
last not least the radiation from a thermic source is not a wave.$^1$
Does this imply that there is a fundamental difference in wave properties of fermions and bosons? | {
"domain": "physics.stackexchange",
"id": 74655,
"lm_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-interpretations, wave-particle-duality",
"url": null
} |
php, mysqli
Title: Creating a database class in PHP with MySQLi I am creating a database class in PHP but I feel that there's something wrong with my code. Is there any suggestion to refactor this? I feel like there's something wrong and missing in this code.
<?php
require_once("db_constants.inc.php");
Class MySqli_Database
{
public $db;
public function __construct($db_host,$db_username,$db_password,$db_name)
{
$this->db = new mysqli($db_host,$db_username,$db_password,$db_name);
}
public function __performSql($sql)
{
}
public static function closeConnection($conn)
{
$this->db_close();
}
}
$conn = new MySqli_Database (DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME)
or die("Could Not Connect To Database: " . mysqli_errno());
Perform SQL will just basically execute the query, though I haven't included the code yet, but I will soon. Also if you have tutorials or guide when creating a database class for MySQLi please post it. It would be a great help. What is the purpose of this class?
Creating a database class in PHP with mySQLI
MySQLi is a "database class." (Whatever meaning of "database class" you choose)
Are you trying to make a class that adds on to MySQLi?
Are you trying to make a class that abstracts away certain operations (a DBAL)?
Are you trying to make a class that maps objects to a database (ORM)? | {
"domain": "codereview.stackexchange",
"id": 1965,
"lm_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, mysqli",
"url": null
} |
Thus, from $f(x)>x$, we get $x>f^{-1}(x)$. So $C<0$.
We also observe that, due to $f(x)>0$, $f^{-1}(x)$ is undefined for $x<0$. Since $f(x)$ is defined wherever its inverse is defined, so $f(x)$ is undefined in $(0,-\infty)$.
$$f^{-1}(0)=C\implies f(C)=0$$
But $C<0$, $f(C)$ should be undefined! Also, I have proven that $f(C)>0$(above). That leads to a contradiction.
So a value of $C$ does not exist, and hence $f^{-1}(0)$ and $f(0)$ is undefined.
From the above observations, we can also see: $$0<f^{-1}(x)<x$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9920620073067491,
"lm_q1q2_score": 0.8770217783251895,
"lm_q2_score": 0.8840392756357327,
"openwebmath_perplexity": 317.77205256315204,
"openwebmath_score": 0.875244140625,
"tags": null,
"url": "https://math.stackexchange.com/questions/2783000/recreational-math-if-ffx-ex-bound-the-integral-int-01-fxdx"
} |
object-oriented, ruby, unit-testing
attr_reader :age, :height, :oranges
def initialize
@age = 0
@oranges = []
end
def age!
@age += 1
add_oranges if fruit_bearing?
end
def dead?
age >= LIFESPAN
end
def fruit_bearing?
age >= FRUIT_BEARING_AGE
end
def height
age * 2
end
private
def add_oranges
ORANGES_PER_YEAR.times { oranges << Orange.new }
end
end
(note that this implementation still has the same issues as yours: It keeps growing and adding oranges even if it's dead.) | {
"domain": "codereview.stackexchange",
"id": 10120,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, ruby, unit-testing",
"url": null
} |
time, astronomy
Title: How to measure the age of light? We measure distances in universe by the units of light year/s or parsec. Which means distance traveled by light in one year equals one light year. Thus the lights we receive from the distant stars or galaxies are coming from many light years away.
So how do we know the age of the light so that we determine the distance it has traveled to reach earth? We actually measure the distance, and infer the age of the light from the distance. There are many answers on the site discussing how cosmological distances are measured. | {
"domain": "physics.stackexchange",
"id": 75605,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "time, astronomy",
"url": null
} |
electromagnetic-radiation, polarization
1) Are the orientations of the electric field and magnetic field constant for a given wavefront? (i.e.), for a given wavefront, does the plane of vibration of the electric field remain the same?
The two pictures above try to convey that unpolarized light is an incoherent superposition of an "infinite" number of polarization planes. The one showing only three to explain how to make a polarized wavefront.
The plane of vibration is the same for a given angle in a coordinate system, hypothetically picking up a polarization plane. It is all mathematics
2) Is the light unpolarized because the orientation of the electric and magnetic fields are different for each wavefront (as shown in my sketch)? Or because the plane of vibration changes each instant for a given wavefront itself?
For a given angle mathematically there is a plane of polarization. That is why the slits in the second picture pick up a polarized wave front.
3) How can I relate all this to a photon of light? Does one photon mean the same thing as one wavefront?
Here is how polarized light depends on the photon spin for circular polarization, photons can only have spin +1 or -1 to their direction of motion:
See my answer here for a discussion. | {
"domain": "physics.stackexchange",
"id": 54095,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-radiation, polarization",
"url": null
} |
beginner, object-oriented, game, vba, excel
Public Sub Add(obj As Control)
MissleObjectsCntrls.Add obj
End Sub
Public Sub Remove(index As Variant)
MissleObjectsCntrls.Remove index
End Sub
Public Property Get Item(index As Variant) As Control
Set Item = MissleObjectsCntrls.Item(index)
End Property
Property Get Count() As Long
Count = MissleObjectsCntrls.Count
End Property
Public Sub Clear()
Set MissleObjectsCntrls = New Collection
End Sub
MissleCount:
Option Explicit
Private pcount As Long
Public Property Get Count() As Long
Count = pcount
End Property
Public Property Let Count(ByRef value As Long)
pcount = value
End Property
Public Sub IncrementMissleCount()
pcount = pcount + 1
End Sub
MissleObjectsDataCol:
Option Explicit
Private MissleObjectsData As Collection
Private Sub Class_Initialize()
Set MissleObjectsData = New Collection
End Sub
Private Sub Class_Terminate()
Set MissleObjectsData = Nothing
End Sub
Public Property Get NewEnum() As IUnknown
Set NewEnum = MissleObjectsData.[_NewEnum]
End Property
Public Sub Add(obj As missle)
MissleObjectsData.Add obj
End Sub
Public Sub Remove(index As Variant)
MissleObjectsData.Remove index
End Sub
Public Property Get Item(index As Variant) As missle
Set Item = MissleObjectsData.Item(index)
End Property
Property Get Count() As Long
Count = MissleObjectsData.Count
End Property
Public Sub Clear()
Set MissleObjectsData = New Collection
End Sub
ScaleItems:
Option Explicit
Private plargestSize As Long
Public Property Get MaxSize() As Long
MaxSize = plargestSize
End Property
Public Property Let MaxSize(ByRef value As Long)
plargestSize = value
End Property
Ship:
Option Explicit
Private Type ShipData
left As Long
top As Long
ImgPathWay As String
ImageName As String
width As Long
height As Long
Name As String
End Type | {
"domain": "codereview.stackexchange",
"id": 31875,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, object-oriented, game, vba, excel",
"url": null
} |
homework-and-exercises, newtonian-mechanics, kinematics
Title: Undefined Velocity at a certain time I have a homework problem where the expression for net force on a particle is given by $F(v,t)=-ktv^2$ ($k$ is a positive constant) and $x(0)=0, v(0)=v_{0}$. I was required to solve this differential equation and get an expression for displacement and velocity. So I did the integration $\int mv^{-2}dv=\int -ktdt$ and got $v(t)=\frac{2m}{kt^2+C}$ for some constant $C$. Using the initial condition, I got $C=\frac{m}{v_{0}}$. Then I realized that if the particle's initial velocity is negative, then there is a certain time where velocity is not defined. I can understand this mathematically, but how does it make sense in physics? How is it even possible to have some undefined velocity? Your velocity $v(t)$ isn't necessarily undefined in general but rather for the given functional form. In other words, there is only a certain domain of validity for your expression. There are often cases in both physics and mathematics where one may have different forms of solutions depending on the domain of validity. If the quantity in general seems undefined for certain extreme cases, one does asymptotic analysis to describe the limiting behavior to understand what is going on in the given situation. | {
"domain": "physics.stackexchange",
"id": 93098,
"lm_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, kinematics",
"url": null
} |
java, object-oriented, mvc, swing, quiz
private void close(){
if (deck.getIsModified()) {
// Automatically closes the program if there's nothing to be saved.
if(deck.getQuizCardList().size() == 0 && getQuestionText().getText().length() == 0
&& getAnswerText().getText().length() == 0) {
System.exit(0);
}else {
int optionChosen = JOptionPane.showConfirmDialog(frame, "Do you want to save this deck?", "Save",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (optionChosen == JOptionPane.YES_OPTION) {
save();
}
if (optionChosen != JOptionPane.CANCEL_OPTION) {
System.exit(0);
}
}
}else{
System.exit(0);
}
}
/** createQuizCardPlayer - safely creates an instance of QuizCardPlayer, whilst allowing QuizCardPlayer to
* have a callback */
private void createQuizCardPlayer(){
quizCardPlayer = new QuizCardPlayer(deck);
quizCardPlayer.registerQuizCardBuilder(this); // registers the callback
}
private void displayFrame() {
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
/** openFile - opens a saved Deck */
private void openFile(){
int optionChosen = JOptionPane.YES_OPTION;
if(deck.getIsModified()){
optionChosen = JOptionPane.showConfirmDialog(frame, "Do you want to save this deck before " +
"opening another?", "Save", JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
if(optionChosen == JOptionPane.YES_OPTION){
save();
}
} | {
"domain": "codereview.stackexchange",
"id": 12605,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, mvc, swing, quiz",
"url": null
} |
c#, programming-challenge, strings, interview-questions, balanced-delimiters
Title: CareerCup (Bloomberg): Check if string is valid based on brackets The goal of this problem is to determine if a string with brackets is valid. Below is a summary of the question from careercup.
Check if string s is valid based on brackets
"(({{}}))" is a valid s
"{[]}" is a valid s
"[{[}]]" is not valid
I know this is a rather basic exercise. I am looking for feedback on whether my solution is sound and efficient. I would also like to know if my code is clean. Also is there too much for a 45 minute interview? The solution is shown below.
public class Question_ValidStringWithBrackets
{
public bool IsValidBracketString(String s, BracketValidator validator = null)
{
if (s == null)
throw new ArgumentNullException("A string is required");
if (validator == null)
validator = BracketValidator.CreateDefaultValidator();
Stack<char> openStack = new Stack<char>();
foreach (var curBracket in s)
{
if (validator.IsOpen(curBracket))
{
openStack.Push(curBracket);
}
else if (openStack.Count == 0 || validator.IsMatchingPair(openStack.Pop(), curBracket))
{
return false;
}
}
return openStack.Count == 0;
}
public class BracketValidator
{
private HashSet<char> openBrackets = new HashSet<char>();
private Dictionary<char, char> closedOpenedPair = new Dictionary<char, char>();
public void AddPair(char open, char close)
{
if (char.IsWhiteSpace(open) || char.IsWhiteSpace(close))
throw new ArgumentException("A bracket must be specified. An empty character is not allowed.");
if (openBrackets.Contains(open) || openBrackets.Contains(close))
throw new ArgumentException("Brackets exist already."); | {
"domain": "codereview.stackexchange",
"id": 34901,
"lm_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, strings, interview-questions, balanced-delimiters",
"url": null
} |
# Convergency radius of the generating series for A93637
Sequence A93637 of the OEIS (https://oeis.org/A093637) starting as $$1,1,2,4,9,20,49,117,297,746,1947,\ldots$$ is defined by the coefficients $$a_0,a_1,\ldots$$ of the unique formal power series defined by the equality $$A(x)=\prod_{n=0}^\infty \frac{1}{1-a_nx^{n+1}}=\sum_{n=0}^\infty a_n x^n\ .$$ Experimentally, $$a_{n+1}/a_n$$ seems to converge to some a limit roughly given by $$2.96777$$ suggesting a convergency radius slightly larger than $$1/3$$ for $$A(x)$$.
Is there an easy argument ensuring that $$A(x)$$ has strictly positive convergency radius? Are there computable upper/lower bounds for the convergency radius of $$A(x)$$?
• this is such a nice question, we could presumably ask this about every series in OEIS Oct 18, 2022 at 4:25
• I suspect that there is a nice asymptotic expression for coefficients of this series. Since it is dominated by powers of the inverse of the convergency radius, establishing the exact convergency radius is a first step. Oct 18, 2022 at 7:33 | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426450627306,
"lm_q1q2_score": 0.8052525363631956,
"lm_q2_score": 0.8267117876664789,
"openwebmath_perplexity": 150.3095914398148,
"openwebmath_score": 0.9791216850280762,
"tags": null,
"url": "https://mathoverflow.net/questions/432382/convergency-radius-of-the-generating-series-for-a93637"
} |
sets Z, D, Q, R and C. Z is the set of integers, ie. The "Reset" button clears the calculator. The atom calculator is a tool for calculating the atomic number and the mass number based on numbers of atom components - protons, neutrons, and electrons (or vice versa). an idea ? P(S) = 2n= 25= 32. The numbers using suspension points ... for their decimal writing therefore have an infinite number of decimal places and therefore do not belong to the set D. The set D is included in sets Q, R and C. The sets N and Z are included in the set D (because all integers are decimal numbers that have no decimal places). Range Calculator Instructions. In fact, this number is pre-calculated and is knows as the Bell number. Thus, for a set of size 6, the Bell number is 203, and the Bell number for the set of size 12 is 4213597. Find the union $\color{blue}{A \cap B}$ of sets $A = \{ 5, 7, 3, 1\}$ and $B = \{2, 5, 9\}$. Example: 1/3, -4/1, 17/34, 1/123456789 $\in \mathbb{Q}$. If you want random number sets with duplicates allowed try the Random Number and Letter Set Generator. The number of subsets with k elements in the power set of a set with n elements is given by the number of combinations, C(n, k), also called binomial coefficients. For K-12 kids, teachers and parents. Number of Subsets Calculator: Just enter the values for a set separated by a comma in this algebra calculator and you could calculate the number of subsets (powersets) in a set within the fractions of seconds. The subset symbol ⊆ is that of inclusion (broad sense), A ⊆ B if every element of A is an element of B. Thanks to your feedback and relevant comments, dCode has developed the best 'Number Sets' tool, so feel free to write! Read More -> Select the lottery game you want to generate numbers for and the number of plays you want. A set that contains all sets in a given context is called a Universal set (U). | {
"domain": "zezenbeltz.eus",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.975946446405965,
"lm_q1q2_score": 0.8111510958483881,
"lm_q2_score": 0.8311430394931456,
"openwebmath_perplexity": 685.1780129295474,
"openwebmath_score": 0.6768036484718323,
"tags": null,
"url": "https://www.zezenbeltz.eus/17qw8/aa2dfd-number-sets-calculator"
} |
electromagnetism, dirac-delta-distributions, greens-functions
Title: Inhomogeneous wave equation by fourier in analysis
$$\nabla^2\psi_\omega+\frac{\omega^2}{c^2}\psi_\omega=-g\omega,\tag{14-16}$$
which is similar to Poisson's equation.
We may synthesize the solution of Eq. (14-16) by the superposition of unit point solutions corresponding to a source at the point $x_a'$ given by $g_\omega\left(x_a\right)=\delta\left(x_a-x_a'\right)$ where $\delta\left(x_a-x_a'\right)$ is the Dirac $\delta$-function. Each unit source potential satisfies the equation
$$\nabla^2G\left(x_a,\,x_a'\right)+\frac{\omega^2}{c^2}G\left(x_a,\,x_a'\right)=-\delta\left(x_a-x_a'\right),\tag{14-17}$$ | {
"domain": "physics.stackexchange",
"id": 45695,
"lm_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, dirac-delta-distributions, greens-functions",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.