text stringlengths 1 1.11k | source dict |
|---|---|
radioactivity, isotopes
because most terrestrial plans and animals share their carbon with the large atmospheric reservoir, and that is reasonably constant, as far as things go. For instance, it is highly unlikely you will find two wolves from the same era in the same general location with different isotopic ratios. | {
"domain": "physics.stackexchange",
"id": 71995,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "radioactivity, isotopes",
"url": null
} |
php, object-oriented, sql, mysql
return $result->fetch(PDO::FETCH_OBJ);
}
public function find_users($username = '', $skill = '', $tag = '', $lat = 1, $lng = 1, $distance)
{
$sql = "SELECT DISTINCT
users.username, ( 3959 * acos( cos( radians($lat) ) * cos( radians( latitude ) )
* cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) ) * sin(radians(latitude)) ) ) AS distance
FROM
users
INNER JOIN
user_skills ON users.user_id = user_skills.user_id
INNER JOIN
skills ON user_skills.skill_id = skills.skill_id
INNER JOIN
user_tags ON users.user_id = user_tags.user_id
INNER JOIN
tags ON user_tags.tag_id = tags.tag_id
WHERE users.availability = 'Yes'";
$bindings = array();
if ($username) {
$sql .= " AND users.username LIKE :username";
$bindings['username'] = "%" . $username . "%";
}
if ($skill) {
$sql .= " AND skills.skill_name = :skill";
$bindings['skill'] = $skill;
} | {
"domain": "codereview.stackexchange",
"id": 12468,
"lm_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, sql, mysql",
"url": null
} |
quantum-mechanics, double-slit-experiment
My understanding of this example is that interference on the upper detector constitutes a measurement for the lower detector (lower electron went through upper slit) and lack of interference on the upper detector also constitutes a measurement (right electron went through lower slit). Am I then correct that on the lower detector we will see corpuscular pattern with density equivalent to 50% of the firing rate of a single cannon whilst on the upper detector we will see a sum of 50% density corpuscular pattern and 100% density interference pattern? You have to understand that in the double slit experiment one electron at a time, the same interference pattern appear as with shooting many electrons at a time. | {
"domain": "physics.stackexchange",
"id": 35832,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, double-slit-experiment",
"url": null
} |
$$\sqrt{2-x} > x$$ then $$\sqrt{2-x} > x-2 +2$$ , move all to the left hand side then $$2-x = (\sqrt{2-x})^2$$ $$\left(\sqrt{2-x}\right)^2 + \sqrt{2-x} - 2 > 0$$ $$( \sqrt{2-x} +2) (\sqrt{2-x} -1)>0$$ I avoided squaring both sides.
Starting from
$$\sqrt{2-x} > x$$
it is immediately clear that if $$x<0$$ then $$\sqrt{2-x} >0$$ and therefore $$x<0$$ is part of the solution set. We then need to analyze where
$$\sqrt{2-x}$$
is defined. We know that $$\sqrt{2-x}$$ will have positive real solutions if $$2-x \ge 0$$. Therefore, we need to check $$0\le x \le 2$$. In order to do this, let $$\varepsilon$$ be a small number where $$0\le\varepsilon< 1$$. Then $$\sqrt{2-\varepsilon}>\sqrt{1}> \varepsilon$$ $$\sqrt{2-1}=\sqrt{1}=1$$ $$\sqrt{2-(\varepsilon+1)}\le\sqrt{1}\le\varepsilon+1$$
so when $$0\le x < 1$$ we have $$\sqrt{2-x} > x$$ and when $$1\le x \le 2$$ we have $$\sqrt{2-x} \le x$$. Hence, the proper solution set is $$x<1$$ or $$(-\infty,1)$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9728307676766118,
"lm_q1q2_score": 0.8503292245029808,
"lm_q2_score": 0.8740772318846386,
"openwebmath_perplexity": 127.51534364116308,
"openwebmath_score": 0.9506801962852478,
"tags": null,
"url": "https://math.stackexchange.com/questions/3415109/how-can-i-solve-the-following-square-root-inequality"
} |
cosmological-inflation, dark-energy
Title: Exponentially accelerating universe, dark energy, the universe's temperature and event horizons.. (sorry in advance!) Ok.. assume that space-time is accelerating away from itself with a>0 and.. jerk - j⃗ (t)>0 (sorry - don't know how to write "a dot"! :s )..
If this continues on without the rate of acceleration ever stopping, or decreasing, the ambient temperature of the universe will fall due to its expansion in volume, approaching absolute 0 (as ours has been doing up until now).
However, as the acceleration of space-time increases, at some point in time the Unruh effect would start to become significant with regards to the background temperature of the observable universe (as we assume the rate of acceleration only increases). | {
"domain": "physics.stackexchange",
"id": 30168,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmological-inflation, dark-energy",
"url": null
} |
a set of measure zero physics, 3rd ed as limit... ' theorem the Theory of functions and functional analysis '' and then dx! Or necessary for completeness ; constituent: the result of a curve measure!, volumes, displacement, etc information on how much water was in each you. Constituent or component: integral Parts which to call U and which to call U and to! The antiderivative the Web. operation, differentiation, being the other of other integral may! An indefinite integral of $f$ over $[ a, b ] then U$ not. Of f ( x ) is just any function whose derivative is f ( x ) the curve our... Leads to some useful and powerful identities it is the inverse of finding differentiation lower limits and subtracting classical analysis... Finite Terms: Liouville 's Theory of the integral is a mathematical integration … Introduction to integration way! The fundamental objects of calculus is the reverse of a function, given its derivative, is reverse! 1981 ), as the name suggests, it is visually | {
"domain": "grecotel.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.984093606422157,
"lm_q1q2_score": 0.8601738073467186,
"lm_q2_score": 0.8740772236840656,
"openwebmath_perplexity": 1183.2569398418889,
"openwebmath_score": 0.9133315682411194,
"tags": null,
"url": "http://dreams.grecotel.com/white-background-dtksbvo/a7dd49-integral-meaning-in-maths"
} |
filters
My question: What is the relationship between $r$ above and the more usual filter parameter $Q$?
I am just beginning to learn (self-teach) how to build filters, and I am still unclear on some of the concepts. Thanks in advance for any help. | {
"domain": "dsp.stackexchange",
"id": 3280,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters",
"url": null
} |
special-relativity, symmetry, field-theory, representation-theory, lie-algebra
$$\mathsf{D}(1+\omega)\approx1-\frac{\mathrm{i}}{2}\omega_{\mu\nu}M^{\mu\nu}\tag{3}\label{algebrarepr}$$
where the generators $M^{\mu\nu}$ of $\mathfrak{so}(1,3)$ obey the generic commutation relations (these may actually be proven but it's a little lengthy)
$$\left[M^{\mu\nu},M^{\rho\sigma}\right]=\mathrm{i}\left(\eta^{\nu\rho}M^{\mu\sigma}-\eta^{\mu\rho}M^{\nu\sigma}-\eta^{\nu\sigma}M^{\mu\rho}+\eta^{\mu\sigma}M^{\nu\rho}\right)\tag{4}\label{lorentzliealgebra}$$ | {
"domain": "physics.stackexchange",
"id": 75895,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, symmetry, field-theory, representation-theory, lie-algebra",
"url": null
} |
ros
in "<string>", line 1, column 14:
{header: {seq:0, stamp: {secs:0, nsecs:0}, fr ...
^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.
Originally posted by Emilio on ROS Answers with karma: 13 on 2015-08-12
Post score: 0
I guess the question is "What is wrong with this command?", right?
Try with:
rostopic pub servo sensor_msgs/JointState '{header: {seq: 0, stamp: {secs: 0, nsecs: 0}, frame_id: ""}, name: ["art1"], position: [150.0], velocity: [0.0], effort: [0.0]}' --once
Note the space after each :. This is mandatory!
Originally posted by mgruhler with karma: 12390 on 2015-08-13
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Emilio on 2015-08-13:
That works, thank you!
Comment by mgruhler on 2015-08-13:
please mark the answer as correct, if it helped :-)
Comment by Emilio on 2015-08-13:
sorry, this is the first time i post here ;) | {
"domain": "robotics.stackexchange",
"id": 22441,
"lm_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
} |
machine-learning, k-means, kernel, spectral-clustering
DISCLAIMER: There are many simplifications and not accurately use of terms in my answer. I tried to be intuitive more than accurate (e.g. our example data will result in two disconnected subgraphs which need numerical solution to be clustered using spectral clustering but does not affect the concept anyways) | {
"domain": "datascience.stackexchange",
"id": 10730,
"lm_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, k-means, kernel, spectral-clustering",
"url": null
} |
nomenclature, water, stoichiometry, terminology, solid-state-chemistry
$\ce{3CdSO4·8H2O}\quad$ cadmium sulfate—water (3/8)
You need to convert the reciprocal of $n$ expressed as a decimal fraction to the simple fraction (or the ratio consisting of natural numbers) and put it in braces after the names of corresponding individual constituents of (formal) addition compounds separated by ‘em’ dash. Few examples:
$\ce{2ZnO·3B2O3·3.5H2O}\quad$ zinc(II) oxide—boron(III) oxide—water (4/6/7)
$\ce{MgCl2·4.33H2O}\quad$ magnesium(II) chloride—water (3/13)
$\ce{CHCl3·2H2S·4.5H2O}\quad$ chloroform—hydrogen sulfide—water (2/4/9)
Reference
IUPAC. Nomenclature of Inorganic Chemistry, IUPAC Recommendations 2005 (the “Red Book”), 1st ed.; Connelly, N. G., Damhus, T., Hartshorn, R. M., Hutton, A. T., Eds.; RSC Publishing: Cambridge, UK, 2005. ISBN 978-0-85404-438-2. (PDF) | {
"domain": "chemistry.stackexchange",
"id": 16670,
"lm_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, water, stoichiometry, terminology, solid-state-chemistry",
"url": null
} |
c++, linux, io, posix, gcc
And string_data is a std::string.
The only thing that I suspect might make this code slower than your code, and only for very, very large files, is that there is no way (AFAIK) to allocate a std::string without initializing its contents. In other words, s.resize(n) doesn’t does just allocate n bytes (internally), it also zeros those bytes… which is a total waste of time for us. You shouldn’t have this inefficiency if you’re reading binary data into a std::vector<std::byte> (for which the code is otherwise identical).
But even that std::string inefficiency should be tolerable (unless your files are huge), because you get the benefit of actually having an honest-to-goodness string. Which basically works everywhere, and which many APIs specifically need, in one form or another.
And, frankly, I seriously doubt you’ll even notice it, because, again, unless you’re dealing with huge files, the cost of that zeroing will be completely dwarfed by the I/O costs. | {
"domain": "codereview.stackexchange",
"id": 41281,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, linux, io, posix, gcc",
"url": null
} |
ros, c++, spinonce
Then, the main node in charge of gathering all the sensors' data first wait for the initialization time + a small additional time to make sure all the messages have been sent on the corresponding topics and call afterwards all the callback with ros::spinOnce(). Let's pretend here for sake of simpliticy that the messages were received by the main node in a ascending order (if the sensors are enumerated from 1 to 5, the messages were received in that exact order). If the second sensor is faulty (hence the node did send a -1 value) and the callback determines its faultiness and throws an exception, what would happen to the other callbacks waiting to process the other messages in the queue ? Would they still be evaluated or would I have to call another time the ros::spinOnce() function in order to do so ?
Thanks in advance for your help. | {
"domain": "robotics.stackexchange",
"id": 29258,
"lm_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, c++, spinonce",
"url": null
} |
quantum-mechanics, quantum-interpretations, causality, non-locality
Skipping over #3, which I've found to lead to generally fruitless discussions, that brings us to your main question, option #4.
First of all, all retrocausal models explicitly violate the parameter independence equations; they violate $P(\lambda|a,b)=P(\lambda)$. The idea of a (non-FTL) retrocausal model is that something hidden in the past ($\lambda$) depends on the future settings (a and b) in the future light cone of ($\lambda$). So this equation wouldn't hold true in a retrocausal model. If it did hold true, it wouldn't be retrocausal.
The answer to your original question, in the title, is "no". If you had meant to write "does a local hidden variable model imply retrocausality", and you mean "local" in the sense of having Lorentz-covariant physical mediators to explain the correlations in entanglement experiments, then yes, I think it's fair to say that retrocausality is the only option. Support for this claim can be found in this Rev. Mod. Phys. paper. | {
"domain": "physics.stackexchange",
"id": 95135,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-interpretations, causality, non-locality",
"url": null
} |
performance, css, animation, css3
</li>
<li><span><img src="http://www.meilleurs-masters.com/images/classement_icon_mobile_mail.png" alt=""/></span><a href="#">Contact</a>
</li>
</ul>
</nav>
<section>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus porta augue vitae bibendum vulputate. Nam sed pulvinar neque. Pellentesque justo neque, aliquet at risus sed, tristique mattis purus. In laoreet diam at porttitor tempor. Vestibulum ante
ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras in lorem sit amet purus egestas aliquet. Cras dignissim venenatis facilisis. Suspendisse id dui consectetur, lobortis mauris nec, egestas augue. Sed dui sapien, dignissim
in dui eget, pretium laoreet leo. Phasellus semper faucibus elit eu consequat. Maecenas aliquam nibh sit amet sapien blandit, non sagittis mi vestibulum.</p>
... More content ... | {
"domain": "codereview.stackexchange",
"id": 8799,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, css, animation, css3",
"url": null
} |
imu, a200, ubuntu, husky, ubuntu-oneiric
Title: No output from /imu/data
Hi People,
I am working on Husky A200 Robot from clearpath. I have got an issue with the imu_um6 node of the Robot.
The follwoing is an update of the question with a new form of output that appears simpler to be solved in ros answers:
when I try to run roslaunch imu_um6 test.launch
the following is the output:
SUMMARY
PARAMETERS
/imu_um6_node/port
/rosdistro
/rosversion
NODES
/
imu_pose (imu_um6/imu_pose.py)
imu_tf (tf/static_transform_publisher)
imu_um6_node (imu_um6/imu_um6_node.py)
rviz (rviz/rviz) | {
"domain": "robotics.stackexchange",
"id": 8946,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "imu, a200, ubuntu, husky, ubuntu-oneiric",
"url": null
} |
machine-learning, time-series, regression, random-forest
Title: Time series regression forecast next month from now (random forest,Lasso,Ridge) I have a dataset about hedge funds. Its include data from 2010 january to 2019 december. This data are monthly financial ratios of hedge funds such as sharpe,alpha,beta,sortino and monthly returns of hedge funds. I normalized the relative returns of each fund. And I want to estimate these monthly returns. Using these ratios. Now Im using machine learning regression models, I created this function "$$Y_{t+1} = X_{0,t}+...+ X_{12,t}$$" for the regression model. "$Y_{t+1}$" shows the normalized relative return of the hedge fund in the following month(t+1)(next/future), "$X_{0,t}$" variables show the financial ratios of that fund in the t month(now). I thought about this function to predict future month's returns before data came so I want to predict the next month with the current data.Because the data comes as of the end of the month. I have to guess the return for the next month. As an example, I | {
"domain": "datascience.stackexchange",
"id": 7399,
"lm_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, time-series, regression, random-forest",
"url": null
} |
inorganic-chemistry, molecular-orbital-theory, stability
The important point is that the unusually small size of the Li+ ion makes it able to polarize a neutral atom to form a strong bond (and come in closer!), whereas the neutral atoms have only uncharged molecular orbitals to spread their electrons over. It is highly unlikely that larger atoms (Na, K) would show similar stability for an ion-molecule compared to a neutral molecule. Magnesium might be a similar exception, however, since both Li and Mg have small radii; it might be interesting to compare stabilities of Mg2 and Mg2+. | {
"domain": "chemistry.stackexchange",
"id": 10318,
"lm_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, molecular-orbital-theory, stability",
"url": null
} |
memo = {}
def all_big_set_sizes(m, S):
// check if it's in the memo
if memo has (m, S) as a key:
return memo[(m, S)]
size_counts[0..m] // initially all zero
if m == 1:
size_counts[0]++
else:
// if m is not in the set
counts = all_big_set_sizes(m-1, S)
for i = 0..m-1:
size_counts[i] += counts[i]
// if m is in the set
if P(m) and S don't intersect:
counts = all_big_set_sizes(m-1, union(P(m), S))
for i in 0..m-1:
size_counts[i + 1] += counts[i]
memo[(m, S)] = size_counts
return size_counts
But this is still not enough, because there is still too many distinct calls to all_big_set_sizes! (For instance, there are already at least 2^{25} distinct values for the parameter S, because it is a set of primes \le 100.)
At this point, there are two major optimizations that will allow all_big_set_sizes to run quickly. You can implement either one of them (or even both) to pass.
Optimization 1: Primes > 50 | {
"domain": "codechef.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9921841123662666,
"lm_q1q2_score": 0.8065140427181402,
"lm_q2_score": 0.8128673223709251,
"openwebmath_perplexity": 1640.9128890158113,
"openwebmath_score": 0.8088893890380859,
"tags": null,
"url": "https://discuss.codechef.com/t/seagcd2-editorial/12571"
} |
thermodynamics, general-relativity, fluid-dynamics, cosmology, states-of-matter
In case of radiation, energy $E_\textrm{rad} = \rho \, a^3$ is not conserved, since there is pressure and the photons wavelength is redshifted while the universe expands. But then what is the constant $\rho \, a^4$ ? I strongly suspect it's related to the total radiation entropy in the volume $a^3$, or maybe the number of ultra-relativistic particles, but I can't find any reliable source on this.
I know that in standard RWFL (Robertson-Walker-Friedmann-Lemaître) models, entropy is conserved because of the local conservation of energy-momentum, which is equivalent of saying
\begin{equation}\tag{2}
\mathrm dE = T \, \mathrm dS - p \, \mathrm dV = -\, p \, \mathrm dV.
\end{equation} | {
"domain": "physics.stackexchange",
"id": 33172,
"lm_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, general-relativity, fluid-dynamics, cosmology, states-of-matter",
"url": null
} |
time-complexity, dynamic-programming, recurrence-relation
n is the size of the rod and p an array that contains the prices.
I understand the algorithm, the problem I have is that I thought intuitively the time complexity of such an algorithm would be O(b^d) (where b is the branching factor and d the depth of the recursion tree) which would be O(n^n).
In the book the recurrence relation is presented: T(0) = 1 and T(n) = 1 + sum(j=0, n-1, T(j)) Then it is explained that the complexity following from this is O(2^n) which you can easily be seen by expand the recurrence relation.
How can I quickly see that my initial intuition was wrong? And in general when looking at a recursive algo how can I figure out weather the time complexity is O(b^d) or not. Based on the code you show there, your intuition is right.
However, it looks like there is a typo in the code and the next-to-last line should have been
q = max(q, p[i] + CutRod(p, n-i)) | {
"domain": "cs.stackexchange",
"id": 11542,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "time-complexity, dynamic-programming, recurrence-relation",
"url": null
} |
gravity, space, general-relativity, space-time, newtonian-gravity
Title: Why can't gravity repel things? Gravity is the result of the curvature of space, so could the curvature actually send objects away from the source? Apart from the field-theoretical standpoint presented by Stan, one can repel objects in a sense, when taking orbital mechanics into account.
The slingshot maneuver extracts angular momentum and energy of an orbiting mass by the use of gravity. The trick here is that the probe's velocity just gets redirected in the planet's reference frame. But this results in an acceleration in the solar rest-frame that the probe essentially tries to leave.
As you were asking about curvature, I don't know how and if centrifugal potentials that play a role here are described by general relativity. | {
"domain": "astronomy.stackexchange",
"id": 1261,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gravity, space, general-relativity, space-time, newtonian-gravity",
"url": null
} |
refraction, geometric-optics
$\hat\imath$: The vector in the direction of the incoming ray.
$\hat{t}$: The vector in the direction of the transmitted ray.
$\hat{n}$: The vector perpendicular to the surface, the normal vector.
$\hat{n}_\perp$: A vector perpendicular to the normal vector, in the plane of $\hat\imath$ and $\hat{t}$. | {
"domain": "physics.stackexchange",
"id": 19078,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "refraction, geometric-optics",
"url": null
} |
string-theory, constrained-dynamics
$$
\xi \dot{X}\cdot P-\xi L=\text{const}
$$
might be a constraint. In fact, if you calculate $P$ and plug it in, we indeed see that this expression vanishes identically. So indeed it is true that
$$
\partial _tX\cdot P=-L.
$$
If you do the same thing with $\sigma$ re-parameterization, you find
$$
\partial _\sigma X\cdot P=0.
$$
Note that in this case $\delta L$ is a $\sigma$ derivative, as opposed to a time derivative as before, and so doesn't show up. Fantastic! The only thing that remains to be down is to eliminate the pesky $\dot{X}$. To do this, we have to actually compute $P$.
It turns out that
$$
P_\mu =\frac{T^2}{L}\left( (\partial _tX\cdot \partial _\sigma X)\partial _\sigma X_\mu-(\partial _\sigma X)^2\partial _tX_\mu \right) .
$$
The idea is that we can use the time re-parameterization constraint to eliminate $\partial _tX$ from the expression for $P$ by contracting $P$ with itself:
$$ | {
"domain": "physics.stackexchange",
"id": 7710,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "string-theory, constrained-dynamics",
"url": null
} |
If 188 students were truly selected at random from a pool of 3700, you will be able to calculate a $p$-value: that is, the probability under the null hypothesis (of random selection) that you see an outcome as "extreme" as the one you found. One possible definition of "extreme" is "at least one school had at least 43 students chosen". To calculate the probability of this latter event, you can apply a symmetry argument to bound the prob by $37 \times P(N_1\ge 43)$, where $N_1$ is the number of students selected from school 1. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347838494566,
"lm_q1q2_score": 0.8320822924714577,
"lm_q2_score": 0.8539127566694178,
"openwebmath_perplexity": 330.9712797406824,
"openwebmath_score": 0.8401802778244019,
"tags": null,
"url": "https://math.stackexchange.com/questions/1576082/probability-analyzing-randomness-of-data"
} |
forces, energy, potential-energy
Title: Why do we use the particular magnitude of a force to calculate work? I can't say I know physics very well. The most confusing concept for me as for now is potential energy. Often, while introducing potential energy of a gravitational force, the following example is used: imagine an object that has the mass of 1 kilogram that is lying on the earth. The gravitational force acting on it is its mass times $g$ which is about 10 Newtons. Now I want to lift an object two meters up and count the work I've done. In order to produce acceleration, I need to pull on it with a force that is a tiny little bit stronger than 10 Newtons, then I can just maintain a force of 10 Newtons and it will be going up. Now the work I've done is distance traveled times force magnitude, hence 20 Joules. But what if I decided to exert a force that is not 10 Newtons but e.g. 13 Newtons? It would still give that object acceleration upwards, but now the work would be 26 joules. What prevents me from doing so? Is | {
"domain": "physics.stackexchange",
"id": 62486,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, energy, potential-energy",
"url": null
} |
c++, beginner, algorithm, programming-challenge, c++17
} else {
return 1;
}
}
inline size_t Solution::decode(const char a_num_ast, const char b_num_ast) {
if (a_num_ast == '1') {
if (b_num_ast == '*') {
return 9;
} else if (b_num_ast >= '0' && b_num_ast <= '9') {
return 1;
}
} else if (a_num_ast == '2') {
if (b_num_ast == '*') {
return 6;
} else if (b_num_ast >= '0' && b_num_ast <= '6') {
return 1;
}
} else if (a_num_ast == '0') {
return 0;
} else if (a_num_ast == '*') {
return decode('1', b_num_ast) + decode('2', b_num_ast);
}
return 0;
}
inline size_t Solution::numDecodings(const std::string message) {
const size_t length = message.size();
std::vector<size_t> decodes_dp(3, 0);
decodes_dp[0] = 1;
decodes_dp[1] = decode(message[0]); | {
"domain": "codereview.stackexchange",
"id": 38760,
"lm_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, algorithm, programming-challenge, c++17",
"url": null
} |
php, object-oriented, validation
$uv = new UserValidator();
$uv->validate($user)); //true
$uv->getErrors()); //empty array Coding-wise it looks pretty good. Consistent naming convention and code style, no apparent security vulnerabilities (assuming your Rule classes do what I expect them to do).
Let's talk about approach and scale.
Scale
It doesn't really make sense for you to write a validator for each Domain Object you create! What if you have 50 Domain Objects, will you write an extra 50 classes just for validation?
Approach
As a result of the above, your UserValidator class is very highly tightly coupled with the User object, it knows about the structure of the User object, making it useless for reuse (Unless, of course, you find another project with the exact same User object).
A better approach?
For starters, you should ask yourself what are you validating?
Let's differentiate between two possible "validations": | {
"domain": "codereview.stackexchange",
"id": 8199,
"lm_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, validation",
"url": null
} |
solidworks
When a line is fully defined, it will turn black. When the whole sketch is fully defined, you can move on, go to the features toolbar, and select extruded boss/Base. If you move on without fully defining the sketch, you can accidently drag lines out of place without knowing. Which is the worst to try to hunt down and fix. | {
"domain": "engineering.stackexchange",
"id": 857,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solidworks",
"url": null
} |
javascript, programming-challenge, processing.js
var x = function(i) {
if(i === 0) {
return ar[0];
} else if(i === 1) {
return br[0];
} else if(i === 2) {
return cr[0];
}
}; // Used to get the x value of a certain point
var y = function(i) {
if(i === 0) {
return ar[1];
} else if(i === 1) {
return br[1];
} else if(i === 2) {
return cr[1];
}
}; // Used to get the y value of a certain point
var setX = function(i, value) {
if(i === 0) {
a[0] = value;
} else if(i === 1) {
b[0] = value;
} else if(i === 2) {
c[0] = value;
}
}; // Used to set the x value of a certain point
var setY = function(i, value) {
if(i === 0) {
a[1] = value;
} else if(i === 1) {
b[1] = value;
} else if(i === 2) {
c[1] = value;
}
}; // Used to get the y value of a certain point
var drawControlPoint = function(cp) {
var cpX;
var cpY;
if(cp === 0) {
cpX = ar[0]; cpY = ar[1]; | {
"domain": "codereview.stackexchange",
"id": 16350,
"lm_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, programming-challenge, processing.js",
"url": null
} |
upward. Resource Development background, has over 10 years experience in content developmet and.... Statistical definition, the stronger the relationship between two variables concept of variance to measure its.... Measure brain size and body weight ( both in grams ) across species negative positive... The spread between numbers in a variance-covariance matrix, ( aka, a smaller variance the! But covariance is a measure of magnitude of separation between the random variables together associated with variables! And get the covariance, on the other methods because of the correlation between two random variables together random together. Stocks move in the set are closer to the mean ( a… a matrix. Two variables is an analytical way to minimize the risk how strongly two random variables together. Also, it determines the total risk of the distances types of the scatter of the strength of standard... Covariance are mathematical terms frequently used in statistics to describe the spread | {
"domain": "freedomfest.nu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846672373524,
"lm_q1q2_score": 0.8131776102133206,
"lm_q2_score": 0.8311430436757312,
"openwebmath_perplexity": 695.0317242200002,
"openwebmath_score": 0.736044704914093,
"tags": null,
"url": "https://www.freedomfest.nu/g7iev7ln/jgn4k8q.php?736ae3=variance-and-covariance"
} |
algorithms, graphs, clustering
Title: Proof for clustering in a network of friendship Consider an undirected graph $G = (V, E)$ representing the social network of friendship/trust between
students. We would like to form teams of three students that know each other. The question
is to decide whether the network allows for enough such teams, without checking all the triples
of graph $G$. For this reason, we use random sampling to design an efficient estimator of the
number of connected triples.
We partition the set of node triples into four sets $T_0, T_1, T_2$, and $T_3$. A node triple $v1, v2, v3$
belongs to
$T_0$ iff no edge exists between the nodes $v1, v2$, and $v3$,
$T_1$ iff exactly one of the edges
$(v1, v2)$, $(v2, v3)$, and $(v3, v1)$ exists,
$T_2$ iff exactly two of the edges $(v1, v2)$, $(v2, v3)$, and $(v3, v1)$
exist,
$T_3$ iff all of the edges $(v1, v2)$, $(v2, v3)$, and $(v3, v1)$ exist. | {
"domain": "cs.stackexchange",
"id": 15271,
"lm_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, graphs, clustering",
"url": null
} |
python, python-3.x, python-requests
more subroutines
an Enum to self-document your process status codes
argparse support
Suggested
from argparse import ArgumentParser, Namespace
from enum import Enum
from json import JSONDecodeError
from typing import Any
import json
import requests
import sys
class ProcessStatus(Enum):
OK = 0
PYTHON_DEFAULT_ERROR = 1
IO_ERROR = 2
JSON_ERROR = 3
HTTP_ERROR = 4 | {
"domain": "codereview.stackexchange",
"id": 43302,
"lm_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, python-requests",
"url": null
} |
quantum-field-theory, renormalization, fermions, effective-field-theory, non-perturbative
The original expression for the Wetterich equation missed an inverse on $\left(\Gamma^{(2)}_k + R_k \right)^{-1}$ before the edit. This inverse is important in general, because even if the regulator $R_k$ only couples to $\phi \phi$ and $\psi \bar{\psi}$ terms, the inverse involves all $9$ derivatives of $\Gamma_k$, not just $\delta^2 \Gamma_k/\delta \phi \delta \phi$ and $\delta^2 \Gamma_k/\delta \psi \delta \bar{\psi}$. This means that, in order to evaluate this inverse, in principle you will need to make your ansatz for $\Gamma_k$, evaluate all $9$ second derivatives, and then set $\phi$, $\psi$, and $\bar{\psi}$ to constant values, independent of space/momenta, so that you can actually evaluate the inverse. (The cited paper does not mention this point explicitly, but since they include a local potential $U_k(\phi^2/2)$ in their ansatz, they presumably take $\phi$ to be a scalar variable, and perhaps they set the $\psi$'s to be either zero or some other constant value). In this | {
"domain": "physics.stackexchange",
"id": 83948,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, renormalization, fermions, effective-field-theory, non-perturbative",
"url": null
} |
graphs, time-complexity, polynomial-time, graph-isomorphism, subgraphs
So, my question is: if we constrain our nodes to have maximally a constant number of incident edges, then does the subgraph isomorphism problem become polynomial-time solvable?
That is, both the query graph $G$ and the large graph $H$ have bounded incident edges, such that you're trying to find an isomorphism of $G \xrightarrow{\sim} H' \subset H$. The problem is still NP-hard. You can show a polynomial-time reduction from the Hamiltonian path problem on graphs of degree at most $3$. | {
"domain": "cs.stackexchange",
"id": 18984,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs, time-complexity, polynomial-time, graph-isomorphism, subgraphs",
"url": null
} |
c++, recursion, assembly, fibonacci-sequence, memoization
extern "C" { // To the GNU Linker (which comes with Linux and is used by GCC),
// AEC language is a dialect of C, and AEC is a C compiler.
float n, stackWithLocalVariables[1024], memoisation[1024],
topOfTheStackWithLocalVariables, temporaryResult, returnValue,
result; // When using GCC, there is no need to declare variables in the same
// file as you will be using them, or even in the same language. So,
// no need to look up the hard-to-find information about how to
// declare variables in GNU Assembler while targeting 64-bit Linux.
// GCC and GNU Linker will take care of that.
void fibonacci(); // The ".global fibonacci" from inline assembly in
// "fibonacci.aec" (you need to declare it, so that the C++
// compiler doesn't complain: C++ isn't like JavaScript or AEC
// in that regard, C++ tries to catch errors such as a | {
"domain": "codereview.stackexchange",
"id": 38704,
"lm_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++, recursion, assembly, fibonacci-sequence, memoization",
"url": null
} |
python, beginner, pygame
global _Y_TOP
global _DELTA_Y
f = open('./games.json')
s = f.read()
f.close()
j = json.loads(s)
x = 100
y = _Y_TOP
y_space = _DELTA_Y
for game in j['games']:
_games[game['Name']] = [game, x, y]
y += y_space
#Jet Pac is used as a generic key. The key used does not matter as long as it has all the fields to be displayed
lables = _games['Jet Pac'][_DATA_I].keys()
for text in lables:
creat_text(text + ': ', None)
print 'debug:'
print _games
for game in _games:
print '\t' + game
for dict_key in _games[game][_DATA_I].keys():
print '\t\t' + dict_key + ': ' + _games[game][_DATA_I][dict_key]
creat_text(_games[game][_DATA_I][dict_key], None)
print _games['Jet Pac'][_DATA_I]['Name']
print _text_library.keys()
#end load | {
"domain": "codereview.stackexchange",
"id": 9757,
"lm_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, pygame",
"url": null
} |
electromagnetism, general-relativity, differential-geometry
Question: Does it follow that $F_{ab}$ and $\tilde{F}_{ab}$ are equivalent up to isometry, in that $\varphi_*F_{ab} = \tilde{F}_{ab}$?
Wald's General Relativity (1984, Chapter 10 Problem 2) shows a sense in which the answer is yes in the source-free case ($J^a=\mathbf{0}$). I wonder what is known about the non-source-free case. No, you also need an initial condition for the field, and a boundary condition for the field. A plane wave solution to the Maxwell equations has the same 4-current as vacuum, after all. | {
"domain": "physics.stackexchange",
"id": 15437,
"lm_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, general-relativity, differential-geometry",
"url": null
} |
jenkins, ros-kinetic, pre-release, docker, buildfarm
wait until things have settled and try again
assume everything will be fine and "just" do the release
which one you feel more comfortable with is something only you know.
I'm pretty sure this is a transient error.
As you can see at status_page/ros_kinetic_default.html?q=dynamic_reconfigure, dynamic_reconfigure is currently missing (ie: not building) for Kinetic amd64 (and i386 actually).
I haven't checked why, but this will either be resolved by a new build or someone will need to look into it (the maintainers or buildfarm managers).
Your build depends on dynamic_reconfigure, but the package is not there, hence the error.
Originally posted by gvdhoorn with karma: 86574 on 2020-10-16
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 35637,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "jenkins, ros-kinetic, pre-release, docker, buildfarm",
"url": null
} |
c#, reflection, expression-trees
private static object GetObject(Expression expression)
{
// This is a static class.
if (expression == null)
{
return null;
}
if (expression is MemberExpression anonymousMemberExpression)
{
// Extract constant value from the anonyous-wrapper
var container = ((ConstantExpression)anonymousMemberExpression.Expression).Value;
return ((FieldInfo)anonymousMemberExpression.Member).GetValue(container);
}
else
{
return ((ConstantExpression)expression).Value;
}
}
}
Tests
Here are a couple of test I wrote.
[TestMethod]
public void Load_InstanceMembers_OnTheType_Loaded()
{
var config = new Configuration(new Memory
{
{ "PublicProperty", "a" },
{ "PrivateProperty", "b" },
{ "PublicField", "c" },
{ "PrivateField", "d" },
{ "PrivateReadOnlyField", "e" },
}); | {
"domain": "codereview.stackexchange",
"id": 26648,
"lm_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#, reflection, expression-trees",
"url": null
} |
Question
# The mean age of a combined group of men and women is $$25$$ years. If the mean age of the group of men is $$26$$ and that of the group of women is $$21$$, then the percentage of men and women in the group is
A
60, 40
B
80, 20
C
20, 80
D
40, 60
Solution
## The correct option is A $$80,\space 20$$Let total no. of people in the group be $$100$$ and out of them $$x$$ are meni.e no of women = $$100-x$$.Mean age = $$\displaystyle\frac{sum \ of \ ages \ in \ the\ group}{no \ of \ people}$$Total sum = sum of ages of men + sum of ages of women$$\Rightarrow\quad 100\times 25 = x\times 26+\left(100-x\right)\times 21$$$$\Rightarrow x=80$$Hence, the percentage of men and women in the group is $$80,20$$ respectivelyMathematics
Suggest Corrections
0
Similar questions
View More
People also searched for
View More | {
"domain": "byjus.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682484719524,
"lm_q1q2_score": 0.8059944840023854,
"lm_q2_score": 0.8152324960856175,
"openwebmath_perplexity": 377.94921694245124,
"openwebmath_score": 0.5500855445861816,
"tags": null,
"url": "https://byjus.com/question-answer/the-mean-age-of-a-combined-group-of-men-and-women-is-25-years-if/"
} |
ros, navigation, robot
Originally posted by ChrisEule with karma: 26 on 2013-08-07
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by bbbExtremly on 2014-01-11:
Would you mind sharing the source code of collvoid package? Because the original address is fail(rosws merge https://kforge.ros.org/collvoid/collvoid/raw-file/tip/collvoid.rosinstall) and I cannot download it. Thank you | {
"domain": "robotics.stackexchange",
"id": 15130,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, navigation, robot",
"url": null
} |
machine-learning, supervised-learning, unsupervised-learning
Mass refers to the probability measure of the sample. The idea is to redress by difference in sample sizes by weighting the probability of each sample inversely by its size (or equivalently, the size of the other sample). That's why the density of the mixture is the average of the components. A mixture density is simply a distribution formed by a mixture or sum (of two distributions in this case). Finally, $\mu$ is commonly used in statistics to denote the mean. The conditional mean of $Y$ is simply the probability that $x$ is drawn from $g$ (because the $Y=0$ term does not contribute to the expectation), thus
$$\mu(x) \equiv \mathbb E(Y|x) = \mathrm P(Y=1|x) = \frac{g}{g+g_0}(x)$$
This equation comes from Bayes' rule, after using $g = P(x|Y=1)$ and $g_0 = P(x|Y=0)$. This approach shows the power of using density ratios. In fact, there's a whole book devoted it. | {
"domain": "datascience.stackexchange",
"id": 1914,
"lm_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, supervised-learning, unsupervised-learning",
"url": null
} |
with respect to time. In order to derive the simple pendulum equation and prove the dimensional analysis case about we show the following depiction. The harmonic oscillator solution: displacement as a function of time We wish to solve the equation of motion for the simple harmonic oscillator: d2x dt2 = − k m x, (1) where k is the spring constant and m is the mass of the oscillating body that is attached to the spring. dependent variable and its derivatives are of degree one, 2. Dividing out the exponential yields: Setting generates: which is the Hermite differential equation. motion of the trolley will be such that its acceleration ¨x satisfies mx¨ = −kx. In general, the equation of a simple harmonic motion may be represented by any of the following functions Although all the above three equations are the solution of the differential equation but we will be using x = A sin (w t + f) as the general equation of SHM. the number of cycles per unit time), and its phase, φ, which determines | {
"domain": "road-bike-charity.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.991014572574342,
"lm_q1q2_score": 0.8031964069881444,
"lm_q2_score": 0.8104789063814617,
"openwebmath_perplexity": 279.03876033102404,
"openwebmath_score": 0.76235431432724,
"tags": null,
"url": "http://vcxv.road-bike-charity.de/differential-equation-of-simple-harmonic-motion-and-its-solution.html"
} |
I got my mistake thanks for rectifying
I solved it in a bit of hurry
_________________
Never Settle for something less than what you deserve...........
I've failed over and over and over again in my life and that is why I succeed--Michael Jordan
Kudos drives a person to better himself every single time. So Pls give it generously
Wont give up till i hit a 700+
ISB, NUS, NTU Moderator
Joined: 11 Aug 2016
Posts: 300
Re: What is the value of integer n ? (1) n(n + 1) = 20 (2) 6!/(n!)(6-n)! [#permalink]
### Show Tags
08 Sep 2018, 05:04
vasuca10 wrote:
Option C
As per Statement 1 n*(n+1)=20
Possible values 1*20 , -1*-20, 2*10, -2*-10, 4*5, -4*-5, 5*4, -5*-4, 10*2, -10*-2
Multiple values hence Statement 1 alone is not suffice
Now when we combine both statements all negative values which we deduced from statement 1 can be eliminated as factorial can never be negative. Values satisfying both the statements is n =4
Hence Option C
Kindly give kudos if my explanation helped | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9372107878954106,
"lm_q1q2_score": 0.8207970134324674,
"lm_q2_score": 0.8757869884059267,
"openwebmath_perplexity": 6846.832697623608,
"openwebmath_score": 0.5605282783508301,
"tags": null,
"url": "https://gmatclub.com/forum/what-is-the-value-of-integer-n-1-n-n-1-20-2-6-n-6-n-275556.html"
} |
python, timer, tkinter
button3=Button(text='Start', command=return_entry)
button3.grid(row=10, column=4, sticky=N+S+E+W)
button4=Button(text='Quit', command=master.quit)
button4.grid(row=10, column=5, sticky=N+S+E+W)
master.after(1000, None)
mainloop() Don't use wildcard imports
I know that most tkinter tutorials show you to do from tkinter import *, but they are wrong. PEP8 recommends not use use wildcard imports, and I think that's especially true with tkinter.
Instead, use import tkinter as tk, and then prefix all tk classes with tk.. For example:
master = tk.Tk()
...
label1 = tk.Label(master, text="Working Time", bg='white')
You are using after incorrectly
This statement does not do what you think it does:
master.after(1000, label5.config(text=i))
The above is exactly the same as this:
result = label5.config(text=i)
master.after(1000, result) | {
"domain": "codereview.stackexchange",
"id": 26143,
"lm_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, timer, tkinter",
"url": null
} |
c#, beginner, object-oriented, json
public static int GetNewId()
{
int id;
if (Inventory.Products.Count == 0)
id = 1;
else
{
id = Inventory.Products.Last().Id + 1;
}
return id;
}
This is a really bad idea because what's the guarantee that the products are always stored and loaded in the exact same order, AND that their order in the list is never changed? (None, especially when the list is publicly settable and modifiable.) You can easily end up with multiple products with the same ID.
DataManager should be a repository. | {
"domain": "codereview.stackexchange",
"id": 23625,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner, object-oriented, json",
"url": null
} |
In general, the larger the data set, the easier it is to reject the null hypothesis and claim "statistical significance." If the data set is very large, it is even possible to reject the null hypothesis and claim that the slope $$β_{1}$$ is not 0, even when it is not practically or meaningfully different from 0. That is, it is possible to get a significant P-value when $$β_{1}$$ is 0.13, a quantity that is likely not to be considered meaningfully different from 0 (of course, it does depend on the situation and the units). Again, the mantra is "statistical significance does not imply practical significance."
## Caution #7
A large $$R^{2}$$ value does not necessarily mean that a useful prediction of the response $$y_{new}$$, or estimation of the mean response $$\mu_{Y}$$, can be made. It is still possible to get prediction intervals or confidence intervals that are too wide to be useful.
We'll learn more about such prediction and confidence intervals in Lesson 3.
## Try it! | {
"domain": "psu.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407160384082,
"lm_q1q2_score": 0.8233056215234046,
"lm_q2_score": 0.8459424353665382,
"openwebmath_perplexity": 675.4804132704174,
"openwebmath_score": 0.506095290184021,
"tags": null,
"url": "https://online.stat.psu.edu/stat501/book/export/html/893"
} |
homework-and-exercises, torque, statics
Now to address your first diagram, if you calculate the torques about point A, then you must consider the interaction of the walls of the hole with the rod. Those interactions produce the torques which make the sum equal to zero. If the rod is in static equilibrium, you can't ignore the effects of the walls of the hole. And you can't say that the entire hole is a point.
Edit: If the rod is secured to the wall by attaching it to the outside by sending a screw or nail through the rod, then the friction between the wall and rod, or the friction between the rod and screw (or nail) will exert a torque about A.
Regarding the second diagram, if support C is touching the rod, it exerts a force on the rod and therefore has a torque about point B. If a different point (away from B) is chosen and the rod is touching support B, then B exerts a torque. But if the system is in rotational equilibrium, the sum of the torques about a chosen point must be zero. | {
"domain": "physics.stackexchange",
"id": 29295,
"lm_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, torque, statics",
"url": null
} |
homework-and-exercises, electrostatics, charge, equilibrium
Title: Checking for equilibrium in a square configuration of charges Four equal positive charges each of magnitude q are placed at the respective vertices of a square of side length l. A point Q is placed at the centre of the square. Then find the state of equilibrium of charge Q (stable, unstable or neutral)
I figured that the charge Q was in equilibrium because the force on it was zero but couldn't find out if it were stable or not. I know that in stable equilibrium, a small displacement results in SHM about the mean position so I tried to write an equation of force for a small displacement but couldn't succeed in formulating the equation. Any help regarding writing the force on a small displacement would be deeply appreciated.
Thank you Take for example, the case when the charge Q at the centre is negative, so the force is attractive. | {
"domain": "physics.stackexchange",
"id": 21015,
"lm_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, electrostatics, charge, equilibrium",
"url": null
} |
1. ## Conditional probability
10. The following data from a sample of 100 families show the record of college attendance by fathers and their oldest sons: in 22 families, both father and son attended college; in 31 families, neither father nor son attended college; in 12 families, the father attended college while the son did not; and, in 35 families, the son attended college while the father did not.
a. What is the probability a son attended college given that his father attended college? 0.22 (3 pts)
b. What is the probability a son attended college given that his father did not attend college? 0.35 (3 pts)
My answers are wrong and I followed the joint probability formula.. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936101542134,
"lm_q1q2_score": 0.8045698134731346,
"lm_q2_score": 0.817574471748733,
"openwebmath_perplexity": 3498.287843831063,
"openwebmath_score": 0.6057596206665039,
"tags": null,
"url": "http://mathhelpforum.com/statistics/113866-conditional-probability.html"
} |
'Outcome' here means the same as 'way' in the question. It doesn't matter how we define it, as long as all outcomes/ways are equally likely. Under the book's interpretation of numbering the balls before the draw, that requirement is met. Under the interpretation where an outcome/way is a sequence of six characters drawn with replacement from {B,W}, subject to there being no more than four Bs and no more than five Ws, the outcomes/ways are not all equally likely. For instance the outcome WWWWWB is less likely than WWWBBB. So that interpretation is not amenable to a calculation of probability.
10. Jul 14, 2015
### geoffrey159
Take the event $E_k = \{ \text{among the 6 balls, exactly k are black}\}$, $k\le 4$
The elements of $E_k$ are all the couples of $k$ distinct black balls and $6-k$ distinct white balls, so
$E_k = \{ B_{i_1} ... B_{i_k}, \ 1 \le i_1 < ... < i_k \le 4\} \times \{ W_{j_1} ... W_{j_{6-k}}, \ 1 \le j_1 < ... < j_{6-k} \le 5\}$ | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9643214511730025,
"lm_q1q2_score": 0.809773482172678,
"lm_q2_score": 0.8397339716830606,
"openwebmath_perplexity": 413.306004858109,
"openwebmath_score": 0.7769777178764343,
"tags": null,
"url": "https://www.physicsforums.com/threads/combination-or-probability-question.823012/"
} |
autocorrelation, fundamental-frequency
Title: How to find the fundamental frequency of a discrete signal using partial autocorrelation? I hope you can help me with this question.
I am trying to calculate the fundamental frequency (to know the beats per minute) of a cardiac pulse signal using partial autocorrelation.
I use a 12-bit ADC and taking 4096 samples at Fs=512 Hz.
Heres what I'm trying:
First I do an offset of -2048 to align the signal to 0 (since the ADC gives me values from 0 to 4096).
Then I multiply it by the Hamming window wich I calculated as
$$ w[n] = 0.54 - 0.46 \cos \left(2 \pi \frac{n}{N} \right) $$
To get this
Then I do the partial autocorrelation like this.
$$ C_{xx}[n] = \frac{1}{N} \sum\limits_{m=0}^{N-1-n} x[m]x[m+n] $$ | {
"domain": "dsp.stackexchange",
"id": 7472,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "autocorrelation, fundamental-frequency",
"url": null
} |
electromagnetism, charge, induction
From this question, I thought we can create two scenarios:
scenario 1:
A: +
B: -
C: -
scenario 2:
A: -
B: +
C: +
A and B attract, so I thought they have to be opposite signs. B and C repel, so they must be the same sign. I was surprised when I saw solutions, the selected answer was just (e). (e). In the first experiment, objects A and B may have charges with opposite signs, or one of the objects may be neutral. The second experiment shows that B and C have charges with the same signs, so that B must be charged. But we still do not know if A is charged or neutral. | {
"domain": "physics.stackexchange",
"id": 18629,
"lm_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, charge, induction",
"url": null
} |
semiconductor-physics, electronics
According to the authors, the depletion zone becomes narrower when the diode is connected in forward bias because the height of the potential barrier, $V_0$, decreases. Height of $V_0$ decreases because the p-side is connected with the positive terminal of $V_{ext}$ and the n-side is connected with the negative terminal of $V_{ext}$, according to the authors. Can someone please explain more easily and clearly why the the height of the potential barrier, $V_0$, decreases when the diode is connected in forward-bias?
If $V_{ext}$ is increased, will the depletion zone become narrower? Can $V_{ext}$ be increased so much that the depletion zone becomes non-existent? This question is a good segue to my 3rd question. | {
"domain": "physics.stackexchange",
"id": 79787,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "semiconductor-physics, electronics",
"url": null
} |
beginner, php, converting, number-systems, roman-numerals
$closestMag = $mag;
$foundKey = $romanNumeral;
}
}
}
$numLeft = $numToFind - $closestNum;
if ($numLeft < 0){
$numLeft *= -1;
}
return array($closestNum, $foundKey, $numLeft);
}
function num2RomanNumeral($num, &$string){
if ($num != null || $num != 0){
$numArray = separateNumberIntoUnits($num);
foreach($numArray as $splitNum){
$data = getClosestNum($splitNum);
if ($data != null){
$closestNumber = $data[0];
$foundRomanNumeral = $data[1];
$numLeft = $data[2];
if ($splitNum > $closestNumber){
$string = $string.$foundRomanNumeral;
if ($numLeft > 0){
num2RomanNumeral($numLeft, $string);
} | {
"domain": "codereview.stackexchange",
"id": 43838,
"lm_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, php, converting, number-systems, roman-numerals",
"url": null
} |
javascript, strings, functional-programming, ecmascript-6
And then you can configure inBetween to accept the variable parameter separately:
const inBetween = (a, b) => x => a <= x && x <= b
const space = x => [9, 10, 12, 13, 32].includes(x)
const numeric = inBetween(48, 57)
const lowerAlpha = inBetween(97, 122)
const upperAlpha = inBetween(65, 90)
I find this a bit more readable, since it removes the repetition of the parameter code. The resulting code is denser and reads nicely: "alpha means either lowerAlpha or upperAlpha", etc.
But really this comes down to your preferences. As far as
do these functions satisfy what said as functional? | {
"domain": "codereview.stackexchange",
"id": 21600,
"lm_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, strings, functional-programming, ecmascript-6",
"url": null
} |
nlp, data-mining, structured-data
The simplest method to structure text data is to represent the sentence or document as a bag of words (BoW), i.e. a set containing all the tokens in the sentence or document. Such a set can be represented with One-Hot-Encoding (OHT) over the full vocabulary (all the words in all the documents) in order to obtain structured data (features). Many preprocessing variants can be applied: remove stop words, replace words with their lemma, filter out rare words, etc. (don't neglect them, these preprocessing options can have a huge impact on performance).
Despite their simplicity, BoW models usually preserve the semantic information of the document reasonably well. However they cannot handle any complex linguistic structure: negations, multiword expressions, etc. | {
"domain": "datascience.stackexchange",
"id": 9715,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nlp, data-mining, structured-data",
"url": null
} |
electric-circuits, electric-current, electrical-resistance, voltage, power
$V=IR$ means that $I$ varies directly with $V$ if $R$ is constant.
$P=IV$ means that $I$ varies inversely with $V$ if $P$ is constant.
The only time you could get a contradiction is if you are comparing situations where the power is constant and also the resistance is constant. But if that's the case you'll find there is only one solution for $I$ and $V$, that is to say, with those restrictions $I$ and $V$ can't vary - directly or inversely. | {
"domain": "physics.stackexchange",
"id": 35705,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-circuits, electric-current, electrical-resistance, voltage, power",
"url": null
} |
graphs, greedy-algorithms, minimum-spanning-tree, prims-algorithm
I know that Kruskal's and Prim's algorithm can all be used to solve the first part of the problem, the minimum spanning tree, and I can do it. However, I have been struggling hard for the second part, as I don't know how to minimise the weight of the tree given the number D. In the following, I assume the set of all feasible solutions is the set $\{(T,uv):T$ is a not necessarily minimum spanning tree of $G$ and $uv$ is a distinguished edge in $T\}$, with the cost of a particular solution $(T,uv)$ being the sum of the edges in $T$ minus $\min(D,w(uv))$.
Let $(T, uv)$ be an optimal solution to the problem you describe, having weight $\sum_{xy \in E(T)} w(xy) - s$, where $s = \min(D, w(uv))$. There are two possibilities: | {
"domain": "cs.stackexchange",
"id": 13289,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs, greedy-algorithms, minimum-spanning-tree, prims-algorithm",
"url": null
} |
special-relativity, spacetime, inertial-frames, observers
In the original diagram, sqrt(7^2-5^2)$\approx$ 4.898 $\sim$ 5.
If you have more specific coordinates, repeat the calculation.
If you use arithmetically nice values (like v=(3/5)c or v=(4/5)c),
you can end up with nice fractions... and can have coordinates that lie on rational values. | {
"domain": "physics.stackexchange",
"id": 98799,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, spacetime, inertial-frames, observers",
"url": null
} |
The time complexity of radix sort is given by the formula,T(n) = O(d*(n+b)), where d is the number of digits in the given list, n is the number of elements in the list, and b is the base or bucket size used, which is normally base 10 for decimal representation. However, the time complexity of an algorithm also depends on the hardware, operating system, processors, etc. Somewhere, Korea; GitHub1; GitHub2; Email On this page. Algorithm Implementation . A Sorting Algorithm is used to rearrange a given array or list elements according to a comparison operator on the elements. Therefore, it is crucial to analyse all the factors before executing the algorithm, and it is essential to select a suitable Sorting Algorithm to achieve efficiency and effectiveness in time complexity. Time Complexity in Sorting Algorithms. n indicates the input size, while O is the worst-case scenario growth rate function. Time Complexity A best sorting algorithm in python. How To Add A Document Viewer In Angular | {
"domain": "raggato.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759593358227,
"lm_q1q2_score": 0.8236748591603252,
"lm_q2_score": 0.8397339656668286,
"openwebmath_perplexity": 732.1756600480524,
"openwebmath_score": 0.3800761103630066,
"tags": null,
"url": "https://raggato.com/franklin-templeton-sbtzog/sorting-algorithms-time-complexity-bb7278"
} |
tree, swift, machine-learning
init(value:Double, variable:Int)
{
//Split node
self.value = value
self.isTerminal = false
self.variable = variable
self.description = "\(variable): \(value)"
}
init(result: Int)
{
//Terminal node
self.result = result
self.isTerminal = true
self.description = "Terminal node: \(result)\n"
}
func addLeftChild(child:Node)
{
self.leftChild = child
self.description += " L -> \(child)\n"
}
func addRightChild(child:Node)
{
self.rightChild = child
self.description += " R -> \(child)\n"
}
//For prediction
func getChild(x:Double) -> Node
{
if x < value
{
return leftChild!
}
else
{
return rightChild!
}
}
} | {
"domain": "codereview.stackexchange",
"id": 19295,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "tree, swift, machine-learning",
"url": null
} |
differential-geometry, group-theory, topology, instantons
which interpolate between vacua. Even if this is all correct, there are a lot of things that are not clear to me: Are both approaches equivalent or do they need to be taken into consideration simultaneously? How is one related to the other? Does the second approach also assumes the temporal gauge and the condition $U(\mathbf{x})\to 1$? I understand how this could be seen as "too many questions", but they are just meant to show my general confusion which could probably be settled by a few lines about the two approaches. Nice question. I don't think I'd be able to answer everything but here are my thoughts. Please don't hesitate to ask if I've written things in an unclear way. | {
"domain": "physics.stackexchange",
"id": 68759,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "differential-geometry, group-theory, topology, instantons",
"url": null
} |
java, object-oriented, file, libgdx, 2048
I do not how I would implement the different for loops in a parameterized method, some of the for loops are ascending and others are descending. – The Coding Wombat
the interface:
interface Direction{
int startValue();
boolean hasNext(int loopIndex);
int next(int loopIndex);
int getX(int loopIndex);
int getY(int loopIndex);
}
the directions as anonymous inner classes:
Direction right = new Direction(){
@Override public int startValue(){
return tiles.length - 2;
}
@Override public int hasNext(int loopIndex){
return loopIndex >= 0;
}
@Override public int next(int loopIndex){
return loopIndex--;
}
@Override public int getX(int loopIndex){
return loopIndex;
}
@Override public int getY(int loopIndex){
return 1;
}
} | {
"domain": "codereview.stackexchange",
"id": 25279,
"lm_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, file, libgdx, 2048",
"url": null
} |
This algorithm can be extended to take the $K$ largest elements, and for each partition of them, extends the partition by adding the remaining elements successively to whichever set is smaller. (The simple version above corresponds to $K=2$.) This version runs in time $O(2^K n^2)$ and is known to give a $(K+2)/(K+1)$ approximation; thus we have a polynomial-time approximation scheme (PTAS) for the number partition problem, though this is not a fully polynomial time approximation scheme (the running time is exponential in the desired approximation guarantee). However, there are variations of this idea that are fully polynomial-time approximation schemes for the subset-sum problem, and hence for the partition problem as well.[2][3]
### Differencing algorithm | {
"domain": "wikipedia.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9920620040210504,
"lm_q1q2_score": 0.8133850215439639,
"lm_q2_score": 0.8198933315126791,
"openwebmath_perplexity": 578.7865795576408,
"openwebmath_score": 0.7254106998443604,
"tags": null,
"url": "http://en.wikipedia.org/wiki/Partition_problem"
} |
climate-change, oceanography, foraminifera
Therefore, I wonder if there are any biological or geological indicators that can be used to show the change in the 18O signature of a marine system in recent times (since 1880)? Well, the question is not easy to answer. On the one hand, we need a data carrier that sediments reliably over several million years and thus transmits the isotope signatures of the water from the past. On the other hand, many comparative studies are needed to understand factors such as kinetic fractionation during the uptake of isotopes into the skeleton. Unfortunately, after some research I only stumbled across formainifers which fufill this criteria. In my opinion, it is also good that other animals/plants/planktons are not used so that science can concentrate on one area according to the motto simple and short.
Update:
Ok I now have a little more understanding of geostratigraphy using formainifers.
My findings that may be important:
Foraminifera have existed for about 560 million years | {
"domain": "earthscience.stackexchange",
"id": 2740,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "climate-change, oceanography, foraminifera",
"url": null
} |
differential equation with Neumann boundary conditions. 2) with respect to e in order to obtain Neumann boundary conditions on 0Q for the derivative O,u(0, -) of the eigenfunction (equation (2. In Section 2 the statement of the main problem (2. When imposed on an ordinary or a partial differential equation, the condition specifies the values in which the derivative of a solution is applied within the boundary of the domain. , the Dirichlet boundary condition), the treatment for straight and curved boundaries are similar to the hydrodynamic counterpart. Related Threads on Boundary conditions for the Heat Equation Neumann Boundary Conditions for Heat Equation. Professor Macauley 2,870 views. Dirichlet vs Neumann Boundary Conditions and Ghost Points Approach Different boundary conditions for the heat equation - Duration: 51:23. Neumann Boundary Conditions Robin Boundary Conditions Remarks At any given time, the average temperature in the bar is u(t) = 1 L Z L 0 u(x,t)dx. Gradient | {
"domain": "danieledivittorio.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717460476701,
"lm_q1q2_score": 0.8019519313003395,
"lm_q2_score": 0.8128673201042492,
"openwebmath_perplexity": 606.8482181438628,
"openwebmath_score": 0.8299397826194763,
"tags": null,
"url": "http://danieledivittorio.it/vube/neumann-boundary-condition-heat-equation.html"
} |
lagrangian-formalism, gauge-theory, maxwell-equations, gauge
At the classical level, if we want to write electromagnetism in terms of a four-potential, that potential has to have a gauge symmetry to avoid redundancy. If you don't have a gauge symmetry, the theory simply won't be classical electromagnetism. Instead, waves with a fixed wavevector will have three independent polarizations.
However, such a theory has a deep problem: the equation of motion $\partial_\mu F^{\mu\nu} = 0$ only suffices to determine the evolution of the fields, not the potentials. That is, the classical theory is not deterministic! This directly corresponds to a loss of unitarity at the quantum level. Both these features are sufficiently bad that some would say gauge symmetry is a requirement for the theory to make sense. | {
"domain": "physics.stackexchange",
"id": 54637,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, gauge-theory, maxwell-equations, gauge",
"url": null
} |
visible-light, material-science, reflection
Title: Is there a substance that doesn't reflect OR absorb light from the visible light spectrum? Is there a substance that doesn't reflect or absorb visible light but may reflect light from another spectrum? Is there a theoretical substance that would have these properties?
EDIT: | {
"domain": "physics.stackexchange",
"id": 38981,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "visible-light, material-science, reflection",
"url": null
} |
c#
The declaration (Memory<bool> TopLine, Memory<bool> BottomLine) in CompressSearch would be more readable if written as two separate declarations, which also allows easy use of var:
var TopLine = TargetReader.CachedItems[TopIndex];
var BottomLine = TargetReader.CachedItems[BottomIndex];
The if (FoundTop > -1 && FoundBottom > -1) check could be split up and moved into the two earlier ifs. This would allow for only checking one value (since you just assigned one value, you only need to check the other), and would then only do this check when it needs to be done, rather than every loop iteration.
There is a bit of inconsistency in the naming style, as sometimes your identifiers start with a capital letter, other times lowercase. I had initially though this was a distinction between member variables and parameters or local variables, but I see this is not the case. | {
"domain": "codereview.stackexchange",
"id": 37717,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#",
"url": null
} |
thermodynamics, heat, order-of-magnitude
The wood has more atoms than the metal, because the wood is made of light atoms. But if the metal is Lithium, the lithium has more atoms per gram. That's the heuristic, and its pretty accurate at room temperature. It becomes inaccurate at temperatures low enough that the quantum nature of the atomic vibrations becomes obvious, so that the level spacings of the phonon excitations are larger than kT. | {
"domain": "physics.stackexchange",
"id": 3658,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, heat, order-of-magnitude",
"url": null
} |
jupiter, gas-giants
Sing et al. 2012).
Another example is that at UV and X-ray wavelengths there have been observations suggesting hot Jupiters have very extended (and opaque to high energy photons) atmospheres and may be being photoevaporated (e.g. Poppenhaeger et al. 2013).
This raises an important distinction. A definition based on the radius at a particular pressure is mostly used by theorists and solar system scientists. However, we still don't know what the atmospheric structures of exoplanets are and can't measure pressures. The radii quoted for exoplanets are more akin to how the radius of a star is measured - based on its opacity at the wavelengths being observed. | {
"domain": "astronomy.stackexchange",
"id": 680,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "jupiter, gas-giants",
"url": null
} |
stress-energy-momentum-tensor, stress-strain
Now for a differential force balance on the deformed membrane. Consider the force balance on the "window" shaped element of the deformed membrane between $r_0$ and $r_0+dr_0$, and between $\theta$ and $\theta+d\theta$: $$\left(\sigma_r\lambda_{\theta}r_0d\theta t\hat{s}\right)_{r_0+dr_0}-\left(\sigma_r\lambda_{\theta}r_0d\theta t\hat{s}\right)_{r_0}+(\sigma_{\theta}\lambda_r dr_0 t\hat{\theta})_{\theta +d\theta}-(\sigma_{\theta}\lambda_r dr_0 t\hat{\theta})_{\theta}=0$$Dividing by $dr_0d\theta$ then gives: $$\frac{(\sigma_r\lambda_{\theta}r_0 t\hat{s})}{\partial r_0}+\frac{(\sigma_{\theta}\lambda_r t\hat{\theta})}{d\theta}=0$$Next, since the membrane material is incompressible, we have $$t=\frac{t_0}{\lambda_r \lambda_{\theta}}$$ Substituting this into the differential force balance then gives: $$\frac{[r_0(\sigma_r/\lambda_{r}) \hat{s}]}{\partial r_0}+\frac{[r_0(\sigma_{\theta}/\lambda_{\theta}) \hat{\theta}]}{r_0d\theta}=0$$ | {
"domain": "physics.stackexchange",
"id": 97334,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stress-energy-momentum-tensor, stress-strain",
"url": null
} |
black-hole
Just as the path of light rays are curved around the BH, so are the sightlines from you toward the BH (you can think of sightlines as reversed photons). That means that all sightlines that are closer than (a projected distance of) $2.6r_\mathrm{S}$ to the BH will, eventually, end up on the EH, even if taking several orbits around the BH. These sightlines comprise the so-called shadow (Falcke et al.(2000); Event Horizon Telescope Collaboration et al.(2019a), ). On the other hand, along sightlines that a farther away, you see the radiation emitted from the matter falling into the BH, both in front of and behind the BH. And since the first sightlines that don't terminate at the EH circle the photon sphere many times, those sightlines are actually very long paths through matter shining its last light before being engulfed, and hence they look exceptionally bright (e.g. Event Horizon Telescope Collaboration et al.(2019b)). This bright ring just outside the shadow is called the photon ring, | {
"domain": "astronomy.stackexchange",
"id": 3631,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "black-hole",
"url": null
} |
catkin-make, catkin
include_directories(${THIS_PACKAGE_INCLUDE_DIRS})
include_directories(SYSTEM
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIRS}
${OMPL_INCLUDE_DIRS}
)
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY include/${PROJECT_NAME} DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
add_executable(approach_outside_lower_weld src/approach_outside_lower_weld.cpp)
target_link_libraries(approach_outside_lower_weld
${PROJECT_NAME}_utils
${PROJECT_NAME}_OmplPlanner
${PROJECT_NAME}_graph_plotter
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${OMPL_LIBRARIES}
)
install(TARGETS approach_outside_lower_weld DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
add_executable(approach_rib_weld src/approach_rib_weld.cpp)
target_link_libraries(approach_rib_weld
${PROJECT_NAME}_utils | {
"domain": "robotics.stackexchange",
"id": 36711,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "catkin-make, catkin",
"url": null
} |
quantum-mechanics, entropy, quantum-entanglement, spin-chains
Title: How can you (computationally) calculate the halfchain entanglement entropy of a spinchain? I am simulating a (small) spinchain with exact diagonalization and dynamics. I would like to track the entanglement entropy of half the chain with the other part of the chain.
I have the vectors of my state $|\Psi(t)>$ in the basis $|s_1, s_2, .., s_i, .. , s_n>$ which are the spins at each sites at a certain time. I know you can get the density matrix of this by taking the outer product $\rho = |\Psi(t)>< \Psi(t)|$ which is a $n \times n$ matrix, but this is a pure state so entanglement entropy will be zero, so now I want the density matrix of the subsystem which includes the first (or last) half of the spin chain. This probably includes tracing out certain parts of the density matrix $\rho$ to $\rho_A$, but how do I do this specifically, what parts? | {
"domain": "physics.stackexchange",
"id": 65660,
"lm_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, entropy, quantum-entanglement, spin-chains",
"url": null
} |
• Oh, that was actually faster. Thanks, but the = is not part of the partial order definition, so why did you bring reflexivity in this? I mean reflexivity states that a ≤ a, right? – gurghet Apr 16 '18 at 20:58
• PS: I’m approaching this from a cat theory point of view so ≤ is just a symbol for a relation, it doesn't know what an = is, I suppose = is just our way to say that we are talking about the same object – gurghet Apr 16 '18 at 21:04
• @gurghet Yes, reflexivity is $a \le a$, so if you pick the same $a$ for $a$, $b$, and $c$ you get $(a \le a \land a \le a) \rightarrow a \not = a$, and since a partial order is reflexive, we have $a \le a$ for any $a$, and thus $a \le a \land a \le a$ is true, and hence we obtain $a \not = a$ – Bram28 Apr 16 '18 at 21:07
• Ok now I get it – gurghet Apr 16 '18 at 21:15 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9669140235181257,
"lm_q1q2_score": 0.8159740071401809,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 406.1691602385308,
"openwebmath_score": 0.7565542459487915,
"tags": null,
"url": "https://math.stackexchange.com/questions/2740415/how-to-express-the-special-property-of-a-partial-order"
} |
• Shamir assumes that the secret coefficients $$a_n, a_{n-1}, ..., a_1$$ are chosen uniformly. However, it turns out to be impossible to select uniformly randomly from a set of size $$\aleph_0$$ (which the set of integers is), that is, any selection method must necessarily be biased. And, depending on what the distribution is, this bias will also leak further information.
BTW: Shamir Secret Sharing isn't necessarily done modulo a large prime; it can be implemented over any finite field. In practice, we often use even characteristic fields, such as $$GF(2^8)$$ or $$GF(2^{128})$$; the security is the same, but it has the practical advantage of everything fitting in an integral number of bytes. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759587767815,
"lm_q1q2_score": 0.8042136662755782,
"lm_q2_score": 0.819893340314393,
"openwebmath_perplexity": 560.5054784824654,
"openwebmath_score": 0.9194777011871338,
"tags": null,
"url": "https://crypto.stackexchange.com/questions/92225/what-is-the-reason-for-shamir-scheme-to-use-modulo-prime"
} |
javascript, jquery
}
);
};
$(document).ready(function() {
tweetHover("#tw-root");
});
</script>
<!-- Facebook JavaScript
https://developers.facebook.com/docs/javascript/howto/jquery/v2.4
-->
<script type="text/javascript">
var facebook_sdk = '//connect.facebook.net/en_US/sdk.js';
if (document.documentElement.lang = 'pt-BR') {
facebook_sdk = '//connect.facebook.net/pt_BR/sdk.js';
}; | {
"domain": "codereview.stackexchange",
"id": 15814,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery",
"url": null
} |
cell-culture, infection, parasitology, pathogenesis
References:
Dean L. Blood Groups and Red Cell Antigens [Internet]. Bethesda (MD): National Center for Biotechnology Information (US); 2005. Chapter 9, The Duffy blood group. Available from: http://www.ncbi.nlm.nih.gov/books/NBK2271/
Ménard, Didier, et al. "Plasmodium vivax clinical malaria is commonly observed in Duffy-negative Malagasy people." Proc Nat Acad Sci, USA 107.13 (2010): 5967-5971.
Mendes, Cristina, et al. "Duffy negative antigen is no longer a barrier to Plasmodium vivax–molecular evidences from the African West Coast (Angola and Equatorial Guinea)." PLoS Negl Trop Dis 5.6 (2011): e1192.
Cserti, Christine M., and Walter H. Dzik. "The ABO blood group system and Plasmodium falciparum malaria." Blood 110.7 (2007): 2250-2258.
Rowe, J. Alexandra, et al. "Blood group O protects against severe Plasmodium falciparum malaria through the mechanism of reduced rosetting." Proc Nat Acad Sci, USA 104.44 (2007): 17471-17476. | {
"domain": "biology.stackexchange",
"id": 5094,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cell-culture, infection, parasitology, pathogenesis",
"url": null
} |
python, performance, algorithm, python-3.x
}
def __init__(self, board=None, rows=None, cols=None, figures=STANDARD_FIGURES):
if board is None:
board = [[0] * cols for _ in range(len(rows))]
if rows is None and cols is None:
rows = len(board)
cols = len(board[0])
... | {
"domain": "codereview.stackexchange",
"id": 37699,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, algorithm, python-3.x",
"url": null
} |
general-relativity, differential-geometry, metric-tensor, coordinate-systems, covariance
By including $\sqrt{-g}$ you remove this change, since $$g=det(g_{\mu\nu})\rightarrow det\left(g_{\tau\lambda}\frac{\partial x^{\tau}}{\partial x'^{\mu}}\frac{\partial x^{\lambda}}{\partial x'^{\nu}}\right)=g\,\cdot\,(|J|^{-1})^2=g'$$
and
$$d^4x\rightarrow det\left(\frac{\partial x'}{\partial x}\right)d^4x=|J|\,d^4x=d^4x'$$
So in conclusion
$$d^4x\sqrt{-g}\quad\rightarrow\quad d^4x\sqrt{-g}|J|\cdot|J|^{-1}=d^4x\sqrt{-g}$$
and the action is invariant, provided the Lagrangian density is a scalar. | {
"domain": "physics.stackexchange",
"id": 58991,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, differential-geometry, metric-tensor, coordinate-systems, covariance",
"url": null
} |
ros, pr2, ros-kinetic, grasp
// pick container, using the generated grasp generator
auto pick = std::make_unique<stages::Pick>(std::move(grasp));
pick->setProperty("eef", "left_gripper");
pick->setProperty("object", std::string("object"));
pick->properties().configureInitFrom(Stage::PARENT);
geometry_msgs::TwistStamped approach;
approach.header.frame_id = "l_wrist_roll_link";
approach.twist.linear.x = 1.0;
pick->setApproachMotion(approach, 0.01, 0.10);
geometry_msgs::TwistStamped lift;
lift.header.frame_id = "base_footprint";
lift.twist.linear.z = 1.0;
pick->setLiftMotion(lift, 0.05, 0.10);
current_state = pick.get();
t.add(std::move(pick));
} | {
"domain": "robotics.stackexchange",
"id": 35109,
"lm_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, pr2, ros-kinetic, grasp",
"url": null
} |
electrostatics, work, potential-energy
Since the location of the image charge changes with the location of the outside charge, moving the point charge changes the potential due to the image charge.
The point is that, interpreting the potential of a system of charges as the work done to bring a charge in from infinity assumes that the system of charges is fixed, i.e., undisturbed by our bringing in the charge from infinity. Thus, the notion of a test charge. | {
"domain": "physics.stackexchange",
"id": 38112,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, work, potential-energy",
"url": null
} |
lesson. for e.g. " Definite Integral. The double integration in this example is simple enough to use Fubini’s theorem directly, allowing us to convert a double integral into an iterated integral. To obtain double/triple/multiple integrals and cyclic integrals you must use amsmath and esint (for cyclic integrals) packages. Double Integral Area. This happens when the region of integration is rectangular in shape. The discussion on this page is in two main parts based on the type of region described by the limits of integration. The first group of questions asks to set up a double integral of a general function f(x,y) over a giving region in the xy-plane. » Integrate can evaluate integrals of rational functions. Order of Integration refers to changing the order you evaluate iterated integrals—for example double integrals or triple integrals.. Changing the Order of Integration. MULTIPLE INTEGRALS Triple Integrals in Spherical Coordinates Muliple Integration Section 1: DOUBLE INTEGRALS | {
"domain": "kabero.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773707993078212,
"lm_q1q2_score": 0.8345893935251338,
"lm_q2_score": 0.8539127566694177,
"openwebmath_perplexity": 693.7423234955559,
"openwebmath_score": 0.9358883500099182,
"tags": null,
"url": "http://kabero.com/1nr89fz/a56140-multiple-integrals-examples"
} |
acid-base
Title: Why are the phosphate ion and hydrogen phosphate not conjugate acid/base pairs of each other?
(e) Identify in the following reaction the Bronsted-Lowry acid and its conjugate base
$$\ce{PO4^3- + HNO3 -> NO3- + HPO4^2-}$$
Both $\ce{PO4^3-}$ and $\ce{HPO4^2-}$ differ by a $\ce{H+}$ ion so why aren't they conjugate acid base pairs?. This query seems to be a product of misunderstanding the problem in question.
The question asks the following,
(e) Identify in the following reaction the Bronsted-Lowry acid and its conjugate base
$$\ce{PO4^3- + HNO3 -> NO3- + HPO4^2-}$$
Now, your reasoning is correct. $\ce{PO4^3-}$ and $\ce{HPO4^2-}$ are in fact conjugate acid/base pairs. However, the question doesn't ask for that. Rather it asks for the Bronsted-Lowry acid (in this reaction specifically).
According to The IUPAC Compendium of Chemical Terminology 2014, a conjugate acid-base pair is defined as follows. | {
"domain": "chemistry.stackexchange",
"id": 16880,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base",
"url": null
} |
navigation, ekf, navsat-transform-node, robot-localization, ekf-localization-node
Originally posted by Mahmoud Kamel on ROS Answers with karma: 103 on 2017-06-14
Post score: 1
Original comments
Comment by wings0728 on 2017-11-28:
how can I add google map to rviz?
Comment by Mahmoud Kamel on 2017-11-28:
-Make sure you have map server package(from navigation stack ) installed.
-prepare a .png image of your map and follow this link to create a .pgm image and to update .yaml file
-Have a look at the third attached launch file to add the map to move_base.
-run rviz.
Use the datum parameter, correct.
The reason for those values is that the map->UTM transform involves rotation. If you create a transformation matrix with the values you posted (MATLAB or Octave code shown):
mat = [cos(1.754486327) -sin( 1.754486327) 309151.07
sin(1.754486327) cos( 1.754486327) 3328209.18
0 0 1 ];
inv(rot) | {
"domain": "robotics.stackexchange",
"id": 28118,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ekf, navsat-transform-node, robot-localization, ekf-localization-node",
"url": null
} |
definite. Approximately calculating integrals over spherical surfaces in R3 can be done by simple extensions of one dimensional quadrature rules. I haven't been able to find it, I'm trying to derive it now but it's crucial that I'm 100% correct. The algorithm includes finding the coefficients of Legendre polynomials and their zeros. , on whether the basic equations are soundproof or fully compressible. Perform multivariate Gaussian quadrature. Compare the accuracy and dspee of othb types of Gaussian quadrature with the built-in Scipy ackagep. The weights and abscissae are computed by a straightforward numerical algorithm with a working precision set by the argument digits. ERROR BOUNDS FOR GAUSSIAN QUADRATURE 401 Bounds of the type (1. Gauss Legendre quadrature have been applied for numerical solution of the integral of the form 1 𝑘𝑥 0 𝑓 𝑥𝑑𝑥, where k is real number. nag_quad_1d_gauss_vec (d01ua) computes an estimate of the definite integral of a function of known analytical form, using | {
"domain": "teckspace.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.984810947625669,
"lm_q1q2_score": 0.8119391267485825,
"lm_q2_score": 0.8244619220634457,
"openwebmath_perplexity": 878.0046815432065,
"openwebmath_score": 0.7859308123588562,
"tags": null,
"url": "http://ilfq.teckspace.de/gauss-legendre-quadrature-example.html"
} |
Lesson 4 - Inverses Homework - This lesson…. 7-sinusoidal problem solving. Lesson 1 – Polynomials Handout. Learn vocabulary, terms, and more with flashcards, games, and other study tools. Graphing and finding properties of the root function and the reciprocal function. Assessment. Graphs *use vertical line test to determine if relation or function* Set of ordered pairs Table of values Mapping diagram Today's Lesson: Function Notation Three different ways to represent a function: Equation Notation Function Notation Mapping Notation y = 3x² - 5 f(x) = 3x² - 5 "f of x is equal to 3x² - 5". Chapter 2: Equivalent Algebraic Expressions. (a) 4S7 – S7 = 4(2 + 8 + 32 + 128 + 512 + 2048 + 8192) Displaying MCR3U. Title: MCR3U Functions Author: Customer Last modified by: OCDSB User Created Date: 11/6/2012 5:27:00 PM Company: OCDSB. U3D2_S Warmup D & R. Selection File type icon File name Description Size Revision Time User. Periodic Functions Graphs of Sine and Cosine (worksheet) Interpreting | {
"domain": "autismart.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811571768048,
"lm_q1q2_score": 0.8166568946581027,
"lm_q2_score": 0.8459424431344437,
"openwebmath_perplexity": 4586.49902089402,
"openwebmath_score": 0.1873454600572586,
"tags": null,
"url": "http://kwyn.autismart.it/mcr3u-test.html"
} |
javascript, game
break;
case 6:
cards.push('diplomacy');
cards.push(5 * Math.ceil(Math.random() * 3));
break;
case 7:
cards.push('coup');
cards.push(10 * Math.ceil(Math.random() * 2));
break;
case 8:
cards.push('traitors');
cards.push(Math.ceil(Math.random() * 3));
break;
case 9:
cards.push('growth');
cards.push(10 * Math.ceil(Math.random() * 2));
break;
}
}
}; | {
"domain": "codereview.stackexchange",
"id": 24291,
"lm_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, game",
"url": null
} |
c++, time-limit-exceeded, dynamic-programming
Title: Target Sum array using Dynamic Programming I'm learning Dynamic Programming and trying to solve this Target Sum array problem. I've to find an array of integers that sums to a given target sum using the integers of given input array. I've used memoization technique but still getting TLE. Can somebody help what I might be doing wrong. This is my code:
#include <iostream>
#include <vector>
#include <optional> | {
"domain": "codereview.stackexchange",
"id": 42204,
"lm_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++, time-limit-exceeded, dynamic-programming",
"url": null
} |
relies on the classification of finite simple groups, so is not "easy".</p> <p><strong>Addendum:</strong> I took a closer look at the related literature and happened across the following interesting result, which I figured was worth sharing. (It can also be used to give an affirmative answer to the original question.)</p> <blockquote> <p><strong>Theorem.</strong> Let <code>$G$</code> be a nontrivial finite group. If the character table of <code>$G$</code> has a column or row containing distinct rational entries, then <code>$G$</code> must be isomorphic to either <code>$S_2$</code> or <code>$S_3$</code>.</p> </blockquote> <p>The reference is</p> <blockquote> <p>M. Bianchi, D. Chillag, A. Gillio, <em><a href="http://www.math.technion.ac.il/~chillag/pubfiles1/edith_szabo_memorial_paper1.pdf" rel="nofollow">Finite groups with many values in a column or a row of the character table</a></em>, Publ. Math. Debrecen <strong>69</strong> (2006), no. 3, 281–290.</p> </blockquote> <p>The result | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462215484651,
"lm_q1q2_score": 0.8100105276363543,
"lm_q2_score": 0.8198933403143929,
"openwebmath_perplexity": 598.38865623681,
"openwebmath_score": 0.9509128332138062,
"tags": null,
"url": "http://mathoverflow.net/feeds/user/430"
} |
python, scikit-learn, predictive-modeling, decision-trees, classifier
In this way you should be able to find the top most frequent drugs for treating bradicardia
Given a list of symptoms find the previous and closes drug that was offered in the past. Just as a query, if a person shows the same symptoms that your new patient, if you find a past query that has the same symptoms you might want to recommend the same. And then rank for the next closes query to your query.
This will be without ML. With ML, you need to do proper cleaning of your dataset, and the build a ranking system. To start I will recommend you with a point-wise ranking system.
Still I believe that you should try first without ML. | {
"domain": "datascience.stackexchange",
"id": 10257,
"lm_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, scikit-learn, predictive-modeling, decision-trees, classifier",
"url": null
} |
c++, algorithm, random, iterator
#include <bits/stdc++.h>
using namespace std;
int main() {
cout << "Enter the length of list: ";
int n;
cin >> n;
std::vector<int> v(n);
cout << "The random generated numbers are: \n";
for (int i = 0; i < n; i++) {
int x = rand() % 151;
cout << std::setw(10);
cout << i << " ";
cout << std::setw(10);
cout << x << endl;
v[i] = x;
}
int sum = 0;
for (int i = 0; i < n; i++)
sum += v[i];
cout << "The sum: " << sum << endl;
cout << "The mean: " << sum / n*1.0 << endl;
sort(v.begin(), v.end());
cout << "The median: " << v[n / 2] << endl;
return 0;
} Include the right things
You're starting with:
#include <bits/stdc++.h>
using namespace std; | {
"domain": "codereview.stackexchange",
"id": 17386,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, random, iterator",
"url": null
} |
Yes, in the case of $p=q$ it can even happen. See here : http://mathworld.wolfram.com/SparsePolynomialSquare.html
-
Thanks; I'm pretty sure this is what I remember seeing, wherever it was. Sparse seems to be the key word, since anything else I typed in Google returned nothing but things like "How do you multiply polynomials?". – Daenerys Naharis Dec 11 '12 at 5:04
$$(x^2-2x+2)(x^2+2x+2)=x^4+4.$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399069145609,
"lm_q1q2_score": 0.8064081513576821,
"lm_q2_score": 0.8311430457670241,
"openwebmath_perplexity": 589.8725774202769,
"openwebmath_score": 0.9950683116912842,
"tags": null,
"url": "http://math.stackexchange.com/questions/256028/does-multiplying-polynomials-ever-decrease-the-number-of-terms/256031"
} |
• This sounds very indirect to me. Surely the real point is that any open cover of any topological space is a subset of the power set of the underlying set, and power sets of finite sets are finite! – Billy Feb 25 '18 at 17:59
• You must consider cases because, what happens if $x_2\in U_{x_1}$ and there is not another open set in $\{U_x\}$ such that contains to $x_2$? – Gödel Feb 25 '18 at 18:00
• @Gödel sure, that is true. – Andres Mejia Feb 25 '18 at 18:03
• @Billy post a new answer, I think that is a nice point as well. Mine was moreso not considering subspaces of potentially infinite spaces, but it is true that no matter which way, in the subspace topology your argument works. – Andres Mejia Feb 25 '18 at 18:04
• @Gödel That is a simple modification. Instead of $x_2$, cover the first $x_i$ such that $x_i \notin U$ (assuming that all points are not already covered). We know that this will always be possible. – Matthew Feb 25 '18 at 21:37 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462194190619,
"lm_q1q2_score": 0.8275234800896925,
"lm_q2_score": 0.8376199673867852,
"openwebmath_perplexity": 267.0866965526565,
"openwebmath_score": 0.8033259510993958,
"tags": null,
"url": "https://math.stackexchange.com/questions/2666274/are-one-point-sets-always-compact-in-any-topological-spaces"
} |
star, observational-astronomy, luminosity
A further point is that I don't think it can be assumed that the trajectory of the spacecraft will be such that they are travelling in a direct straight line
between the Earth and Proxima Centauri, which are of course in relative motion.
Thus the spacecraft would approach Proxima Cen "at an angle" as viewed from the position of the Earth some 30 years after the spacecraft were launched, unless the trajectories can be tuned quite carefully en-route.
Even if they were, the parallax motion of the Earth around the Sun would mean that the spacecraft would not necessarily be aligned be when they reached Proxima Cen, although I suppose the launch time and speed could be arranged so that was the case. However, from what I have read, the idea is just to pepper the inner au of the Proxima Cen system with these 1000 spacecraft and so only a few of them would actually be lined up so that they could obscure the star as seen from Earth. | {
"domain": "astronomy.stackexchange",
"id": 3319,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "star, observational-astronomy, luminosity",
"url": null
} |
c#, game, memory-management, xna, state
Title: Memory usage in Reversi board state I'm coding a Reversi game, with an artificial intelligence using the MinMax as the search algorithm. My concern is that (most) search algorithms needs to store a lot of instances of "states", in my case, board states. What I want is to represent a BoardState with 64 SlotState (Empty, White Disk or Black Disk), with the minimum RAM usage as possible. My current implementation uses a System.Collections.BitArray for storage.
public enum SlotState : byte {
Empty = 0,
White = 1,
Black = 2
}
public sealed class BoardState {
private const int BitsPerSlot = 2;
private const int SlotsPerRow = 8;
private const int SlotsInBoard = 64;
private const int BitsPerRow = SlotsPerRow * BitsPerSlot;
private const int BitsInBoard = SlotsInBoard * BitsPerSlot;
// stores state in big-endian row-major
private BitArray State; | {
"domain": "codereview.stackexchange",
"id": 9493,
"lm_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#, game, memory-management, xna, state",
"url": null
} |
localization, slam, multi-agent
When it comes to localizing the vehicles as well using this incrementally built map, the standard approach that comes to mind is to apply the PNP algorithm on each camera (assuming the reconstructed scene is visible to all cameras) which results in the 3D pose: but this doesn't necessarily take advantage of the fact that multiple cameras exist, apart from the fact that they are used in reconstructing the environment. Is there anything I can exploit using multiple cameras/vehicles that would result in enhanced localization accuracy of all of the vehicles as compared to a "single vehicle performing PNP on a known map" scenario? You can do it by fusion using a Kalman filter:
You have a process model model:
$$
x_t = g(x_{t-1},u_t)
$$
Now, you have multiple measurements of the same process model from different perspectives:
$$
z1_t = h_1(x_{t}) \leftarrow \text{camera 1} \\
z2_t = h_2(x_{t}) \leftarrow \text{camera 2} \\
\cdots \\
zn_t = h_n(x_{t}) \leftarrow \text{camera n} \\
$$ | {
"domain": "robotics.stackexchange",
"id": 1214,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "localization, slam, multi-agent",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.