text stringlengths 1 1.11k | source dict |
|---|---|
algorithms, search-algorithms, string-matching
Title: KMP - longest palindromic prefix I wanted to ask if there is a way to use KMP (Knuth-Morris-Pratt) algorithm to find the longest palindromic prefix of a word.
I've seen this algorithm used for determining if a word is rotation of the other for example. We can concatenate first word with itself and look for a pattern which would be the second word (and if found, the answer is yes). But I cannot imagine how could I use KMP for my problem. I am not sure what would the pattern be etc. Can it also be done in linear time using KMP? Thank you. KMP algorithm is able to solve your problem. Suppose your input string can be represented as $S=AB$ where $A$ is a palindrome ($B$ can be an empty string). Now reverse $S$ we can get $S'=B'A$. consider the string $T=S*S'=AB*B'A$ where '*' is a character which doesn't appear in $S$. | {
"domain": "cs.stackexchange",
"id": 12349,
"lm_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, search-algorithms, string-matching",
"url": null
} |
data-compression
It goes on up to Others17, and that's just part of the description, and there are probably similar descriptions on many other images. This is full of long duplicated strings that can be compressed to a few bytes after their first occurrence.
Even ordinary English text tends to compress fairly well for similar reasons.
Will converting ebooks to XML be any helpful in reduction of size of ebook ?
No. But ebooks tend to be small anyway if they're just text. | {
"domain": "cs.stackexchange",
"id": 18895,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "data-compression",
"url": null
} |
rna-seq, filtering, isoform
for record in SeqIO.parse(args.input, "fasta"):
gene = record.id.split("_")[0]
if last_gene is None:
last_gene = gene
if last_gene == gene:
transcripts.append(record)
else:
print_longest_transcripts(transcripts, args.number)
last_gene = gene
transcripts = [record]
print_longest_transcripts(transcripts, args.number)
def print_longest_transcripts(transcripts, number):
longest = sorted(transcripts, key=lambda x: len(x.seq), reverse=True)
for record in longest[:number]:
print(">"+record.id, record.seq, sep="\n")
def get_args():
parser = ArgumentParser(description="")
parser.add_argument("-i", "--input", help="input fasta", required=True)
parser.add_argument("-n", "--number", help="number of longest transcript per gene", type=int, required=True)
return parser.parse_args()
if __name__ == '__main__':
main() | {
"domain": "bioinformatics.stackexchange",
"id": 827,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rna-seq, filtering, isoform",
"url": null
} |
quantum-mechanics, statistical-mechanics, computational-physics, physical-chemistry, quantum-computer
How might Exascale computation coupled with Machine learning (quantum ML? {doi:10.1038/nature23474}) and a QPU help solve this problem?
Relevant References (Mostly Keywords but also looking for books, papers etc.) would be greatly appreciated. Interesting questions, but very broad.
The statements about the (quantum) computational complexities do not in principle have much to do with the questions of what is feasible with QC, referring to worst-case scenarios (it may actually be an interesting question for cstheory how much these statements are relevant to the more commonly occurring cases).
Also, they are not per se statements about the complexity of simulating a quantum system, but refer to harder problems.
The answer to the question of whether QC can solve in polynomial time (and resources) the 2 problems you mention is generally yes.
A quantum computer can, in principle, solve efficiently the problem of simulating a quantum system. | {
"domain": "physics.stackexchange",
"id": 45155,
"lm_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, statistical-mechanics, computational-physics, physical-chemistry, quantum-computer",
"url": null
} |
computational-geometry, data-mining
Attempt: since the number of points in the plane is at least 50%, we can randomly sample 3 points from the set. They will all be in the plane with probability 12.5%. We build a plane through these 3 points and check that at least 50% of points lie approximately in it. Within 10-20 samples we'll find the plane.
Problem: because of the margin of error there's not just one plane going through 3 points, but many possible planes. How do we examine all of them?
How would you tackle this problem? One reasonable approach is to use RANSAC.
Pick three points. Find the plane that goes through them. Iterate through all the points and keep the points that are near that plane (the inliers) and discard the rest (the outliers). If fewer than 50% of the points are inliers, discard this plane. Otherwise, discard the plane you have so far and use linear regression to find the best plane that fits the inliers as well as possible. That's a candidate plane. | {
"domain": "cs.stackexchange",
"id": 13960,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computational-geometry, data-mining",
"url": null
} |
special-relativity, time, reference-frames
Title: When moving fast Time slows down Vs speeds up I was watching an old cartoon movie where a scientist makes a gadget, which when bound on the wrist, freezes the movement of the whole world. So, that one may do 100s of things in a single second. (The beagle boys later use the gadget to rob a whole bank in 1 second).
The scientist explains the working that the gadget helps in moving "very very fast". So fast that the person who wears it, sees the world, he finds everything frozen. As whatever he is doing is going on 1000s of times faster than the people in the world are doing.
The above explanation is quite logical and easily understandable actually.
So, with this logic, if movement occurs faster, time freezes. More the movement, more the time freezes.
With this thing in mind, how come then theory of relativity claims that
"moving faster may transport you ahead in time". | {
"domain": "physics.stackexchange",
"id": 5277,
"lm_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, time, reference-frames",
"url": null
} |
c#, beginner
SqlCommand mscmd = new SqlCommand(strCatchUp, idb.msconn);
msrdr = mscmd.ExecuteReader();
while (msrdr.Read())
{
try
{
string strdIntervalStart = msrdr["dIntervalStart"].ToString();
int intnExternToInternAcdCalls = System.Convert.ToInt32(msrdr["nExternToInternAcdCalls"]);
string cName = msrdr["cName"].ToString();
string sqlInsertUpdate = "INSERT INTO `forecasts`.`statistics` (`dIntervalStart`, `nExternToInternAcdCalls`, `cName`, `DateCreated`, `DateModified`) "
+ "VALUES (@dIntervalStart, @nExternToInternAcdCalls, @cName, now(), now())"; | {
"domain": "codereview.stackexchange",
"id": 7357,
"lm_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",
"url": null
} |
c#, asp.net-mvc, asp.net-mvc-5
if (BKQEventData == null)
{
return RedirectToActionPermanent("Login", "Login");
} | {
"domain": "codereview.stackexchange",
"id": 25662,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, asp.net-mvc, asp.net-mvc-5",
"url": null
} |
• If we put $y=x^{d}$, then $x^{p-1}-1=y^{(p-1)/d}-1=(y-1)(y^{(p-1)/d-1}+\cdots+1)=(x^{d}-1)q(x)$ where $q(x)=x^{p-1-d}+x^{p-1-2d}+\cdots+1$. – Seewoo Lee Jul 11 '16 at 0:39
• @Bill Dubuque . Why is the following true $p-1-(p-1-d)=d$? – TheMathNoob Jul 12 '16 at 7:27
• @TheMathNoob The idea is simple: if $\, f = gh\,$ and $\,f\,$ has $\,\deg f\,$ roots, then also $\,g\,$ has $\,\deg g\,$ roots and $\,h\,$ has $\,\deg h\,$ roots, since if one of $\,g,h\,$ had less, then the other would have to have more, contra Lagrange. – Bill Dubuque Jul 12 '16 at 13:50
• @Bill Dubuque. How does the factorization show that that the roots of $x^{p-1}-1$ are either roots of $x^d-1$ or roots of q(x)? – TheMathNoob Jul 13 '16 at 1:38
• $0 \equiv f(n)\equiv g(n)h(n)\,\Rightarrow\, g(n)\equiv 0\,$ or $\,h(n)\equiv 0\,$ since $\,\Bbb Z/p\,$ is a domain; or, equivalently, $\,p\mid g(n)h(n)\,\Rightarrow\, p\mid g(n)\,$ or $\,p\mid h(n).\$ – Bill Dubuque Jul 13 '16 at 2:04 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575142422757,
"lm_q1q2_score": 0.8055923624031062,
"lm_q2_score": 0.819893340314393,
"openwebmath_perplexity": 182.14231571532613,
"openwebmath_score": 0.9122315645217896,
"tags": null,
"url": "https://math.stackexchange.com/questions/1855431/need-help-with-the-following-theorem"
} |
performance, image, swift, ios, color
return (RGBA32(red: redMin, green: greenMin, blue: blueMin, alpha: alphaMin),
RGBA32(red: redMax, green: greenMax, blue: blueMax, alpha: alphaMax))
}
func between(_ min: RGBA32, _ max: RGBA32) -> Bool {
return
redComponent >= min.redComponent && redComponent <= max.redComponent &&
greenComponent >= min.greenComponent && greenComponent <= max.greenComponent &&
blueComponent >= min.blueComponent && blueComponent <= max.blueComponent
} | {
"domain": "codereview.stackexchange",
"id": 42033,
"lm_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, image, swift, ios, color",
"url": null
} |
quantum-chemistry, electrons, terminology
know about one, the less we know about the other. Many of the properties of an element, however, depend on the energies of its electrons. In the following paragraphs, we describe the probability distribution maps for electron states in which the electron has well-defined energy, but not well-defined position. In other words, for each of these states, we can specify the energy of the electron precisely, but not its location at a given instant. Instead, the electron’s position is described in terms of an orbital, a probability distribution map showing where the electron is likely to be found. Since chemical bonding often involves the sharing of electrons between atoms (see Section 4.2), the spatial distribution of atomic electrons is important to bonding. | {
"domain": "chemistry.stackexchange",
"id": 14350,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-chemistry, electrons, terminology",
"url": null
} |
java, design-patterns, json, error-handling, factory-method
General observations
"I find your lack of javadoc disturbing".
Especially when writing code for others, your class should describe what it does. In detail. See it as a contract: Your javadoc describes what behaviour a caller can (and cannot) expect. Oracles document on javadoc has a lot more details on that.
A library which handles URL -> JSON seamlessly
The default implementation, see above ;-) | {
"domain": "codereview.stackexchange",
"id": 27901,
"lm_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, design-patterns, json, error-handling, factory-method",
"url": null
} |
## Latex Math Letters | {
"domain": "site-photographer.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9372107949104865,
"lm_q1q2_score": 0.8372192158871655,
"lm_q2_score": 0.8933094032139576,
"openwebmath_perplexity": 2403.9701909023875,
"openwebmath_score": 0.911067545413971,
"tags": null,
"url": "http://ddhk.site-photographer.it/latex-math-letters.html"
} |
cryptography, encryption
Title: RSA cryptosystem: Encrypting a signed message I've started to read the section about the RSA cryptosystem in CLRS (page 958) and I don't understand the way it describes how to encrypt a signed message.
If Bob wants to send a message $M$ to Alice:
Bob takes $M$ and encrypts it (using Alice's public key): $P_A(M) = C$.
Sends $C$ to Alice.
She decrypts it using her private key: $S_A(C) = S_A(P_A(M)) = M$.
If Alice wants to send a signed message $M'$ to Bob (page 961):
She computes the digital signature of $M'$ (with her private key): $\sigma = S_A(M')$.
Sends the pair $(M', \sigma)$ to Bob.
Bob receives the pair and check the message authenticity by comparing $M'$ and $P_A(\sigma)$.
If Alice want to send an encrypted, signed message $M'$ to Bob.
In cursive is what I think (I don't know how) it goes. | {
"domain": "cs.stackexchange",
"id": 14483,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cryptography, encryption",
"url": null
} |
Worksheet. (a) cm² (b) cm² Question 2 Find the areas and perimeters of the shapes below. Worksheet is 2 pages total ~ plus th by biggieb. Great practice of Geometry Area-of-Irregular-Figures, also known as Composite-Figures or Compound-Shapes. 10 3 Area Of Composite Figures Practice Worksheets - there are 8 printable worksheets for this topic. Save. 9th - 12th grade. Created by. This video shows you how to find the area of composite shapes and then has some practice questions for you to try. Lesson Worksheet: Area of Composite Shapes Mathematics In this worksheet, we will practice finding the areas of composite shapes formed of squares, rectangles, triangles, and parallelograms. Q1: Calculate the area of the gray part. Composite Figures: Level 4 Challenges Composite Figures: Level 2 Challenges The figure above shows three consecutive squares of sides 5, 4 and 3, respectively. In most cases, you can separate the composite figures into simpler shapes whose areas you can find, and then | {
"domain": "co.za",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9643214480969029,
"lm_q1q2_score": 0.8117905310294954,
"lm_q2_score": 0.8418256512199033,
"openwebmath_perplexity": 2002.8074878856394,
"openwebmath_score": 0.37977302074432373,
"tags": null,
"url": "https://wwc.co.za/assassins-creed-yqp/area-of-composite-figures-practice-4d37e7"
} |
electromagnetism, field-theory, tensor-calculus, variational-calculus
Title: A query in a step when deriving Maxwell's equations from stationary action When varying the Maxwell action, one gets to the following part
$$
\begin{align}
\delta \left(F^{\mu \nu} F_{\mu \nu}\right) &= 2 F^{\mu \nu} \delta F_{\mu \nu} \\
&= 2 F^{\mu \nu} \left(\partial_\mu \delta A_\nu - \partial_\nu \delta A_\mu\right) \\
&= 4 F^{\mu \nu} \partial_\mu \delta A_\nu
\end{align}
$$
However, how does one actually get from the second last step to the last step? I tried to write out the indices and I got double of the term in the second last step (without the factor of 2) instead. There are dummy summation indices in $F^{\mu\nu}\partial_{\nu}\delta A_{\mu}$. Make the change $ \mu \rightarrow \nu$ and $\nu \rightarrow \mu$. You will get $F^{\nu\mu}\partial_{\mu}\delta A_{\nu}$. And now simply use the antisymmetry of the Faraday field tensor to get rid of the minus sign. | {
"domain": "physics.stackexchange",
"id": 80950,
"lm_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, field-theory, tensor-calculus, variational-calculus",
"url": null
} |
magnetic-fields
I have no idea what whoever you read meant when they wrote that a magnetic field “has three dimensional relevance”. However, like an electric field, a magnetic field exists in three-dimensional space, and at each point it is a vector that points in a particular direction in three-dimensional space.
Magnetic fields may or may not depend on time. If you have a bar magnet lying on a table, its magnetic field field does not change. But if an electrical current is flowing through a wire and you increase the current, the magnetic field around the wire will get stronger. A moving point charge has time-dependent electric and magnetic fields; at any point, they are strong when the particle passes by, and weak when the particle is not near. An electromagnetic wave consists of time-varying electric and magnetic fields. | {
"domain": "physics.stackexchange",
"id": 54719,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields",
"url": null
} |
json, bash, r
// R build / send current selection to interactive R
{"keys": ["super+'"], "command": "build", "args": {"variant": "r_send_selection"} },
// R build / generate output.Rout and plots files from, non-interactive
{"keys": ["ctrl+shift+b"], "command": "build", "args": {"variant": "r_output"} }
] In the main loop of the script,
you don't need the $a variable.
You can use an infinite loop,
and break out of it when the if condition becomes true.
You also don't need the semicolons at the end of the lines.
The script can be simplified to:
while :; do
if xdotool search --name 'Running R' windowactivate --sync; then
xdotool key --window 0 ctrl+shift+v
echo 'Initialized.'
break
fi
sleep 2 # decreasing the value increases asynchrony behavior.
done
As for this comment:
# in this workaround
# I could not find a better way to properly
# catch the terminator ending,
# after it receives the 'Running R' name. | {
"domain": "codereview.stackexchange",
"id": 11863,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "json, bash, r",
"url": null
} |
neural-networks, deep-learning, convolutional-neural-networks, computer-vision, model-request
I'm able to achieve this much - and then find their difference or do some kind of preprocessing so that a neural net could learn from it. If this is not quite possible, then is there a type of neural network out there which could detect very small features from an image and learn from it. I have tried Convolutional Neural Network but that also isn't working very well or I'm not applying them efficiently. From what I understand, don't bother with a CNN, you have essentially perfectly structured images.
You can hand code detectors to measure how much filled in a circle is.
Basically do template alignment and then search over the circles.
Ex a simple detector would measure the average blackness of the circle which you could then threshold. | {
"domain": "ai.stackexchange",
"id": 2013,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks, deep-learning, convolutional-neural-networks, computer-vision, model-request",
"url": null
} |
python, pandas
Title: Create new columns in a DataFrame using functions and reposition the new columns I would like a review regarding the method I use to create the new columns and then reposition them in the correct place where they should be.
The new column called total_matched_vls should always be on the right side of the column called total_matched, which in the original CSV is at position 10
The new column called market_matched_vls should always be on the right side of the column called market_matched, which in the original CSV is at position 12
import pandas as pd
def calc_back(df):
if (df['result'] == 'WINNER'):
return (df['odds']-1)*0.935
elif (df['result'] == 'LOSER'):
return -1
else:
return ''
def calc_lay(df):
if (df['result'] == 'LOSER'):
return (1/(df['odds']-1))*0.935
elif (df['result'] == 'WINNER'):
return -1
else:
return '' | {
"domain": "codereview.stackexchange",
"id": 44138,
"lm_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, pandas",
"url": null
} |
14. billh,
I see your point. You are correct in a way.
[sqrt(4 -x^2)]dx can be viewed as the dA for the area above the x-axis of the circle centered at the origin with radius = 2 units.
The whole circle is x^2 +y^2 = 2^2
Or, x^2 +y^2 = 4.
Then, solving for y,
y^2 = 4 -x^2
y = +,-sqrt(4 -x^2)
Meaning, the positive y's are above the x-axis, so y = sqrt(4 -x^2) is any y-coordinate above the x-axis.
So, if we want to get the area of the said circle above the x-axis, by integration, then we may integrate horizontally with dA = y*dx
Then,
A = INT.(-2 -> 2)[y]dx
Converting y into x-terms,
A = INT.(-2 -> 2)[sqrt(4 -x^2)]dx
A = [2(arcsin(x/2)) +(1/2)(x*sqrt(4-x^2))] (-2 -> 2)
A = [2(arcsin(2/2)) +(1/2)(2*sqrt(4 -2^2))] - [2(arcsin(-2/2)) +(1/2)(-2*sqrt(4 -(-2)^2))]
A = [2(arcsin(1) +(1/2)(2*sqrt(0))] - [2(arcsin(-1) +(1/2)(-2*sqrt(0))]
A = [2(p1/2) +0] -[2(-pi/2) +0]
A = pi -(-pi)
A = 2pi sq.units | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513881564148,
"lm_q1q2_score": 0.8458892038666984,
"lm_q2_score": 0.8577681013541613,
"openwebmath_perplexity": 3966.1428553028854,
"openwebmath_score": 0.9020524024963379,
"tags": null,
"url": "http://mathhelpforum.com/calculus/37-integrate-sqrt-4-x-2-dx.html"
} |
ros, cmake, qt
Title: ROS Answers SE migration: qtcreator ros
Hi,
i try to combine ros with qt. I want to develop some GUI including ros. I created a package with roscreate-pkg then i’ve created a QTProject copy whole cpp, h and ui files into the main folder of my package. Then i edit the CMakeLists.txt and tipped in the whole cpp h and ui files. When i launch CMakeLists.txt from qtcreator i’ve got:
C
Make Error at CMakeLists.txt:2 (include):
include could not find load file:
/core/rosbuild/rosbuild.cmake
CMake Error at CMakeLists.txt:12 (rosbuild_init):
Unknown CMake command "rosbuild_init".
-- Configuring incomplete, errors occurred!
This is my CmakeLists.txt
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) | {
"domain": "robotics.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": "ros, cmake, qt",
"url": null
} |
genetics, molecular-biology, cell-biology, cancer, mutations
You can also have a situation where you have transcriptional regulators of proto-oncogenes that can be effected making the gene product oncogenic. If there is a mutation in an enhancer (intronic) of the gene that affects the binding kinetics of enhancers leading to a great increase in transcription, this concentrational difference can lead to uncontrolled grown and tumor formation. | {
"domain": "biology.stackexchange",
"id": 4776,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "genetics, molecular-biology, cell-biology, cancer, mutations",
"url": null
} |
@ex0du5: I was not being pedantic; I was concerned that Nicolò was using the wrong term for the repeated-division method for converting bases (which is generally used for integers) as shown in the answers to these questions: Converting decimal (base 10) numbers to binary by repeatedly dividing by 2, Convert numbers from one base to another using repeated divisions – robjohn Feb 12 '13 at 21:19
@robjohn: Yes, that's exactly what I said. I said that the answer Nicolo wrote was addressing what was asked, but "It's also clear the OP intended to ask about other representations and just didn't use the right terms". I was the one who had a pedantic point that Nicolo's answer was relevant as stated. I didn't call you pedantic. I just pointed out your comment on the euclidean algorithm didn't seem to understand why it was relevant here. – ex0du5 Feb 14 '13 at 18:59 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811631528337,
"lm_q1q2_score": 0.8454682584116457,
"lm_q2_score": 0.8757869851639066,
"openwebmath_perplexity": 935.5141489496608,
"openwebmath_score": 0.7899264097213745,
"tags": null,
"url": "http://math.stackexchange.com/questions/301435/fractions-in-binary"
} |
Q&A
# Show that $f(x) = \arctan\left(\frac{x}{x+1}\right) + \arctan\left(\frac{x+1}{x}\right) = \frac{\pi}{2}$
+3
−0
Show that $$f(x) = \arctan\left(\frac{x}{x+1}\right) + \arctan\left(\frac{x+1}{x}\right) = \frac{\pi}{2} \quad \forall x \in (-\infty, -1)\large\cup (0, \infty)$$
I observed this feature graphically, but am looking for a way to prove it. My attempt is as follows:
We can show that $$\arctan(A) + \arctan(B) = \arctan\left(\frac{A+B}{1 - AB}\right)$$ It follows that
$$\displaylines{f(x) = \arctan\left(\frac{x}{x+1}\right) + \arctan\left(\frac{x+1}{x}\right) = \arctan\left(\frac{\frac{x}{x+1} + \frac{x+1}{x}}{1 - \left(\frac{x}{x+1}\right)\left(\frac{x+1}{x}\right)}\right) \cr = \arctan\left(\frac{\frac{x}{x+1} + \frac{x+1}{x}}{1 - 1}\right) = \arctan\left(\frac{\frac{x}{x+1} + \frac{x+1}{x}}{0}\right) = \arctan(\infty) = \boxed{\frac{\pi}{2}}}$$ | {
"domain": "codidact.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631679255076,
"lm_q1q2_score": 0.8109770711180386,
"lm_q2_score": 0.8221891261650247,
"openwebmath_perplexity": 153.33214065708088,
"openwebmath_score": 0.9748053550720215,
"tags": null,
"url": "https://math.codidact.com/posts/286829"
} |
ros, dwa-local-planner
global_costmap:
global_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 1.0
track_unknown_space: true
static_map: true
transform_tolerance: 0.5
static_layer:
track_unknown_space: true
enabled: true
map_topic: "/map"
inflation_layer:
enabled: true
cost_scaling_factor: 10
inflation_radius: 2.0
track_unknown_space: true
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"} | {
"domain": "robotics.stackexchange",
"id": 29423,
"lm_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, dwa-local-planner",
"url": null
} |
snp, plink
Title: Using PLINK to find SNPs in LD (Linkage Disequilibrium) with another set of SNPs I have a list of SNPs (index SNPs). As my tagging SNPs, I want to use SNP data from here. The data has the following column headers: Chromosome, Position, MarkerName, Effect_allele, Non_Effect_allele, Beta, SE, Pvalue.
My ultimate aim is to identify SNPs in the tagging set that are in LD with each of index SNPs. I need to calculate r2 between index SNPs and tagging SNPs within 1MB window and get a table of index vs tagging SNPs (r2>0.8). | {
"domain": "bioinformatics.stackexchange",
"id": 308,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "snp, plink",
"url": null
} |
newtonian-mechanics, angular-momentum, rotational-dynamics, collision, torque
And my second question is can the point of reference be chosen at a point other than the center of mass (but still be on the stick), and calculate the torque about that point and still be able to calculate the stick's motion after collision? I've thought about picking the point the ball collides with the stick as the point of reference. Then by the definition of torque, the torque will be $0$, which implies there will be no rotation at all? Why is this reasoning incorrect?
Suppose a ball moves horizontally to the right and hits a vertical stick at a position closer to its upper end. I understand intuitively, the stick will have linear and angular momentum, and that it will spin around its center of mass. | {
"domain": "physics.stackexchange",
"id": 65058,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, angular-momentum, rotational-dynamics, collision, torque",
"url": null
} |
android-core, rosjava, android
(the manually installed) lse_xsens_mti, cereal_port, hector_mapping, hector_imu_attitude_to_tf
rosjava, rosjava_tutorial_services, rosjava_messages, rosjava_bootstrap, rosjava_geometry, rosjava_actionlib, rosjava_actionlib_tutorial, rosjava_tutorial_pubsub,
polling_input_stream
compressed_visualization_transport_msgs
compressed_visualization_transport
google_handheld_slam
hokuyo
android_tutorial_image_transport, android_tutorial_camera, android_acm_serial, android_tutorial_hokuyo, android_tutorial_teleop, android_tutorial_pubsub, android_gingerbread, android_honeycomb_mr2
compressed_image_transport
...
So what did I miss to build android_core?
Thanks in advance!
Best regards,
Andreas
@Gemini: It was something about my android setup but unrelated to ROS. Sorry I can't remember how I've solved it. | {
"domain": "robotics.stackexchange",
"id": 9067,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "android-core, rosjava, android",
"url": null
} |
Thanks!
• Voting to close as "needs clarity". OP keeps saying (in comments) that coprimeness is an assumption in the usual proof of irrationality of $\sqrt2$, even after it was explained several times that it is not an assumption but rather information obtained by a preliminary construction, namely reducing the fraction. Sep 19, 2020 at 16:29
• I’m voting to close this question because OP is obstinate in comments. Sep 19, 2020 at 18:53
(An answer because this is a little long for a comment) Here is a proof which does not use coprimality, but is essentially the same: Suppose that $$a/b = \sqrt{2}$$ where $$a$$ and $$b$$ are integers. Then $$a=\sqrt{2}b$$ and so $$a^2 = 2 b^2$$ where both sides are integers. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9632305307578323,
"lm_q1q2_score": 0.8148375828792548,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 233.46436965790838,
"openwebmath_score": 0.8380909562110901,
"tags": null,
"url": "https://matheducators.stackexchange.com/questions/18871/missing-step-in-most-proofs-of-the-irrationality-of-sqrt2"
} |
and cosine can be derived easily from the sum formulas, using the identities for negative angles. The sum-to-product formulas are used to rewrite sum or difference as products of sines and cosines. Numerical methods probably should have been emphasized even more in the text, since it is rare when even a moderately complicated trigonometric equation can be solved with elementary methods, and since mathematical software is so readily available. Inverse Trigonometric Functions. The angle sum and difference formulas for sine and cosine are sometimes referred to as Simpson's formulas. Trigonometric Identities are some formulas that involve Trigonometric functions. The angle sum and difference formulas for the inverse trigonometric functions are: TRIGONOMETRIC IDENTITIES. Solving for x means finding the values of the trig arcs x whose trig functions make the trig equation true. See [link] . Right Triangle Trigonometry. 1 Solving Trigonometric Equations and Identities 413 Try it Now 2. | {
"domain": "jimmec.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815523039175,
"lm_q1q2_score": 0.8040733530335388,
"lm_q2_score": 0.8128673155708975,
"openwebmath_perplexity": 564.1065187435921,
"openwebmath_score": 0.8320470452308655,
"tags": null,
"url": "http://jimmec.com/fvh/how-are-sum-and-difference-identities-used-in-solving-trigonometric-equations.html"
} |
Veritas Prep Reviews
Manager
Joined: 03 Jan 2015
Posts: 67
Concentration: Strategy, Marketing
WE: Research (Pharmaceuticals and Biotech)
Re: Each year for 4 years, a farmer increased the number of trees in a [#permalink]
### Show Tags
06 Jan 2015, 10:39
1
KUDOS
Trees increase by 1/4 the number of trees in preceding year. Hence, correct answer must be divisible by 4. Based on divisibility rules, if last 2 digits are divisible by 4 then the number is divisible by 4. Thus, we can eliminate A, B, C. The answer has to be D or E.
Again, trees increase by 1/4 the number of trees in preceding year. Hence, the number of trees increase by 5/4 times the number of trees the preceding year.
If x = initial number of trees = Answer D or E = 2560 or 2752
Year 1 = 5/4x
Year 2 = (5/4)(5/4)x
Year 3 = (5/4)(5/4)(5/4)x
Year 4 = (5/4)(5/4)(5/4)(5/4)x
Only for Answer D: (5/4)(5/4)(5/4)(5/4) 2560 = 6250 | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 1,
"lm_q1q2_score": 0.8577681049901036,
"lm_q2_score": 0.8577681049901036,
"openwebmath_perplexity": 1384.2064824380445,
"openwebmath_score": 0.570276141166687,
"tags": null,
"url": "https://gmatclub.com/forum/each-year-for-4-years-a-farmer-increased-the-number-of-trees-in-a-135487.html"
} |
quantum-mechanics, mathematical-physics, angular-momentum, operators, schroedinger-equation
Title: Radial quantum number for infinite circular well For completeness, I will sketch the solution of a particle in an infinite circular well first and then get to my question. I apologize in advance since the introduction is standard undergraduate quantum mechanics. | {
"domain": "physics.stackexchange",
"id": 27934,
"lm_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, mathematical-physics, angular-momentum, operators, schroedinger-equation",
"url": null
} |
classical-mechanics, lagrangian-formalism, hamiltonian-formalism, potential, variational-principle
V. Berdichevsky, Variational Principles of Continuum Mechanics: I. Fundamentals, 2009; Appendix B. | {
"domain": "physics.stackexchange",
"id": 19987,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, lagrangian-formalism, hamiltonian-formalism, potential, variational-principle",
"url": null
} |
entity sets. C D 4 10 8 6 1 2 7 3 5 9 A number is chosen at random from. 30 students are asked if they have a dog or cat. Create beautiful venn diagrams using this tool and download as image (png or jpg). See more ideas about venn diagram, diagram, venn diagram template. They are extensively used to teach Set Theory. Example 6: Shade the portion of the Venn diagram that represents the given set. A Venn diagram, named after John Venn, is a diagram representing all possible logical relations between a finite collection of different sets. A diagram that shows sets and which elements belong to which set by drawing regions around them. Venn Diagrams A Venn diagram is a drawing in which sets are represented by geometric figures such as circles and rectangles. A Venn diagram (also known as a set diagram or logic diagram) is a diagram that shows all possible logical relations between a finite collection of different sets. In business, Venn diagrams are used to compare products, processes, | {
"domain": "1upload.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769042651874,
"lm_q1q2_score": 0.8576752802971456,
"lm_q2_score": 0.8791467659263148,
"openwebmath_perplexity": 789.4183828942959,
"openwebmath_score": 0.4094984829425812,
"tags": null,
"url": "http://zveg.1upload.de/r-venn-diagram-6-sets.html"
} |
quantum-operation, hamiltonian, hilbert-space
and
$$ \Phi(\rho) = (\Phi_2\circ \Phi_1)(\rho) = \text{Tr}_{\mathcal{K}'}(e^{iH'(t_1+t_2)/\hbar}\rho\otimes \vert 0\rangle\langle 0\vert e^{-iH'(t_1+t_2)/\hbar })$$
But there doesn't seem to be any guarantee that such objects exist just from Stinespring's dilation. That is, we can find some $H$ and $t$ such that $V = e^{iHt/\hbar}$ (where $V$ is an isometry in the Stinespring dilation of $\Phi$), but I don't think there are any guarantees about $e^{iHt_1/\hbar}$.
Is there any way to prove that there is some Stinespring dilation that satisfies my physical intuition, or is there a counterexample? Some pair of channels where no Hamiltonian for the composed channel induces the first channel at some earlier time? TL;DR: In general, this cannot be done exactly, because of the relationship between the eigenvectors of $A$ and $e^A$. | {
"domain": "quantumcomputing.stackexchange",
"id": 4531,
"lm_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-operation, hamiltonian, hilbert-space",
"url": null
} |
quantum-mechanics, homework-and-exercises, wavefunction, atomic-physics, orbitals
Title: Different versions for the Radial Solution of the Hydrogen Atom Initially, I'm trying to prove if the following is true
$$|\psi_{n00}(r=0)|^2 =\dfrac{1}{\pi n^3a_0^3}$$
I'm looking to solve some calculations made in
Introductory Quantum Optics
Christopher Gerry Lehman College, City University of New York
Peter Knight Imperial College London and UK National Physical Laboratory
and in the section 2.6, page 31, the past equation is numbered as $(2.164)$. Even as I tried to do all the math behind it, i'm not reaching the said result.
The hydrogen atom solution is
$$\psi_{nlm_l}=R_{nl}(r)Y_{lm}(\theta,\phi)$$
One of the radial solutions I've found is
$$R_{nl}(r)=-\left(\dfrac{2}{na_0}\right)^{3/2}\sqrt{\dfrac{(n-l-1)!}{2n[(n+l)!]^3}}\left(\dfrac{2r}{na_0}\right)^le^{-r/na_0}L_{n-\ell-1}^{2l+1}\left(\dfrac{2r}{na_0}\right)$$
This radial solution is the one found in Sakurai, Zetilli, Messiah, and many others. Only the one from Wikipedia gives the result I'm trying to prove, which is | {
"domain": "physics.stackexchange",
"id": 90588,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, homework-and-exercises, wavefunction, atomic-physics, orbitals",
"url": null
} |
datetime, objective-c, cocoa-touch
components.hour = 7;
NSDate *nextSevenAm = [calendar nextDateAfterDate:[NSDate date]
matchingComponents:components
options:NSCalendarMatchNextTimePreservingSmallerUnits];
components.hour = 19;
NSDate *nextSevenPm = [calendar nextDateAfterDate:[NSDate date]
matchingComponents:components
options:NSCalendarMatchNextTimePreservingSmallerUnits];
NSDate *nextSeven = nextSevenAm;
if ([nextSeven compare:nextSevenPm] == NSOrderedDescending) {
nextSeven = nextSevenPm;
}
return nextSeven;
}
Importantly, this approach with account correctly for things like daylight savings time and leap seconds, which the original solution does not. | {
"domain": "codereview.stackexchange",
"id": 12808,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "datetime, objective-c, cocoa-touch",
"url": null
} |
python, performance, python-2.x
So what do you notice about that? In terms of multiples of 5, since we're talking about a weakly increasing sequence - and a sequence that increases extremely predictably at that:
S = 2*1 + 3*5 + 4*5 + 5*5 + 6*5 + 7*5 + 8*4
S = 2*5 + 3*5 + 4*5 + 5*5 + 6*5 + 7*5 + 8*4 - 2*4
S = 5*(2+3+4+5+6+7) + (8*4 - 2*4)
I split the 8 and 2 out separately, those are the two ends and are always going to be the edge cases. You can see that 14%5 == 4 and 43%5 == 3, so those almost give us the two multiples we need. We just need to add one to the latter:
sum_to = lambda n: n*(n-1)/2
S = 5 * (sum_to(hi//5) - sum_to(lo//5))
+ (hi % 5 + 1) * (hi // 5) - (lo % 5) * (lo // 5) | {
"domain": "codereview.stackexchange",
"id": 16403,
"lm_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",
"url": null
} |
ros, navigation, ros2, yaml
- nav2_wait_action_bt_node
- nav2_clear_costmap_service_bt_node
- nav2_is_stuck_condition_bt_node
- nav2_goal_reached_condition_bt_node
- nav2_goal_updated_condition_bt_node
- nav2_initial_pose_received_condition_bt_node
- nav2_reinitialize_global_localization_service_bt_node
- nav2_rate_controller_bt_node
- nav2_distance_controller_bt_node
- nav2_speed_controller_bt_node
- nav2_truncate_path_action_bt_node
- nav2_goal_updater_node_bt_node
- nav2_recovery_node_bt_node
- nav2_pipeline_sequence_bt_node
- nav2_round_robin_node_bt_node
- nav2_transform_available_condition_bt_node
- nav2_time_expired_condition_bt_node
- nav2_distance_traveled_condition_bt_node | {
"domain": "robotics.stackexchange",
"id": 37856,
"lm_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, ros2, yaml",
"url": null
} |
organic-chemistry, stereochemistry, isomers, chirality, erratum
(f) The correct response is no, which I agree with. However, it doesn't seem to concur with the response for the follow-up question.
Follow-up: Which image has three planes of symmetry? The correct answer is apparently, (f). My response would have been (e). Let us address the elephant in the room first and foremost. All of these objects do not have any symmetry if you wanted to get real technical about it. However, let us just assume certain things for this useful exercise to be relevant.
b.) The teacup has a vertical plane of symmetry splitting the teacup in half along the handle axis and intersecting with the centroid of the cup and saucer. I would say that your guess is correct though it would be useful to have drawn in a plane rather than simply a line (for all examples).
c.) At first glance the pliers have a couple planes of symmetry BUT upon further thought it may not due to the way the rotating JOINT is constructed. See the example below: | {
"domain": "chemistry.stackexchange",
"id": 3471,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, stereochemistry, isomers, chirality, erratum",
"url": null
} |
javascript
You say you would like to locate attribute via a numeric index. This is possible but I can guarantee you will regret that approach very quickly.
Programmers are inherently lazy, we write code because it makes things easier to do. Many beginners miss this point and find themselves writing huge tracts of repeated names, code, tables, and whatnot. As a classic example your code
document.getElementById(attArray[0]).innerHTML = attObj.strength;
document.getElementById(attArray[1]).innerHTML = attObj.dexterity;
document.getElementById(attArray[2]).innerHTML = attObj.stamina;
document.getElementById(attArray[3]).innerHTML = attObj.presence;
document.getElementById(attArray[4]).innerHTML = attObj.manipulation;
document.getElementById(attArray[5]).innerHTML = attObj.composure;
document.getElementById(attArray[6]).innerHTML = attObj.intelligence;
document.getElementById(attArray[7]).innerHTML = attObj.wits;
document.getElementById(attArray[8]).innerHTML = attObj.resolve; | {
"domain": "codereview.stackexchange",
"id": 32962,
"lm_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",
"url": null
} |
reference-request, ds.data-structures
Title: Simple proof that splay trees have the dynamic finger property? Splay trees are conjectured to be dynamically optimal, and they're known to have a number of nice properties, including the dynamic finger property, which says that the amortized cost of an access in a splay tree is logarithmic in the magnitude of the rank difference between the queried key and the most-recently-queried key.
It seems like the first proof that splay trees have the dynamic finger property comes from a two-paper series by Cole et al ("On the Dynamic Finger Conjecture for Splay Trees I: Splay Sorting $\log n$-Block Sequences" and "On the Dynamic Finger Conjecture for Splay Trees II: The Proof.") These papers collectively are over eighty pages long and involve fairly complicated, technical proofs. They also seem to be the papers cited by future work in splay trees and related structures when referring to the dynamic finger property. | {
"domain": "cstheory.stackexchange",
"id": 4681,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, ds.data-structures",
"url": null
} |
experimental-physics, microscopy, image-processing
Title: Error calculation of physical quantities calculated from a image I have an assignment related with the physical characterization of some images taken in a SEM (microscope). I have images of some salt grains and the goal is to find the area and perimeter of those grains.
So far I have achieved this by using some image processing techniques (a python script to read the image, clean the noise and count the pixels in the regions of interest) and using a scale that is provided in the image, I convert the pixel units measured to physical units (millimeters or micrometers; depends on the image). As usual in experimental physics, the errors related to the quantities measured are needed.
In this case how is the best approach to report the measures? I can't simply say that my value is $x$ and not saying with what precision. | {
"domain": "physics.stackexchange",
"id": 35221,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "experimental-physics, microscopy, image-processing",
"url": null
} |
beginner, c, number-guessing-game
}//End error_handle1() Comments
Comments should tell the reader why you're doing something, not what you're doing. Comments like this are redundant:
//For Option 6
//
void menu_6();
Method Naming
Consider giving your functions more meaningful names that describe what they do. Using the example above, menu_6. Unless you already have the menu in your head the name is meaningless. A better name might be menu_exit_game.
Magic Numbers Vs Defines
Replacing magic numbers with meaningful constants is a good thing, however simply replacing a magic number with it's word value adds little value. Consider:
#define ZERO 0
What should ZERO be used for? You're using it as a direct replacement for 0 in your code, but not always:
int selectOnefirst = 0; | {
"domain": "codereview.stackexchange",
"id": 20844,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, c, number-guessing-game",
"url": null
} |
dirac-delta-distributions, statistics, correlation-functions, stochastic-processes
2) Why is "zero correlation in space" sensible?
This is a matter of scales. Every process has its time and length scale. The assumption of $\delta$-correlation is sensible if the length and time scale associated with the fluctuation of your random force are negligible compared to the time and length scales associated with the motion of your particle (or random field, whatever your system is describing). Let's take two length scales, the microscopic length scale $l_{\textrm{mic}}$ and a mesoscopic length scale $l_{\textrm{mac}}$. Now, ignoring time dependence, the random noise correlation in your system may be of the form $\langle\xi(x_1)\xi(x_2)\rangle = C e^{-|x_1 - x_2|/l_{\textrm{mic}}}$. The constant may depend on $l_{\textrm{mic}}$. But for $l_{\textrm{mic}} \ll l_{\textrm{mac}}$, the exponential will drop off very fast on the length scale you are solving your Langevin equation (or what it may be) on. In principle, you will end up with integrals of the form | {
"domain": "physics.stackexchange",
"id": 62990,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dirac-delta-distributions, statistics, correlation-functions, stochastic-processes",
"url": null
} |
human-anatomy
References:
Brian Cotterell, Fracture and Life, Imperial College Press, 2010 p.77 bottom paragraph via http://bionumbers.hms.harvard.edu//bionumber.aspx?id=108642&ver=2
Bone density. (2014, September 15). In Wikipedia, The Free Encyclopedia. Retrieved 17:08, September 29, 2014, from http://en.wikipedia.org/w/index.php?title=Bone_density&oldid=625737182
http://www.niams.nih.gov/Health_Info/Bone/Bone_Health/bone_mass_measure.asp
http://www.niams.nih.gov/Health_Info/Bone/Osteoporosis/bone_mass.asp | {
"domain": "biology.stackexchange",
"id": 2849,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-anatomy",
"url": null
} |
mathematical-physics, group-theory, group-representations, representation-theory
$$J^2 = j(j+1)\cdot 1_{\text{GL}_n(\mathbb C)}.$$
Since there is no way of linking two irreducible representations that have a different representation of the Casimir operator (i.e. a different value of $j$) by an intertwiner, every value of $j$ gives you a different (i.e. unitarily inequivalent) irreducible representation.
For the second question, the above argument shows that a test for the irreducibility of a representation is just to check that its commutant is trivial. | {
"domain": "physics.stackexchange",
"id": 88997,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mathematical-physics, group-theory, group-representations, representation-theory",
"url": null
} |
javascript, jquery, css, animation
All of the jQuery operations on $('#small') should be done in the same chain.
Clearing the class then calling addClass() is a roundabout way of just setting the class property.
function() { call(); } could just be simplified to call. | {
"domain": "codereview.stackexchange",
"id": 11708,
"lm_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, css, animation",
"url": null
} |
ros, joy-node, joy
I can see that the joy has support for the Xbox 360 Wireless controller
It's hopefully clear that joy doesn't really have support for anything. It just uses the regular Linux joystick (or really: input sub system) support.
I expect the joy node will pick the jsX devices up and from there on things should just work (provided you configure the mapping).
Originally posted by gvdhoorn with karma: 86574 on 2017-07-06
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by tgaspar on 2017-07-06:
Thank you very much for your answer.
I did check if the Xbox One Wireless controller has a Linux driver and came to the same conclusion as you did: that it should work. But of course I wanted to hear a second opinion on that.
I will provide my findings and update once I try it.
Thanks again. | {
"domain": "robotics.stackexchange",
"id": 28298,
"lm_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, joy-node, joy",
"url": null
} |
0: Theorem (Divergence Theorem for Incompressible Fields). In this theorem note that the surface S S can actually be any surface so long as its boundary curve is given by C C. (a) Z c y2 dx+ x2 dy C: The triangle bounded by x= 0, x+ y= 1, y= 0. Determine the divergence of this vector field and evaluate the integral of this quantity over the interior of a cube of side a in z> or equal to 0, whose base has the vertices (0,0,0), (a,0,0), (0,a,0), (a,a,0). Green's theorem, Stokes' theorem, and Divergence theorem Green's theorem 1. Verify the divergence theorem for F = xi + yj + zk and S= sphere of radius a. State Divergence theorem. Math 6B Practice Problems I Written by Victoria Kala [email protected] the orientation on S is outward that is, the unit normal vector n^ is directed outward from E). In vector calculus, the divergence theorem, also known as Gauss's theorem or Ostrogradsky's theorem, is a result that relates the flux of a vector field through a closed surface to the divergence | {
"domain": "saltotech.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9904405991009794,
"lm_q1q2_score": 0.8253585073266065,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 476.73427828009363,
"openwebmath_score": 0.9027653932571411,
"tags": null,
"url": "http://saltotech.it/xmyz/verify-the-divergence-theorem-by-evaluating.html"
} |
java, swing, simulation, graphics, physics
If you decide to save the accelerations vectors, however, it would IMO make more sense to add the x and y acceleration components directly as properties of the Particle class, rather than storing them in a separate map. You could then also move the total force / acceleration calculation into the Particle class, letting each particle compute the total repulsive force it experiences, given a list of all the (other) particles in the system. Since your particles already handle the pairwise force calculations anyway, this would seem natural to me.
Finally, note that your current simulation algorithm takes O(n²) time to simulate a system with n particles, since it needs to compute the forces between each pair of particles. If you wish to simulate a large number of particles, you should consider using something like the Barnes–Hut algorithm, which can simulate n particles in O(n log n) time by approximating the forces using a spatial subdivision scheme. | {
"domain": "codereview.stackexchange",
"id": 27675,
"lm_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, swing, simulation, graphics, physics",
"url": null
} |
complexity-theory, optimization, linear-programming
Title: Complexity of linear programming with restricted quadratic constraints A problem instance is a linear program with the following kind of quadratic inequalities allowed: For some of the variables $x_i$, there is a variable $s_i$ (intuitively for approximating $x_i^2$, and distinct from all the $x_j$) and positive constants $l_i,r_i$, such that the following constraints are also included:
$l_i ≤ x_i ≤ r_i$ (confined to boxes; this is the case for every variable in my application)
$l_i x_i ≤ s_i ≤ r_i x_i$ (minor improvement over $l_i^2 ≤ s_i ≤ r_i^2$)
$s_i ≥ x_i^2$ (the approximation is tightly constrained from below, only)
Only the third line is quadratic. I include the first two lines in case they make the problem more tractable. | {
"domain": "cs.stackexchange",
"id": 12849,
"lm_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, optimization, linear-programming",
"url": null
} |
organic-chemistry, nomenclature
The nomenclature of tricyclic hydrocarbons is based on the nomenclature of bicyclic systems. The additional steps for the naming of tricyclic hydrocarbons are described in the current version of Nomenclature of Organic Chemistry – IUPAC Recommendations and Preferred Names 2013 (Blue Book) as follows. | {
"domain": "chemistry.stackexchange",
"id": 4066,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature",
"url": null
} |
knowrob, rosrun
Originally posted by moritz with karma: 2673 on 2012-08-06
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by sam on 2012-08-06:
If two way both can load ias_semantic_map, why the way which use rosrun couldn't run visualisation_canvas? I have edited on the orginal post. Thank you~
Comment by moritz on 2012-08-06:
You either need to use
$ rosrun rosprolog rosprolog mod_vis
?- register_ros_package(ias_semantic_map).
or
$ rosrun rosprolog rosprolog ias_semantic_map
?- register_ros_package(mod_vis).
Comment by moritz on 2012-08-06:
You can check with rospack, neither package depends on the other one, so neither will be initialized if you launch KnowRob with the other one as argument. You need to load the package you haven't use as argument to rosprolog manually using register_ros_package. | {
"domain": "robotics.stackexchange",
"id": 10489,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "knowrob, rosrun",
"url": null
} |
electrostatics, capacitance, dielectric
And Did the shown Charge distribution.
Later he equated the potentials and stuff like so
$$V_{Q'_1,Q'_2}=\frac{Q'd}{K_1\epsilon_oA}+\frac{Q'd}{K_2\epsilon_oA}~~~~....1$$
$$V_{Q''_1,Q''_3}=\frac{Q''d}{K_1\epsilon_oA}+\frac{Q''d}{K_3\epsilon_oA}~~~~....2$$
then said that $V_{Q'_1,Q'_2}=V_{Q''_1,Q''_3}$ he then put the values of $Q',Q''$ in the equation $$C=\frac{Q'+Q''}{V}$$
Basically getting a result that was quite different from the result given in books . | {
"domain": "physics.stackexchange",
"id": 3687,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, capacitance, dielectric",
"url": null
} |
python, beginner, python-3.x, tic-tac-toe
print("|" + game_board[0][2] + "|" + game_board[1][2] + "|" + game_board[2][2] + "|")
if location == 6:
game_board[2][1] = 'o'
print("|" + game_board[0][0] + "|" + game_board[1][0] + "|" + game_board[2][0] + "|")
print("|" + game_board[0][1] + "|" + game_board[1][1] + "|" + game_board[2][1] + "|")
print("|" + game_board[0][2] + "|" + game_board[1][2] + "|" + game_board[2][2] + "|")
if location == 7:
game_board[0][2] = 'o'
print("|" + game_board[0][0] + "|" + game_board[1][0] + "|" + game_board[2][0] + "|")
print("|" + game_board[0][1] + "|" + game_board[1][1] + "|" + game_board[2][1] + "|")
print("|" + game_board[0][2] + "|" + game_board[1][2] + "|" + game_board[2][2] + "|")
if location == 8:
game_board[1][2] = 'o'
print("|" + game_board[0][0] + "|" + game_board[1][0] + "|" + game_board[2][0] + "|") | {
"domain": "codereview.stackexchange",
"id": 33109,
"lm_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, tic-tac-toe",
"url": null
} |
ros
Title: What are the units and coordinate conventions in ROS?
Has ROS agreed on a units standard?
Originally posted by mwise on ROS Answers with karma: 208 on 2011-02-15
Post score: 4
REP 103 outlines in detail the standard units of measure and coordinate conventions that are used in ROS.
Originally posted by mmwise with karma: 8372 on 2011-02-15
This answer was ACCEPTED on the original site
Post score: 7 | {
"domain": "robotics.stackexchange",
"id": 4744,
"lm_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
} |
ros, gazebo7, ros-kinetic
Title: Which unity do the linear and angular speed have in the teleop_twist_keyboard node?
Hi,
I was wondering the unity of linear and angular speed when running the teleop_twist_keyboard node in ROS, are there m/s and rad/s? I could not find anywhere this information.
Additionally, as time dependent speeds, do they use the real time or simulated time?
Cheers,
Simone.
Originally posted by simff on ROS Answers with karma: 98 on 2018-03-13
Post score: 0
Please see #q248465 and #q212296 for related (and possibly duplicate) questions.
Summary: everything is in SI units, following REP-103.
Originally posted by gvdhoorn with karma: 86574 on 2018-03-13
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 30294,
"lm_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, gazebo7, ros-kinetic",
"url": null
} |
electromagnetism, magnetohydrodynamics
All of this is confounded by the fact that a rotating rigid vessel creates shear forces on the fluid contained within. The fluid viscosity, fluid temperature, the precise strength of the magnetic field and the rotation velocity, the ratio of $l$ to $d$, the ratio of the mean free path to the rod size... all of these variables become relevant to the magnetohydrodynamic model of the system you have described, and the result is very complex. | {
"domain": "physics.stackexchange",
"id": 6556,
"lm_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, magnetohydrodynamics",
"url": null
} |
On the other side, you might also change variable, and set $$u = 5x$$, if you wish, but in that case $$du = 5dx$$ and therefore $$\begin{split} \int - \frac{1}{5x} dx &= - \int \frac{1}{u} \frac{du}{5} \\ &= -\frac{1}{5} \ln(u) + c’ \\ &= -\frac15\ln(5x) + c’ = -\frac15 \ln(x) - \frac15\ln(5) + c’ \end{split}$$ Since $$\ln(5x) = \ln(5) + \ln(x)$$ it’s just a metter of choosing a different constant $$c$$ or $$c’$$.
They clearly both give the same function if you differentiate, for they differ for a constant value $$\ln(5)$$ whose derivative is zero.
• Thank you, this really helped. Jul 18, 2020 at 15:37
• We need to include the absolute value sign in $\ln|x|$ since we don't know if $x>0$. Jul 19, 2020 at 3:31
• @Axion004 in which case you need also to use two constants $c$ for $x>0$ and $x<0$ as they could be different. I have assumed $x>0$, albeit implicitly, in order to show why there are two possible solutions which look different but they are the same. Jul 19, 2020 at 9:15 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9843363545048391,
"lm_q1q2_score": 0.8586832232190706,
"lm_q2_score": 0.8723473630627235,
"openwebmath_perplexity": 299.60657833294954,
"openwebmath_score": 0.923105001449585,
"tags": null,
"url": "https://math.stackexchange.com/questions/3761308/what-is-the-indefinite-integral-of-int-left-frac15x-right-dx/3761320"
} |
resource-recommendations
Electromagnetism:
$\bullet$ Electricity & Magnetism By Edward M Purcell: This is one of the great Berkeley Physics course series developed more or less at the same time during the publications of Feynman's lectures; he provides each & every concept rigorously with minute to minute details; the most remarkable thing is that he introduces magnetism using relativity which is quite uncommon in conventional books; also the book can be cherished for its numerical problems & in fact Purcell has written himself a key-book which explains all the problems. The con of the book is it uses Gaussian units which is quite unpopular at least in my country as they are difficult to be dealt with.
$\bullet$ Lectures on Physics Vol.II by Richard Feynman, Matthew Sands: The second series of the lectures is completely devoted to electromagnetism. No cons actually! | {
"domain": "physics.stackexchange",
"id": 24379,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "resource-recommendations",
"url": null
} |
neural-network, cost-function
Here's a worked example. If you have a network with 2 inputs, 2 neurons in the hidden layer, and a single output, and you found that the following weight matrices were a minimum:
$W^{(1)} = \begin{bmatrix} -1.5 & 2.0 \\ 1.7 & 0.4 \end{bmatrix}$
$W^{(2)} = \begin{bmatrix} 2.3 & 0.8 \end{bmatrix}$
Then the following matrices provide the same solution (the network outputs the same values for all inputs):
$W^{(1)} = \begin{bmatrix} 1.7 & 0.4 \\ -1.5 & 2.0 \end{bmatrix}$
$W^{(2)} = \begin{bmatrix} 0.8 & 2.3 \end{bmatrix}$
As we said the first set of 6 parameters was a solution/minimum, then the
second set of 6 parameters must also be a solution (because it outputs the same). The loss function therefore has 2 minima with respect to the weights. In general for a MLP with one hidden layer containing $n$ neurons, there are $n!$ permutations of weights that produce identical outputs. That means that there are at least $n!$ minima. | {
"domain": "datascience.stackexchange",
"id": 1926,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, cost-function",
"url": null
} |
ros, meta
Edit YYYY-MM-DD: see answer by @user_who_posted_new_answer for an updated answer.
The original answer text ..
And with enough karma it's also possible to unaccept the answer and then accept the new one. Personally I would not do that, as it implies that the original poster accepted the new answer, which he hasn't (and with really old questions most likely never will do).
Originally posted by gvdhoorn with karma: 86574 on 2017-08-16
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by jayess on 2017-08-16:
I like the idea of appending the date and newer answer reference to the accepted answer. Thanks @gvdhoorn | {
"domain": "robotics.stackexchange",
"id": 28618,
"lm_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, meta",
"url": null
} |
machine-learning, deep-learning, keras, overfitting, epochs
if self.restore_best_weights:
if self.verbose > 0:
print("Restoring model weights from the end of the best epoch")
self.model.set_weights(self.best_weights) | {
"domain": "datascience.stackexchange",
"id": 3670,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning, keras, overfitting, epochs",
"url": null
} |
ros, navigation, extended-kalman-filter, robot-localization, amcl
0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1e-3, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1e-3, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, | {
"domain": "robotics.stackexchange",
"id": 22965,
"lm_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, extended-kalman-filter, robot-localization, amcl",
"url": null
} |
quantum-gate, superconducting-quantum-computing, quantum-advantage, random-quantum-circuit, google-sycamore
Now imagine what happens in a less trivial example in which there are actual non-trivial entangling gates in the circuit: to compute the output state you will need to perform a number of operations on these giant-dimensional vectors ${}^{(1)}$. On the other hand, the quantum device solves the sampling task naturally: you just look at the output of the device. | {
"domain": "quantumcomputing.stackexchange",
"id": 975,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, superconducting-quantum-computing, quantum-advantage, random-quantum-circuit, google-sycamore",
"url": null
} |
quantum-mechanics, spacetime, symmetry, time, noethers-theorem
Translation in time : $t \rightarrow t + a$
is a $\textbf{continuous}$ symmetry, for any real $t,a$
but
Time reversal: $t \rightarrow -t$ is a $\textbf{discrete}$ symmetry.
But if we choose $a=- 2t$ we get the same transformation - can somebody explain to me why this is no contradiction? In a nutshell, $a$ is an arbitrary but fixed 1-parameter, while $t$ is a running time coordinate. One cannot consistently put a fixed parameter equal to a running coordinate. Phrased differently, $a$ is here not allowed to depend on $t$.
In particular, the 1-parameter family $(\mathbb{R}\ni t\mapsto t+a\in\mathbb{R})_{a\in\mathbb{R}}$ of time translation maps is a continuous deformation of the identity map $\mathbb{R}\ni t\mapsto t\in\mathbb{R}$.
In contrast, the time reversal map $\mathbb{R}\ni t\mapsto -t\in\mathbb{R}$ is a discrete deformation of the identity map $\mathbb{R}\ni t\mapsto t\in\mathbb{R}$. | {
"domain": "physics.stackexchange",
"id": 58543,
"lm_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, spacetime, symmetry, time, noethers-theorem",
"url": null
} |
figure with one circular base. 5 2 × 5 = 11. This calculator will calculate the volume of cone given its height and the radius of its base. Imagine starting with a right pyramid or cone and sliding thin layers to make it oblique. The volume is a measure of how much a figure can hold and is measured in cubic units. For a circular cone with radius r and height h, the formula for volume becomes V=\frac{\pi}{3}r^2h $For a right circular cone, the surface area$ A $is$ A=\pi r^2+\pi rs $where$ s=\sqrt{r^2+h^2} \$ is the slant height. Right circular cone. 10) A party hat has a diameter of 18 feet and a height of 25 feet. Bea also calculates the volume of the sugar cone and finds that the difference is < 15%, and decides to purchase a sugar cone. 21. g. So, if you want the volume in cubic meters, you will have to fill in all the data in meters. a geometric surface formed by a line rotating about the vertex and connecting the peripheries of two closed plane bases, usually circular or | {
"domain": "consultoriaig.es",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9896718486991903,
"lm_q1q2_score": 0.8091304499023398,
"lm_q2_score": 0.8175744828610095,
"openwebmath_perplexity": 368.03488808347953,
"openwebmath_score": 0.7482104897499084,
"tags": null,
"url": "http://paginasweb.consultoriaig.es/zyacniw/nfgrzmm.php?gakoombkk=volume-of-cone"
} |
python, performance, python-2.x, csv
#Familia N2
elif fo[6] in check[4] and (check[3] == '') and (check[5] == ''):
if fo[2] in check[6]: #EstCom
if fo[1] in check[2]: #ITEMREP
for nodo in nodos:
if check[2] in nodo: #ITEMREP
nod = nodo.split(';')
if bool(check[9]):
for item in lista:
if nod[3] in item:
clinea += 1
ub = lista.index(item)
del lista[ub]
if clinea > 1:
if find_word(nod[3], check[7]): #Linea coincide en nodo actual
count += 1
elif clinea == 1:
pass
else:
if find_word(nod[3], check[7]): #Linea coincide en nodo actual | {
"domain": "codereview.stackexchange",
"id": 16949,
"lm_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, csv",
"url": null
} |
python, pygame
As a rough guide of the direction you should try to go with the program:
Decouple the main game loop and the internals of each Obj. Try to make it so the main loop knows as little as possible about the Obj itself, and instead, if a click or mouse move occurs, tell the object and let it decide what action is appropriate. This will make it easier if you want to add more classes like Obj, because you can implement general methods such as draw() and clicked() which the game loop can call.
Share logic through inheritance. Where two objects behave in a similar way or you feel that you're repeating yourself, try and figure out what is the same about the two classes, then abstract that out into a parent class as I demonstrated above. | {
"domain": "codereview.stackexchange",
"id": 39819,
"lm_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, pygame",
"url": null
} |
java, object-oriented, swing, quiz
Looking to hear your feedback on how I can improve and manage my code. Thank for sharing your code.
OOP doesn't mean to "split up" code into random classes.
The ultimate goal of OOP is to reduce code duplication, improve readability and support reuse as well as extending the code.
Doing OOP means that you follow certain principles which are (among others):
information hiding / encapsulation
single responsibility
separation of concerns
KISS (Keep it simple (and) stupid.)
DRY (Don't repeat yourself.)
"Tell! Don't ask."
Law of demeter ("Don't talk to strangers!")
replace branching with polymorphism | {
"domain": "codereview.stackexchange",
"id": 29165,
"lm_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, swing, quiz",
"url": null
} |
optics, reflection
Title: Why is angle of incidence equal to angle of reflection? In the Law of Reflection, the angle of incidence is equal to angle of reflection. Why is this true? This is clearly true experimentally, but how does one prove this true mathematically? This is beautifully explained by Feynman using his path integrals.
I cannot hope to do it better, but just a quick non-mathematical overview. | {
"domain": "physics.stackexchange",
"id": 54606,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, reflection",
"url": null
} |
temperature, paleoclimatology
This in turn means that the fraction of oxygen 18 versus oxygen 16 in the water and air bubbles in the ancient ice in Greenland and Antarctica are indicative of the climate at the time that that ice and those air bubbles formed. Despite being a half a world apart, the ratios of oxygen-18 to oxygen-16 over time are highly consistent between Greenland and Antarctica. The consistency of these measures at half a world apart are almost universally taken as being a proxy for something else, and that something else is climate. | {
"domain": "earthscience.stackexchange",
"id": 2105,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "temperature, paleoclimatology",
"url": null
} |
gears, glass
Finally, gear teeth have to withstand large shock loads when the gear train is slammed into engagement and starts up and/or reverses during operation. Brittle materials like glass exhibit very low toughness which means they break promptly under a shock load. | {
"domain": "engineering.stackexchange",
"id": 3473,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gears, glass",
"url": null
} |
performance, vba
End If
Next counterOfElements
counterColumns = 1
counterRows = counterRows + 1
If UBound(lineArray) < 100 Then
If UBound(lineArray) = 1 Then
progressBarCount = 100
Else
progressBarCount = (counterRows * 100) / lastRowCounter
End If
Else
progressBarCount = (counterRows * 100) / UBound(lineArray)
End If
If UBound(lineArray) = 0 Then
progressBarCount = 0
End If
progressBar.Update progressBarCount, 100, "Processing records", True
Next indexCount
SplitColumns = True
secondsElapsed = Round(Timer - startTime, 2)
MsgBox "Macro run in " & secondsElapsed & " seconds."
End Function | {
"domain": "codereview.stackexchange",
"id": 25780,
"lm_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, vba",
"url": null
} |
machine-learning, feature-selection, random-forest
The key thing that I'm interested in here are the features themselves. I want to know what is contributing to my user churn. I have extracted the feature importances and plotted a nice looking graph, but now I'm stuck. I'd ideally like to know how each variable influences the churned/not churned outcome. The problem with GINI feature importances is that I can see which ones are most influential, but for example with continuous variables I want to know at which value the RF found best to split on. I don't need to see this for every feature as I have 70+ only the most 'important' ones. | {
"domain": "datascience.stackexchange",
"id": 1800,
"lm_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, random-forest",
"url": null
} |
rnn, pytorch
The RNN creates for every element in a sequence 1 neuron (because every element needs to be stored with its previous value. In addition, the hidden_size can be independently defined, which multiplies every neuron. Therefore, the output size of the RNN is sequence_length * hidden_size and that's also the reason why a linear layer (fully connected, fc) is needed to reduce the system output to the actual size (output_size).
Restructuring of the input_data
In the next step, it is necessary to reorganise the input_data into batches/sequences. In the following example I have two inputs a and b. These inputs are organized as 2-dimensional tensor x.
x = [[ a1, b1],
[ a2, b2],
[ a3, b3],
[ a4, b4],
[ a5, b5],
[ a6, b6],
[ a7, b7],
[ a8, b8],
[ a9, b9],
...
] | {
"domain": "datascience.stackexchange",
"id": 11740,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rnn, pytorch",
"url": null
} |
quantum-mechanics, terminology, quantum-entanglement, superposition
Title: What's the difference between an entangled state, a superposed state and a cat state? 1) Can a state be entangled without also being a superposition? (Please give an example.)
2) Can a state be a superposition without being entangled? (Again, an example please.)
3) And what about a cat state?
I am royally confused, and a little bit of googling didn't help.
This question is partly motivated by the recent news announcement (Nature, NYTimes) that ten billion entangled pairs have been created.
4) Are these spin pairs also in a superposition?
5) Does this count as a cat state? This goes on order from the more general to the more specific: | {
"domain": "physics.stackexchange",
"id": 25244,
"lm_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, terminology, quantum-entanglement, superposition",
"url": null
} |
pathology, virus, skin, immune-system
Figure one: Sweat glands in skin. Source: wikimedia commons.
(source: uwa.edu.au)
Figure two: Slide of sweat gland. Tightly packed secretory cells dump sweat into the lumen through exocytosis (see fig 3). Source: University of Western Australia.
Figure three: Exocytosis. The lining of the sweat gland contains cells producing sweat through exocytosis. Viruses and other pathogens cannot simply enter these cells, and also cannot 'slip in between' the cells. Source: wikimedia commons. | {
"domain": "biology.stackexchange",
"id": 6265,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pathology, virus, skin, immune-system",
"url": null
} |
star, galaxy, distances, milky-way, magnitude
Another way of approaching the question... From what I've read it seems we estimate the Milky Way to contain about 250 billion stars. I also read that the Gaia satellite will map about 1 billion stars. Does that mean our best telescopes are only able to discern 1/250 of the stars in the Milky Way? Of course all stars on the other side the galaxy disk are hidden from us, so they surely account for a large portion of the invisible stars. But looking straight up from the galactic plane, can we see the last galactic stars before the empty intergalactic "void"? Take a look at the HR-diagram. You have forgotten to take into account that stars come in vastly different luminosities.
For example, we can barely see all red dwarves out to a distance of 10pc, while we know that they vastly outnumber the more luminous stars. | {
"domain": "astronomy.stackexchange",
"id": 3447,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "star, galaxy, distances, milky-way, magnitude",
"url": null
} |
human-biology, biochemistry
I could not find a paper on its exact mechanism, so I'd rather say that the process is still not clear. Yet, as the paper suggests, the main effects of omega-3 fatty acids are reducing LDL synthesis and/or increasing fractional rate of catabolism (FRC) of LDL.
A similar article can be found here:
Omega-3 fatty acids have been shown to lower triglycerides, which are a type of fat in the bloodstream. Experts aren't sure of the exact mechanism. Omega-3 fatty acids may also slow down the growth of plaques in the arteries and reduce inflammation throughout the body.
A number of studies going back years have shown the benefits of fatty fish. In an important review of studies, researchers found that getting daily omega-3 fatty acids from fish oil could lower triglyceride levels by 25%-30%. The results were published in The American Journal of Clinical Nutrition in 1997. | {
"domain": "biology.stackexchange",
"id": 5398,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology, biochemistry",
"url": null
} |
c++, number-guessing-game
else if ((computersNumber < tooHigh) && (computersNumber > playersNumber))
{
tooHigh = computersNumber;
}
} | {
"domain": "codereview.stackexchange",
"id": 24409,
"lm_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++, number-guessing-game",
"url": null
} |
hilbert-space, standard-model, superposition, quarks, mesons
Title: Particles composed of square roots? There are some particles which require square roots when telling their compositions. Mostly mesons, not baryons.
e.g. $$ρ^0=\frac{u\bar{u}-d\bar{d}}{\sqrt{2}}.$$
Could you explain me how to make sense of it? There are some particles which are made of a specific composition of quarks and are always made of that composition. For example, as I believe you have heard of, protons and neutrons are always composed of $uud$ and $udd$, respectively.
You can think of this intuitively in the following sense: if you could pick up a proton and look inside it to figure out what it is made of, you would have $100\%$ probability to find $uud$ inside it. Similarly, if you were to pick up a neutron and look inside it, you would always find $udd$ inside it.
This seems a silly way of putting it, perhaps even obvious. They are made like that, what else could happen? Why am I stating what they are made of in terms of probabilities? | {
"domain": "physics.stackexchange",
"id": 84936,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "hilbert-space, standard-model, superposition, quarks, mesons",
"url": null
} |
php, design-patterns, dependency-injection, static
All in all I am happy with what the results are so far, but since the subjects are new to me I am reaching out the community here on Code Review for feedback. I am basically concerned with whether or not my understanding of DI/IoC/Registries/Service Locators are sound and whether or not I am overlooking various design considerations. I would also like to know if I am going in the right direction with my IoC code as it is now or if I am completely missing the point on how to create such a thing in PHP. First off: _steer clear of static's as much as you can, especially in PHP.
You seem unclear as to what IoC exactly is. It's perfectly simple, though: IoC has more to do with how your code works. How you generate the desired results. It doesn't define how you do it. At least, not as much as a definite pattern/implementation of this technique.
Dependency Injection (DI) is, actually, a technique with which IoC is achieved. Take a class that writes stuff to a log of sorts:
class Logger
{ | {
"domain": "codereview.stackexchange",
"id": 5502,
"lm_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, design-patterns, dependency-injection, static",
"url": null
} |
c#, user-interface, rubberduck
protected RubberduckCommandBase(IRubberduckMenuCommand command)
{
_command = command;
_command.RequestExecute += command_RequestExecute;
}
private void command_RequestExecute(object sender, EventArgs e)
{
ExecuteAction();
}
protected IRubberduckMenuCommand Command { get { return _command; } }
/// <summary>
/// A method that uses the <see cref="Command"/> helper to wire up as many UI controls as needed.
/// </summary>
public abstract void Initialize();
/// <summary>
/// The method that is executed when either wired-up UI control is clicked.
/// </summary>
public abstract void ExecuteAction();
public void Release()
{
_command.Release();
}
}
} | {
"domain": "codereview.stackexchange",
"id": 15032,
"lm_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#, user-interface, rubberduck",
"url": null
} |
temperature, acoustics, everyday-life
Title: Does sound propagate further in freezing weather? A few days ago I went for a walk in the evening. We're having winter with a little snow and freezing temperatures. We're in a quiet, shallow valley with a train station about 1km from us. I heard a train coming so I wanted to wait for it to watch it arriving to the station. To my surprise, although I was hearing the sound coming from behind a hill, the train wasn't appearing. After several minutes, I gave up, and went back, and finally I saw the train arriving after another a few minutes. The train must have been several km away when I first heard it.
I watched this phenomenon later and I realized that also I could hear and understand people talking on much larger distances than usual.
This has not happened before, and my only idea is that it's because of the cold weather. I have two ideas how to explain it: | {
"domain": "physics.stackexchange",
"id": 6190,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "temperature, acoustics, everyday-life",
"url": null
} |
python, strings, natural-language-processing
And usage
determiners = ['AND',
'THE',
'ET',
'LE',
'LA',
'LES',
'DE']
text = 'LES PILES DE-LA TELECOMMANDE'
remove_determiners(determiners, clean_text(text)) | {
"domain": "codereview.stackexchange",
"id": 32724,
"lm_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, strings, natural-language-processing",
"url": null
} |
ros, iai-kinect2, 3d-object-recognition
Title: how to add base link or world frame rviz
I m new user of rviz
I am using Kinect 2 and want to see point cloud information
I want to see the cloud information in rviz however my fixed frame popup only shows map ... however in different tutorial i have observed many other frames availble in the pop up. How can i add these frames in my pop up menu and how these are useful. and for me which frame is important.
Plz reply with details keeping in mind that i m new user of ros and rviz thankss
Originally posted by noman on ROS Answers with karma: 21 on 2016-05-18
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 24683,
"lm_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, iai-kinect2, 3d-object-recognition",
"url": null
} |
= $$2r \int_{0}^{\pi} \sin^2 \frac{\varphi}{2}\cos \frac{\varphi}{2} d\varphi$$
= $$\frac{4r}{3} [\sin^3 \frac{\varphi}{2}]_{0}^{\pi}$$
= $$\frac {4r}{3}$$
I tend to use geometry as far as it will carry me. In this case, that served to simplify both integrals. Not everyone responds to that. See what you think.
• Please, use \sin and \cos. Jul 29, 2021 at 0:02
• Oh, I see. That identifies them as functions, and they are no longer in italics. Thank you.
– Pope
Jul 29, 2021 at 7:23
• No no no. Generating points uniformly on a cube then projecting them onto a sphere does not give a uniform distribution on the sphere. Points will be denser in the directions of the corners of the sphere. There are several published algorithms for generating points randomly and uniformly on an $n$-dimensional sphere, and these are built into many software systems such as Mathematica's SpherePoints[]. Jul 29, 2021 at 8:02 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303404461439,
"lm_q1q2_score": 0.8115553041729218,
"lm_q2_score": 0.819893340314393,
"openwebmath_perplexity": 394.23650490520686,
"openwebmath_score": 0.9401670694351196,
"tags": null,
"url": "https://math.stackexchange.com/questions/4209167/the-expected-distance-between-two-points-on-a-sphere-and-on-a-circle"
} |
astrophysics, planets, stars, solar-system, jupiter
If you ignore that the solar system is dominated by the Sun and just focus on mass, Jupiter is roughly 80x lighter than the lightest star that undergoes fusion. So it would need to have accumulated 80 times what it already has in order to be a "real star." No Solar System formation model indicates this was remotely possible, which is why I personally don't like to think of it as a "failed star."
Below 80 MJ (where MJ is short for "Jupiter masses"), objects are considered to be brown dwarf stars -- the "real" "failed stars." Brown dwarfs do not have enough mass to fuse hydrogen into helium and produce energy that way, but they do still produce their own heat and glow in the infrared because of that. Their heat is generated by gravitational contraction.
And Jupiter also produces heat through both gravitational contraction and differentiation (heavy elements sinking, light elements rising). | {
"domain": "physics.stackexchange",
"id": 67998,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astrophysics, planets, stars, solar-system, jupiter",
"url": null
} |
orbit, astrophysics
Now that the gravity field of the moon is mapped, it turns out that there are some low orbits that are reasonably stable:
"What counts is an orbit's inclination," that is, the tilt of its plane to the Moon's equatorial plane. "There are actually a number of 'frozen orbits' where a spacecraft can stay in a low lunar orbit indefinitely. They occur at four inclinations: 27º, 50º, 76º, and 86º"—the last one being nearly over the lunar poles. | {
"domain": "astronomy.stackexchange",
"id": 542,
"lm_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, astrophysics",
"url": null
} |
resource-recommendations, standard-model, effective-field-theory, hadron-dynamics
In brief, I would like a text on the subject which is i) as pedagogical and ii) as self-contained as possible. I'm not concerned too much with generality, detailed treatment of the lowest-terms only would suffice. Also, I would strongly favour more modern expositions since some old-fashioned terms and approaches are by themselves a great source of confusion for me. What you are looking for are explanations of effective field theory (for example see this review by Burgess http://arxiv.org/abs/hep-th/0701053) and chiral perturbation theory in particular (for example see this review by Scherer http://arxiv.org/abs/hep-ph/0210398, and here are some slides by Tiburzi that look good at first glance: http://www.int.washington.edu/PROGRAMS/12-2c/week2/tiburzi_01.pdf). | {
"domain": "physics.stackexchange",
"id": 23258,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "resource-recommendations, standard-model, effective-field-theory, hadron-dynamics",
"url": null
} |
python, python-3.x, programming-challenge
# using inputYesNo() for single ingredients with no further types
mayo = pyp.inputYesNo('Do you want mayo?(Y/N) \n')
mustard = pyp.inputYesNo('Do you want mustard?(Y/N) \n')
lettuce = pyp.inputYesNo('Do you want lettuce?(Y/N) \n')
ketchup = pyp.inputYesNo('Do you want tomato ketchup?(Y/N) \n')
# using inputInt() and blockRegexes that do not allow negative integer, float or 0
sandwichQT = pyp.inputInt('How much sandwiches you would like to order?\n',
blockRegexes=['[0|-|.]'])
total_amount = 0
# using for loop to print items, prices and adding their amount to total_amount variable
for item, price in prices.items():
if bread == item:
print(f'Your sandwich ingredients and prices are as follows: \n'
f'{item}= {price}')
total_amount += price
if protein == item:
print(f'{item}= {price}')
total_amount += price | {
"domain": "codereview.stackexchange",
"id": 39854,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, programming-challenge",
"url": null
} |
thermodynamics, quantum-field-theory, mathematical-physics, qft-in-curved-spacetime
Title: KMS condition and quasi-free states In algebraic formulation of QFT, it is known that if a state is KMS with respect to some time parameter $\tau$, then the Wightman 2-point functions must satisfy certain conditions, namely stationarity $W(\tau,\tau') = W(\tau-\tau',0) \equiv W(\Delta \tau)$, complex anti-periodicity $W(\Delta t+i\beta) = W(-\Delta t)$, and some holomorphicity condition for $W(z)$ on the complex strip $\Im(z)\in (0,\beta)$.
I am fairly sure that the converse is not true, that even if a free field theory has Wightman 2-point function that satisfy these condition, the state needs not be KMS. However, I cannot find the place that says this (or the opposite claim). For example, if one restricts to a subclass of algebraic states $\omega$, can the converse be true? Would something like Gaussian states (is it quasi-free state?) suffice to make one-to-one correspondence between the KMS state and the three-properties of the Wightman functions? | {
"domain": "physics.stackexchange",
"id": 98783,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, quantum-field-theory, mathematical-physics, qft-in-curved-spacetime",
"url": null
} |
ros, rate, joint-state-publisher, publish
Originally posted by JoshuaElliott with karma: 46 on 2020-12-17
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by gvdhoorn on 2020-12-17:
Have you tried disabling Nagle for your subscriber?
Comment by JoshuaElliott on 2020-12-17:
That sounds like it might be the exact cause of the problem. Can you explain how to disable it? It sounds like it is set within the subscriber, for clarity by subscriber is below:
sub5 = nh_.subscribe("/dd_robot/joint_states", 5, &variables::joint_states_Callback, this);
Where "variables" is the name of the class I'm using to hold things.
EDIT I figured it out after writing this original comment and amended by answer above to show how to disable it. Thanks a lot for saving me a lot of work converting ROS nodes into Gazebo plugins.
Comment by gvdhoorn on 2020-12-17:
It's documented on the roscpp/Overview/Publishers and Subscribers page. | {
"domain": "robotics.stackexchange",
"id": 23164,
"lm_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, rate, joint-state-publisher, publish",
"url": null
} |
step by step so that I can fully understand the solution, along with supporting key concept points to grasp the idea. We may compute the values of $x$ on the half steps by, e.g., averaging (so that $x_{k+1/2} = (1/2) (x_k + x_{k+1})$. There are difference equations "approximating" the given differential equation, but there is no (finite) difference equation equivalent to it. Of course, as we know from numerical integration in general, there are a variety of ways to do the computations. tfmToTimeDomain[{num_, den_}, ipvar_, opvar_, s_, t_] := Catch[polyToTimeDomain[den, … ... Read Applications of Lie Groups to Difference Equations Differential and Integral Equations PDF Online. 1:18. Please show all steps. Sign in to answer this question. Why the half-steps? In discrete time system, we call the function as difference equation. @Karan Chatrath Addressing the remaining integral: Taking T+h−s=zT+h-s = zT+h−s=z, plugging into the integral, manipulating and simplifying gives: | {
"domain": "gridserver.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290930537122,
"lm_q1q2_score": 0.8195310893889575,
"lm_q2_score": 0.8438951064805861,
"openwebmath_perplexity": 758.8218497616799,
"openwebmath_score": 0.6470473408699036,
"tags": null,
"url": "https://s166534.gridserver.com/last-train-bigr/convert-differential-equation-to-difference-equation-28cf35"
} |
This is a generous explanation of Lucia's comment above.
The functions $$\mathcal H_n(x)=\frac{2^{1/4}}{(2^n n!)^{1/2}}H_n(\sqrt{2\pi}\; x) e^{-\pi x^2}$$ form an orthonormal system in $L^2(\textbf{R})$. Here $H_n(x)$ are the usual Hermite polynomials defined by $$e^{2xz-z^2}=\sum_{n=0}^\infty \frac{H_n(x)}{n!}z^n,\qquad |z|<\infty.$$ The functions are eigenfunctions for the usual Fourier transform so that $$\int_{-\infty}^{+\infty}\mathcal H_n(t)e^{-2\pi i x t}\,dt=(-i)^n \mathcal H_n(x).$$
It follows that $L^2(\textbf{R})$ is a direct sum of four subspaces. In each of these subspaces the Fourier transform is just multiplication by $1$, $i$, $-1$, $-1$ respectively. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.985271387015241,
"lm_q1q2_score": 0.8678241633226886,
"lm_q2_score": 0.8807970826714614,
"openwebmath_perplexity": 302.4624352044359,
"openwebmath_score": 0.8792707324028015,
"tags": null,
"url": "https://mathoverflow.net/questions/263397/is-there-a-transformation-or-a-proof-for-these-integrals?noredirect=1"
} |
# Calculate $\int \frac{x^{\:}}{\sqrt{x^4+3}}\ dx$ [closed]
How to calculate
$$\int \frac{x^{\:}}{\sqrt{x^4+3}}\ dx$$
• Hint: What about the sustitution $x^2=\sqrt{3}\tan t$? – Ángel Mario Gallegos Jun 17 '16 at 3:32
• The trick here is reducing to $$\int \frac{1}{\sqrt{s^2+1}}\,ds$$ – user228113 Jun 17 '16 at 3:32
• (assuming the "surface-integral" is just a bad choice of tag) – user228113 Jun 17 '16 at 3:34
• @SophieAgnesi The first edit after the question was put on hold gets it into reopen review queue, see meta (if it is within 5 days). For this reason I think that if a question is on hold, we should avoid minor edits. An edit which addresses all reasons why the post was put on hold is preferred. – Martin Sleziak Jun 17 '16 at 4:50 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429107723175,
"lm_q1q2_score": 0.8053459374245118,
"lm_q2_score": 0.8175744717487329,
"openwebmath_perplexity": 701.3186626928493,
"openwebmath_score": 0.6842122673988342,
"tags": null,
"url": "https://math.stackexchange.com/questions/1829345/calculate-int-fracx-sqrtx43-dx/1829375"
} |
python, python-3.x, machine-learning, genetic-algorithm, tetris
self.rows_complete = rows_complete
self.weighted_height = weighted_height
self.cumulative_heights = cumulative_heights
self.relative_height = relative_height
self.holes = holes
self.roughness = roughness
self.fitness = fitness
class GeneticAI():
def __init__(self, model_path):
self.mutation_rate = 0.2
self.mutation_step = 0.2
self.archive = []
self.genes = []
self.population_size = 10
self.current_gene = -1
self.current_board = None
self.current_shape = None
self.next_shape = None
self.model_path = model_path
self.initial_population()
def initial_population(self):
self.read_dataset()
self.evaluate_next_gene()
def evaluate_next_gene(self):
self.current_gene += 1
if self.current_gene == len(self.genes):
self.evolve() | {
"domain": "codereview.stackexchange",
"id": 30500,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, machine-learning, genetic-algorithm, tetris",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.