text stringlengths 1 1.11k | source dict |
|---|---|
javascript, comparative-review
Title: Flatten an array - loop or reduce? Problem: Concat all sub-arrays of a given array.
Example input: [[0, 1], [2, 3], [4, 5]]
Example output: [0, 1, 2, 3, 4, 5]
Solution A: Use a loop
var flattened=[];
for (var i=0; i<input.length; ++i) {
var current = input[i];
for (var j=0; j<current.length; ++j)
flattened.push(current[j]);
}
Solution B: Use reduce
var flattened = input.reduce(function(a, b) {
return a.concat(b);
}, []); | {
"domain": "codereview.stackexchange",
"id": 12584,
"lm_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, comparative-review",
"url": null
} |
fracking, clathrates
Title: Do we know how large deposits of methane clathrates were formed in permafrost regions? We can see that there are large buildups of methane clathrates in permafrost regions. This seems different to the buildups of natural gas which fracking releases, which appear to have just come from escaped gases from oil/coal deposits. | {
"domain": "earthscience.stackexchange",
"id": 1823,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fracking, clathrates",
"url": null
} |
coordinate-systems, integration
$$
\begin{align}
&\int\frac{d^3\mathbf{p}}{(2\pi)^3}f(|\mathbf{p}|)\mathbf{\hat{p}}\cdot\mathbf{A}\exp(i\mathbf{p}\cdot\mathbf{B})\\
&=-i\mathbf{A}\cdot\boldsymbol{\nabla}_{\mathbf{B}}\int\frac{d^3\mathbf{p}}{(2\pi)^3}f(|\mathbf{p}|)\frac{1}{|\mathbf{p}|}\exp(i\mathbf{p}\cdot\mathbf{B})
\end{align}
$$
Now one can consider $\mathbf{B}$ to be along $z$ direction and continue to do the integration as usual. The integral would be a function of $|\mathbf{B}|$ and in the final step you must calculate the gradient of $g(|\mathbf{B}|)$ with respect to $\boldsymbol{\nabla}_\mathbf{B}$ which, I presume, wouldn't be that difficult to calculate. | {
"domain": "physics.stackexchange",
"id": 66183,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "coordinate-systems, integration",
"url": null
} |
java, object-oriented, homework
public int size() {
return this.carsArray.size();
}
public void addCar(Car element) {
this.carsArray.add(element);
}
public void removeCar(int carId) {
Car carToRemove = null;
for (Car c : carsArray) {
if (c.getCarID() == carId) {
carToRemove = c;
}
}
if (carToRemove != null) {
carsArray.remove(carToRemove);
} else {
throw new IndexOutOfBoundsException();
}
}
public void printCars() {
if (isEmpty()) {
System.out.println("Empty..");
} else {
for (Car c : carsArray) {
c.printDetails();
}
}
}
public boolean isEmpty() {
return carsArray.isEmpty();
}
}
Car Class:
package CarPartsB;
public class Car { | {
"domain": "codereview.stackexchange",
"id": 32348,
"lm_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, homework",
"url": null
} |
python, beginner, python-3.x
Here is an alternative:
if user_input in valid_decision_input:
return user_input
invalid_input = True
print("Please enter a valid input!")
Other concerns:
This will set a local invalid_input unless you declare it global at the top
Rather than returning a string, consider returning an Enum to narrowly represent user choice
Booleans
This:
if tv_characters == False:
should be
if not tv_characters: | {
"domain": "codereview.stackexchange",
"id": 38604,
"lm_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",
"url": null
} |
javascript, tree
}, {
"id": "13010302",
"children": [],
"name": "13010302 Function definition (specification system level)"
}, {
"id": "13010303",
"children": [],
"name": "13010303 Function definition (specification part level)"
}, {
"id": "13010390",
"children": [],
"name": "13010390 Function definition (unspecified)"
}],
"name": "130103 Function definition"
}, {
"id": "13010400",
"children": [{
"id": "13010490",
"children": [],
"name": "13010490 Concept interpretation (unspecified)"
}],
"name": "130104 Concept interpretation"
}, {
"id": "13010500",
"children": [{
"id": "13010590",
"children": [],
"name": "13010590 Patent and licence (concept development, unspecified)"
}],
"name": "130105 Patent and licence (concept development)"
}, {
"id": "13010600",
"children": [{ | {
"domain": "codereview.stackexchange",
"id": 29273,
"lm_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, tree",
"url": null
} |
## Stream: new members
### Topic: exists_elim
#### Michael Beeson (Jun 20 2020 at 16:54):
Below I will paste in a correct proof. My question is, please show me a couple of better ways to prove this simple theorem.
Q1: how can I do this without entering tactic mode? Q2: how can I do it entirely in tactic mode, i.e., what do I use in tactic mode that corresponds to exists.elim?
variables (p q r : nat→ Prop)
lemma test3 :
(∃ x:nat ,( p x ∧ q x ∧ r x) )→ (∃x:nat, (r x) ):=
assume h,
exists.elim h
begin
intros a h2,
existsi a,
exact h2.right.right,
end
#### Bryan Gin-ge Chen (Jun 20 2020 at 16:59):
variables (p q r : nat→ Prop)
-- Q1
lemma test3_term :
(∃ x:nat ,( p x ∧ q x ∧ r x) )→ (∃x:nat, (r x) ):=
assume h,
exists.elim h (assume a h2, exists.intro a h2.2.2)
-- Q2
lemma test3_tactic :
(∃ x:nat ,( p x ∧ q x ∧ r x) )→ (∃x:nat, (r x) ):=
begin
intro h,
cases h with a h2,
existsi a,
exact h2.2.2
end
#### Michael Beeson (Jun 20 2020 at 17:01): | {
"domain": "github.io",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9597620608291781,
"lm_q1q2_score": 0.8039158680360058,
"lm_q2_score": 0.8376199694135332,
"openwebmath_perplexity": 12210.223008515171,
"openwebmath_score": 0.5964941382408142,
"tags": null,
"url": "https://leanprover-community.github.io/archive/stream/113489-new-members/topic/exists_elim.html"
} |
javascript, performance, object-oriented, design-patterns
Your sub can be better if it just received a function instead of a function or an array. You can always create a separate function for adding an array, which in turn, just calls sub for each item in the array. This avoid bloating your sub.
lib.sub = function(event, handler){
if(typeof handler !== 'function') throw new Error('Handler not a function');
// Use existing array or create an array for event name
events[event] = events[event] || [];
// We can use indexOf to check if the value is in the array.
// If not, we push it there.
if(!~events[event].indexOf(handler)) events[event].push(handler);
}
lib.subArray = function(event, handlers){
handlers.forEach(function(handler){
lib.sub(event, handler);
});
} | {
"domain": "codereview.stackexchange",
"id": 15945,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, object-oriented, design-patterns",
"url": null
} |
1. Choose a combination of size $$k$$
2. Choose some ordering on that combination
And there are $$C$$ ways of doing part 1, and $$k!$$ ways to do part 2, so there are $$Ck!$$ ways to make a subpermutation of size $$k.$$ We haven’t double counted because we don’t double count in step 1 or 2 and two subpermutations need the same set and the same order to be equal. Therefore $$P=Ck!$$, but we happen to know $$P$$ and not $$C$$ so we can deduce $$C=\frac P{k!}$$
My favorite way of explaining this to myself actually would be something in this vein.
Suppose we have a set of $$n$$ objects, and we want to find the number of unique $$k$$-arrangements of them - that is, take $$k$$ objects from the $$n$$, and each unique arrangement counts as a single one. The term "arrangement" is important - that means order matters. We know this to be given by
$$P(n,k) = \frac{n!}{(n-k)!}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137900379085,
"lm_q1q2_score": 0.8266843944086281,
"lm_q2_score": 0.8418256472515684,
"openwebmath_perplexity": 167.3886790718227,
"openwebmath_score": 0.7704142332077026,
"tags": null,
"url": "https://math.stackexchange.com/questions/3120653/why-do-we-divide-permutations-to-get-to-combinations/3120718"
} |
electromagnetism
So (I lack of physical intuition and experience in electrodynamics), I will take into account the equations $$ \nabla\times \boldsymbol B = \mu_0\epsilon_0\frac{\partial \boldsymbol E}{\partial t},~~~~\nabla\times\boldsymbol E = -\frac{\partial \boldsymbol B}{\partial t},~~~~ \nabla\cdot\boldsymbol B = 0.$$
I end up with $\boldsymbol B = \frac{A\beta}{\omega}\sin\beta y\cos\omega t \boldsymbol{\hat k}+\boldsymbol f(x,y,z),$ where $\boldsymbol f:\mathbb R^3\to\mathbb R^3$. So I have a bunch of partial derivatives of $\boldsymbol f$ and of course I can't solve them as the warning adviced. Can you give me any hint that would lead me any further in solving this interesting problem? Thanks a lot! This is a nice physical intuition problem. Here's a kick along the intended path. | {
"domain": "physics.stackexchange",
"id": 22778,
"lm_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",
"url": null
} |
deep-learning, classification, comparison, terminology, prediction
When Classification and Prediction are not the same?
Gregory Piatetsky-Shapiro answers:
It is a matter of definition. If you are trying to classify existing data, e.g. group patients based on their known medical data and treatment outcome, I would call it a classification. If you use a classification model to predict the treatment outcome for a new patient, it would be a prediction.
gabrielac adds
In the book "Data Mining Concepts and Techniques", Han and Kamber's view is that predicting class labels is classification, and predicting values (e.g. using regression techniques) is prediction.
Other people prefer to use "estimation" for predicting continuous values. | {
"domain": "ai.stackexchange",
"id": 1678,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, classification, comparison, terminology, prediction",
"url": null
} |
electrical-engineering, energy-efficiency, renewable-energy
Title: Is it better to charge my electric car on windy days? There are various dashboards (for example, here) that show the current energy generation mix and the overall CO2 emissions (gCO2/kWh).
In the UK renewables can make up a large proportion of the total, but it is never 100% - there is always some fossil fuel generation (from natural gas and occasionally coal).
Naively, I feel I should charge my electric car when the CO2 emissions are low (typically on days when wind generation makes up a greater proportion of the total energy mix).
And a recent article in the New Scientist (Smart Scheduling for Big Computing Tasks Cuts Emissions Up to a Third) also concluded that CO2 emissions are lower if you plug in when renewable sources account for a greater proportion of the energy mix.
On the other hand, plugging my car into the grid presumably increases the load, which will be supplied by non-renewable generation (since renewables don't yet cover 100% of demand). | {
"domain": "engineering.stackexchange",
"id": 4555,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrical-engineering, energy-efficiency, renewable-energy",
"url": null
} |
• I want to upvote this multiple times! Super helpful :) – theonlygusti Feb 4 '17 at 9:20
• +1 anyway because it's a great introductory answer, but especially for "that's where this starts to get complicated (and interesting)" – Paul Evans Feb 4 '17 at 22:19
• @theonlygusti: Good news! You can upvote it two and a half times, because it was you who asked the question. Just click the tick mark on the left, and David K will get an extra 15 points. – TonyK Feb 6 '17 at 11:21
• @TonyK stop deleting and reposting that. – theonlygusti Feb 6 '17 at 11:51
• @theonlygusti: That is the only way to edit a mistake in a comment after the five-minute time limit has expired. I'm sorry if it spoiled your day. (And you still haven't clicked on that tick mark!) – TonyK Feb 6 '17 at 12:35
Element of curve length is $\sqrt{(\Delta x)^2+(\Delta y)^2}$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682444653241,
"lm_q1q2_score": 0.812872286445385,
"lm_q2_score": 0.8221891327004133,
"openwebmath_perplexity": 275.3712084090698,
"openwebmath_score": 0.9315614104270935,
"tags": null,
"url": "https://math.stackexchange.com/questions/2127642/how-to-find-length-of-a-part-of-a-curve/2127885"
} |
how to solve the missing ratios or proportions. If the thought of working math word problems frightens you, don’t panic. Always keep your workbook handy. Each group will contain manipulatives and a proportional situation. number of pink beads = 3. How much of each type of content will be needed to make a book of 400 pages? 2. Best team of research edit my paper online writers makes best orders for students. It is said that in a proportion if. Both firms have a total debt ratio (D/V) equal to 0. Math word problem worksheets. In this tutorial, you'll see how to take the information given in a word problem and write a ratio. Challenge Level: Is it cheaper to cook a meal from scratch or to buy a ready meal? What. You can express a ratio in any one of the following ways: 18 18:5 18 to 5. oz of lemonade is 3 : 1. Ratio Word Problems - Displaying top 8 worksheets found for this concept. In a box of 48 oranges 1 in every 6 oranges is rotten. Financial ratio analysis compares relationships | {
"domain": "lotoblu.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631671237733,
"lm_q1q2_score": 0.8109770726076169,
"lm_q2_score": 0.8221891283434876,
"openwebmath_perplexity": 1571.7178582619654,
"openwebmath_score": 0.35488325357437134,
"tags": null,
"url": "http://lotoblu.it/eign/ratio-word-problems.html"
} |
evolution, ornithology, digestion
An extensive work-out after a meal generally slows down metabolism, as blood is redistributed to the musculature and away from the digestive tract.
These findings imply that seed dispersal potential by mallards calculated from other experiments with resting birds may be underestimated.
Reference
- Kleyheeg et al., Oikos (2015); 124(7): 899–907 | {
"domain": "biology.stackexchange",
"id": 5577,
"lm_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, ornithology, digestion",
"url": null
} |
DEFINITION 4.6
v.
LeI VI. '12. . ... be vectors in a vector space V. A vector v in V is called a linear combination o f V I. '12 • .... 'Ik if
,
v = al'll +a2 v2+ ··· +at Vk= La jv)
for some real numbers (/1. (12 .
)=1
.. .. {It.
Remark Summation nOlation was introduced in Section 1.2 for linear combinations of matrices. and properties of summation appeared in the Exercises for Section 1.2.
Remark Definition 4.6 was stated for a finite sct of vectors, but it also applies to an infinite set S of vectors in a vector space using corresponding notation for infinite sums.
EXAMPLE 7
In Example 5 we showed that W. the set of atl vectors in R J of the fo rm [
~:
],
a+h
where a and b are any real numbers, is a subspace o f R 3. Let
Then every vector in lV is a linear combination of V I and
V2.
since
EXAMPLE 8 | {
"domain": "silo.pub",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.97737080326267,
"lm_q1q2_score": 0.8080039639783043,
"lm_q2_score": 0.8267117876664789,
"openwebmath_perplexity": 4465.94787859596,
"openwebmath_score": 0.8407867550849915,
"tags": null,
"url": "https://silo.pub/elementary-linear-algebra-with-applications-9th-edition.html"
} |
# Linear Vs Exponential Functions Guided Notes | {
"domain": "mozzicristina.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682458008671,
"lm_q1q2_score": 0.8012947608936889,
"lm_q2_score": 0.8104789086703225,
"openwebmath_perplexity": 1190.0006006151593,
"openwebmath_score": 0.3766786456108093,
"tags": null,
"url": "http://www.mozzicristina.it/linear-vs-exponential-functions-guided-notes.html"
} |
electrolysis
Anyway you have not described the composition of the electrolyte. Common metals like iron and zinc are altered by acids, with or without electrolysis. | {
"domain": "chemistry.stackexchange",
"id": 14602,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrolysis",
"url": null
} |
python, python-3.x
Title: RAID 4 Simulation (for learning purposes) I have created a Python 3 program that simulates a RAID 4 configuration, using lists as the simulated HDDs.
a = RAID4() creates a variable of the class RAID4.
a.convert_to("string to make raided", 4): convert_to takes a string input and a number of HDDs to create. It then turns the string into bytes, and evenly splits the bits across the HDDs, leaving the parity HDD empty. It then generates parity and stores the HDDs. A RAID4 class object is returned.
Once this has been done you can:
Simulate a HDD being corrupt or destroyed by a.remove_hdd(2).
Repair the RAID configuration by running a.repair().
Print a table of the HDDs by print(a).
Get the string from the HDDs by running str = a.convert_from().
What I'm asking: | {
"domain": "codereview.stackexchange",
"id": 29060,
"lm_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",
"url": null
} |
lidar, turtlebot, cartographer, xtion, rtabmap
Comment by matlabbe on 2017-12-01:
In your screenshots, the TF between lidar and camera seems ok, as the lidar scans (cyan points) are aligned with their corresponding clouds created from the camera.
Comment by JunJun on 2017-12-03:
Thank you for your answer.
I got what you said.
As you said, I measure and set TF.
Below link is TF of my robot.
link text | {
"domain": "robotics.stackexchange",
"id": 29470,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lidar, turtlebot, cartographer, xtion, rtabmap",
"url": null
} |
speed-of-light, faster-than-light
Title: Faster than light morse code v2 Imagine a theoretical superhard steel cylinder pointed towards the moon , 1 cm in radius and 380,000 km long, traveling at 1km per hour towards the moon. Parallel to this cylinder, 1 meter away we have a magnetic cylinder of equal dimensions, not moving. If we pushed the magnetic cylinder "down" towards the moving steel cylinder, causing the steel cylinder to stop, would both the earth side and the moon side stop at the same time?
Would this pulse be a faster than light morse code machine? If you synchronize the pushes at the two ends then you can make the ends stop at the same time. Or you can make one step before the other, either way around. | {
"domain": "physics.stackexchange",
"id": 76482,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "speed-of-light, faster-than-light",
"url": null
} |
• Dude, you are one analytic/probabilistic machine! I don't know enough about analysis to know why such a $c$ and $\varrho$ exist in the first place; do you have a reference I can read? \\ Regarding the link, just take the final square bracket ] off -- for some reason it's put that in the link. Moreover, I did get the shift wrong (silly calculation error), and your answer of $10/21$ is correct. – Sam T Feb 6 '19 at 20:26 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9843363494503271,
"lm_q1q2_score": 0.8223968189704332,
"lm_q2_score": 0.8354835411997898,
"openwebmath_perplexity": 186.61662410634125,
"openwebmath_score": 0.9716372489929199,
"tags": null,
"url": "https://math.stackexchange.com/questions/3100543/how-many-times-would-you-have-to-roll-a-single-die-on-average-to-reach-a-sum-of"
} |
np-complete
Title: When is a problem strongly NP-complete Let the problem of the diophantic equation 0/1 be as follows.
Input : A polynomial equation on n variables whose coefficients are integers (ex : $2x^3_1 x_2 + x_1x^3_3 - 3x_4 = 8$)
Question: Does this equation have a solution in space {0,1}$^n$ ? (can we satisfy the equation by choosing for each variable the value 0 or 1?)
1 - How to prove that this diophantine equation 0/1 is NP-complete?
2 - How to prove that this diophantine equation 0/1 is Strongly NP-complete (ie its restriction to the case where all the coefficients are bounded by a polynomial of the number of variables is already NP-complete) This problem is strongly NP-complete; it is straightforward to reduce 3SAT to this problem. | {
"domain": "cs.stackexchange",
"id": 15655,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "np-complete",
"url": null
} |
c++, object-oriented
// _s = (_a + _b + _c) / 2;
//}
void setA(std::vector<Point> vertices)
{
_a = sqrt((vertices.at(2).getX() - vertices.at(0).getX()) * (vertices.at(2).getX() - vertices.at(0).getX())) + (vertices.at(2).getY() - vertices.at(0).getY()) * (vertices.at(2).getY() - vertices.at(0).getY());
}
void setB(std::vector<Point> vertices)
{
_b = sqrt((vertices.at(2).getX() - vertices.at(1).getX()) * (vertices.at(2).getX() - vertices.at(1).getX())) + (vertices.at(2).getY() - vertices.at(1).getY()) * (vertices.at(2).getY() - vertices.at(1).getY());
} | {
"domain": "codereview.stackexchange",
"id": 20905,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented",
"url": null
} |
machine-learning, neural-network, svm, computer-vision, object-recognition
Average Precision (AP). For the VOC2007 challenge, the interpolated
average precision (Salton and Mcgill 1986) was used to evaluate both
classification and detection. For a given task and class, the
precision/recall curve is computed from a method’s ranked output.
Recall is defined as the proportion of all positive examples ranked
above a given rank. Precision is the proportion of all examples above
that rank which are from the positive class. The AP summarises the
shape of the precision/recall curve, and is defined as the mean
precision at a set of eleven equally spaced recall levels
[0,0.1,...,1]:
AP = 1/11 ∑ r∈{0,0.1,...,1} pinterp(r)
The precision at each recall level r is interpolated by taking the
maximum precision measured for a method for which the corresponding
recall exceeds r: pinterp(r) = max p(r˜), where p(r˜) is the measured
precision at recall ˜r
About mAP
So does it mean that:
We calculate Precision and Recall: | {
"domain": "datascience.stackexchange",
"id": 3314,
"lm_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, svm, computer-vision, object-recognition",
"url": null
} |
So far it's mostly math, so choosing the proper boundary conditions is where physics starts.
• You are correct in the general sense. However, in the OP's problem a "matching" boundary condition is implied at $\infty$. Nice remark though. May 18, 2022 at 18:41
• @ZaellixA You're right, I missed it. I'm not entirely comfortable with it, however, since $\cos$ has no defined limit at $\pm\infty$, so you can't write any boundary condition at infinity. May 18, 2022 at 18:49
You did correct mathematics deriving the standing wave equation
$$y=2Acos(kx-\frac {kl}{2})sin(wt-\frac{kl}{2})$$ which comes as the superposition of
$$y_1=Asin(wt-kx)$$ and $$y_2=Asin(wt+kx-kl)$$
However the other equation of standing wave which is
$$y=2Asin(wt)cos(kx)$$
comes as the superposition of the following two wave equations
$$Y_1=Asin(wt-kx)$$ and $$Y_2=Asin(wt+kx)$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9518632316144274,
"lm_q1q2_score": 0.8090563064230748,
"lm_q2_score": 0.8499711718571774,
"openwebmath_perplexity": 328.99649939763265,
"openwebmath_score": 0.8380858898162842,
"tags": null,
"url": "https://physics.stackexchange.com/questions/709341/does-the-standing-wave-equation-proof-require-ell-n%CE%BB"
} |
c++, multithreading, parsing
I am not sure if dynamic polymorphic types could help here.
Please review the tokenize and tokenize_chunk functions source code if it could/need to be improved and LexemDataAtomic structure.
One the long question about function extraction/decomposition, the tokenize (tokenize_chunk for multithreaded version) function here does two things, namely creating the dictionaries and compiling the text and this makes sense, since both are done simultaneously and we same execution time here. People often say that function must have one responsibility only. This works if the responsibilities could be split logically. Is there a chance to split these two responsibilities here without performance impact? Note, that data size expected to be huge, so even an additional pass could affect the performance.
What could be done better? | {
"domain": "codereview.stackexchange",
"id": 45433,
"lm_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++, multithreading, parsing",
"url": null
} |
nomenclature, biosynthesis
Title: Difference between AjuA and ajuA in biosynthesis I cannot for the life of me figure this out. In the following figure, you can find ajuA and AjuA for example.
I do understand that the lower-case ones are the genes. The arrows indicate the direction of transcription. However, what is the difference to the upper-case AjuA? The text speaks of subunits. How are the two related? When do I speak of ajuA and when would I be talking about AjuA?
I would also be happy if you could point me in the direction of some literature about the basics of this kind of notation.
PS: I do understand the mechanisms of the biosynthetic route and am familiar with the different domains in the modules as well as PKS and NRPS modules. It's just the nomenclature: | {
"domain": "biology.stackexchange",
"id": 8693,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nomenclature, biosynthesis",
"url": null
} |
electrochemistry
In reality your system’s bandgap must actually exceed 2.0 eV, this is due to the kinetic constraints based in part on the OER (and to a lesser extent the HER ) and losses encountered within the light absorber. Of course, for a single light absorber there is a tradeoff between the percentage of utilized solar flux and the bandgap.
This explains why many efforts are focused on using dual light absorbers, with one dedicated to the anode and another for the cathode. In this tandem structure they can efficiently utilize more of the solar spectrum. If you were to stack these light absorbers and use a 1.2 eV and 1.8 eV materials (with each one carrying out one of the two half-reactions required to split water), you could in theory get twice the efficiency compared to a single absorber with a bandgap of 2.2 eV. | {
"domain": "chemistry.stackexchange",
"id": 3718,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry",
"url": null
} |
java, stream, iterator
private int next;
private final IntPredicate proceed;
private final IntUnaryOperator step;
private boolean terminated;
public WhileIterator(int next, IntPredicate proceed, IntUnaryOperator step) {
this.next = next;
this.proceed = proceed;
this.step = step;
this.terminated = !proceed.test(next);
}
@Override
public void forEachRemaining(IntConsumer action) {
while (!terminated) {
action.accept(next);
next = step.applyAsInt(next);
terminated = !proceed.test(next);
}
}
@Override
public boolean hasNext() {
return !terminated;
}
@Override
public Integer next() {
return nextInt();
} | {
"domain": "codereview.stackexchange",
"id": 13544,
"lm_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, stream, iterator",
"url": null
} |
homework-and-exercises, cosmology, units, neutrinos
Finally, the thermally averaged cross-section $\langle \sigma|v|\rangle$ has units of area times speed, $L^3 T^{-1}$ (where $T$ denotes units of time). Since we are insisting on bringing out all factors of $c$, $\hbar$, and $k_B$, we change $T\rightarrow k_B T$ and, noticing that $G_F$ has units $EL^3$ (see, for instance, p.313 of Griffiths' Introduction to Elementary Particles, 2nd ed.), we can also change $G_{F}\rightarrow G_{F}/(c\hbar)^3$. Now, the product $(k_B T)^2 \,(G_{F}/(c\hbar)^3)^2$ has units of $E^{-2}$. We multiply this by $c^3\hbar^2$, which has units $E^2L^3T^{-1}$ (since $\hbar$ has units $ET$), to produce the dimensionally correct expression for the thermally averaged cross-section:
\begin{equation}
\langle \sigma|v|\rangle = \bigg(\frac{G_{F}}{c^3\hbar^3}\bigg)^2\, (k_B T)^2 \, c^3\hbar^2
\end{equation} | {
"domain": "physics.stackexchange",
"id": 18009,
"lm_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, cosmology, units, neutrinos",
"url": null
} |
wecan take the square root of is 25 Recording. I also made a point of explaining every step radicals, since a power multiplies the exponents 8. To define the square root is a number outside the real number system order! Apply to negative radicands includes Student Recording Sheet and Answer Key for task cards – simplify radicals we. 2 squared is 2 Essential Question How do you simplify square Roots, you to!, and often students find ways to simplify the square root the original number Sheet and Key!, move each group of prime factors outside the radical sign first radical form and How. First to identify if they are doing algebra 2 review tutorial explains to! May not be same the prime factorization of the number inside the radical sign or may. Click here to review the steps, jut square root of 2 squared is 2 inside radical... =, to rewrite as is part of a negative number on the outside selected among thousands of on! Root is a perfect square with imaginary numbers the appropriate number | {
"domain": "gob.mx",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.981735721648143,
"lm_q1q2_score": 0.8116124997470036,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 607.5708475436666,
"openwebmath_score": 0.7944364547729492,
"tags": null,
"url": "http://gob2018.morelia.gob.mx/m879h4w8/viewtopic.php?id=becddd-how-to-simplify-radicals-with-a-number-on-the-outside"
} |
c#, graph
internal Graph<MapTile> Build()
{
var edges = new Dictionary<MapTile, IEnumerable<MapTile>>();
for (var x = 0; x < width; x++)
{
for (var y = 0; y < height; y++)
{
var location = new Coordinate(x, y);
var tile = CreatMapTile(location);
edges[tile] = CreateEdges(tile);
}
}
return new Graph<MapTile>(edges);
}
}
An example of actually creating a map is (I only wrote this for CR so not really wanting it to be reviewed):
static void Main(string[] args)
{
var mapBuilder = new RectangularMapGenerator(10, 10);
for (var x = 1; x < 4; x++)
{
for (var y = 7; y < 9; y++)
{
mapBuilder.AddWall(new Coordinate(x, y));
}
}
for (var x = 4; x < 7; x++)
{
for (var y = 0; y < 10; y++)
{
mapBuilder.AddWater(new Coordinate(x, y));
}
}
var graph = mapBuilder.Build(); | {
"domain": "codereview.stackexchange",
"id": 18724,
"lm_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#, graph",
"url": null
} |
signal-analysis, sampling, periodic, reconstruction
frequency = 1000 #Freq in Hz
sample_rate = 48000 # Reasonable Sample rate
period = 1 / frequency
num_samples_per_period = int(period * sample_rate)
# Generate one period of sine wave
t = np.arange(0, period, 1/sample_rate)
sine_wave = np.sin(2 * np.pi * frequency * t)
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paFloat32,
channels=1,
rate=int(sample_rate),
output=True)
# Infinite loop
while True:
stream.write(sine_wave.astype(np.float32).tobytes())
stream.stop_stream()
stream.close()
p.terminate()
You can confirm that the correct signal is being generated correctly using this website. Also don't forget to pip install pyaudio | {
"domain": "dsp.stackexchange",
"id": 12192,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, sampling, periodic, reconstruction",
"url": null
} |
An equivalence relation on a set $S$ "divides" that set into disjoint subsets, called equivalence classes. Now, suppose $\sim$ is an equivalence relation and $a \in S$. The equivalence class of $a$ under $\sim$, denoted $[a]$ is defined by
$$[a] := \{ b \in S \,|\, a \sim b\}$$
So, in your example, given a non-zero integer $n$, its equivalence class is the set
$$[n]:= \{ m \in \mathbb{Z}\setminus\{0\} \, \mid \, nm > 0\}$$
By definition of an equivalence relation, $\sim$ is reflexive, which means that $a \sim a$ for every $a \in S$, so $a \in [a].$
Using this property for $2 \in \mathbb{Z}\setminus \{0\},$ we see that $2 \in [2]$, which is true since $2 \cdot 2 >0$.
$3$ is also a member of $[2]$, since $2 \cdot 3 > 0$, but $-2 \not\in [2]$, since $2 \cdot (-2) < 0,$ so we have at least two distinct equivalence classes.
Hope this helps. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241956308277,
"lm_q1q2_score": 0.8489215275082248,
"lm_q2_score": 0.8757869981319862,
"openwebmath_perplexity": 90.6393596607566,
"openwebmath_score": 0.8693909645080566,
"tags": null,
"url": "https://math.stackexchange.com/questions/1963793/how-many-equivalence-classes-in-the-equivalence-relation"
} |
asymptotics
$$ \log^kn \geq C \sqrt{n} $$
to hold for some $C>0$ and large $n$. Taking the logarithm,
$$
k \log \log n \geq \log C + \tfrac{1}{2}\log n,
$$
and so
$$
k \geq \frac{\log C + \tfrac{1}{2}\log n}{\log\log n}
$$
should hold for large $n$. In other words,
$$
k = \frac{\log n}{2\log\log n} + \Omega\left(\frac{1}{\log\log n}\right).
$$ | {
"domain": "cs.stackexchange",
"id": 15458,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "asymptotics",
"url": null
} |
• The obvious next question is : since the converse is false in general, is it true when $U$ is of the form $I+N$ where $N$ is nilpotent. Alas, it doesn't work : when $N=\left(\begin{array}{cc} 0 & 3 \\ 0 & 0\end{array}\right)$, then $I+N$'s only eigenvalue is $1$ but it is not P.D. Too bad ... – Ewan Delanoy Nov 26 '17 at 5:23 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769099458927,
"lm_q1q2_score": 0.8171626975149309,
"lm_q2_score": 0.8376199653600372,
"openwebmath_perplexity": 265.3360474180617,
"openwebmath_score": 0.9526810646057129,
"tags": null,
"url": "https://math.stackexchange.com/questions/670650/square-root-of-positive-definite-nonsymmetric-matrix"
} |
quantum-mechanics, homework-and-exercises, quantum-information, density-operator, quantum-states
To summarize: Proving that $\rho_A$ is positive semi-definite and of unit trace shows that it admits a representation of the form $(6)$ and thus proves that it is a density operator in terms of your definition. | {
"domain": "physics.stackexchange",
"id": 88771,
"lm_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, quantum-information, density-operator, quantum-states",
"url": null
} |
shell, sh
Another useful shell idiom to pass optional arguments to a shell script without hassle is to set variables only if they're unset. That way you can pass arguments through the environment, e.g. file=v0.9.1 myscript.
: "${file=v0.9}"
: "${renamed=$file.tar.gz}"
: "${dir=utils/external/firepython/}"
: "${location=https://github.com/darwin/firepython/tarball/$file}" | {
"domain": "codereview.stackexchange",
"id": 26333,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "shell, sh",
"url": null
} |
java, multithreading, concurrency
Title: Printing even and odd using two concurrent threads Please review the code below where thread Odd prints all odd numbers from 1 to 9 and thread Even prints all even numbers from 2 to 8. I tested it and it works but can we improve it from design or performance perspective?
To print odd
public class Odd implements Runnable{
private Monitor sharedObject;
public Odd(Monitor monitor){
this.sharedObject = monitor;
}
@Override
public void run() {
try {
printOdd();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
private void printOdd() throws InterruptedException {
synchronized(sharedObject){
for(int i=1; i< 10; i++){
if(i%2!=0){
while(!sharedObject.isOdd()){
sharedObject.wait();
}
System.out.println("Odd: "+ i);
sharedObject.setOdd(false);
sharedObject.notifyAll();
}
}
}
} | {
"domain": "codereview.stackexchange",
"id": 16365,
"lm_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, multithreading, concurrency",
"url": null
} |
galaxy, star-formation, terminology
What is meant by 'radial direction' of a galaxy ? 'Radial direction' typically means from the center, moving outwards. Typically, these kinds of studies will break a galaxy up into several annuli, or rings, and examine the star formation activity within each ring. (Imagine drawing a series of concentric circles, each one a little bigger than the last.) Then, if the star formation rate or star formation history changes as a function of radius, those changes can be more easily quantified.
It is often difficult to do this well because galaxies are not perfectly symmetric. The LMC, for instance, is a dwarf irregular galaxy, meaning its structure is not nearly as orderly as some other galaxies (e.g. The Milky Way, which is a spiral). The LMC does contain more stars near its center, and it even has a bar, but it is difficult to discern much more structure than that. To define the center of such a galaxy, the total light profile is measured and the centroid calculated. | {
"domain": "astronomy.stackexchange",
"id": 392,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "galaxy, star-formation, terminology",
"url": null
} |
# Induction problem? (ratio of consecutive Fibonacci numbers)
Define $a_1 = 1$ and for all natural $n$'s, $a_{n+1} = 1 + \dfrac{1}{a_n}$.
Prove that for every natural $n$, $$a_n = \dfrac{F_{n+1}}{F_n}.$$
I'm not sure if this is an induction problem or not, but could someone help me understand what is going on?
-
What have you tried? Where are you stuck? – JavaMan Nov 28 '12 at 5:41
Compute the first few, by hand, expressing the answers in the form $\frac{x_n}{y_n}$. Soon you will see what's going on. – André Nicolas Nov 28 '12 at 5:43
Ok I'll try something and then I'll come back. – blutuu Nov 28 '12 at 5:46
Ok I've computed a few n terms and everything after n = 1 seems to produce fractions (that is if my arithmetic is correct). What would you think I should do? – blutuu Nov 28 '12 at 5:57
Yeah I hadn't thought about doing that until recently. I'll fix that – blutuu Nov 28 '12 at 6:23 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846672373524,
"lm_q1q2_score": 0.8410818342375069,
"lm_q2_score": 0.8596637523076225,
"openwebmath_perplexity": 534.7687984177421,
"openwebmath_score": 0.8985628485679626,
"tags": null,
"url": "http://math.stackexchange.com/questions/246284/induction-problem-ratio-of-consecutive-fibonacci-numbers"
} |
algorithms, algorithm-analysis, graph-traversal
If we are using DFS starting from vertex $a$ and we are traversing in alphabetical order, i.e. explore b first, then we end up with two tree edges, which are $(a,b)$ and $(a,c)$. Therefore, $b$ and $c$ are leaf-vertices.
But here if are going to delete vertices $b$ and $c$ the edge $(c,b)$ has no incident vertices which are contained in our vertex cover.
Am I right? I am confused actually. Look at the definition of vertex cover (as provided by the book). It is strictly defined on undirected graphs. Thus, the answer doesn't apply to directed graphs, nor to any other kinds of graphs you might think of. So your counterexample is invalid, as it makes invalid assumptions (graphs are always undirected here). These invalid assumptions are the source of your confusion. | {
"domain": "cs.stackexchange",
"id": 7026,
"lm_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, algorithm-analysis, graph-traversal",
"url": null
} |
ros, sensor-msgs, 2d-image, roslibjs
Title: roslibjs subscribe to sensor_msgs/image
Hello,
I couldn't find an example of how to subscribe to a sensor_msgs/image and display it in a html5 canvas. I already have a page running and I can somehow access the data, but it won't display in an image nor in a html5 canvas. This is an excerpt of my test code:
imageTopic.subscribe(function(message)
{
var imagedata = "data:image/jpeg;base64," + message.data;
document.getElementById('xy_image').setAttribute('src', imagedata);
imageTopic.unsubscribe();
});
First of all: how can I access the frames without subscribing to the topic every time and unsubscribing to it again? Second: The message.data seems correct, but the header doesnt work and the image is not displayed. I tried png as well, with no success. I would be happy if you could help me out - maybe with a basic example.
Thanks in advance | {
"domain": "robotics.stackexchange",
"id": 26786,
"lm_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, sensor-msgs, 2d-image, roslibjs",
"url": null
} |
ros, ros-release
Title: How to release for multiple ROS versions when version dependent patches are needed?
Hello,
due to the recent change in Bullet[1], I have to patch my stack when releasing for unstable
but not when releasing for Electric. The SCM I use for this stack is Git.
Then problem is that even if create.py maintains different branches for each ROS version (unstable and electric in my case), it always update them using the current state of the master branch.
What I would like to do in this case is comitting myself on unstable to handle [1]. Then I would like create.py to use the current state of the unstable branch to create the release.
Is it possible to do so? Is there something I am missing?
Thanks!
[1] ros-users Bullet change in unstable for Fuerte | {
"domain": "robotics.stackexchange",
"id": 7515,
"lm_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-release",
"url": null
} |
optics, diffraction
(Eq. 90) $ U_{pw}(s_x,s_y,z) = U_{pw}(s_x,s_y,z_0) \times e^{-jk(z-z_0)+j\pi\lambda(s_x^2+s_y^2)(z-z_0)}$
Retrieve the field at the new plane by performing a Fourier transform.
(Eq. 91) $ u(x,y,z) = \int\int{U_{pw}(x,y,z) \times e^{-j2\pi(s_xx+s_yy)}}ds_xds_y$
I've written some MATLAB code to try and calculate the diffraction pattern given an illuminated circular aperture. I can predict the Airy disc diameter, but I can't get a matching solution by using transforms. I think my issue may be related to how I am taking samples for the transforms?
%% Example: Circular aperture.
lambda = 632.8e-9; % 632.8nm wavelength light.
diameter = 100e-6; % 100um circular aperture diameter.
aperturez = 0; % Aperture is located at z=0.
imagez = 100e-2; % 100cm from the aperture to the image plane.
aperture_sample_width = 5e-4; % Sample the aperture for a width of 0.5mm.
% image_sample_width = 2e-2; % Sample the image plane for a width of 2cm. | {
"domain": "physics.stackexchange",
"id": 64087,
"lm_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, diffraction",
"url": null
} |
kinect, skeleton-tracker, ros-hydro, ubuntu, ubuntu-precise
I am not sure what this means or how to fix the problem...thanks for your help.
Originally posted by sealguy77 on ROS Answers with karma: 323 on 2014-11-27
Post score: 0
I have found the solution to my issue on this page and this page.
And was able to successfully view the tf for all my 'joints' via Rviz using this page.
Thanks.
Originally posted by sealguy77 with karma: 323 on 2014-11-30
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 20188,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinect, skeleton-tracker, ros-hydro, ubuntu, ubuntu-precise",
"url": null
} |
It may be of interest to determine if the partial correlation is significantly different than 0. The CDF value for this test is
CDF = FCDF(VAL,1,N-3)
where FCDF is the F cumulative distribution function with 1 and N - 3 degrees of freedom (N is the number of observations) and VAL = ABS((N-3)*R**2/(1 - R**2)) with R denoting the computed partial correlation. The pvalue is 1 - CDF. | {
"domain": "nist.gov",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9942697546735803,
"lm_q1q2_score": 0.812889573872435,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 5605.670078404996,
"openwebmath_score": 0.7563793659210205,
"tags": null,
"url": "https://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/partcorr.htm"
} |
java, multithreading
Here's the main program which uses instances of PrimalityTest1Worker as threads:
import java.util.Locale;
import java.text.NumberFormat;
/**
* The master program for the multithreaded primality test that creates
* objects of the PrimalityTestWorker1 to make threads, and then collates
* the results and prints them to stdout.
*
* @author Tirthankar Mazumder
* @version 1.0=2
* @date 3rd May, 2021
*/
public class PrimalityTestParallel1Runner {
public static final int cores = Runtime.getRuntime().availableProcessors();
//We will spawn as many threads as there are cores on the system, and not
//more than that because we are not I/O bound here.
public static final long max = PrimalityTestSerial.max;
//For consistency.
public static void main(String[] args) {
long startTime = System.currentTimeMillis();
primeCalculator(); | {
"domain": "codereview.stackexchange",
"id": 41253,
"lm_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, multithreading",
"url": null
} |
phylogenetics, python, format-conversion
Then, save this script as phylpwrtr.py and do:
chmod +x phylpwrtr.py
./phylpwrtr.py input.fa output_longids.phy 30 # 30 is the width of the header, adjust the value to adjust header length
The contents of output_longids.phy looks like:
4 32
virusA_detailed_description ACGTGACGAT CCCCAAACGT GACGATCCCC AA
virusB_detailed_description ACGTGACGAT CGGGAAACGT GACGATCGGG AA
virusC_detailed_description ACGTGACGAT CAAAAAACGT GACGATCAAA AA
virusD_detailed_description ACGTGACGAT TTTTAAACGT GACGATTTTT AA | {
"domain": "bioinformatics.stackexchange",
"id": 1475,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "phylogenetics, python, format-conversion",
"url": null
} |
c++, file-system, assembly, c++17
are simply ignored and should be discarded.
Write member initializers in declaration order
The AssemblyLine class has this constructor:
AssemblyLine::AssemblyLine(uint8_t code, uint8_t byteCount, const uint8_t param1, const uint8_t param2) :
code(code),
byteCount(byteCount),
param1(param1),
param2(param2)
{
}
That looks fine, but in fact, byteCount will be initialized before code because members are always initialized in declaration order and byteCount is declared before code in this class. To avoid misleading another programmer, you should swap the order of those such that it says instead:
AssemblyLine::AssemblyLine(uint8_t code, uint8_t byteCount, const uint8_t param1, const uint8_t param2) :
byteCount(byteCount),
code(code),
param1(param1),
param2(param2)
{
}
Make character constants visible
One line in OpCodeCatalog.cpp looks like this:
const auto tokens = FileReaderHelper::splitString(line, ' '); | {
"domain": "codereview.stackexchange",
"id": 31501,
"lm_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++, file-system, assembly, c++17",
"url": null
} |
a square is a parallelogram ’ d need for ASA consists of angle DHG and relationship! Other diagonal and determine if the baseball diamond is a parallelogram using the converses of the theorems the... The diagonal divides a parallelogram $25 for each hour she dances:. Into two segments of equal length the rest on the left is made up of the theorems from the section. N proving the parallelogram diagonal theorem parallelograms: rhombus, Rectangles This video geometry lesson gives the of!, ( 3ab+2bc ) meters ( ΔABD ) = ar ( ΔCDB ) is. Opposite sides in a parallelogram is a parallelogram, AE is conruent to CE and be is congruent itself. Prove of two equal and parallel, then it is a parallelogram of e … Volume. Parallelogram are equal and parallel are parallelograms with congruent diagonals theorem if a quadrilateral a!: rhombus, Rectangles This video lesson discusses the properties of the three gears if she wishes to at... Parallelogram using the converses of the theorems from the previous | {
"domain": "higgsme.ir",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9553191259110588,
"lm_q1q2_score": 0.8100798140638624,
"lm_q2_score": 0.8479677545357568,
"openwebmath_perplexity": 1001.6566035361559,
"openwebmath_score": 0.626719057559967,
"tags": null,
"url": "https://higgsme.ir/adxb6i1d/cca795-proving-the-parallelogram-diagonal-theorem"
} |
python, pygame, battle-simulation, pokemon
Game.opponent_can_switch = True
if pokemon.current_health > 0:
Win = False
else:
icon = [Pokemon.icon_x, (x_axis, 109)]
sprites.append(icon)
x_axis += 24 | {
"domain": "codereview.stackexchange",
"id": 23211,
"lm_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, battle-simulation, pokemon",
"url": null
} |
classical-mechanics
Note: the actual centripetal force on the surface of the Earth actually varies in direction relative to the force of gravity as you move away from the equator. The angle of the ground with respect to gravity also changes, since the Earth is closer to a geoid than a sphere. The general situation at any latitude requires friction to resolve, as well as treating the forces as vectors, since they aren't collinear, but the general principle that the force of gravity is stronger than the normal force, and that extra force provides the centripetal acceleration that maintains our circular motion, is still valid. | {
"domain": "physics.stackexchange",
"id": 28162,
"lm_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",
"url": null
} |
python, python-3.x, linux, automation
In extension_finder,
if os.path.exists(path):
if os.path.isfile(path):
return os.path.splitext(path)[1]
return False
can be simplified using
path.suffix
If path is a directory, the .suffix attribute will be an empty string.
You could then just rely on the empty string behaving falsy in boolean contexts.
The only thing you do with extension_finder is feeding it into category_selector.
More on that method later.
Note that, given the method name, extension_finder, I feel like it is not that method's responsibility to check for file existence.
You be the judge of that.
For existence checking, Path objects have is_file(), which includes exists() functionality.
Also note how for that function, you pass self and path, but do not use self.
This method is a prime candidate for a staticmethod.
@staticmethod
def extension_finder(path: Path) -> str:
"""Returns a path's file suffix. | {
"domain": "codereview.stackexchange",
"id": 38124,
"lm_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, linux, automation",
"url": null
} |
php, object-oriented, mysql, database, pdo
As you can see I added some @throws annotations to:
inform implementors of the interface which exception they can throw
informs consumers of the interface which exceptions they can catch
Although PHP cannot enforce the actual type of exceptions thrown from the implementations, documenting the exceptations makes it less likely that someone will implement it wrong.
Now lets make an implementaton for our specific connection:
class MyDatabaseConnector implements DatabaseConnector
{
public function createPdo(): \PDO
{
$dsn = ...;
$user = ...;
$password = ...;
$options = ...;
try {
return new \PDO($dsn, $user, $password, $options);
} catch (\PDOException $e) {
if ($e->getCode() === 1040) {
throw new TooManyConnectionsException($e->getMessage(), (int) $e->getCode(), $e);
} else {
throw new DatabaseConnectionException($e->getMessage(), (int) $e->getCode(), $e);
}
}
}
} | {
"domain": "codereview.stackexchange",
"id": 40956,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, object-oriented, mysql, database, pdo",
"url": null
} |
kinematics, mathematics, calculus
Title: If my displacement is Euler's number $e$ So, differential of $e^x$ ($e$=Euler's No.) is equal to $e^x$.
Now imagine I put $x=1$ and travel with a displacement $e$ (which is a constant) so we will be not moving anywhere since our displacement is constant. But (and this is where the question starts) as the differential of displacement w.r.t. time will be velocity and it will be $e^x$ where we put $x=1$ so velocity=$e$.
So now we have a constant non zero velocity but we also have constant displacement, that means even if we have a velocity we are not moving anywhere with passage of time.
I know I am wrong somewhere please can you tell me where. And please don't mind if it's a silly mistake. The velocity function $v(t)$ is the derivative of the displacement function $x(t)$, so $v(t)= x'(t)$. If $x(t)=e$ (a constant), then $v(t) = x'(t) = 0$.
If $x(t) = e^t$ (in some units), then $x'(t)= e^t$ as well, but in that case, $x(t)$ is not constant. | {
"domain": "physics.stackexchange",
"id": 82324,
"lm_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, mathematics, calculus",
"url": null
} |
physics
Originally posted by dcconner with karma: 298 on 2013-01-18
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by gerkey on 2013-01-18:
Indeed; Bullet integration is planned for Gazebo 1.5. You can follow along with the pull requests that are adding Bullet support (e.g., most recently: https://bitbucket.org/osrf/gazebo/pull-request/217/bullet-integration-spawn-and-drop-simple/). | {
"domain": "robotics.stackexchange",
"id": 2945,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physics",
"url": null
} |
java, algorithm, traveling-salesman
Every possible path would have to be either one or a mixture of these.
Reference.java
package T145.salesman;
import java.util.Random;
public class Reference {
private Reference() {}
public static final double[][] TRICKY_TRAPEZOID = { { 2, 4 }, { 4, 4 }, { 6, 4 }, { 3, 1 }, { 5, 1 } };
public static final double[][] SIMPLE_GRAPH = { { 1, 1 }, { 2, 3 }, { 3, 5 }, { 4, 3 }, { 5, 5 }, { 6, 1 }, { 7, 6 } };
public static final double[][] LINE = { { 1, 1 }, { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, { 7, 7 } };
public static final double[][] FLAT_LINE = { { 1, 1 }, { 2, 1 }, { 3, 1 }, { 4, 1 }, { 5, 1 }, { 6, 1 }, { 7, 1 }, { 8, 1 } };
public static final double[][] SQUARE = { { 1, 1 }, { 5, 5 }, { 1, 5 }, { 5, 1 } };
public static final double[][] SQUARE_WITH_CENTER = { { 1, 1 }, { 5, 5 }, { 1, 5 }, { 5, 1 }, { 3, 3 } };
public static final double[][] RHOMBUS = { { 2, 2 }, { 3, 5 }, { 4, 3 }, { 5, 6 } }; | {
"domain": "codereview.stackexchange",
"id": 28682,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, traveling-salesman",
"url": null
} |
strings, sql, sql-server, t-sql, edit-distance
DECLARE @answer NVARCHAR(32) = 'Cat'
Returns
+----------+--------+
| solution | score |
+----------+--------+
| cat | 0 |
| dog | 196624 |
+----------+--------+
which looks good so far. Searching for "Cat" matched "cat" with a perfect score.
But reverse the search to look for "cat" with an entry for "Cat" in the data...
insert @t(solution)
SELECT 'Cat'
UNION ALL
SELECT 'dog'
DECLARE @answer NVARCHAR(32) = 'cat'
Returns
+----------+---------+
| solution | score |
+----------+---------+
| dog | 196624 |
| Cat | 2097152 |
+----------+---------+
I suggest using a tried and tested string similarity algorithm such as Levenshtein distance - possibly implemented as a CLR function. | {
"domain": "codereview.stackexchange",
"id": 12297,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "strings, sql, sql-server, t-sql, edit-distance",
"url": null
} |
& \text{ if } (x,y) \ne (0,0)\\ Transcript. Would you like to be the contributor for the 100th ring on the Database of Ring Theory? As a consequence, if $$g$$ was differentiable at the origin, its derivative would be equal to zero and we would have \[\lim\limits_{(x,y) \to (0,0)} \frac{\vert g(x,y) \vert}{\Vert (x,y) \Vert} = 0$ That is not the case as for $$x \neq 0$$ we have $$\displaystyle \frac{\vert g(x,y) \vert}{\Vert (x,y) \Vert} = \frac{1}{2}$$. A function is said to be differentiable if the derivative exists at each point in its domain. The partial maps $$x \mapsto g(x,0)$$ and $$y \mapsto g(0,y)$$ are always vanishing. Nowhere Differentiable. However, $$h$$ is not differentiable at the origin. Sal analyzes a piecewise function to see if it's differentiable or continuous at the edge point. Conversely, if we have a function such that when we zoom in on a point the function looks like a single straight line, then the function should have a tangent line there, and thus be | {
"domain": "encoretheatercompany.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750518329435,
"lm_q1q2_score": 0.835262454050263,
"lm_q2_score": 0.8459424334245618,
"openwebmath_perplexity": 297.4254123935993,
"openwebmath_score": 0.9354566335678101,
"tags": null,
"url": "http://encoretheatercompany.com/i-wonder-udiqtww/354501-how-to-prove-a-function-is-differentiable-at-a-point"
} |
javascript, html
Use strict equality operator
You should use strict equality operator in your code, as it doesn't performs type conversion and is generally considered a good practice.
Don't location.reload()
You don't need to location.reload(), just reset() the form.
Don't encode before necessary
Currently you are encoding all strings before they are even randomly chosen. There is no need to do that. What if there were thousands of strings? Reverse the order of operations, first choose random string and just then encode it. That way, you won't even need to store results of encoding, by the way.
Naming
What you do is encoding and decoding with Base64, but one variable is named encryptedText. Comment on the same line have exactly the same naming issue. There is no encryption involved in your code, at all.
Replace two location.reload()s with one
You could remove two instances of location.reload() that you have in your code and add just one below the chain of conditional checks. | {
"domain": "codereview.stackexchange",
"id": 25195,
"lm_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, html",
"url": null
} |
c++, beginner, random, quiz
}
Fix your indentation. Most of the time when you open a block, you add a level of indentation, but unfortunately not always. Do it consistently and your code will be much more readable.
Don't ever use using namespace std;. Yes, book-authors are often forced by publishers to sacrifice on the altar of brevity whatever the consequences, but you aren't.
Read "Why is “using namespace std;” considered bad practice?".
Yes, you can use a single empty line in a function to graphically segregate blocks doing different things. Don't use multiple lines though, and consider whether extracting it into a well-named function might make things more readable, or at least allows you to reuse code.
One function you really should extract is this, which will be called by all challenges:
static void do_challenge(char op, int n1, int n2, int result) {
std::cout << "\n " << n1 << '\n' << op << ' ' << n2 << "\n ---\n ";
int answer;
if ((std::cin >> answer))
if (answer == result) | {
"domain": "codereview.stackexchange",
"id": 26536,
"lm_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, random, quiz",
"url": null
} |
algorithms, automata
By Moore's algorithm, at the end of loop we will have one unmarked edge between state 1 and 2.
As my guess above, the next step is joining both states.
But the result doesn't make sense. Most minimization algorithms assume automata to be complete s.t. for every state p and alphabet a, there is a transition where (p, a, q). Hence, for the case, we need to add one more state as a sink state.
The DFA becomes:
States: {1, 2, 3, 4}
Alphabet: {a, b}
Start : 1
Final : {3}
Transition :
{(1, a, 2), (1, b, 4), (2, a, 4), (2, b, 3), (3, a, 4), (3, b, 4),
(4, a, 4), (4, b, 4)}
By Moore's algorithm:
Picking edge(3,4) causes we mark edge(2,1) and edge(2,4) by b-transition.
Picking edge(2,4) causes we mark edge(1,4) by a-transition.
Now we don't have any unmarked edges left. Hence, no states has to be joined. | {
"domain": "cs.stackexchange",
"id": 5740,
"lm_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, automata",
"url": null
} |
inorganic-chemistry, redox, aqueous-solution, stability, reactivity
Title: Reaction of aqueous sodium carbonate with aluminum foil Aqueous sodium hydroxide is known to react with aluminum foil in an exothermic, hydrogen-gas releasing reaction like $$\ce{2NaOH(aq) + 2Al(s) + 2H2O(\ell) → 2NaAlO2(aq) + 3H2(g)}$$
However, on youtube, it looks like someone was able to substitute NaOH with Na2CO3 and get a vigorous similar-looking reaction as well: https://www.youtube.com/watch?v=ggPWdwcsyqM
Which makes me wonder — did they also form $\ce{NaAl(CO3)2}$ as well? E.g., via
$$\ce{2 Na2CO3(aq) + 4Al(s) + 6H2O(\ell) -> NaAl(CO3)2(aq) + 3NaAlO2(aq) + 6H2(g)}$$
Or was sodium carbonate merely used as a source of NaOH, from $$\ce{Na2CO3(aq) + H2O(\ell) \rightleftharpoons NaHCO3(aq) + NaOH(aq) }$$ It is rather:
$$\ce{2 Al + 6 H2O + 2 OH- -> 2 [Al(OH)4]^- + 3 H2 ^}$$where $\ce{OH-}$ comes either from hydroxide dissociation, either from carbonate hydrolysis.
$$\ce{CO3^2- + H2O <=> HCO3- + OH-}$$ | {
"domain": "chemistry.stackexchange",
"id": 12541,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, redox, aqueous-solution, stability, reactivity",
"url": null
} |
c++, c++11, console
std::cout << utils->repeatString(this->style_line_horizontal, this->padding);
std::cout
<< (col != columns.size() - 1 ? this->style_t_intersect_bottom : this->style_edge_buttomright);
std::cout << (col == columns.size() - 1 ? "\n" : "");
break;
}
}
}
} | {
"domain": "codereview.stackexchange",
"id": 30024,
"lm_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, console",
"url": null
} |
python, pandas, machine-learning
The "tie breaking" comment is helpful.
Ending the range at odd 31 is unusual, given that the final i
tested will be even 30 which is rejected.
Starting at 2 is similarly unusual, and does not aid human cognition.
range takes a 3rd parameter. Prefer:
[i for i in range(3, 30, 2)] which of course is simply
list(range(3, 30, 2))
The grid searching could be better motivated.
As stated it looks like "throw stuff at the wall to see what sticks".
extract helpers
Each time you write a helpful comment like this:
# Loop through each model and perform hyper parameter tuning | {
"domain": "codereview.stackexchange",
"id": 45406,
"lm_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, machine-learning",
"url": null
} |
dark-matter, supermassive-black-hole
Title: How does dark SMBH evaporate? I read that Dragonfly44 is a galaxy mostly consists of dark matter, and it should contain a super massive black hole too. If there really is a dark SMBH, how does it lose mass? I think there is no way for dark matter to be converted into energy and vice versa, no? The "no hair" theory of black holes states that a black hole formed from the collapse of normal matter would be exactly the same as a black hole formed from dark matter. You could even form a black hole from photons, if you could get enough of them close together at the same time.
What originally collapsed to form the black hole has no relevance to whether Hawking radiation is given off. A black hole formed of dark matter WIMPS would behave exactly the same as a black hole formed from normal matter.
Dark matter can be converted into "energy" (I'll assume that you mean light, ie photons), in the same way that normal matter can: for example by antimatter annihilation. | {
"domain": "astronomy.stackexchange",
"id": 2454,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dark-matter, supermassive-black-hole",
"url": null
} |
ros2
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>
And part of my CMakeLists:
find_package(ament_cmake REQUIRED)
find_package(rclcpp)
find_package(cv_bridge)
find_package(sensor_msgs)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
set(msg_files
"msg/Info.msg")
rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
DEPENDENCIES builtin_interfaces std_msgs geometry_msgs
ADD_LINTER_TESTS
)
But in the end I am getting this error:
Error processing 'int32 refId' of 'rtabmap_ros/Info': 'the field name
'refId' is not valid'
Where the Info.msg is:
Header header
int32 refId
int32 loopClosureId
int32 proximityDetectionId
Also, I have tried to look for the pcl_ros in ROS2 but did not find anything. Any idea how people deal with it in ROS2? | {
"domain": "robotics.stackexchange",
"id": 33599,
"lm_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",
"url": null
} |
thermodynamics, visible-light
Title: Is it possible to have light without heat? I am trying to think of a light source that doesn't generate heat; but I am not sure if such a phenomenon exists.
I am not referring to passive light (such as reflected light, ie, moonlight) but an active light source that does not have heat as a by-product.
Is it possible to generate light without heat, or put it a bit differently, without burning something? There is a phenomenon that generates light without generating heat as by-product*. The phenomenom is called Electroluminescence, and is used in LEDs which are used in many electric equipment (the tiny lights in your computer to let you know it's on).
We can stretch it a bit more with Fluorescence and other forms of creating liminous paint
Also if you will, we can consider Annihilation, which will only generate light | {
"domain": "physics.stackexchange",
"id": 30766,
"lm_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, visible-light",
"url": null
} |
thermodynamics, pressure, work
Title: Area under a $pV$ diagram What does the area under a Pressure volume diagram equal?
I read in my textbook it equals 'external' work done, but why is this?
First of all, what exactly is external work?
Can you get it external work by the simple formula $W= F\cdot s$?
Also, why does the area under a $pV$ diagram equal 'external' work?
What is the logic behind that? The area under the curve in the pV-diagram is the integral
$$
\int p \;\mathrm dV = \int \frac FA A\;\mathrm ds=\int F \;\mathrm ds \equiv W
$$
by definition of pressure as force per area and (infinitesimal) volume as area times distance.
This is the mechanical work done by the system on the environment in case of expansion or by the environment on the system in case of compression, which differ by sign. It is called external to emphasize the interaction with the environment. | {
"domain": "physics.stackexchange",
"id": 84263,
"lm_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, pressure, work",
"url": null
} |
Recurrence
Good strings of length $$n$$ can be of two kinds: a good string of length $$n-1$$ followed by '$$0$$' or a good string of length $$n-2$$ followed by '$$01$$'. That is, $$a_n=a_{n-1}+a_{n-2}$$ Starting with
$$a_0=$$ the number of good strings of length $$0=1$$.
$$a_1=$$ the number of good strings of length $$1=2$$.
we get $$a_4=8$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357579585025,
"lm_q1q2_score": 0.8607161280855538,
"lm_q2_score": 0.8791467738423873,
"openwebmath_perplexity": 965.1952862338449,
"openwebmath_score": 0.929974377155304,
"tags": null,
"url": "https://math.stackexchange.com/questions/3358186/number-of-bit-strings-of-length-four-do-not-have-two-consecutive-1s"
} |
beginner, react.js, typescript
playIf(condition: boolean) {
if (condition) {
this.play()
}
}
} I have the strong impression that your code can be simplified drastically. I would love to check it out and give it a try. Don't know if I will find the (spare-)time though.
UPDATE: I forked it and currently browse through your code and see what I can simplify. I'm impressed by how clean it is. This is really an astonishingly well written piece of software. (And I learn a good deal in the process. Didn't know that I could use webpack serve and always used webpack-dev-server on the commandline.)
Here is a list of things that I think needs fixing. I will amend the list as I progress through the code:
Your makeUseClasses seems to cover the functionality of classnames which is the de-factor standard package for this kind of classname fiddelydoo as far as I can tell from (comercial) React projects I have worked on | {
"domain": "codereview.stackexchange",
"id": 40757,
"lm_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, react.js, typescript",
"url": null
} |
phase, recrystallization
The rest of this second paper is devoted to measuring and describing thermodynamically the crystallization curves at different water-hydrazine compostions.
So, yes, you can definitely get a glass, if cooled quickly enough, but it just might decide to phase separate on you if it warms up a bit.
For the case of (only) hydrazine-1,1-dimethylhydrazine, the phase diagram is covered in J. A. McMillan, Journal of Chemical and Engineering Data 12(1) 39-40 (1967). This shows a very slow decrease in the liquidus temperature as 1,1-dimethylhydrazine is added, with the eutectic occurring at 94% mole percent 1,1-dimethylhydrazine at 214K, only 61K below the pure hydrazine melting point. There are no compounds. Further, the article states
Unlike the systems of the components with
water, the mixture hydrazine-1,1-dimethylhydrazine
does not supercool | {
"domain": "chemistry.stackexchange",
"id": 11018,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "phase, recrystallization",
"url": null
} |
neuroscience
Title: What is the function of nodes of Ranvier in axons? In a neuroscience class I'm taking, it was explained that myelin covers axons in sections, the uncovered sections are called nodes of Ranvier, and signals propagate much faster in the covered sections.
But if it is faster for signals to propagate along myelinated regions of the axon, why doesn't the entire axon get covered by myelin? Wouldn't that make it faster? Every signal rapidly fades out with distance if it is not amplified. So if the whole axon were covered with myelin, action potentials wouldn't reach their target. Each Ranvier node can be seen as an active signal repeater. | {
"domain": "biology.stackexchange",
"id": 956,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience",
"url": null
} |
pcl, ros-hydro
>, pcl::PointCloud<pcl::PointXYZRGB>, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType>]’ | {
"domain": "robotics.stackexchange",
"id": 15656,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pcl, ros-hydro",
"url": null
} |
php, html, validation, email, sql-injection
</tr>
<tr>
<td style='color: #FFF; font-size: 1.1rem;' align='center'>
<font style='font-size:0.8rem;'>This email was automatically generated from a mailbox that is not monitored.</font>
</td>
</tr>
</table>
</body>
</html>";
$headers = "Reply-To: MY NAME <no-reply@MYDOMAIN.com>\r\n";
$headers .= "Return-Path: MY NAME <no-reply@MYDOMAIN.com>\r\n";
$headers .= "From: MY NAME <no-reply@MYDOMAIN.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n"; | {
"domain": "codereview.stackexchange",
"id": 39487,
"lm_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, html, validation, email, sql-injection",
"url": null
} |
python, python-3.x, image, pathfinding
return node.neighbors
def add_edge(self, start, end):
if start.position not in self.nodes:
raise ValueError("{} not in the graph".format(start))
if end.position not in self.nodes:
raise ValueError("{} not in the graph".format(end))
self.edges[start.position].add(end)
self.edges[end.position].add(start)
Next we want to actually figure out the distance between them. I've modified your algorithm a bit (I'm not actually sure if it works or not, as it times out for me). I've gotten rid of a lot of the weird string transformations you did as they are no longer necessary, and I've also removed a bunch of code that was unnecessary with the improvements we've made elsewhere.
def find_path(self):
min_distance = self.width + self.height
path = []
current_node = self.nodes[self.start]
next_node = None | {
"domain": "codereview.stackexchange",
"id": 21639,
"lm_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, image, pathfinding",
"url": null
} |
but! The notion of equality … Then is an equivalence relation, we two.? For no real number x is it true that, so equivalence relation examples never holds the of! Are the same with respect to a given setting or an attribute multiple of, i.e a. relations... Have two equiva-lence … Then is an equivalence relation? For no real number x is it that... It true that, so reflexivity never holds that relation ) Addition and ). Are real numbers and, it is not an equivalence relation as de ned on the set of numbers. Example, is true that if and, Then.Thus, is transitive modulo! ˘Jx 2Xg a formal way For specifying whether or not two quantities are the with. Organizational purposes, it is not an equivalence relation as de ned in example 5: is relation. 'Ll show that equality modulo is reflexive and transitive, but is false that.For example, true. Relations as subsets of equivalence relation examples a., but is false setting an! Solution: relation $\geq$ is reflexive and transitive, but it is not an | {
"domain": "terabook.info",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992932829918,
"lm_q1q2_score": 0.8023292887942892,
"lm_q2_score": 0.8289388104343892,
"openwebmath_perplexity": 683.6421284616597,
"openwebmath_score": 0.8740193843841553,
"tags": null,
"url": "http://terabook.info/mzu82/9ac599-equivalence-relation-examples"
} |
rotational-dynamics, gyroscopes
Additional remarks:
During WW I many aircraft types had a rotary engine.
As you can imagine, the gyroscopic effects were very strong, dangerously so. However, I don't think I have ever read mention of noticable gyroscopic effects from the propellor of today's propellor-driven aircrafts.
It is important to be aware that the onset of gyroscopic precession is about motion. Specifically: to a pilot flying an aircraft with a rotary engine it may well have seemed as if giving rudder resulted in pitching instead. However, precise measurement would show that in order for the pitching to occur a bit of yaw must happen. That is: the rotary engine aircraft responds to yawing motion. It's just that if the pitching response is strong the smaller yawing motion may well go unnoticed. Conversely, initiating a slight pitching motion would result in yaw. So if the pilot wanted to turn he had to push for pitching. Flying those aircrafts must have been very tricky. | {
"domain": "physics.stackexchange",
"id": 59611,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rotational-dynamics, gyroscopes",
"url": null
} |
cosmology
Matter
The term "matter" includes "normal" matter (gas, stars, planets, bicycles, etc.), and the mysterious dark matter. As the universe expands, the volume grows as $a^3$. That means that the density falls as $\Omega_\mathrm{M}=\Omega_\mathrm{M,0}/a^3$.
Radiation
Photons redshift as space expands, and this redshift goes as $1/a$. This is in addition to having their number density decrease, so the total energy density of radiation decreases faster than matter, namely as $1/a^4$. Today, the energy density of radiation is dominated by the CMB, and can be neglected, but in the early times, they would dominate.
Curvature
If space is not flat, its curvature contributes to $\Omega_\mathrm{tot}$. The reason is that the curvature affects the volume in which we measure densities (thanks to John Davis for this explanation). This scales as $1/a^2$.
Dark energy | {
"domain": "astronomy.stackexchange",
"id": 2931,
"lm_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",
"url": null
} |
pressure, fluid-statics, biophysics
Title: Isovolumetric pressure changes in blood during ventricular contraction Some background to set up the problem. Blood flows into the left atrium via the mitral valve and leaves through another valve, the aortic valve. There is a moment in the cardiac cycle where these two valves are closed and the muscle that forms the left ventricle squeezes the blood inside. It’s called isvolumetric contraction because the same volume of blood is trapped by these two closed valves. Pressure in the ventricle increases. | {
"domain": "physics.stackexchange",
"id": 63974,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pressure, fluid-statics, biophysics",
"url": null
} |
r, rna-seq, bioconductor, rsem
ENST00000525778.5 CAGCTTGGTACCTCGCGTGTTAGCCTGCTGAGAGCTGCAGCTCCAGCCCA
ENST00000481848.6 CAGCTTGGTACCTCGCGTGTTAGCCTGCTGAGAGCTGCAGCTCCAGCCCA
**************************************************
ENST00000525778.5 GCCGCGGACCGCCGGGAAGTCACCCGCTCTGGGGGCAGCTGAATCTTGAC
ENST00000481848.6 GCCGCGGACCGCCGGGAAGTCACCCGCTCTGGGGGCAGCTGAATCTTGAC
**************************************************
ENST00000525778.5 GTTACCGCCATTGTTTGGAGAAATCGAGTGGGTGTGGAACTGCGGCGAGC
ENST00000481848.6 GTTACCGCCATTGTTTGGAGAAATCGAGTGGGTGTGGAACTGCGGCGAGC
**************************************************
ENST00000525778.5 GAGCCCAAAGTCATGCTCAGCCGGAAAGTCGCATACAATAATATGAAGTT
ENST00000481848.6 GAGCCCAAAGTCATGCTCAGCCGGAAAGTCGCATACAATAATATGAAGTT
************************************************** | {
"domain": "bioinformatics.stackexchange",
"id": 317,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "r, rna-seq, bioconductor, rsem",
"url": null
} |
java, performance, beginner, random
Title: Program in JAVA to generate random alphanumeric string This code will generate a pseudorandom alphanumeric string of given length.
I would welcome suggestions on how to make it more random. Beyond that, have I made any convention violations, Exception cases, and the like?
Also, is there any way to make it faster?
public class Test
{
public static String getRandomAlphaNum(int length)
{
String charstring = "abcdefghijklmnopqrstuvwxyz0123456789";
String randalphanum = "";
double randroll;
char randchar;
for
(double i = 0; i < length; i++)
{
randroll = Math.random();
randchar = '@';
for
(int j = 1; j <= 36; j++)
{
if
(randroll <= (1.0 / 36.0 * j))
{
randchar = charstring.charAt(j - 1);
break;
}
}
randalphanum += randchar;
} | {
"domain": "codereview.stackexchange",
"id": 36744,
"lm_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, performance, beginner, random",
"url": null
} |
optics, waves, spherical-harmonics
I don't understand what is meant by "the pulse has the same extent in space at any point along any radius $r$". Is the author claiming that the pulse at $r = t_1$ has the same width as the pulse at $r = t_4$? That doesn't look to be true to me.
I would greatly appreciate it if people would please take the time to explain this. What the quote is saying is that the amplitude of the pulse decreases, but the $r$ coordinate interval that it occupies stays the same. The picture might not be too clear but while the height of the pulse goes down, its width is indeed the same at all times.
You can see this by taking a function $f(x)$ that is only nonzero for $a < x < b$. If we use it to construct a spherical wave, we would get $\psi(r,t) = f(r-vt)/r$. This is only nonzero when the argument of $f$ is between $a$ and $b$; that is, when
$$a + vt < r < b + vt,$$
and the difference between the maximum and minimum values of $r$ is always $b-a$, independently of $t$. | {
"domain": "physics.stackexchange",
"id": 97818,
"lm_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, waves, spherical-harmonics",
"url": null
} |
ros
<group ns = "$(arg first_tb3)">
<param name="robot_description" command="$(find xacro)/xacro $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
<param name="publish_frequency" type="double" value="50.0" />
<param name="tf_prefix" value="$(arg first_tb3)" />
</node>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model $(arg first_tb3) -x $(arg first_tb3_x_pos) -y $(arg first_tb3_y_pos) -z $(arg first_tb3_z_pos) -Y $(arg first_tb3_yaw) -param robot_description" />
</group>
<group ns = "$(arg second_tb3)">
<param name="robot_description" command="$(find xacro)/xacro $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" /> | {
"domain": "robotics.stackexchange",
"id": 38347,
"lm_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
} |
# Given the function $y=\frac{m}{n}\sqrt{n^2-x^2}$, prove that $y′=\frac{-m^2x}{n^2y}$
I am trying to solve an exercise with derivatives. As the tittle says, I have the following function:
$$y=\frac{m}{n}\sqrt{n^2-x^2}$$
$m$ and $n$ are constants. After finding the first derivative, I need to prove that:
$$y′=\frac{-m^2x}{n^2y}$$
You must have noticed that there is a $y$ in the answer, but you do not need to find the implicit derivative to get the answer. It is supposed that finding the first function somewhere in the first derivative and replacing it with $y$ you get that answer.
I already solved another exercise of this kind, so you can better understand how I am supposed to solve this one.
Example: Given the function $y=\sqrt{2mx}$, prove that $y′=\frac{m}{y}$
$$y=\sqrt{2mx}$$ $$y′=\frac{1}{2\sqrt{2mx}}\left(2m\right)$$ $$y′=\frac{m}{\sqrt{2mx}}$$ Since $y=\sqrt{2mx}$: $$y′=\frac{m}{y}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137868795702,
"lm_q1q2_score": 0.8028694008755557,
"lm_q2_score": 0.8175744695262777,
"openwebmath_perplexity": 133.98593218835873,
"openwebmath_score": 0.9512403011322021,
"tags": null,
"url": "https://math.stackexchange.com/questions/2850210/given-the-function-y-fracmn-sqrtn2-x2-prove-that-y-frac-m2xn"
} |
c#, object-oriented, snake-game
Change that to
UpdateSnakePosition
Abstracting - It's Turtles All the Way Down
Each layer of code structure, method, and class is an opportunity for abstraction into actual Snake Game terminology, concepts, and game play. As a general rule use names and verbs abstracting away, not hanging onto, actual code implementaiton.
Below requires reading the loop code and often reading deeper to make sure I understand what is "true"ly going on:
while (true) {
// ....
}
All that effort goes away when:
while (! isBodyCollision) {
// ....
}
Class name gives context to methods
This: Draw Not: DrawBoard
Concise reading enjoyment:
Board snakeMaze = new Board(...);
snakeMaze.Draw(); | {
"domain": "codereview.stackexchange",
"id": 44662,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, object-oriented, snake-game",
"url": null
} |
• I confess that I'm somewhat surprised by this. I would have suspected it to be false. +1. – MPW Feb 9 '16 at 21:45
• @MPW Me too, but the counterexamples kept failing :) – Hagen von Eitzen Feb 9 '16 at 21:47
• Yes, that was my experience. I even tried a small spreadsheet with all a,b,c in the range 1-5. Oh well, live and learn. – MPW Feb 9 '16 at 21:48
• In hindsight it makes sense. Ceiling works as well. ceiling = q + 1 if r > 0. I can't tell you how long I struggled without realizing q' < c and q" < b. – fleablood Feb 10 '16 at 1:26 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964181787612,
"lm_q1q2_score": 0.8275548153877064,
"lm_q2_score": 0.8397339656668286,
"openwebmath_perplexity": 2132.722640017762,
"openwebmath_score": 0.3459221422672272,
"tags": null,
"url": "https://math.stackexchange.com/questions/1648117/is-this-identity-about-floor-function-true"
} |
c#, wpf, xaml
MyCircle
//Since you didn't provide the code of your circle-class
//I quickly wrote a dummy-circle class, it works but not
//flawless (X and Y coordinates)
public class MyCircle : IDrawable
{
public Ellipse Circle { get; private set; }
public MyCircle(Point location)
{
Circle = new Ellipse
{
Stroke = Brushes.Black,
StrokeThickness = 2,
Margin = new Thickness(location.X, location.Y, 0, 0)
};
}
public void Draw(Point location)
{
if(Circle != null)
{
Circle.Width = location.X - Circle.Margin.Left;
Circle.Height = location.Y - Circle.Margin.Top;
}
}
}
MyLine
public class MyLine : IDrawable
{
public Line Line { get; private set; } | {
"domain": "codereview.stackexchange",
"id": 3170,
"lm_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#, wpf, xaml",
"url": null
} |
machine-learning, neural-network, keras
When the model takes many epochs, the loss change becomes so small, especially when the number of epochs increases.
Epoch 455/1000
- 0s - loss: 0.0903 - acc: 0.9630 - val_loss: 0.1317 - val_acc: 0.9417
Epoch 456/1000
- 0s - loss: 0.0913 - acc: 0.9628 - val_loss: 0.1329 - val_acc: 0.9443
Kindly, I have two questions:
What does this phenomenon mean? i.e., the loss begins to decrease very well at the beginning but not much reduction by the time the training epochs takes a lot of iteration.
What is the possible solution for this? | {
"domain": "datascience.stackexchange",
"id": 5400,
"lm_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, keras",
"url": null
} |
algorithm, f#, audio
let numUsableBytes =
let indexOpt = bytes |> Array.tryFindIndex (fun b -> b &&& 0x80uy = 0uy)
match indexOpt with
| Some(index) -> index + 1
| None -> invalidArg "bytes" ("Cannot fetch the bytes for a variable length quantity from the given " +
"byte array because the end byte of the quantity is missing.")
let rec composeNum num bit resultBit byte =
if bit = 7 then num, resultBit
else
composeNum (num ||| (bigint (int ((byte >>> bit) &&& 1uy)) <<< resultBit)) (bit + 1) (resultBit + 1) byte
let result, _ =
Array.foldBack
(fun byte (num, resultBit) -> (composeNum num 0 resultBit byte))
(bytes |> Array.take numUsableBytes)
(0I, 0)
result, bytes.[numUsableBytes..]
In the same way it is relatively easy to change toByteArray too. | {
"domain": "codereview.stackexchange",
"id": 34904,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, f#, audio",
"url": null
} |
• (1) The statement that "there are no sets between $\mathbb{Q}$ and $\mathbb{R}$" in the sense you write is called the "Continuum Hypothesis". It is an statement that is independent from regular set theory (can neither be proven nor disproven), just like the parallel postulate is independent from the remaining geometric axioms. You can work in theories where it is true that no such sets exist, and you can work in theories where it is false that no such sets exist. (2) As for the Cantor set, it definitely has the cardinality of $\mathbb{R}$.(cont) – Arturo Magidin Mar 21 at 16:56 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964169008471,
"lm_q1q2_score": 0.8901932143763159,
"lm_q2_score": 0.9032942171172603,
"openwebmath_perplexity": 229.05506416988493,
"openwebmath_score": 0.8847659230232239,
"tags": null,
"url": "https://math.stackexchange.com/questions/3157055/does-the-cantor-set-have-the-cardinality-of-the-continuum?noredirect=1"
} |
classification, class-imbalance, preprocessing, supervised-learning, multilabel-classification
Classifier
f1score(train)
acc(train)
f1score(test)
acc(test)
Time – f1score(train)
GaussianNB
23 %
41 %
24 %
40 %
0.54 (sec)
Dummy
1 %
16 %
2 %
19 %
0.01 (sec)
1NN
4 %
18 %
8 %
24 %
0.22 (sec)
Logistic
34 %
56 %
40 %
62 %
1.04 (sec)
MLP
33 %
54 %
39 %
59 %
10.5 (sec)
SVM
19 %
46 %
32 %
57 %
3.7 (sec) | {
"domain": "datascience.stackexchange",
"id": 10324,
"lm_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, class-imbalance, preprocessing, supervised-learning, multilabel-classification",
"url": null
} |
food, human-physiology, senses
However, it's still unknown why food taste bland in microgravity. Also, there is no consensus about that fact, to start with:
There's little scientific data to back up astronauts' claims that taste changes in space, despite a number of studies since the 1970s on the effect of microgravity on the sense of taste and smell. In essence [...] study participants were split on the matter.
For those that report a change in the taste, some hypothesis were proposed:
One of the most prominent physiological changes associated with spaceflight has to do with fluid shifting from the lower to the upper parts of the body because of weightlessness. This facial and upper-body swelling also creates significant nasal congestion, and because odor is essential to the sense of taste, a decrease in the perception of flavors would occur.
And also:
The shuttle has a "sterile" smell, which when combined with other odors, such as the scent of their rinse-free shampoo, can be somewhat distracting. | {
"domain": "biology.stackexchange",
"id": 8141,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "food, human-physiology, senses",
"url": null
} |
differentiation, variational-principle, calculus
Title: When can I treat derivative as a fraction? (Brachistochrone) My teacher was solving the Brachistochrone problem in class. She parametrized the required path with $x(y)$, then said $T=\int_0^Tdt=\int_{y_1}^{y_2}\frac{dt}{dy}dy=\int_{y_1}^{y_2}\frac{dy}{dy/dt}$. Why is this conversion from $dt/dy$ to $dy/dt$ allowed? There is a similar question on math stack https://math.stackexchange.com/q/1784671/ which has a green answer saying that this can be found from the chain rule wherever it is legal. How does the chain rule explain what my teacher did? Or is there a different explanation? In mathematics people discuss a lot about this things but in physics one is usually happy with differential formulas as if they were algebraic simple formulas, thus $$\frac{\mathrm{d}y}{\mathrm{d}y} \equiv 1,$$ which is what your teacher probably intended. Then $$ \mathrm{d}t = \frac{\mathrm{d}y}{\mathrm{d}y} \mathrm{d}t = \frac{\mathrm{d}t}{\mathrm{d}y} \mathrm{d}y = \frac{ \mathrm{d}y}{v_y}.$$ | {
"domain": "physics.stackexchange",
"id": 67616,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "differentiation, variational-principle, calculus",
"url": null
} |
12
This is indeed tricky, and it seems to me the most effective way (in far more general, similar situations) is to show them the problem would be to have them apply their method to another, close problem where the answer is actually opposite. Either they will explain why it does not apply there, and you can argue that the difference is subtle enough to warrant ...
11
To really understand why the integers $\mathbb{Z}$ have unique prime factorization, it helps to understand how unique prime factorization can fail in other settings. For example, $$(2 + \sqrt{10}) \cdot (2 - \sqrt{10}) = -6 = -2 \cdot 3,$$ so prime factorizations in $\mathbb{Z}[\sqrt{10}] = \{a + b\sqrt{10}: a, b \in \mathbb{Z}\}$ aren't unique. On the other ...
10 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575178175919,
"lm_q1q2_score": 0.8554118993133387,
"lm_q2_score": 0.8705972768020108,
"openwebmath_perplexity": 618.7862224429809,
"openwebmath_score": 0.5858034491539001,
"tags": null,
"url": "https://matheducators.stackexchange.com/tags/number-theory/hot"
} |
observational-astronomy, distances, positional-astronomy
Title: Compute Distance Between Stars If I have the following information about star A and Star B, how can I compute the distance between A and B?
Distance from Sol for Star A
Right Ascension/Declination of Star A
Parallax/Absolute Magnitude of Star A
Distance from Sol for Star B
Right Ascension/Declination of Star B
Parallax/Absolute Magnitude of Star B | {
"domain": "astronomy.stackexchange",
"id": 6245,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "observational-astronomy, distances, positional-astronomy",
"url": null
} |
## (Minimum Path Sum)
Given a $m \times n$ grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at any point in time.
Thoughts:
Because the grid is filled with non-negative numbers. Standing at any position ($i, j$), the minimum sum we can get is $\text{grid}[i,j] + \min$(minimum sum starting from$[i+1,j]$, minimum sum starting from $[i,j+1]$). Hence we find the recursive structure of this problem. The base case would be one element only, one row only and one column only. Notice that we could end up with repeating computations a lot (e.g., right->down and down->right), hence we should employ dynamic programming, in which we introduce a hashmap to cache the partial result.
Code (Java):
public class Solution {
private Map<List<Integer>, Integer> map =
new HashMap<List<Integer>, Integer>(); | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540686581882,
"lm_q1q2_score": 0.8052142701832102,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 8086.991876633165,
"openwebmath_score": 0.508704423904419,
"tags": null,
"url": "https://tianrunhe.wordpress.com/2013/03/09/minimum-path-sum/"
} |
sequence-annotation, ensembl, human-genome
The genes that are found on the alt sequences are listed as Human Alternative sequence Gene. They are both real genes and correct for the gene name.
If the gene is on a patch (the location will include the word PATCH in its name) you should probably use the patch gene because the primary assembly gene may be dodgy.
It gets more complicated if you're working with haplotypes, as all the versions are correct. Most people take the easy option of using just the primary assembly, but if you're variant calling, it may be worth trying to determine which haplotype the individual has and calling against that. This is particularly true for highly variable regions like MHC, where there are genes only found on the alternative haplotypes and not found on the primary assembly.
There's more information about alternative sequences from Ensembl here. And here from the GRC. | {
"domain": "bioinformatics.stackexchange",
"id": 2000,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sequence-annotation, ensembl, human-genome",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.