text stringlengths 1 1.11k | source dict |
|---|---|
javascript, jquery, touch
Notice the following:
Object use of .on() rather than mere string use (only one binding instead of multiple)
caching where appropriate
variables and functions declared at top
Now that we've got your original code all pretty and efficient, I'll offer a different alternative that should be mu... | {
"domain": "codereview.stackexchange",
"id": 5496,
"lm_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, touch",
"url": null
} |
equals the value of the cofunction of the complement. Figure:Note that for complementary angles and ˚, the role of the legs (opposite versus adjacent) are interchanged. From the definitions of the functions, it may be seen that sin B =cos A, cos B =sin A, tan B =cot A, and sec B =csc A ; in general, the function of an ... | {
"domain": "elettricaguida.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9859363741964573,
"lm_q1q2_score": 0.8060764059291305,
"lm_q2_score": 0.8175744673038222,
"openwebmath_perplexity": 1087.111807905534,
"openwebmath_score": 0.7388229966163635,
... |
rosdep, ros-fuerte, ros-groovy
Title: rosdep update problem
Hello, I'm installing groovy now.
After running "rosdep update" it show error as follows:
$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit*****************/rosdep/osx-homebrew.yaml
Hit*****************/rosdep/gentoo.yaml
H... | {
"domain": "robotics.stackexchange",
"id": 13941,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosdep, ros-fuerte, ros-groovy",
"url": null
} |
java, console, math-expression-eval, calculator
Efficiency issues
Creating new strings often. Examples are on lines 116, 124, 127, 131, 149, 158. Use String.substring when you do need a part of your original string.
Testing boundaries with IndexOutOfBoundsException at 135 and 163. A quick profiling run with VisualV... | {
"domain": "codereview.stackexchange",
"id": 8765,
"lm_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, console, math-expression-eval, calculator",
"url": null
} |
python, validation, user-interface
Arguments:
name (str, optional): The name to store the validator under.
Defaults to None (i.e. not stored).
**config (dict): The configuration options for the validator.
Attributes:
DEFAULT_PROMPT (str): The default prompt to use if not supplied
... | {
"domain": "codereview.stackexchange",
"id": 12154,
"lm_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, validation, user-interface",
"url": null
} |
matlab, wavelet, bandwidth
Thus, to answer your first question, the $F_c$ parameter, must be chosen such that it is at or near the frequency you wish to interrogate.
Regarding the wavelet bandwidth: What I have called $T_p$ here is your "Period Parameter", and this is directly related to your bandwidth. Go back to th... | {
"domain": "dsp.stackexchange",
"id": 1097,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, wavelet, bandwidth",
"url": null
} |
aerodynamics, free-fall, lift
Title: Surviving Free Fall with the Help of Mr. Bernoulli What is the best strategy to survive a free fall naked out of a jetliner at cruising altitude (ignoring temperature)?
For instance, my strategy would be to streamline my fall so that my terminal velocity was very high. Then at some... | {
"domain": "physics.stackexchange",
"id": 6890,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "aerodynamics, free-fall, lift",
"url": null
} |
javascript, mergesort
return merge(leftSorted, rightSorted);
}
The merge function
Inside the while loop of the merge function you are doing too much. Each 2 values that need to be compared have the overhead of two if statements. They are true only when the loop is ready to exit. The loop should only deal with the com... | {
"domain": "codereview.stackexchange",
"id": 29474,
"lm_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, mergesort",
"url": null
} |
acid-base, electrochemistry, equilibrium
Hence the overall reaction for this process would be:
$E^{0}_{cell}=E_{cathode}-E_{anode}=0.7999-0.0000=0.7999\,V$
Which is for:
$Ag^{+}+\frac{1}{2}H_{2}+\rightarrow Ag_{(s)} + H^{+}$
Hence:
$E_{cell}=E^{0}-\frac{0.0592}{n}\log\frac{[H^{+}]}{[Ag^{+}]p^{\frac{1}{2}}_{H_{2(g)}}}$... | {
"domain": "chemistry.stackexchange",
"id": 13427,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, electrochemistry, equilibrium",
"url": null
} |
image-processing, reference-request, 3d
Buzug, Computed Tomography
Hermann, Fundamentals of Computerized Tomography | {
"domain": "dsp.stackexchange",
"id": 180,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, reference-request, 3d",
"url": null
} |
c++, performance, algorithm, floating-point
and
// } else if (p < SqrtSig53 || ...
} else if (p <= SqrtSig53 || ...
Portability
Use of Significand53 and other code relies on double as a binary64. A simple test would prevent a number of errant compilations, even if not increase portability.
#if DBL_MANT_DIG != 53
#... | {
"domain": "codereview.stackexchange",
"id": 41305,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, algorithm, floating-point",
"url": null
} |
# How to simplify $\frac{n^n - 1}{n - 1} \mod (n + 1)$?
My question is how to simplify the following:
$$\frac{n^n - 1}{n - 1} \mod (n + 1)$$
I've tried a bunch of tricks (splitting into even and odd $n$ and using a difference of squares) but I can't seem to find anything that gives a clean answer.
Is there even a s... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290955604489,
"lm_q1q2_score": 0.8437429680037208,
"lm_q2_score": 0.8688267830311354,
"openwebmath_perplexity": 170.69421665905384,
"openwebmath_score": 0.87685227394104,
"tags... |
You can also prove it by induction, which is nice and easy, although it doesn't give much intuition as to why it works.
It works for $1$ since $\frac{1\times 2}{2} = 1$.
Let it work for $n$.
$$1 + 2 + 3 + \dots + n + (n + 1) = \frac{n(n+1)}{2} + (n + 1) = \frac{n(n+1) + 2(n+1)}{2} = \frac{(n+1)(n+2)}{2}.$$
Therefor... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754447499795,
"lm_q1q2_score": 0.8605949777138324,
"lm_q2_score": 0.874077230244524,
"openwebmath_perplexity": 327.80113531866834,
"openwebmath_score": 0.9854366779327393,
"tag... |
geomagnetism, mass-extinction
Title: Is it possible that the geomagnetic field reversal led to the extinction of Dinosaurs? Is it possible that the geomagnetic field reversal with a weakened geomagnetic field over centuries if not thousands of years (according to the Pittsburgh simulation: https://www.psc.edu/science/... | {
"domain": "earthscience.stackexchange",
"id": 1444,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "geomagnetism, mass-extinction",
"url": null
} |
propulsion
Cars pushing the earth backwards via electromagnetic repulsion between tire and the earth,
Rockets,
Propeller or jets on airplanes
...
Are all engines we have, based on inertia? The purpose of a propulsion system is to provide acceleration, but acceleration means the momentum of the accelerating object is ... | {
"domain": "physics.stackexchange",
"id": 15193,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "propulsion",
"url": null
} |
clojure, macros
Title: Custom threading macro To help myself learn macros, I made a custom version of the threading macro that lets you choose which argument the "thread" gets put into.
My main concern is simplifying it, and making it more idiomatic, but anything notable is welcome. If anyone knows of a better impleme... | {
"domain": "codereview.stackexchange",
"id": 22917,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "clojure, macros",
"url": null
} |
muscles, electrophysiology, neurotransmitter, protein-structure, electromuscular
tl;dr to the long answer
You need to sum before taking ratios rather than take a difference of ratios when computing a reversal potential for multiple ions together.
Before we get into the weeds...
In most sources you will hear something ... | {
"domain": "biology.stackexchange",
"id": 8716,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "muscles, electrophysiology, neurotransmitter, protein-structure, electromuscular",
... |
python, algorithm, python-3.x
It is a bit clearer, I hope, how this works, and it is several times faster than the code in the post. The reasons why this is faster are (i) the accumulation total_area += ... is done once per rectangle, not once per vertical slice; and (ii) the subtraction of the land part is done once ... | {
"domain": "codereview.stackexchange",
"id": 36483,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, algorithm, python-3.x",
"url": null
} |
ros2, ros-crystal
while(rclcpp::is_initialized)
{
auto message = test_msgs::msg::Test();
message.header.stamp.nanosec = ros_now.nanosec;
publisher_->publish(message);
usleep(3000000);
}
rclcpp::shutdown();
}
Would it be okay for me to keep the position of the add_node as is?
Originally post... | {
"domain": "robotics.stackexchange",
"id": 32469,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2, ros-crystal",
"url": null
} |
scrnaseq, seurat, splitseq
I started following chapter 9 of the scRNA-Seq course I found here. I ran into some issues which I was able to resolve by tweaking my mtx to tsv conversion script, such as including the chromosome in the row names (so that the mitochondrial QC step would work), but I ran into some errors tha... | {
"domain": "bioinformatics.stackexchange",
"id": 1374,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scrnaseq, seurat, splitseq",
"url": null
} |
beginner, c, strings, caesar-cipher
Title: Message decoder I've built a C decoder program. The length of an encoded message will be given and the message itself in the following line. All the characters of the message will be in uppercase letters. The task is to print out the decoded message.
Encoding: A->B, B->C...Y-... | {
"domain": "codereview.stackexchange",
"id": 23671,
"lm_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, strings, caesar-cipher",
"url": null
} |
ros-melodic, roslaunch, ros-kinetic, rospack
Originally posted by gvdhoorn with karma: 86574 on 2019-12-15
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by gvdhoorn on 2019-12-15:
The bash script you show is afaict unneeded: you could add this to the node element in your .launc... | {
"domain": "robotics.stackexchange",
"id": 34146,
"lm_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-melodic, roslaunch, ros-kinetic, rospack",
"url": null
} |
evolution
Does a Batesian mimic initially need to be initially quite similar in morphology to the different species which it evolves to mimic? | {
"domain": "biology.stackexchange",
"id": 5443,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "evolution",
"url": null
} |
scala
Title: Scala Binary Search Tree In an attempt to get deeper down into Scala, I decided to make a BST using as many interesting concepts as possible in order to explore everything Scala has to offer.
Taking inspiration from this question/accepted answer, I wrote:
package bst
object BST {
def apply[T <% Ordered... | {
"domain": "codereview.stackexchange",
"id": 16243,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scala",
"url": null
} |
java, beginner, api, http
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(responseStream);
rootElement = doc.getDocumentElement();
} catch(Exception e) {
System.out.print(e.toString());
... | {
"domain": "codereview.stackexchange",
"id": 178,
"lm_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, beginner, api, http",
"url": null
} |
information-theory, coding-theory, encoding-scheme
We may possibly discuss as to what symbols is encoded in what, but it
is an essential aspect of Morse code that it has these three levels
of representation, with characters at the top, dots and dashes in the
middle, and bits 0 and 1 at the bottom.
This implies that t... | {
"domain": "cs.stackexchange",
"id": 4234,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "information-theory, coding-theory, encoding-scheme",
"url": null
} |
c++, algorithm, converting, roman-numerals
}
return 0;
}
int get_roman_value( char digit )
{
switch( tolower(digit) )
{
case 'i': return 1; break;
case 'v': return 5; break;
case 'x': return 10; break;
case 'l': return 50; break;
case 'c': return 100; br... | {
"domain": "codereview.stackexchange",
"id": 2378,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, converting, roman-numerals",
"url": null
} |
classification, cnn, convolutional-neural-network, inception
test_generator = test_datagen.flow_from_directory(
directory = '/kaggle/input/test/',
target_size = (IM_WIDTH, IM_HEIGHT),
color_mode = 'rgb',
batch_size = 1,
class_mode = None,
shuffle = False)
Found 8225 images belonging to 23 clas... | {
"domain": "datascience.stackexchange",
"id": 9468,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classification, cnn, convolutional-neural-network, inception",
"url": null
} |
organic-chemistry, nomenclature, notation
You should use the same letter to denote $\ce{O}$ or $\ce{NH}$, for example. It's perfectly permissible to write $\ce{R-X-C(O)-R'}$ and say $\ce{X} = \ce{O}, \ce{NH}$. This approach is commonly used in the literature. If your amide is tertiary then write something like $\ce{X}... | {
"domain": "chemistry.stackexchange",
"id": 15946,
"lm_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, notation",
"url": null
} |
homework-and-exercises, newtonian-mechanics, electrostatics, energy-conservation, coulombs-law
The trouble is that this often leads to equations that are hard to solve. If we have to do this way then, well, we just have to grind through all the maths and as you say this does involve calculus.
But if you aren't concern... | {
"domain": "physics.stackexchange",
"id": 39254,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, electrostatics, energy-conservation, ... |
thermodynamics, statistical-mechanics, statistics
On the other hand, Maxwell-Boltzmann statistics is a rule how to statistically treat the information about many particles of the same "species". The rule, the only one known in classical (pre-quantum) physics, says that even though they may have the same properties, th... | {
"domain": "physics.stackexchange",
"id": 31767,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, statistical-mechanics, statistics",
"url": null
} |
photography
Some ideas and solutions:
Adapters
I tell everyone who is trying to do prime focus photography with visual scopes (dobsonians, regular newtonians) to ditch the old T-ring system and just buy dedicated adapters. All you need is a piece of metal that goes in the bayonet mount on the camera on one side, and i... | {
"domain": "astronomy.stackexchange",
"id": 6719,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "photography",
"url": null
} |
nlp, information-retrieval, question-answering
People have tried to do "intelligent" rule-based algorithms in NLP for decades, before realizing that ML is more efficient and performs much better in most tasks. So it's extremely unlikely that a rule-based algorithm would suddenly outperform ML on a non-trivial task lik... | {
"domain": "datascience.stackexchange",
"id": 6032,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nlp, information-retrieval, question-answering",
"url": null
} |
Notice that Definition B does not preclude a vector space from having many bases, and this is the case, as hinted above by the statement that the archetypes contain three bases for the column space of a matrix. More generally, we can grab any basis for a vector space, multiply any one basis vector by a nonzero scalar a... | {
"domain": "ups.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9910145725743421,
"lm_q1q2_score": 0.8148014097594807,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 262.5017693702132,
"openwebmath_score": 0.8959358930587769,
"tags": null,
... |
performance, algorithm, c, median
for (j = 0; j < length; ++j) // N iterations
{
...
}
for (k = 0; k < length; ++k) // N iterations
{
...
}
}
this makes \$ N/2 (N+N) = N^2\$ iterations, where \$ N \$ is the length
of the array.
There are small improvements possible: In the ... | {
"domain": "codereview.stackexchange",
"id": 13233,
"lm_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, algorithm, c, median",
"url": null
} |
solid-state-physics, electronic-band-theory
At large temperature, $\beta$ is small, such that energies $\epsilon\gg\epsilon_F$ are allowed and the high energy tail of $f(\epsilon)$ is approximately a Maxwell-Boltzmann distribution
$$f(\epsilon)\approx\mathrm e^{-\beta\epsilon}\qquad(T\gg\epsilon_F/k_B).$$
In the secon... | {
"domain": "physics.stackexchange",
"id": 25047,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solid-state-physics, electronic-band-theory",
"url": null
} |
So today I watched the Mythbusters episode that discussed the "Monty Hall paradox" - the infamous probability problem. The Monty Hall paradox is well-known enough that I've come across before during maths lessons in school, in probability and statistics textbooks, in lectures, on TV, and so on. This particular Mythbust... | {
"domain": "newey.me",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138131620184,
"lm_q1q2_score": 0.8126200447387143,
"lm_q2_score": 0.831143054132195,
"openwebmath_perplexity": 660.7840745954676,
"openwebmath_score": 0.6401795744895935,
"tags": null,
... |
distortion
Could the jam jar's reflection and refraction be impacting the length of the pulses? If not, how can this effect be explained? Short answer: No.
Long answer: you can of course create shadowing that way, and that would disturb operation. And of course, a glass wall will refract infrared just as it refracts a... | {
"domain": "dsp.stackexchange",
"id": 4949,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "distortion",
"url": null
} |
java, object-oriented, json, generics, reddit
public long getScore() {
return score; }
public String toString() {
return subreddit + "=> " + score + "=>" + author + ": " + body; }
}
private class RedditComment extends RedditThing {
}
private class RedditPost extends RedditThing {
String... | {
"domain": "codereview.stackexchange",
"id": 31922,
"lm_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, json, generics, reddit",
"url": null
} |
complexity-theory
$$
(The second bound is Bonferroni's inequality.)
This shows that Schwartz–Zippel is essentially tight when $d$ is small compared to $\mathbb{F}$.
The bound $1-(1-1/|\mathbb{F}|)^d$ is tight for multilinear polynomials, see this answer on math.se. | {
"domain": "cs.stackexchange",
"id": 16999,
"lm_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",
"url": null
} |
performance, swift, formatting, hash-map
return Array(repeating: Money<Currency>(units: fraction + units.signum()),
count: remainder)
+ Array(repeating: Money<Currency>(units: fraction),
count: numParts - remainder)
}
Examples:
// Pound Sterling, minor unit is 0.01... | {
"domain": "codereview.stackexchange",
"id": 34678,
"lm_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, swift, formatting, hash-map",
"url": null
} |
# Area of surface
1. Feb 24, 2015
### Incand
1. The problem statement, all variables and given/known data
Calculate the area of the surface $x^2+y^2+z^2 = R^2 , z \ge h , 0 \le h \le R$
2. Relevant equations
$A(S_D) = \iint_D |\mathbf r'_s \times \mathbf r'_t|dsdt$
where $S_D$ is the surface over $D$. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9838471677827476,
"lm_q1q2_score": 0.8420267251786931,
"lm_q2_score": 0.8558511451289037,
"openwebmath_perplexity": 388.901196468416,
"openwebmath_score": 0.9359966516494751,
"tags... |
python, programming-challenge, python-2.x
I noticed in the thread for the solutions that many python solutions appeared to be in the 8-12ms range, 10x faster than my solution. As a result I was concerned with the performance of my solution. | {
"domain": "codereview.stackexchange",
"id": 15990,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, programming-challenge, python-2.x",
"url": null
} |
java, game, mvc, tic-tac-toe
public void changePlayer() {
String newPlayer = reverseValue(getCurrentPlayerString());
this.indicator.setText(newPlayer);
}
public void winGame() {
this.indicator.setText(getCurrentPlayerString() + " wygrał!");
for(JButton knob : this.knobs) {
... | {
"domain": "codereview.stackexchange",
"id": 11108,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game, mvc, tic-tac-toe",
"url": null
} |
python, numpy
# generate some test data ...
test_data = ''
for n in range(500 * 12 * 2 - 1):
test_data += chr(n % 256)
t0 = datetime.utcnow()
# in this example we have 6000 samples, 8 channels, 750 samples/channel
# data received is interleaved: A1, B1, C1, ..., A2, B2, C2, ... F750, G750, H750
channels = ('A', ... | {
"domain": "codereview.stackexchange",
"id": 3049,
"lm_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, numpy",
"url": null
} |
performance, algorithm, regex, perl
and later inside while loop,
# my $string = "Foo str bar rd foo";
$string =~ s/$reCombined/$replace{$1}{output}/g; | {
"domain": "codereview.stackexchange",
"id": 8339,
"lm_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, algorithm, regex, perl",
"url": null
} |
astrophysics, neutron-star, stellar-astrophysics, x-ray, gamma-rays
Is it as simple as $\partial \mathbf{B} / \partial t$ produces an electric field which accelerates charged particles that happen to be there, and then those accelerating particles radiate photons?
Does the energy radiated by these photons cary any si... | {
"domain": "astronomy.stackexchange",
"id": 4129,
"lm_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, neutron-star, stellar-astrophysics, x-ray, gamma-rays",
"url": nu... |
ros, ros-melodic, topic, publisher
TL;DR: Is it safe to assume that once the above mentioned connect_cb is triggered, the underlying TCP connection must have been established so that publishing messages using the returned ros::Publisher object will definitely deliver the message to the node denoted by ros::SingleSubsc... | {
"domain": "robotics.stackexchange",
"id": 33917,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, topic, publisher",
"url": null
} |
mole, mass-spectrometry
Title: Why is the relative atomic mass numerically equal to the gram atomic mass of the Atom? Why is it that the relative atomic mass of an atom is numerically equal to gram atomic mass?
For example,Relative Atomic Mass of Oxygen= 16 u
So,Gram atomic mass of Oxygen=16 g. The relative atomic ma... | {
"domain": "chemistry.stackexchange",
"id": 7661,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mole, mass-spectrometry",
"url": null
} |
kinematics, jacobian, dh-parameters
\end{matrix}
\right]$$
Please note that this is $6x3$ as it is used to compute both linear and rotational velocities of the end-effector based on the 3 joint velocities as follows:
$$ \left[ \begin{array}
\dot{x} \\ \dot{y} \\ \dot{z} \\ \dot{\alpha} \\ \dot{\beta} \\ \dot{\gamma}
... | {
"domain": "robotics.stackexchange",
"id": 2070,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinematics, jacobian, dh-parameters",
"url": null
} |
java, game
This can be rewritten like so:
public void displayGraph() {
for (int i = 0; i < graph.length; ++i) {
for (int j = 0; j < graph[i].length; ++j) {
if (graph[i][j] > 0) {
System.out.print("+");
}
else if (graph[i][j] == 0) {
System.ou... | {
"domain": "codereview.stackexchange",
"id": 7373,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game",
"url": null
} |
andrewkirk
Homework Helper
Gold Member
You have to show that if $H_m$ is a subgroup of order m then $H_m=\mu_m$.
Start by showing that any $g\in H_m$ must satisfy $g^m=1$.
You have to show that if $H_m$ is a subgroup of order m then $H_m=\mu_m$.
Start by showing that any $g\in H_m$ must satisfy $g^m=1$.
Well, since ... | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.931462514578343,
"lm_q1q2_score": 0.8042169184549387,
"lm_q2_score": 0.8633916082162403,
"openwebmath_perplexity": 84.64408633329504,
"openwebmath_score": 0.9411901831626892,
"... |
java, array, programming-challenge
Title: Hackerrank "Sherlock Holmes" challenge
Watson gives to Sherlock an array: A1, A2, ⋯, AN. He also gives to
Sherlock two other arrays: B1, B2, ⋯, BM and C1, C2, ⋯, CM. Then Watson asks
Sherlock to perform the following program:
for i = 1 to M do
for j = 1 to N do
... | {
"domain": "codereview.stackexchange",
"id": 9250,
"lm_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, array, programming-challenge",
"url": null
} |
waves
Title: Leading/Lagging terminology for sinusoidal waves Is there a method to identify which wave is leading and which wave is lagging from their equations?
For example, if the two waves are $A\sin(\omega t+\pi/6)$ and $A\sin(\omega t+2\pi)=A\sin(\omega t)$ (by trigonometric relations), is the second wave leadin... | {
"domain": "physics.stackexchange",
"id": 37616,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves",
"url": null
} |
ros2, ros-humble, callback, rostopic, rclcpp
rclcpp::Subscription<std_msgs::msg::String>::SharedPtr subscription_1_;
rclcpp::Subscription<std_msgs::msg::String>::SharedPtr subscription_2_;
};
int main(int argc, char *argv[]) {
rclcpp::init(argc, argv);
rclcpp::spin(std::make_shared<MinimalSubscriber>());
rclc... | {
"domain": "robotics.stackexchange",
"id": 39049,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2, ros-humble, callback, rostopic, rclcpp",
"url": null
} |
c++, algorithm, image, template, c++20
void print(std::string separator = "\t", std::ostream& os = std::cout) const
{
if(size.size() == 1)
{
for(std::size_t x = 0; x < size[0]; ++x)
{
// Ref: https://isocpp.org/wiki/faq/input-output#p... | {
"domain": "codereview.stackexchange",
"id": 45514,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, image, template, c++20",
"url": null
} |
organic-chemistry
Now, we look at the problem in hand. This reaction come down to inter- versus intra-molecular acylation reactions. It's always intra-molecular reaction is much more faster than same type of inter-molecular reactions (here is acylation reaction of both kind) due to proximity. Thus, this phenomenon ove... | {
"domain": "chemistry.stackexchange",
"id": 13159,
"lm_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",
"url": null
} |
physical-chemistry, hydrogen-bond
Title: Volatile nature due to hydrogen bonding Why does intramolecular hydrogen bonding make an organic (or possibly inorganic as well(?)) compound volatile.
What I think is that it might be due to decrease in the solubility of the compound as intermolecular hydrogen bonding cannot be... | {
"domain": "chemistry.stackexchange",
"id": 2876,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, hydrogen-bond",
"url": null
} |
biochemistry, cell-biology, cell-signaling
an integral membrane protein? This seems contradictory to my understanding of ligands, which (I thought) are released from the cell in order to signal with cells (be it the same, neighbor, or distant cells). Integral membrane protein ligands would only be useful for autocrine... | {
"domain": "biology.stackexchange",
"id": 4118,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, cell-biology, cell-signaling",
"url": null
} |
molecular-structure, symmetry
My book says it has a centre of symmetry, but not a plane of symmetry. But if I took a cut through any of the blue lines wouldn't both sides be symmetrical? Ivan already stated quite briefly in the comments, that the planes you drew would transform an upward facing chlorine to a downward... | {
"domain": "chemistry.stackexchange",
"id": 6068,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "molecular-structure, symmetry",
"url": null
} |
java, beginner, object-oriented
OOP
OOP doesn't mean to "split up" code into random classes with random inheritance relationships.
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 (a... | {
"domain": "codereview.stackexchange",
"id": 36867,
"lm_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, beginner, object-oriented",
"url": null
} |
slam, navigation, ekf, filter, kalman
MAP CONSTRUCTION
The map construction is at times so easy and so hard.
Basically it's really easy: you sample your sensor, transform the readings with the transformation matrix pertaining to the robot and sensor poses (Denavit-Hartemberg: kinematic chains) and put the output of th... | {
"domain": "robotics.stackexchange",
"id": 11879,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, ekf, filter, kalman",
"url": null
} |
reviewing the some definitions and results functions. Sets: every one has a partner and no one is left out and results about functions measure the... Or one-to-one ) if implies every one has a partner and no one left... Epimorphisms in the three preceding examples all used the same formula to determine the outputs ''. ... | {
"domain": "org.br",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9843363517478327,
"lm_q1q2_score": 0.8405373584622082,
"lm_q2_score": 0.8539127473751341,
"openwebmath_perplexity": 518.5773486296423,
"openwebmath_score": 0.9288099408149719,
"tags": nul... |
python, linked-list, memory-management, complexity
# coalesce next
if new_block.next and new_block.next.address == (new_block.address +
new_block.size):
new_block.size += new_block.next.size
new_block.next = new_block.next.next
... | {
"domain": "codereview.stackexchange",
"id": 44343,
"lm_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, linked-list, memory-management, complexity",
"url": null
} |
c#, .net, design-patterns, exception-handling
private void DoSomething()
{
try
{
// try something
}
catch (Exception ex)
{
SafetyNet net = new SafetyNet();
net.Abort = () => DoSomething_Abort();
net.Retry = () => DoSomething();... | {
"domain": "codereview.stackexchange",
"id": 1641,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, .net, design-patterns, exception-handling",
"url": null
} |
differential-geometry, geometry, kinematics, geodesics
\begin{align}
\Gamma^i_{jk}v^iv^k = 0.
\end{align}
This would, for example, be the case for cartesian coordinates on $\mathbb R^3$ because then, the Christoffel symbols would all vanish. | {
"domain": "physics.stackexchange",
"id": 9931,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "differential-geometry, geometry, kinematics, geodesics",
"url": null
} |
c++, beginner, object-oriented, tic-tac-toe
As marked by the comments, there are spurious semicolons there which should be removed.
Reconsider the interface
Right now there is little relationship between the game play, defined in main, and the Gameboard class. It would likely make the code simpler and better to move ... | {
"domain": "codereview.stackexchange",
"id": 33675,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, beginner, object-oriented, tic-tac-toe",
"url": null
} |
gazebo, laser, ros-kinetic
Originally posted by JoseJaramillo on ROS Answers with karma: 16 on 2018-12-27
Post score: 0
Try the using the non-GPU version of the laser.
Hello! I did that, it didn't work as expected.
However, I solved it by reinstalling-updating the NVIDIA drivers. works like a champ! Thank you anywa... | {
"domain": "robotics.stackexchange",
"id": 32211,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, laser, ros-kinetic",
"url": null
} |
parameterized-complexity, treewidth
For FPT computing of optimal branch decomposition, there is an algorithm of Bodlaender and Thilikos [2] which also has time complexity $2^{O(k^3)}n$. It uses very similar techniques as the Bodlaender's algorithm for treewidth. Similarly as for treewidth, no FPT algorithms with bette... | {
"domain": "cstheory.stackexchange",
"id": 5332,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "parameterized-complexity, treewidth",
"url": null
} |
cosmology, entropy, data-analysis
\begin{equation}
P_i = \left\{ \begin{array}{l} 1 \text{ for } i=j \\
0 \text{ otherwise} \end{array} \right.
\end{equation}
In the case 3), in the contrary, you have $P_i= 1/\Omega$ whatever $i$ (where $\Omega$ is your number of states), and this is a uniform probability distribut... | {
"domain": "physics.stackexchange",
"id": 62543,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, entropy, data-analysis",
"url": null
} |
homework-and-exercises, newtonian-gravity, potential-energy, planets, binding-energy
Title: Accurate Equation for Earth's Gravitational Binding Energy This is a relatively important question for anyone who can answer it. I am trying to find the equation that accurately solves for Earth's Gravitational Binding Energy. ... | {
"domain": "physics.stackexchange",
"id": 53519,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-gravity, potential-energy, planets, binding-ener... |
# Permuation of graph
## Question
Let $$G$$ be a Graph with $$100!$$ vertices,with each vertex labelled by a distinct permutation of the numbers $$1,2,3,...100.$$There is an edge between vertices $$u$$ and $$v$$ $$\text{iff}$$ the label of $$u$$ can be obtained by swapping two adjacent numbers in the label of $$v$$.L... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446425653805,
"lm_q1q2_score": 0.8155441917785998,
"lm_q2_score": 0.8376199653600372,
"openwebmath_perplexity": 263.2059900153976,
"openwebmath_score": 0.8828458189964294,
"tag... |
special-relativity, visible-light, speed-of-light, inertial-frames, observers
Einstein's second postulate immediately implies the following result:
It is impossible for an inertial observer to travel at c, the speed of
light in vacuum. We can prove this by showing that travel at c implies
a logical contradiction... | {
"domain": "physics.stackexchange",
"id": 68729,
"lm_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, visible-light, speed-of-light, inertial-frames, observers",
... |
Could anyone please give me any hints?
For the record, this is a question from Round 1 of the British Mathematical Olympiad.
• $$n+2008$$ needs to be factor of $$2008\cdot2009$$ – lab bhattacharjee Jan 10 '16 at 17:13
• Yes, I know that, and $n+2009$ needs to be a factor of $2009.2010$ but I'm not sure what more I co... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399086356109,
"lm_q1q2_score": 0.8358987553291168,
"lm_q2_score": 0.861538211208597,
"openwebmath_perplexity": 228.53500632625787,
"openwebmath_score": 0.9946723580360413,
"tag... |
python, pybedtools, pyranges
Now the result is:
print(gr)
# +--------------+-----------+-----------+-------------+------------+-----------+-----------+--------------+-----------+
# | Chromosome | Start | End | Score | Strand | Start_b | End_b | Strand_b | Gene |
# | (object) | ... | {
"domain": "bioinformatics.stackexchange",
"id": 1147,
"lm_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, pybedtools, pyranges",
"url": null
} |
neural-networks, convolutional-neural-networks
You want to know how many windows are necessary to cover an image of size $W$, given a window of size $K$ and stride $S$. So your image is a vector with indices $1, 2\dots, W$; as you put the first window on the image, the window will cover the indices from $1$ to $K$. As... | {
"domain": "ai.stackexchange",
"id": 2527,
"lm_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, convolutional-neural-networks",
"url": null
} |
quantum-field-theory, conformal-field-theory
2) To test invariance under conformal transformations you either have to calculate how your fields transform under special conformal transformations or under inversion. Invariance under inversion will imply conformal invariance since K=I*P*I where K is the generator of SCTs... | {
"domain": "physics.stackexchange",
"id": 13964,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, conformal-field-theory",
"url": null
} |
# Finding the equation of the normal to the parabola $y^2=4x$ that passes through $(9,6)$
Let $$L$$ be a normal to the parabola $$y^2 = 4x$$. If $$L$$ passes through the point $$(9, 6)$$, then $$L$$ is given by
(A) $$\;y − x + 3 = 0$$
(B) $$\;y + 3x − 33 = 0$$
(C) $$\;y + x − 15 = 0$$
(D) $$\;y − 2x + 12 = 0$$
My... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137910906878,
"lm_q1q2_score": 0.8404576240267597,
"lm_q2_score": 0.8558511414521922,
"openwebmath_perplexity": 133.97802776503522,
"openwebmath_score": 0.8091282248497009,
"ta... |
homework-and-exercises, energy, statistical-mechanics, electrons, temperature
Title: Kinetic energy of electron in metals Will it be correct to relate temperature of metal with kinetic energy of electron in metal just like as we do to find kinetic energy of gas molecules if we know the temperature by using the followi... | {
"domain": "physics.stackexchange",
"id": 33322,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, energy, statistical-mechanics, electrons, temperature",
... |
quantum-mechanics, quantum-information, decoherence
Decoherence tends to diagonalize the density matrix in the position basis because interactions are local in that basis. However, the kinetic terms compete with this, so decoherence in the position basis is never perfect. Over time, these two effects tend to continual... | {
"domain": "physics.stackexchange",
"id": 59176,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-information, decoherence",
"url": null
} |
java
This looks more concise than your first method but it is not really that obvious what is going on. You can probably guess it but to say for sure you will probably need some moments.
Maybe one can come up with something a bit more readable but I'm afraid that given the current setup it won't get much better.
To g... | {
"domain": "codereview.stackexchange",
"id": 28195,
"lm_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",
"url": null
} |
php, design-patterns, classes, php5, validation
Additionally, the above statement is redundant. At least in as far as you are checking if a field exists in your array on every iteration. Do it once outside of the loop and use that instead. But what is this even doing? You are saying that if one parameter is required, ... | {
"domain": "codereview.stackexchange",
"id": 2462,
"lm_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, classes, php5, validation",
"url": null
} |
graphs, directed-graphs, subgraphs
The characterization of $G'$ also indicates how to find it in linear-time as below.
Compute the condensation of $G$ using any one of the linear-time algorithms. (We can make this step much easier, since $G$ is transitively closed.)
Select the edges of the transitive reduction that c... | {
"domain": "cs.stackexchange",
"id": 19114,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs, directed-graphs, subgraphs",
"url": null
} |
quantum-field-theory, particle-physics, symmetry-breaking, beyond-the-standard-model, axion
Title: How come Goldstone boson, PQWQ axion, be able to have mass at all? Quote:
Goldstone's theorem: For every spontaneously broken continuous symmetry, there is a massless particle created by the symmetry current. | {
"domain": "physics.stackexchange",
"id": 62971,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, particle-physics, symmetry-breaking, beyond-the-standard-mod... |
c++, c++11, linux, logging, server
std::string LoggerConfig::path(void) const {
return get(LoggerConfig::LogPath) + "/" + get(LoggerConfig::LogName);
}
Unlike in C, it's unnecessary to specify void for functions that take no arguments. The compiler will already be aware of this.
In parseOpts(), it doesn't look li... | {
"domain": "codereview.stackexchange",
"id": 15773,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, linux, logging, server",
"url": null
} |
python, beginner, number-guessing-game
def play_game(secret):
for _ in range(limit):
guess = input('Enter guess: ')
if guess == secret:
message = "You got it!"
break
else:
message = "Out of guesses, you lose!"
print(message)
# the 5 here is the len... | {
"domain": "codereview.stackexchange",
"id": 43181,
"lm_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, number-guessing-game",
"url": null
} |
enthalpy
https://en.wikipedia.org/wiki/Morse_potential
My textbook states that in a reaction where NaOH dissolves in water, the energy of the solid NaOH is greater than the energy of the dissolved ions in water. Is the "energy" of the reactants and products determined by the bond strength?
Yes, this refers to the po... | {
"domain": "chemistry.stackexchange",
"id": 11860,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "enthalpy",
"url": null
} |
stem-cells, transplantation
Peripheral stem cell transplantation makes use of this ability. The donor first will be administered with certain drugs to proliferate stem cells in bone marrow and hereby raising the concretion of hematopoietic stem cells in blood. Those stem cells in blood then will be collected and trans... | {
"domain": "biology.stackexchange",
"id": 1604,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stem-cells, transplantation",
"url": null
} |
lambda-calculus, types-and-programming-languages
FV(t) is used for substitution in 5.3.5 and so has a more specific context, I.e.
x ↦ s = λy.[x ↦ s]t₁ if y ≠ x and y ≠ FV(s)
My implementation is in Prolog and the terms are converted to an AST before being passed to fv/2.
AST
app(abs(var(x),var(x)),var(x))
Pr... | {
"domain": "cs.stackexchange",
"id": 19555,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lambda-calculus, types-and-programming-languages",
"url": null
} |
c++, c++11, memory-management, graph, pointers
Object::iPtr::~iPtr() {
this->srcObj->outPtrs.erase(srcIter);
if (this->dstObj)
setDst(NULL);
graph().ptrs.erase(graphIter);
};
Object* Object::iPtr::getDst() const {
return dstObj;
};
void Object::iPtr::setDst(Object* dstObj) {
if (this->dstObj)
this-... | {
"domain": "codereview.stackexchange",
"id": 20478,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, memory-management, graph, pointers",
"url": null
} |
error-analysis
Title: Why aren't the 0's significant figures in 0.002? I understand that significant figures is a term used for "reliably known digits". However, what I don't understand is why the 0's are not counted among these in numbers such as 0.002. Surely, if we know that the units digit is 0, and that the tenth... | {
"domain": "physics.stackexchange",
"id": 61424,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "error-analysis",
"url": null
} |
materials, steel
Note that if the strain is not isotropic (i.e. is not purely hydrostatic), then the lattice strain field makes vacancies slightly larger in tensile-strain directions than in compressive-strain directions. As a result, the energy barrier to moving in the tensile directions will be lower than in the com... | {
"domain": "engineering.stackexchange",
"id": 506,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "materials, steel",
"url": null
} |
My main question is how does the substitution for L work? You substitute L for x_(n+1) and for x_n? I guess that requires the assumption that the sequence is converging, right? If not, why not? If so, how do you prove monotonic decrease and find the limit, given the series is recursive? | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750507184357,
"lm_q1q2_score": 0.8469388207842018,
"lm_q2_score": 0.85776809953619,
"openwebmath_perplexity": 272.1334771852378,
"openwebmath_score": 0.9591599106788635,
"t... |
c, linked-list, posix
/*
* Edits the node data.
* Reallocates memory for the the data, copies the data passed by the user to
* the reallocated space, and updates any necessary metadata.
*
* return:
* 0: OK.
* -ENOMEM: Aborted; failure to reallocate the data. Previous
* data is left ... | {
"domain": "codereview.stackexchange",
"id": 36852,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, linked-list, posix",
"url": null
} |
python, performance, google-app-engine, facebook
nose_img = None
try:
nose_img = images.Image(image_data=nose_data)
except Exception, e:
self.set_message(type=u'error',
content=u'Could not find nose img for file '
+ str... | {
"domain": "codereview.stackexchange",
"id": 719,
"lm_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, google-app-engine, facebook",
"url": null
} |
linear-programming, convex-hull
Title: The updated convex hull algorithms in 2023? I'm studying the convex hull algorithms in the high dimensions. There were two papers by Bernard Chazelle and T.M. Chan from the 90s, to have achieved the at then the state of the art complexity. However, when I tried to find the recent... | {
"domain": "cs.stackexchange",
"id": 21413,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "linear-programming, convex-hull",
"url": null
} |
We can split that problem into two inequalities:
1) $-Z < \frac{(\bar{x} - B)} {\frac{B}{\sqrt{n}}}$ and 2) $\frac{(\bar{x} - B)} {\frac{B}{\sqrt{n}}} < Z$
For the first one, we can first multiply both sides of the inequality by $\frac{B}{\sqrt{n}}$,
and we arrive at $\frac{-Z(B)}{\sqrt{n}} = \bar{x} - B$.
Then, add ... | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9896718477853187,
"lm_q1q2_score": 0.8247178940957195,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 454.84476499219835,
"openwebmath_score": 0.8561978936195374,
... |
algorithms, computational-geometry, nearest-neighbour, polygons
The polygons are closed.
I have ~300 such polygons with varying edges total sum of which is ~120000. The grid is of ~600000 points.
Required output is the set of points closest to the edge (the orange ones). It should be per edge ( edge 1 (x0,y0 to x1,y1... | {
"domain": "cs.stackexchange",
"id": 21147,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, computational-geometry, nearest-neighbour, polygons",
"url": null
} |
machine-learning, neural-network, deep-learning, keras, metric
Title: Neural Networks to Output Metrics other than Prediction I have a Deep Learning Network that predicts values. However, along with the prediction i also want it to output some further metrics. For example, for each image i want it to give me the total... | {
"domain": "datascience.stackexchange",
"id": 7455,
"lm_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, neural-network, deep-learning, keras, metric",
"url": null
... |
ros, nao-driver, actionlib, services
Title: Best approach for continuous blinking task
Hello!
I'm developping a small node that interfaces with nao_driver which is supposed to offer the user to start a blinking behaviour. The user is supposed to be able to turn on the behaviour and the stop it as needed.
I see two op... | {
"domain": "robotics.stackexchange",
"id": 11670,
"lm_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, nao-driver, actionlib, services",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.