text stringlengths 1 1.11k | source dict |
|---|---|
7. Originally Posted by Bacterius
You are not wrong, I mistakenly wrote up the wrong problem, now I edited to write the correct problem.
Twice Wilson's theorem:
$(2m-1)!=1\cdot2\cdot,\ldots,\cdot(m-1)\cdot m\cdot(m+1)\cdot,\ldots,\cdot(2m-1)=$ $(-1)\cdot m\cdot (-1)\!\!\!\!\pmod m=m\!\!\!\!\pmod m$ , and from here follows the solution to your problem.
It is not sufficient, imo, to prove $\left(\frac{(2m-1)!}{m},m\right)=1$ , but we need, as shown above, something stronger: $\frac{(2m-1)!}{m}=1\!\!\!\!\pmod m$
Tonio
8. Originally Posted by tonio
Twice Wilson's theorem:
$(2m-1)!=1\cdot2\cdot,\ldots,\cdot(m-1)\cdot m\cdot(m+1)\cdot,\ldots,\cdot(2m-1)=$ $(-1)\cdot m\cdot (-1)\!\!\!\!\pmod m=m\!\!\!\!\pmod m$ , and from here follows the solution to your problem.
It is not sufficient, imo, to prove $\left(\frac{(2m-1)!}{m},m\right)=1$ , but we need, as shown above, something stronger: $\frac{(2m-1)!}{m}=1\!\!\!\!\pmod m$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9603611654370414,
"lm_q1q2_score": 0.8273878388777312,
"lm_q2_score": 0.8615382094310355,
"openwebmath_perplexity": 241.4918968202332,
"openwebmath_score": 0.9588844776153564,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/121360-congruence-problem.html"
} |
zero* if $ma=a+a+\cdots+a=0$ implies $m=0$. * $\mathbb{Z}$, $\mathbb{Q}$, etc. are of characteristic zero * **Definition**: With $R$ an integral domain, $R$ is of *finite characteristic* if there exists a positive integer $m$ such that $ma=0$ for all $a\in R$. In that case, the smallest such $m$ is the *characteristic* of $R$. The problems below are paraphrased from/inspired by those given in Topics in Algebra by Herstein. The solutions are my own unless otherwise noted. I will generally try, in my solutions, to stick to the development in the text. This means that problems will not be solved using ideas and theorems presented further on in the book. ### Herstein 3.2.1: Let $a,b,c,d\in R$. Evaluate $(a+b)(c+d)$. By the distributive property, $(a+b)(c+d)=(a+b)c+(a+b)d=ac+bc+ad+bd$. Notably, the multiplication does not have to be commutative, so the order of the four products cannot be ignored. ### Herstein 3.2.2: Let $a,b\in R$. Show that $(a+b)^2=a^2+ab+ba+b^2$ where $x^2=xx$. This is | {
"domain": "bergknoff.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9848109516378093,
"lm_q1q2_score": 0.8051563001237441,
"lm_q2_score": 0.817574478416099,
"openwebmath_perplexity": 135.87529461222113,
"openwebmath_score": 0.9347715377807617,
"tags": null,
"url": "http://bergknoff.com/journal/topics-in-algebra-chapter-3-section-2"
} |
ros
Does anyone have an idea why this error occurs!? The source code seems to be right...
Thank you und best regards
Stefan
Originally posted by Dark-Valentine on ROS Answers with karma: 146 on 2012-07-23
Post score: 3
The problem is solved...
It seems that the roslib package isn't a dependency of roscpp anymore. Adding the roslib package as dependency to my package makes it linkable.
roscpp manifest.xml in electric
...
<depend package="roslib"/>
...
roscpp manifest.xml in fuerte
<package>
<description brief="ROS C++ client library">
... | {
"domain": "robotics.stackexchange",
"id": 10312,
"lm_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
} |
12. Apr 6, 2009
### Almutairi
Thank you for the confidence boost, and also thanks for the mod operator info it really helped. Unfortunately, every one who knows me will count this as a life achievement:rofl:.
13. Apr 6, 2009
### ramsey2879
Unfortunately, ones ego is often set even before preschool. Because of the programing you under go in your early years one's subconcious mind often works to sabotage ones efforts to succeed. It never matters what others believe you are capable of if you yourself work subconciously to prove yourself to not have the talent. You most likely have the talent but do not know it. Your work shows that you have talent in math. If I were you, I would never base my goals purely on others or even your own concepts about your talent. If you believe in your self you will succeed in math. I can see that from what you done. My advice is to for you continue to post more of your work or questions in this forum. Give it your best, you may surprise yourself! | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759632491111,
"lm_q1q2_score": 0.8064655553736673,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 877.3599625740432,
"openwebmath_score": 0.6803491711616516,
"tags": null,
"url": "https://www.physicsforums.com/threads/2-n-2-1-must-be-divisible-by-3.304880/"
} |
c++, game, snake-game, fltk
Game_window.cpp
// Snake game's window
//------------------------------------------------------------------------------
#include "Game_window.h"
//------------------------------------------------------------------------------
namespace Graph_lib {
//------------------------------------------------------------------------------ | {
"domain": "codereview.stackexchange",
"id": 39152,
"lm_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, snake-game, fltk",
"url": null
} |
That made it clear to me that for any circle, there was a unique square that intersected the circle three times as Megan had posed.
Seeing this and revealing its algebraic bias, my mind conceived an algebraic solution. Assuming the radius of the circle is R, the equation of my circle is $x^2+y^2=R^2$ making the lower y-intercept of the circle $(0,-R)$. That made $y=2x-R$ the locus line containing the upper right corner of the square.
To find generic coordinates of the upper right corner of the square in terms of R, I just needed to solve the system of equations containing the circle and the line. That’s easy enough to compute by hand if you can handle quadratic algebra. That manipulation is not relevant right now, so my Nspire CAS’s version is:
The output confirms the two intersections are $(0,-R)$ and the unknown at $\displaystyle \left( \frac{4R}{5} , \frac{3R}{5} \right)$. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717456528508,
"lm_q1q2_score": 0.8133908376744382,
"lm_q2_score": 0.8244619220634457,
"openwebmath_perplexity": 1055.0532797372414,
"openwebmath_score": 0.7279426455497742,
"tags": null,
"url": "https://casmusings.wordpress.com/tag/nspire/"
} |
forces, potential, potential-energy, vector-fields, conservative-field
In problems I usually thought about it in terms of the differential way but I would love to get some insight on this. Thanks. Thinking in terms of "root source" is somehow like going in circles: you might always choose the starting point of your theory however you want and argue that the remaining quantities easily follow from the definitions (or as properties, or else). What makes more sense, in physics, is trying to understand what are the observable quantities (i. e. quantities that one can empirically measure with experiments) versus the mathematical framework that you introduce to describe the theory and make predictions. | {
"domain": "physics.stackexchange",
"id": 49963,
"lm_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, potential, potential-energy, vector-fields, conservative-field",
"url": null
} |
navigation, move-base, ros-kinetic
if __name__ == "__main__":
mbSmoother()
Originally posted by june2473 on ROS Answers with karma: 83 on 2019-12-24
Post score: 1
I don't know about the python client but as far as I remember, sending an empty message to this topic like this cancels all goals:
rostopic pub -1 /move_base/cancel actionlib_msgs/GoalID -- {}
This works in terminal well.
You can send the message in python like:
from actionlib_msgs.msg import GoalID
cancel_pub = rospy.Publisher("/move_base/cancel", GoalID, queue_size=1)
cancel_msg = GoalID()
cancel_pub.publish(cancel_msg)
Just tried these lines in python terminal to be sure and it works.
Originally posted by Orhan with karma: 856 on 2019-12-25
This answer was ACCEPTED on the original site
Post score: 4 | {
"domain": "robotics.stackexchange",
"id": 34192,
"lm_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, move-base, ros-kinetic",
"url": null
} |
• Yes, sure, it is connected with the well-known fact from the Newtonian potential theory that the gravitational field inside a hollow sphere is zero. I then generalized the Newtonian law of gravitation to arbitrary (but still radial) f(r) instead of inverse square $1/r^2$ and calculated the force acting on a particle inside such spherical shell. So, what you have proved above is that the absence of force inside the spherical shell automatically implies the inverse square law. And likewise for the electrostatic Coulomb case of a charge inside the hollow charged sphere. – Tigran Aivazian Apr 5 '18 at 16:53
• I have used this method to prove the second part of the Inverse Shell Theorem as well and put together all this in a PDF file here bibles.org.uk/articles/… – Tigran Aivazian Apr 6 '18 at 13:44 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812327313545,
"lm_q1q2_score": 0.800572190390176,
"lm_q2_score": 0.8267117983401362,
"openwebmath_perplexity": 900.5328778960726,
"openwebmath_score": 0.7816450595855713,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/170445/how-do-i-solve-an-integral-equation-related-to-the-newtonian-gravity"
} |
using Symbol("x") or numbers using Integer(5) or Float(34. Resulting function, returned as a symbolic matrix. These are not always easy to use, as all CAS have their own formal languages that rarely perfectly match your expectations. h5py and PyTables can both access data stored in the HDF5 format. SymPy is built out of nearly 100 open-source packages and features a unified interface. SymPy is a Python library for symbolic mathematics. We can reason about these placeholder variables just as we can reason about the equation without needing to know the particlar values of , , or. For instance, the aptly-named is_symbolic tells if a matrix consists of symbolic elements or not: A. SymPy can be installed, imported and used like any other regular Python module. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. But! When working with a real arm it suddenly becomes critical to have | {
"domain": "antplus.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.963779943094681,
"lm_q1q2_score": 0.815302352218938,
"lm_q2_score": 0.8459424353665381,
"openwebmath_perplexity": 1440.1432832397454,
"openwebmath_score": 0.5822976231575012,
"tags": null,
"url": "http://tjwu.antplus.it/sympy-symbolic-matrix.html"
} |
quantum-mechanics, soft-question
Of course, electromagnetism and any other branch of physics will help but, compared to Hamiltonian Mechanics, it is secondary. | {
"domain": "physics.stackexchange",
"id": 5383,
"lm_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, soft-question",
"url": null
} |
Categories
## Sequence and permutations | AIME II, 2015 | Question 10
Try this beautiful problem from the American Invitational Mathematics Examination I, AIME II, 2015 based on Sequence and permutations.
## Sequence and permutations – AIME II, 2015
Call a permutation $a_1,a_2,….,a_n$ of the integers 1,2,…,n quasi increasing if $a_k \leq a_{k+1} +2$ for each $1 \leq k \leq n-1$, find the number of quasi increasing permutations of the integers 1,2,….,7.
• is 107
• is 486
• is 840
• cannot be determined from the given information
### Key Concepts
Sequence
Permutations
Integers
AIME II, 2015, Question 10
Elementary Number Theory by David Burton
## Try with Hints
While inserting n into a string with n-1 integers, integer n has 3 spots where it can be placed before n-1, before n-2, and at the end
Number of permutations with n elements is three times the number of permutations with n-1 elements | {
"domain": "cheenta.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9572778048911613,
"lm_q1q2_score": 0.8507890781944768,
"lm_q2_score": 0.8887588052782736,
"openwebmath_perplexity": 2119.3254802272163,
"openwebmath_score": 0.7063864469528198,
"tags": null,
"url": "https://usa.cheenta.com/category/calculus/"
} |
-
Nice technique and a good example of why there are really two solutions when taking the square root, contrary to what most mathematicians would like it to be (a single-valued function), and that it doesn't matter much whether you take the square root of an unknown or a "simple number". – SasQ Dec 14 at 22:26
Where does these names come from? ("norm" and "trace") I see that the first one is similar to calculating the norm of a complex number, but there's no $i$ in it, so why does it still work similarly to complex conjugates? And why is the norm subtracted instead of divided out? Why is it the trace which is divided out instead? The trick is really nice, but it would be nicer if you explained why does this magic work so well. – SasQ Dec 14 at 22:29 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754456551736,
"lm_q1q2_score": 0.8464038167319454,
"lm_q2_score": 0.8596637469145053,
"openwebmath_perplexity": 304.27271737474575,
"openwebmath_score": 0.9307201504707336,
"tags": null,
"url": "http://math.stackexchange.com/questions/329838/how-to-simplify-a-square-root"
} |
U1 + K1 + Wother = U2 + K2
0 + 0 + (WF - Wf ) = U2 + K2
1341.71 J - 329J - 991J = K2
K2 = 21.71J
(the answer at back of book is 360J)
e.) Use summation{F} = ma to calculate the acceleration of the oven. Assuming the oven is initially at rest, use the acceleration to calculate the oven's speed after traveling 14.0m. Compute from this the increase in the oven's kinetic energ, and compare this answer to the one you got in part d.
F - Ff = ma
(120N - 29.4N ) / 12.0kg = a
a = 7.55m/s^2
vf^2 = v0^2 + 2ax
vf^2 = 2(7.55m/s)(14.0m)
Vf = 14.5396m/s
K = 1/2(mv^2)
K = 1/2(12.0kg)(14.5396m/s)
K = 87.238J <<< not same as d i dunno why
(the answer at back of book is a = 0.699m/s^2: K = 360J) | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9728307747659751,
"lm_q1q2_score": 0.8288059007460586,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 3320.424187498014,
"openwebmath_score": 0.47822731733322144,
"tags": null,
"url": "http://www.physicsforums.com/showthread.php?t=182548"
} |
Then we need to define two cases
1. $$Z \geq 0$$
2. $$Z \lt 0$$
In the first case
$$p(z) = \sum_{i=0}^{n_1} m(i+z, n_1, p_1) m(i, n_2, p_2)$$
since this covers all the ways in which X-Y could equal z. For example when z=1 this is reached when X=1 and Y=0 and X=2 and Y=1 and X=4 and Y=3 and so on. It also deals with cases that could not happen because of the values of $$n_1$$ and $$n_2$$. For example if $$n_1 = 4$$ then we cannot get Z=1 as a combination of X=5 and Y=4. In this case thanks to our modified binomial pmf the probablity is zero.
For the second case we just reverse the roles. For example if z=-1 then this is reached when X=0 and Y=1, X=1 and Y=2 etc.
$$p(z) = \sum_{i=0}^{n_2} m(i, n_1, p_1) m(i+z, n_2, p_2)$$
Put them together and that's your pmf.
$$f(z)= \begin{cases} \sum_{i=0}^{n_1} m(i+z, n_1, p_1) m(i, n_2, p_2),& \text{if } z\geq 0\\ \sum_{i=0}^{n_2} m(i, n_1, p_1) m(i+z, n_2, p_2), & \text{otherwise} \end{cases}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.969785412932606,
"lm_q1q2_score": 0.835507191638001,
"lm_q2_score": 0.8615382129861583,
"openwebmath_perplexity": 251.1541282943821,
"openwebmath_score": 0.7042048573493958,
"tags": null,
"url": "https://math.stackexchange.com/questions/562119/difference-of-two-binomial-random-variables"
} |
php, sql, pdo, sql-injection
Still, even for a single page, using global is not a good idea. In combination with your deeply nested code, it makes it very hard to see what is actually going on. And that has a direct impact on security.
Just seeing $averagepricedata = $db->prepare($averageprice); looks nice. It's using prepared statements and everything. But what is averageprice really? It's this:
$averageprice = "SELECT $level,
SUM(a.`sales`) as sales, SUM(a.`units`) as units, ROUND(a.sales / a.units, 2) as asp,
SUM(a.`sales`) / b.total * 100 as share
FROM `brandlevel_data` as a
CROSS JOIN (SELECT SUM(sales) as total FROM `brandlevel_data` WHERE $filt1 $and $intersect AND destination LIKE :destination) as b
WHERE $filt $and
$intersect AND
destination LIKE :destination1
GROUP BY $level"; | {
"domain": "codereview.stackexchange",
"id": 18808,
"lm_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, sql, pdo, sql-injection",
"url": null
} |
neural-networks, machine-learning, recurrent-neural-networks, definitions, teacher-forcing
Of course, intuitively, teacher forcing should help to stabilize training, given that the predictions are not based on noisy or wrong histories.
See also the blog post What is Teacher Forcing for Recurrent Neural Networks? by Jason Brownlee. | {
"domain": "ai.stackexchange",
"id": 1714,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks, machine-learning, recurrent-neural-networks, definitions, teacher-forcing",
"url": null
} |
parsing, rust, lexical-analysis
Ok(ObjectBox::new(Object::Integer(
self.source
.chars()
.skip(self.start)
.take(self.current - self.start)
.collect::<String>()
.parse::<i64>()
.unwrap(),
)))
}
fn parse_boolean(&mut self) -> Result<ObjectBox, String> {
if let Some(ch) = self.advance() {
match ch {
't' => Ok(ObjectBox::new(constants::TRUE)),
'f' => Ok(ObjectBox::new(constants::FALSE)),
_ => Err(String::from("")),
}
} else {
Err(String::from(""))
}
} | {
"domain": "codereview.stackexchange",
"id": 42636,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "parsing, rust, lexical-analysis",
"url": null
} |
python, python-3.x, datetime, csv
# add break field
for s, sumst in enumerate(summary_stamps):
stop_start_diff = datetime.datetime.combine(sumst['date'], sumst['stop']) - datetime.datetime.combine(sumst['date'], sumst['start'])
pause_time = stop_start_diff - sumst['total']
summary_stamps[s]['pause_min'], _ = divmod(pause_time.seconds, 60)
return summary_stamps
def date_is_present(timestamp, summary_stamps):
if summary_stamps == []:
return False
for summary_stamp in summary_stamps:
if summary_stamp['date'] == timestamp.date():
return True
# if no date is present:
return False
def get_date_index(timestamp, summary_stamps):
for s, summary_stamp in enumerate(summary_stamps):
if summary_stamp['date'] == timestamp.date():
return s
def parse_summary_stamps_to_entries(summary_stamps):
entry_list = [[] for i in range(len(summary_stamps))]
for s, sumst in enumerate(summary_stamps): | {
"domain": "codereview.stackexchange",
"id": 37838,
"lm_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, datetime, csv",
"url": null
} |
fluid-dynamics, fluid-statics
I found the pressure drop between $p_1$ and $p_2$ by using the usual hydrostatic equation $p_1+\gamma _{water}*(1.06+y+0.15)-0.15*\gamma_{Hg}-y*\gamma_{water}=p_2$ and solved for $p_1-p_2$. My question is, which term in the equation corresponds to friction loss? And why? None of these terms correspond to the friction loss. The equation you wrote down is, as you say, just the hydrostatic pressure equation, which knows nothing about friction. You find the part of the pressure drop that is due to friction loss by comparing the pressure drop you would see without friction (which would be the pressure drop between points 1 and 2, if there was no flow), with the actual pressure drop you just calculated. You should be able to take it from there. Let us know if you need more help. | {
"domain": "physics.stackexchange",
"id": 78489,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, fluid-statics",
"url": null
} |
frequency-spectrum
FHSS does not really have any particular advantages or disadvantages that I am aware of when it comes to handling doppler. | {
"domain": "dsp.stackexchange",
"id": 2013,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "frequency-spectrum",
"url": null
} |
algorithms, sorting
[1] If $k$ is not a power of $2$, the lowest level processes only a subset of the elements. Obviously the bound still holds for this case. | {
"domain": "cs.stackexchange",
"id": 12802,
"lm_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, sorting",
"url": null
} |
homework-and-exercises, electrostatics, electric-fields, potential, dipole
Taylor expanding gives $V\left(r, \theta\right) = \frac{qa \cos \theta}{4\pi\varepsilon_0 r^2}$. Any higher-order terms can always be ignored, because this is an ideal point dipole.
Now all that's left is finding the electric field from this potental. We know that $ \vec E = - \nabla V$. Taking the gradient of the dipole potential gives $\vec E = \frac{qa}{4 \pi \varepsilon_0 r^3} \left( 2 \cos \theta \hat r + \sin \theta \hat \theta \right) $.
This is nice, but we'd like an expression in terms of the dipole moment; there aren't really any point charges separated by a physical distance, that was just scaffolding to get us this far. Fortunately, the way we've defined the coordinate axes gives us a nice expression for the dipole moment: $\vec p = qa \hat z$, or, in spherical coordinates, $\vec p = qa\left( \cos \theta \hat r - \sin \theta \hat \theta\right)$. So $ \vec p . \hat r = p \cos \theta = qa \cos \theta $. | {
"domain": "physics.stackexchange",
"id": 51496,
"lm_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, electric-fields, potential, dipole",
"url": null
} |
fusion, stability
While magnetic confinement seeks to extend the time that ions spend close to each other in order to facilitate fusion, the inertial confinement strategy seeks to fuse nuclei so fast that they don't have time to move apart.
Directed onto a tiny deuterium-tritium pellet, the enormous energy influx evaporates the outer layer of the pellet, producing energetic collisions which drive part of the pellet inward. The inner core is increased a thousandfold in density and its temperature is driven upward to the ignition point for fusion. Accomplishing this in a time interval of $10^{-11}$ to $10^{-9}$ seconds does not allow the ions to move appreciably because of their own inertia; hence the name inertial confinement. | {
"domain": "physics.stackexchange",
"id": 16744,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fusion, stability",
"url": null
} |
ros, logitech, uvc-camera
Originally posted by trianta2 on ROS Answers with karma: 293 on 2013-11-11
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 16124,
"lm_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, logitech, uvc-camera",
"url": null
} |
python, beginner, tree
def post_order_traverse(self, visitor_func=None):
"""
Performs a post-order traversal of the tree.
Returns the list of elements
"""
if self.__value is not None:
# Visit the left node first if present
if self.__left is not None:
self.__left.post_order_traverse(visitor_func)
# Then visit the right node if present
if self.__right is not None:
self.__right.post_order_traverse(visitor_func)
# Then visit the root node
if visitor_func:
visitor_func(self.__value)
if __name__ == "__main__":
binarytree = BinaryTree()
binarytree.add_value(23)
binarytree.add_value(15)
binarytree.add_value(19)
binarytree.add_value(8)
binarytree.add_value(7)
binarytree.add_value(42)
binarytree.add_value(0)
binarytree.add_value(1)
def visitor1(value):
print(value) | {
"domain": "codereview.stackexchange",
"id": 23716,
"lm_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, tree",
"url": null
} |
electromagnetism, electric-fields, photonics
Title: Transforming electric field in frequency domain to intensity in frequency domain I'm currently struggling to convert the electric field to the intensity in the frequency domain.
In principle it seems like I need to do the following:
$$
I(\omega)=\mathcal{F}[I(t)]=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}dt|\mathcal{R}(E(t))|^2e^{-i\omega t}
$$
where
$$
E(t)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}d\omega E(\omega)e^{i\omega t}
$$
with the given electric field $E(\omega)$ in the frequency domain.
This is in the first place not really doable analytically and also not very easy numerically. That's why I wanted to ask if there is a better way to do this transformation. It's actually remarkably easy. No need to go into the time domain. Use Ohm's law and the impedance of free space, $Z_0$ (about 377Ω).
$$I(\omega)= E(\omega)^2 /Z_0 $$ | {
"domain": "physics.stackexchange",
"id": 92393,
"lm_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, electric-fields, photonics",
"url": null
} |
fluorescent-microscopy, flow-cytometry, cytogenetics
As for Flow-FISH, it is a method used to measure telemore lengths.
Vyacheslav I Borisov et al. in Current Protocols in Cytometry. 2014
Published on applying flow-fish to look at M phases. | {
"domain": "biology.stackexchange",
"id": 9634,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluorescent-microscopy, flow-cytometry, cytogenetics",
"url": null
} |
electromagnetism, electrostatics, newtonian-gravity, mathematical-physics, gauss-law
Iterating thousands of times with the simplest (slowest) algorithm:
(I know, I shouldn't use jet - cf. here and here.)
However: my question is about how to handle the situation where you have the potential on one circular (or spherical) boundary. The reason I showed the Fourier transform above is to suggest that all higher order terms drop rapidly with radius, and so it may be possible that I can at least have a second boundary at very large r and "know" that the potential is just $q_{tot}/r$ as r goes to infinity. So I have a feeling that could come in handy.
So I have three cases: $S_2$ encloses $S_1$, $S_2$ is enclosed by $S_1$, or $S_2$ intersects $S_1$ in some straightforward way.
What are the techniques and assumptions I need in order to solve for the potential on $S_2$, given the potential on $S_1$, without having to go back and generate some solution for the generating mass (or charge) distribution again? Are all, or any of the three cases solvable? | {
"domain": "physics.stackexchange",
"id": 34394,
"lm_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, electrostatics, newtonian-gravity, mathematical-physics, gauss-law",
"url": null
} |
are 144, 24, 4 b) The missing terms are 7 4, 7 8, 7 16 4) The 10th term is 1310720 and the n th term is 5 × 4 n − 1 5) The first term is 4 3 and the 10th term is 26244 a) Show that the sequence is geometric. GEOMETRIC PROGRESSION Examples The following are called geometric progressions: 1. Determine the volume of the cuboid. Calculating the last term using the general form listed above, the term is: There are easier ways to generate the 100th term of a geometric sequence than listing all 99 terms before it. ARITHMETIC AND GEOMETRIC SEQUENCES. example The ratios that appear in the above examples are called the common ratio of the geometric progression. Vocabulary Example: 1, 3, 5, 7, d=2 10, 20, 30, d=10 10, 5, 0, 5,. This ratio is called the common ratio. Instructor: Dr. Here are a few examples of geometric sequences. Example 4. Algebra > Sequences and Series > Geometric Sequences. An arithmetic sequence is a list of numbers with a definite pattern. Each term (except the first term) | {
"domain": "givelife.ph",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717468373085,
"lm_q1q2_score": 0.8443585556551937,
"lm_q2_score": 0.8558511414521922,
"openwebmath_perplexity": 333.5769276148712,
"openwebmath_score": 0.7515195608139038,
"tags": null,
"url": "http://givelife.ph/yygjmih/srlbmqa.php?gzrorzaen=geometric-sequence-examples"
} |
machine-learning, r, predictive-modeling
Recombine these data with the Z variables, by column
dat4 <- cbind(dat3, dat[grep("Z", names(dat))])
identical(dat, dat4)
# [1] TRUE
In summary, we can use the indices of the training and test data to combine the data in the rows in the original order. | {
"domain": "datascience.stackexchange",
"id": 231,
"lm_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, r, predictive-modeling",
"url": null
} |
quantum-mechanics, angular-momentum, symmetry, quantum-spin, representation-theory
To the spin story we add that half-integers are allowed and if $\ell$ is a half-integer then $m$ is also a half-integer, so for an $\ell = \frac12$ system then $m = -\frac12, +\frac12.$
But the key thing is that you are describing the world in terms of $m$ but the equation that you are looking at describes the world in terms of $\ell.$ There are no spin-negative-one-half systems, there are just spin-one-half systems which happen to be most-pointed-along the negative $z$-axis for whatever $z$ we happened to use to diagonalize. | {
"domain": "physics.stackexchange",
"id": 71117,
"lm_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, angular-momentum, symmetry, quantum-spin, representation-theory",
"url": null
} |
newtonian-mechanics, acceleration, geodesics
Title: Christoffel symbols and measurements of acceleration In some coordinates $x^a$, the equation of motion for a particle of unit mass is
\begin{equation}
\ddot x^i + \Gamma^i_{jk}\dot x^j \dot x^k = F^i
\end{equation}
My questions is simple: Suppose I measure the particle's acceleration. Is the value I obtain the value of $\ddot x^i$ or of $ \ddot x^i + \Gamma^i_{jk}\dot x^j \dot x^k$.
My thoughts:
To be more concrete, the situation I have in mind is that of Euclidean space where I am recording all of my values in spherical coordinates.
What I typically think of as the 'acceleration' is
\begin{equation}
\ddot{\mathbf{r}} = (\ddot r, \ddot \phi, \ddot\theta)
\end{equation} | {
"domain": "physics.stackexchange",
"id": 43258,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, acceleration, geodesics",
"url": null
} |
• Theorems on order of an element of a group
• Theorem 4.1: The order of every element of a finite group is finite.
• Theorem 4.2: If the element $a$ of a group $G$ is of order $n$, then $a^m=e$ if and only if $n$ is a divisor of $m$.
Proof: Let $O(a)=n$ $\Rightarrow$ $a^n=e$. To prove: $a^m=e \Leftrightarrow n|m$.
Let $a^m=e$ Then $O(a)=n \Rightarrow a^n=e$ and $a^m=e$ $\Rightarrow$ $n\leq m$
By division algorithm, $\exists$ $q,r \in \mathbb{Z}$ such that $m=qn+r$ with $0\leq r<n$
Now, $a^m=e$ $\Rightarrow$ $a^{qn+r}=e$
$\Rightarrow$ $a^{qn}a^r=e$
$\Rightarrow$ $(a^n)^qa^r=e$
$\Rightarrow$ $e^qa^r=e$
$\Rightarrow$ $a^r=e$
$\Rightarrow$ $r=0$ [$\because$ $O(a)=n$ $\Rightarrow$ $n$ is the least positive integer such that $a^n=e$]
$\therefore$ $m=qn$ $\Rightarrow$ $n|m$
Conversely: Suppose if $n|m$. To prove: $a^m=e$.
Now, $n|m \Rightarrow m=qn$ where $q$ is any integer
$\Rightarrow$ $a^m=a^{qn}$
$\Rightarrow$ $a^m=(a^n)^q$
$\Rightarrow$ $a^m=e^q$
$\Rightarrow$ $a^m=e$ $\blacksquare$ | {
"domain": "gargsain.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.994530724104456,
"lm_q1q2_score": 0.8012259712311727,
"lm_q2_score": 0.8056321959813275,
"openwebmath_perplexity": 156.71099325492173,
"openwebmath_score": 0.9908809065818787,
"tags": null,
"url": "http://nstejas.gargsain.com/content/semester_3/chapter4.html"
} |
electromagnetism, special-relativity, lagrangian-formalism, tensor-calculus, classical-field-theory
for any possible (timelike) 4-vector $\mathbf u$. The simplest way to satisfy this is to require that $F_{\mu\nu}$ be antisymmetric.
In any specific frame of reference, such a matrix acting on the 4-velocity can be broken up into a piece which depends on the ordinary 3-velocity $\vec v$ (in that frame) and a piece which does not. It's a straightforward exercise to show that
$$qF\mathbf u = q\gamma \pmatrix{\sum_{i=1}^3 F^0_{\ \ i} v^i \\ F^1_{\ \ 0} + \sum_{i=1}^3 F^1_{\ \ i} v^i \\ F^2_{\ \ 0} + \sum_{i=1}^3 F^2_{\ \ i} v^i \\ F^3_{\ \ 0} + \sum_{i=1}^3 F^3_{\ \ i} v^i }$$
This suggests that, for organizational purposes, we might define
$$F^i_{\ \ 0}\equiv E^i \qquad F^i_{\ \ j} = \mathcal B^i_{\ \ j}$$
where $\vec E$ is a 3-vector and $\mathcal B$ is a 3$\times$3 matrix with the property that $\mathcal B^i_{\ \ j} = -\mathcal B^j_{\ \ i}$ for each $i,j$. With this notation being defined, we have
$$F\mathbf u = q\gamma \pmatrix{\vec E \cdot \vec v \\ \vec E + \mathcal B\vec v}$$ | {
"domain": "physics.stackexchange",
"id": 95512,
"lm_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, special-relativity, lagrangian-formalism, tensor-calculus, classical-field-theory",
"url": null
} |
python, python-3.x, recursion
[214, 'Brauerei Hrlimann', 8.524499893188477000, 47.364200592041016000],
[216, 'Brauerei Leibinger', 9.621500015258789000, 47.781799316406250000],
[217, 'Brauerei Locher AG', 9.413499832153320000, 47.330101013183594000],
[218, 'Brauerei Reissdorf', 6.994400024414062500, 50.875301361083984000],
[219, 'Brauerei Schtzengarten', 9.379400253295898000, 47.430099487304690000],
[220, 'Brauerei Schumacher', 6.785299777984619000, 51.221599578857420000],
[221, 'Brauerei Schwelm', 7.293600082397461000, 51.284698486328125000],
[222, 'Brauerei Spezial', 10.885499954223633000, 49.894199371337890000],
[223, 'Brauerei und Altbierkche Pinkus Mller', 7.621399879455566000, 51.965698242187500000],
[225, 'Brauereigasthof Adler', 9.399600028991700000, 48.077800750732420000], | {
"domain": "codereview.stackexchange",
"id": 38369,
"lm_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, recursion",
"url": null
} |
ros, nao-robot, nao
Originally posted by AHornung with karma: 5904 on 2014-03-21
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 16821,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, nao-robot, nao",
"url": null
} |
homework-and-exercises, newtonian-mechanics, friction, acceleration
My goal is to find the angle that allows for that acceleration, using the 700N of force. I first flipped the axis to make the x-axis go up the inclined plane. So I can find the angle using the sum of the x-forces.
The sum of the x-forces (or m*a) = Applied force - (Weight force y component * coefficient of friction) - (Weight force of the x component).
I rewrote this as m*a = Applied - (coefficient of friction * w * cos theta) - (w * sin theta).
After trying for solve for the angle, I got stuck at (Applied - m*a) / w = (coefficient of friction * cos theta) + sin theta.
Is there a better way to solve this, without ending up with two different trig functions? Construct an auxiliary right-angle triangle with angle $\alpha$, opposite side $\mu$ and adjacent side $1$. The hypotenuse is hence $\sqrt{1+\mu^2}$, and therefore
$$\mu \cos\theta+\sin\theta=\sqrt{1+\mu^2}\sin\alpha\cos\theta+\sqrt{1+\mu^2}
\cos\alpha\sin\theta$$
$$=\sqrt{1+\mu^2}\sin(\theta+\alpha)$$
where
$$\alpha=\tan^{-1}\mu$$ | {
"domain": "physics.stackexchange",
"id": 33961,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, friction, acceleration",
"url": null
} |
where the dots stands for the expression above. I also tried only with the denominator and it does not work.
Any smarter / stronger command?
Thank you so much!!
• Use ComplexExpand[Re[expr]] to get the real part (assuming all variables are real). Similar for the imaginary part. Then Simplify[..., r > 0]. The results might contain I. That does not mean that their values are not real. Oct 6 '17 at 12:42
• This really should have the input expression in cut-and-pastable code. Oct 6 '17 at 15:03
I found this way to proceed:
Simplify[ComplexExpand[
3 Sqrt[2] (1 - 1/2 (r^3)^(1/3) - 1/2 I Sqrt[3] (r^3)^(1/3))^(1/4),
TargetFunctions -> {Re, Im}], r > 0]
With the following output
$$3 \sqrt{2} \sqrt[8]{r^2-r+1} \left(\cos \left(\frac{1}{4} \tan ^{-1}\left(2-r,-\sqrt{3} r\right)\right)+i \sin \left(\frac{1}{4} \tan ^{-1}\left(2-r,-\sqrt{3} r\right)\right)\right)$$
Could this be ok?
expr = 3 Sqrt[2] (1 - 1/2 (r^3)^(1/3) - 1/2 I Sqrt[3] (r^3)^(1/3))^(1/4); | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9511422186079557,
"lm_q1q2_score": 0.8026642563818902,
"lm_q2_score": 0.8438950986284991,
"openwebmath_perplexity": 3133.2684937621257,
"openwebmath_score": 0.8389783501625061,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/157228/force-an-im-re-separation-in-a-complex-number-with-parameter"
} |
python, beginner, sorting, unit-testing
initiate.py
from dsal.algorithm_list import algorithms
class Initiate:
def __init__(self, algorithm_name, **kwargs):
self.algorithm_name = algorithm_name
self.result = {}
self.args = kwargs
@staticmethod
def get_algorithm(name):
algorithm = None
for key, alg in algorithms.items():
if name in key:
algorithm = alg
break
if algorithm is None:
raise TypeError('Algorithm not defined !')
return algorithm
def set_params(self, name):
algorithm, params = Initiate.get_algorithm(name), dict()
for k, v in algorithm.check_params(self).items():
val = self.args.get(k, None)
if val is not None and v(val):
params[k] = val
return algorithm(**params)
def run(self):
algorithm = self.set_params(self.algorithm_name)
return algorithm.run() | {
"domain": "codereview.stackexchange",
"id": 32888,
"lm_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, sorting, unit-testing",
"url": null
} |
c#, beginner, comparative-review, unity3d
There are 2 problems here:
It's ugly.
It involves unboxing.
We can fix those 2 problems easily using generics:
void Awake()
{
_playerRigidbody2D = GetComponent<Rigidbody2D>();
_playerAnimator = GetComponent<Animator>();
_playerSpriteRenderer = GetComponent<SpriteRenderer>();
}
You're not really following the C# naming conventions but I will leave that for someone else to comment on. | {
"domain": "codereview.stackexchange",
"id": 24885,
"lm_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, comparative-review, unity3d",
"url": null
} |
4. By "the complement of a compact set (in $\mathbb C$)" I mean the complement (in $\mathbb C \cup \{ \infty\}$) of a compact (in $\mathbb C$). For instance:
$\{z\in\mathbb C:|z|>2\}\cup\{\infty\}$
is an open set in $\mathbb C\cup\{\infty\}$ since its complement is the closed ball of radius 2 centered at the origin, which is compact.
5. Originally Posted by Nyrox
By "the complement of a compact set (in $\mathbb C$)" I mean the complement (in $\mathbb C \cup \{ \infty\}$) of a compact (in $\mathbb C$). For instance:
$\{z\in\mathbb C:|z|>2\}\cup\{\infty\}$
is an open set in $\mathbb C\cup\{\infty\}$ since its complement is the closed ball of radius 2 centered at the origin, which is compact.
Then is it right if I say the connectedness is equivalent to "cannot be the union of two nonempty disjoint relatively open set in the extended plane"? | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9884918505966739,
"lm_q1q2_score": 0.8104578809090517,
"lm_q2_score": 0.8198933359135361,
"openwebmath_perplexity": 203.74036621682635,
"openwebmath_score": 0.8986822366714478,
"tags": null,
"url": "http://mathhelpforum.com/differential-geometry/127303-what-point-infinity.html"
} |
c++, binary-search-tree
void Erase(Node** const P)
// ------ in the subtree with the root *P:
// ------ recursively erase its root
{
const auto nodePtr = *P;
if (nodePtr->_lPtr != nullptr && nodePtr->_rPtr != nullptr)
{
// ------ the node has two children: find the closest node, copy its key and erase it
// ------ closest left or right nodes are chosen randomly for symmetry
const auto closestPtr = (std::rand() % 2 == 0) ? FindMax(&nodePtr->_lPtr) : FindMin(&nodePtr->_rPtr);
nodePtr->_key = (*closestPtr)->_key;
Erase(closestPtr);
}
else if (nodePtr->_lPtr != nullptr)
{
// ------ the node has only the left child
*P = nodePtr->_lPtr;
delete nodePtr;
}
else if (nodePtr->_rPtr != nullptr)
{
// ------ the node has only the right child
*P = nodePtr->_rPtr;
delete nodePtr;
}
else
{
// ------ the node doesn't have children
*P = nullptr;
delete nodePtr;
}
} | {
"domain": "codereview.stackexchange",
"id": 42043,
"lm_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++, binary-search-tree",
"url": null
} |
java, json, wrapper
public MovieDataRetriever(String movieTitle)
{
if(movieTitle == null)
{
throw new IllegalArgumentException("Movie title can't be null");
}
this.MOVIE_TITLE_FOR_QUERY = movieTitle.replace(" ", "+");
JsonObject movieData = validateMediaData("movie", MOVIE_TITLE_FOR_QUERY);
if(movieData == null)
{
this.MOVIE_TITLE = "No data";
this.MOVIE_STATUS = "No data";
this.BUDGET = 0;
this.GENRES = new String[0];
this.RELEASE_DATE = "No data";
this.REVENUE = 0;
this.RUNTIME = 0;
this.VOTE_AVERAGE = 0;
this.VOTE_COUNT = 0;
this.POSTER_PATH = "No data";
validityFlag = false;
}
else
{
this.MOVIE_STATUS = movieData.get("status").getAsString();
this.BUDGET = movieData.get("budget").getAsLong();
this.GENRES = setGenres(movieData); | {
"domain": "codereview.stackexchange",
"id": 37333,
"lm_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, json, wrapper",
"url": null
} |
electromagnetism
Title: Lorentz model and energy exchange The Lorentz model, describing the electron of the atom as an harmonic oscillator forced by an oscillating electric field $\vec{E}$, shows that the dipole moment $\vec{D}$ obeys the following equation in the stationary regime:
$$\vec{D}=\frac{q^2}{2m\omega_0}\frac{\vec{E}}{\omega_0-\omega-i\gamma_d}$$
where $\omega_0$ and $m$ are the natural frequency and mass of the electron, $\gamma_d$ is the dissipation introduced by hand to take account of the energy emitted by the electron when accelerated (and also its collisions).
My trouble is that one finds that the energy transmitted by the electron to the field by unit of time, given by:
$$P=-\vec{E}.\frac{d\vec{D}}{dt}$$ | {
"domain": "physics.stackexchange",
"id": 5263,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism",
"url": null
} |
microbiology, bacteriology, virology, infection, infectious-diseases
For some diseases insects (or other organisms) serve as mechanical vectors, merely carrying disease from one human to another or from a human-like animal to humans, while not infecting the vector.
There are animals that can be infected by both animal and human viruses. E.g., the types of influenza affecting many birds are not dangerous for humans, and these birds do not get infected with human influenza. However, pigs and paultry may get infected by both. The influenza viruses coexisting in a pig then undergo gene reshuffling, producing new viral strains infectious to humans, that humans get from pigs.
Finally, what the OP probably had in mind is the transmission of viruses such as Ebola, SARS/MERS, and HIV which exist in nature as animal viruses and suddenly transform to become human viruses. This is an evolutionary process, which is rarely successful. | {
"domain": "biology.stackexchange",
"id": 11727,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "microbiology, bacteriology, virology, infection, infectious-diseases",
"url": null
} |
orbit, milky-way, orbital-mechanics
With this crucial piece of information, we can solve for $M_r$ by integrating $\rho(r)$ (which I'll leave up to you). The result is that
$$M_r = \frac{v^2r}{G}$$
This means your force is given by
$$F(r) = \frac{v^2rm}{r^2} = \frac{v^2m}{r}\Rightarrow F(1/u) = v^2mu\propto ku$$
You can see here that unlike the Keplerian case, our force is proportional to $r^{-1}$ rather than $r^{-2}$. You can do this process with other density profiles (such as the NFW or Einasto I listed above), but you'll wind up with the same result.
If you're so inclined, you could choose to plug this into the orbital equation of motion above and solve it out, but you're now working with a non-linear differential equation and things can get messy fast. | {
"domain": "astronomy.stackexchange",
"id": 1901,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbit, milky-way, orbital-mechanics",
"url": null
} |
java, beginner, android, converting, unit-conversion
/**
* Converts distance from meters to units selected in profile
*
* @param input metric system
* @return distance in units of measurements selected in the user profile
*/
public Number convertToDistanceUnits(Number input) {
return convertToDistanceUnits(input, Metric, profile.getSystemMeasures());
}
/**
* Converts distance from units selected in profile to meters
*
* @param input metric system
* @return distance in units of measurements selected in the user profile
*/
public Number convertToMeter(Number input) {
return convertToDistanceUnits(input, profile.getSystemMeasures(), SystemsMeasures.Metric);
} | {
"domain": "codereview.stackexchange",
"id": 37884,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner, android, converting, unit-conversion",
"url": null
} |
a simple beam shown of length l that carries a uniform load of w n m throughout its length and is held in equilibrium. Step 3: In Quick Grid Lines menu input the following: Number of Gridlines: X = 5, Y = 1, Z =1. You will be fully competent in drawing shear force and bending moment diagrams for statically determinate beams and frames. 2 Shear and Bending-Moment Diagrams: Equation Form Example 4, page 1 of 6 4. Given below are solved examples for calculation of shear force and bending moment and plotting of the diagrams for different load conditions of simply supported beam, cantilever and overhanging beam. Since the principle of virtual work applies for any assume virtual displacement, the most general virtual displacement field within the space of possible functions will be assumed. The greater concentration of buoyancy at the bow and stern, and the concentration of weight at the center has an overall effect attempting to bend the barge in the middle. ForceMethod Page 4. You will be | {
"domain": "versoteano.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.975946444307138,
"lm_q1q2_score": 0.8111510941039626,
"lm_q2_score": 0.8311430394931456,
"openwebmath_perplexity": 1067.4010244498343,
"openwebmath_score": 0.6429223418235779,
"tags": null,
"url": "http://versoteano.it/shear-and-bending-moment-diagrams-for-frames-examples.html"
} |
quantum-mechanics, perturbation-theory
Title: Time-dependent perturbation theory in a harmonic oscillator with a time-dependent force Lets assume the classic quantum harmonic oscillator (HO) with a Hamiltonian
$$
\hat{H}(t) = - \frac{\hbar^2}{2m} \frac{d^2}{d x^2} + \frac{m \omega^2 \hat{x}^2}{2} + F(t) \hat{x}
$$
where $F(t)$ is a time-dependent force defined via
$$
F(t)=\frac{F_0 \tau / \omega}{\tau^2 + t^2}
$$
At time $t \to -\infty$ the particle with mass $m$ is in the ground state $| 0 \rangle$ of the HO potential. Since this is a time-dependent problem, I try to use time-dependent perturbation theory to first order to obtain the probability that at $t \to \infty$ the particle is in the first excited state $|1\rangle$. From the lecture we have obtained the (slightly more general) formula
$$
|c_f (t)|^2 = \frac{1}{\hbar^2} \left| \int_{t_0}^t V_{fi} (t') e^{i \omega_{fi} t'} dt' \right|^2
$$ | {
"domain": "physics.stackexchange",
"id": 39082,
"lm_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, perturbation-theory",
"url": null
} |
astrophysics, stellar-physics, stellar-evolution
The key to the stability of stars is the strong temperature dependence of the fusion reactions and hydrostatic equilibrium. If the rate of nuclear reactions were to fall in the centre, then because (in the low-mass stars you discuss) convection efficiently transports energy outwards, the core would cool and the pressure would fall. As a result the star would contract, the central pressure and temperature rise and the fusion reaction rate would increase again. Conversely, if the reactions speed up, the core temperature and pressure would initially rise, but the star would expand until a new equilibrium was found at a lower reaction rate. This negative feedback on the nuclear reaction rate is what gives the star it's stability. | {
"domain": "physics.stackexchange",
"id": 42705,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astrophysics, stellar-physics, stellar-evolution",
"url": null
} |
ros
Title: gmapping-pointcloud_to_laserscan-laser
Dear all.
I am just wondering whether it might be possible to use gmapping using laser and kinect/xtion pro based on pointcloud_to_laser.
I appreciate any suggestions,
Cheers
Originally posted by acp on ROS Answers with karma: 556 on 2013-05-29
Post score: 0
Like already mentioned you can use gmapping with kinect provided u have odometry reading. If u dont have odometry data u can use hector SLAM as it only requires laser scans..
Originally posted by ayush_dewan with karma: 1610 on 2013-05-29
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 14346,
"lm_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
} |
scheme, racket
(sequence->list (combinations '(a b c) 2))
;=> '((a a) (a b) (a c) (b a) (b b) (b c) (c a) (c b) (c c))
;returns all the ways you can choose n elements from items without replacement
;this is inefficient, don't use. Only for showing how in-nested works
(provide/contract
[combinations (-> list? (and/c exact-integer? positive?) sequence?)])
(define (permutaions items n)
(let ((options (make-list (- n 1) (lambda used (foldl remove items used)))))
(in-values-sequence (foldl (lambda (e a) (in-nested a e)) items options))))
(sequence->list (permutaions '(a b c) 2))
;=> '((a b) (a c) (b a) (b c) (c a) (c b)) | {
"domain": "codereview.stackexchange",
"id": 1559,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scheme, racket",
"url": null
} |
python, json, csv
Title: Convert all CSV files in a given directory to JSON using Python I am attempting to convert all files with the csv extension in a given directory to json with this python script.
I am wondering if there is a better and more efficient way to do this?
Here is my code:
import csv
import json
import glob
import os
for filename in glob.glob('//path/to/file/*.csv'):
csvfile = os.path.splitext(filename)[0]
jsonfile = csvfile + '.json'
with open(csvfile+'.csv') as f:
reader = csv.DictReader(f)
rows = list(reader)
with open(jsonfile, 'w') as f:
json.dump(rows, f)
EDIT:
Here is the sample input: | {
"domain": "codereview.stackexchange",
"id": 28200,
"lm_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, json, csv",
"url": null
} |
regular-languages, pumping-lemma
Here are a few exercises about the languages you have encountered.
Exercise 1. Prove the language $C \triangleq\left\{a^{m} b^{n} c d^{n} d^{m} \mid n, m \in \mathbb{N} \wedge m \leq 3\right\}$ is not regular "without case distinction".
Exercise 2. Prove the language $B \triangleq\left\{w \in \Sigma^{*} \mid |\left.w\right|_{b} \neq|w|_{c} \right\}$ is not regular "without case distinction".
Exercise 3. Prove the language $A \triangleq\left\{(a b)^{n} c^{n} | n \in \mathbb{N}\right\}$ is not regular using two combined cases. | {
"domain": "cs.stackexchange",
"id": 13342,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regular-languages, pumping-lemma",
"url": null
} |
\n<\/p> | {
"domain": "ehealthbilbao.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551515780319,
"lm_q1q2_score": 0.8433579232259054,
"lm_q2_score": 0.8740772351648677,
"openwebmath_perplexity": 868.1705949519477,
"openwebmath_score": 0.39770543575286865,
"tags": null,
"url": "https://ehealthbilbao.com/s-yromo/acd9db-how-to-find-unknown-angles-in-geometry"
} |
solidworks
Title: How to use the intersect tool for two components in an assembly with solidworks? I have an assembly file in Solidworks 2019 with two components, the green, and yellow rectangular prisms.
I'm having trouble understanding the instructions I found online about making an intersection with these two components. Can someone help me with this?
They form a subassembly in a larger file, and I'm really just interested in the volume that they share.
Edit
I just found out how to make a 3D sketch outlining the intersection. Tools > Sketch tools > Intersection curve. But I'm not sure how to take this further and extract the intersected volume. | {
"domain": "engineering.stackexchange",
"id": 4876,
"lm_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
} |
laserscan
Title: How to publish single sensor_msgs/LaserScan over ROS from two sick_tim sensor
How can I publish single sensor_msgs/LaserScan over ROS from two sick_tim sensor.
Originally posted by naka on ROS Answers with karma: 18 on 2015-03-04
Post score: 0
As mentioned by Lorenz on this thread:
http://answers.ros.org/question/37794/using-multiple-laserscan/
It seems that you can simply publish on the same topic from multiple laser scan sources, since each laser scan message includes frame and time information to differentiate. For this you have to set up your URDF correctly.
Originally posted by Valts with karma: 41 on 2015-03-04
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 21051,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "laserscan",
"url": null
} |
java, performance, mysql, sql
break;
case Varchar:
mCallableStatement.registerOutParameter(parameterName,
java.sql.Types.VARCHAR);
break;
case Array:
mCallableStatement.registerOutParameter(parameterName,
java.sql.Types.ARRAY);
break;
case BigInt:
mCallableStatement.registerOutParameter(parameterName,
java.sql.Types.BIGINT);
break;
case Blob:
mCallableStatement.registerOutParameter(parameterName,
java.sql.Types.BLOB);
break;
case Char:
mCallableStatement.registerOutParameter(parameterName,
java.sql.Types.CHAR);
break;
case Boolean:
mCallableStatement.registerOutParameter(parameterName,
java.sql.Types.BOOLEAN); | {
"domain": "codereview.stackexchange",
"id": 5895,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, mysql, sql",
"url": null
} |
quantum-algorithms, grovers-algorithm
Finally, note that the oracle knows nothing about the content of the full database. It only implements coherently a function that checks a single state $|\psi_k\rangle$ against its target.
However, the fact that this gate works coherently means that one can input to this checker function a superposition of many (possibly all of the) elements of the database, and obtain an output which contains some global information about all the elements in the database. | {
"domain": "quantumcomputing.stackexchange",
"id": 2412,
"lm_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-algorithms, grovers-algorithm",
"url": null
} |
special-relativity, spacetime, metric-tensor, variational-principle, geodesics
Title: "In spacetime, a straight path yields the longest elapsed time between two events". Could someone explain this please? I know this may appear to be a duplicate question but the other question Straight lines and longest distance doesn't seem to explain in laymans terms. So...
I'm trying to understand this but have read loads of stuff about Minkowski space etc but it's still beyond my tiny brain to grasp.
So, would anyone like to tackle this in layman's terms for me please.
The quote I've seen and would like explaining is this..
In space, a straight line describes the shortest distance between two points. In spacetime, by contrast, a straight path yields the longest elapsed time between two events. | {
"domain": "physics.stackexchange",
"id": 91848,
"lm_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, metric-tensor, variational-principle, geodesics",
"url": null
} |
homework-and-exercises, newtonian-mechanics, energy, momentum, collision
Title: Conservation of angular momentum in an inelastic collision | {
"domain": "physics.stackexchange",
"id": 82347,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, energy, momentum, collision",
"url": null
} |
game, lua
You can now simply use player:handSize() or player:handSize(n) for getting and setting the private variable.
Since you are simply inserting new players to self.players table, you can iterate using ipairs to list them sequentially (depends on your game design).
You can save a little disk space by using the oop approach of defining functions instead of passing self every time.
That much was a basic approach to oop in lua. Now, extending the concept, you can use closures for proper private variables.
function Player.new( startingHandSize )
local self = setmetatable( {}, Player )
local h = (function()
local _handSize = startingHandSize
return function( self, newHandSize )
if not newHandSize then return _handSize end
_handSize = newHandSize
end
end)()
self.handSize = h -- self._handSize will always be nil
return self
end | {
"domain": "codereview.stackexchange",
"id": 9130,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "game, lua",
"url": null
} |
python, object-oriented, design-patterns
def rotate(word, offset):
"""Rotates the word right by the amount specified"""
offset %= len(word)
return word[offset:] + word[:offset]
Finally how these algorithms would be composed together is a simple accumulating loop
def decode(cipher, encryptions):
for encryption in reversed(encryptions):
cipher = encryption.decrypt(cipher)
return cipher
I feel like this is the wrong approach to take though, as there is a lot of boilerplate for what is essentially a function which is used in two ways. Is there a better design pattern to use in this scenario? I suspect a more functional approach would suit, such as passing the encryption functions into a class that binds them together. My concern is I lose the option of providing metadata with the function with that style. For such a simple use case, I would drop the abc module in favor of NotImplementedError:
class BaseAlgorithm:
"""This is the base on which all other algorithms are to be built.""" | {
"domain": "codereview.stackexchange",
"id": 22871,
"lm_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, object-oriented, design-patterns",
"url": null
} |
c++, design-patterns, c++11, template, polymorphism
Title: Is this a meaningful Intrusive Pointer Class? Is this intrusive pointer implementation correct? I tried to use the CRTP Pattern to avoid a virtual destructor in my class ReferenceCounting which provides the reference counter.
Is this efficient?
The following things I could not solve yet:
How can I make a conversion between IntrusionPtr<A> to IntrusionPtr<B> as long as A* is implicitly convertable to B*? (That's how boost does it somehow)
What are the most important things we should prohibit and things we can allow to do with an IntrusionPtr? I am quite unsure about this.
#include <iostream>
#include <type_traits>
using namespace std;
template<typename TDerived>
class ReferenceCounting {
public:
typedef TDerived Derived ;
ReferenceCounting() : m_ref(0) { }
~ReferenceCounting() {std::cout <<" RC:DTOR" <<std::endl; } | {
"domain": "codereview.stackexchange",
"id": 7992,
"lm_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++, design-patterns, c++11, template, polymorphism",
"url": null
} |
python, game, python-2.x, hangman
Flow of control
All the critiques above are minor details. The most important problem with the code, in my opinion, is that you are misusing recursive function calls as a kind of goto.
To see a symptom of the problem, play a few rounds, then hit CtrlC. Notice that the stack trace is very deep — it contains one call to play() for every guess ever made in the history of the program, including previous rounds. It is inappropriate to keep such state around in the call stack.
The remedy is to use loops for looping.
Here's how I would write it (without making too many of the recommended changes listed above).
def play(word):
""" Play one game of Hangman for the given word. Returns True if the
player wins, False if the player loses. """
gallows = Gallows()
wrong_guesses = 0 # number of incorrect guesses
blanks = set_blanks(word) # blanks which hide each letter of the word until guessed | {
"domain": "codereview.stackexchange",
"id": 6387,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, game, python-2.x, hangman",
"url": null
} |
Suppose we have positive $a,b,c,d$ with $\frac{a}{b}\ge \frac{c}{d}$. Then multiplying through by $bd$ we get $ad\ge bc$. Adding $ab$ to both sides we get $a(b+d)\ge b(a+c)$. Dividing by $b(b+d)$, we get $\frac{a}{b}\ge\frac{a+c}{b+d}$.
Similarly, add $cd$ to both sides of $ad\ge bc$ to get $d(a+c)\ge c(b+d)$. Dividing by $d(b+d)$ we get $\frac{a+c}{b+d}\ge \frac{c}{d}$.
Assuming $a,b,c,d\gt0$, we have
\begin{align} {a\over b}\lt{a+c\over b+d}\lt{c\over d}&\iff a(b+d)\lt b(a+c)\quad\text{and}\quad(a+c)d\lt(b+d)c\\ &\iff ad\lt bc\quad\text{and}\quad ad\lt bc\\ &\iff ad\lt bc\\ &\iff {a\over b}\lt{c\over d} \end{align} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9643214491222696,
"lm_q1q2_score": 0.8524980471466388,
"lm_q2_score": 0.8840392878563336,
"openwebmath_perplexity": 315.015695645829,
"openwebmath_score": 0.8573033809661865,
"tags": null,
"url": "https://math.stackexchange.com/questions/1761557/prove-fracacbd-lies-between-fracab-and-fraccd-for-posit"
} |
condensed-matter
Due to the projection operator, you have a well-defined relationship between your DFT and +U/DMFT basis set and thus you can evaluate the total energy functional in the original DFT basis.
Further information (reviews on DFT+DMFT): | {
"domain": "physics.stackexchange",
"id": 6182,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter",
"url": null
} |
Director
Joined: 12 Nov 2016
Posts: 743
Location: United States
Schools: Yale '18
GMAT 1: 650 Q43 V37
GRE 1: Q157 V158
GPA: 2.66
Re: The price of a gallon of gasoline was $30 on the 15th of March. By the [#permalink] Show Tags 21 Jun 2017, 02:24 Bunuel wrote: The price of a gallon of gasoline was$30 on the 15th of March. By the 15th of April, the price per gallon had increased by 20%, and by the 15th of May the price had increased again to a total of $45 per gallon. What was the percent change in the price of a gallon of gasoline between the 15th of April and the 15th of May? A. 20% B. 25% C. 30% D. 35% E. 50% We can solve this problem rather quickly by applying a few fundamental formulas Step 1$30(1.20) = $36.00 remember any increase under 100% percent can be expressed as (1 +r) where r is the rate of increase so here we have (1 +.20) or even ( 1 +20/100) Step 2 New- Old/ Old = percentage increase$45-$36/$36= 1/4 = .25 x 100 = 25 percent increase | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.966914027331785,
"lm_q1q2_score": 0.8179536033156691,
"lm_q2_score": 0.8459424314825853,
"openwebmath_perplexity": 7370.912952560939,
"openwebmath_score": 0.6083093881607056,
"tags": null,
"url": "https://gmatclub.com/forum/the-price-of-a-gallon-of-gasoline-was-30-on-the-15th-of-march-by-the-226968.html"
} |
game, objective-c, queue
case WallBuildJob:
return (tempFloor.isRevealed && tempFloor.hasBottom && !tempFloor.hasWalls && self.currentCommonResources >= _wallCost && !tempFloor.hasActiveWorker);
case RoomBuildJob:
return (tempFloor.isRevealed && tempFloor.hasBottom && tempFloor.hasWalls && self.currentCommonResources >= _roomCost && !tempFloor.hasActiveWorker);
default:
return NO;
}
} | {
"domain": "codereview.stackexchange",
"id": 6853,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "game, objective-c, queue",
"url": null
} |
___________________________________________________________________
Pre-checking the number $C$
We perform the two pre-checks as described above. In searching for small factors, we find that $C$ is not divisible by all prime numbers less than 200,000. So if $C$ has a factor, it will have to be a large one. Or it could be that $C$ is prime. Instead of continuing to search for factors, we can do the second check. We calculate $2^{C-1} \ (\text{mod} \ C)$ and find that:
$2^{C-1} \equiv t \ (\text{mod} \ C)$
where $t=$ 7426390354305013563302537374271875139618265902
Since $t$ clearly is not 1, this tells us that $C$ is composite.
___________________________________________________________________
Remarks | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759638081522,
"lm_q1q2_score": 0.8042136639257234,
"lm_q2_score": 0.8198933337131076,
"openwebmath_perplexity": 196.70244281521545,
"openwebmath_score": 0.8269802331924438,
"tags": null,
"url": "https://mathcrypto.wordpress.com/tag/square-and-multiply-algorithm/"
} |
control-engineering, control-theory
There might be a half-dozen different ways to solve a given problem, so long as you arrive at the correct answer and don't pick a method involving rain dances or Satanic rituals, you are free to pick the method that you find easiest.
However, the requirements in academia are often different. There is a good chance that your professor has a reason for using the method he does. If he asks you to solve a problem step-wise, you should do what he asks.
It's likely that, at a certain point, doing it directly rather than piecemeal becomes overly complex and involves massive equations. At this point, knowing how to do it step-wise becomes necessary, and your professor is preparing you for this. But the only way to know for sure is to ask him.
As I said, beyond this class, the only thing that will matter is getting the correct answer and being able to explain how you arrived at that answer, so if you get the same answer through both methods, both are equally valid. | {
"domain": "engineering.stackexchange",
"id": 438,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "control-engineering, control-theory",
"url": null
} |
c#, array
public T this[int key]
{
get { return array[key]; }
}
public void Clear()
{
Count = 0;
}
public T Add()
{
return array[Count++];
}
public void RemoveRange(int index, int count)
{
var newSize = Count - count;
for (int i = index; i < newSize; i++)
{
array[i] = array[i + count];
}
Count = newSize;
}
public void RemoveAt(int index)
{
throw new NotImplementedException();
}
}
Usage is simple, for example
var element = array.Add();
// configure, assign only "mutable" fields
element.field1 = value1;
element.field2 = value2; | {
"domain": "codereview.stackexchange",
"id": 4793,
"lm_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#, array",
"url": null
} |
javascript, performance, game
if (this.field[i][j] === this.FIELD.EMPTY)
{
this.player.running = true;
switch (this.keyBoard.lastKey)
{
case KEYS.DOWN:
this.player.leftPoints.push({x: i + 1, y: j});
this.player.rightPoints.push({x: i - 1, y: j});
break;
case KEYS.UP:
this.player.leftPoints.push({x: i - 1, y: j});
this.player.rightPoints.push({x: i + 1, y: j});
break;
case KEYS.RIGHT:
this.player.leftPoints.push({x: i, y: j - 1});
this.player.rightPoints.push({x: i, y: j + 1});
break;
case KEYS.LEFT:
this.player.leftPoints.push({x: i, y: j + 1});
this.player.rightPoints.push({x: i, y: j - 1}); | {
"domain": "codereview.stackexchange",
"id": 12230,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, game",
"url": null
} |
newtonian-mechanics, momentum, conservation-laws
Title: Classic Man on a Boat problem To be clear I have indeed reviewed the question asked by helios321 (Classic man on boat problem). But i have something else to ask related to man on a boat problem.
The man on a boat problem goes like this:
A man is standing on one side of a boat and the boat is stationary. We ignore friction between water and boat (and air friction). Thus there are no external forces on the man+boat system. So momentum is conserved, and centre of mass does not move. (Copied from helios321's post)
I know that if the man moves to the other side of the boat the boat moves in the opposite direction.
But what i don't understand is :
Let the boat move $x$ m to left and the man $(L-x)$m to right.[L is the length of the boat]
then how can we say that
$M_{man}(L-x) = M_{boat}(x)$ Well, before the man started moving, lets find the location of the Centre of mass of our system consisting of the man and the boat.
Let us assume the man to be the origin. | {
"domain": "physics.stackexchange",
"id": 66711,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, momentum, conservation-laws",
"url": null
} |
quantum-chemistry, bond, molecular-structure, molecular-orbital-theory
the same number as the size of the atomic orbital basis with which we started) and the number of all possible functions that can be built using this basis. Just as in a two dimensional vector space, where you have a maximum of two independent basis functions, but an infinite number of possible vectors by adding those two basis vectors by varying the coefficients. | {
"domain": "chemistry.stackexchange",
"id": 15960,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-chemistry, bond, molecular-structure, molecular-orbital-theory",
"url": null
} |
java, game
if(bullet.y <= 0)
{
bulletList.remove(i);
i--;
}
}
}
/**
* Method to check if the player is on the screen at all times
*/
private void checkBounds()
{
if( this.x > 720)
{
this.x = 720;
}
if( this.x < 0)
{
this.x = 0;
}
if( this.y > 450)
{
this.y = 450;
}
}
}
Bullet
package com.emeraldzonegames.jinvaders.entities;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
public class Bullet extends Entity
{
private final String ENTITY_ID = "bullet";
public Bullet(int x , int y)
{
this.x = x;
this.y = y;
this.loadImage(ENTITY_ID);
this.setDimenseions(15, 15);
this.createRectangle();
}
/**
* Moves the bullet up the Y-Axis
*/
public void moveBullet()
{
this.setSpeed(3);
this.y -= speed;
this.entityRect.y -= speed;
} | {
"domain": "codereview.stackexchange",
"id": 2988,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game",
"url": null
} |
general-relativity, differential-geometry, loop-quantum-gravity, boundary-terms
In LQG, one chooses $\omega$ and this choice is fixed from there on. LQG is a very specific quantization procedure that destroys the symplectic symmetry of the classical phase space. In other words, after quantizing with LQG, you no longer have the option to choose $e$ instead of $\omega$ to be your boundary variable.
However, in the classical theory (which is not directly related to LQG, hence the short answer above), if you chose to use $e$ as your boundary variable, you'd discover that the Hamilton function would differ by a fixed term. That term doesn't impact classical physics (read, e.o.m.) because it is a boundary term, and it is exactly equal to GHY.
Covariant LQG
Covariant LQG is based on Plebanski gravity, which is a reformulation of the Holst gravity into a constrained topological theory:
$$S[B, \omega] = \frac{1}{2 \kappa} \int B_{IJ} \wedge F^{IJ}, $$
with an extra "simplicity constraint" that has to guarantee that the only form $B$ is allowed to take is | {
"domain": "physics.stackexchange",
"id": 82287,
"lm_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, loop-quantum-gravity, boundary-terms",
"url": null
} |
lattices, order-theory
When Post defined the notion of a simple set as an r.e. set with an infinite complement not containing any infinite r.e. set, he started to study the structure of the recursively enumerable sets under inclusion. This lattice became a well-studied structure. Recursive sets can be defined in this structure by the basic result that a set is recursive if and only if the set and its complement are both recursively enumerable. Infinite r.e. sets have always infinite recursive subsets; but on the other hand, simple sets exist but do not have a coinfinite recursive superset. Post (1944) introduced already hypersimple and hyperhypersimple sets; later maximal sets were constructed which are r.e. sets such that every r.e. superset is either a finite variant of the given maximal set or is co-finite. Post's original motivation in the study of this lattice was to find a structural notion such that every set which satisfies this property is neither in the Turing degree of the recursive sets nor in | {
"domain": "cs.stackexchange",
"id": 1547,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lattices, order-theory",
"url": null
} |
Of course as @kevinzakka comments, it suffices to show that $T$ is one-to-one. This is equivalent to $\dim Ker (T)=0$ and hence by the Rank - nullity Theorem you can conclude that $\dim \Im (T)=2$.
• Since the image and the co-image are the same, all you have to show is one or the other. Usually proving it is one-to-one is easier. – Kevin Zakka Dec 9 '15 at 15:14 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765622193215,
"lm_q1q2_score": 0.8405926440542913,
"lm_q2_score": 0.8577681104440172,
"openwebmath_perplexity": 99.98469886694613,
"openwebmath_score": 0.9305991530418396,
"tags": null,
"url": "https://math.stackexchange.com/questions/1567310/prove-that-t-is-linear-one-to-one-and-onto"
} |
In case this matters performance-wise you could also use RankedMax which is highly optimized for this purpose.
mat = RandomReal[{0, 1}, {10*6, 10000}];
Mean[RankedMax[#, 2] & /@ mat]
(* 0.999801 *)
For large matrices this is an order of magnitude faster.
In[34]:= AbsoluteTiming[r1 = Mean[RankedMax[#, 2] & /@ mat];]
Out[34]= {0.0151883, Null}
In[35]:= AbsoluteTiming[r2 = Mean[(Sort /@ mat)[[All, -2]]];]
Out[35]= {0.112088, Null}
In[36]:= r1 == r2
Out[36]= True
• @kuba my apologies I didn't notice you had already posted this in the comments – Andy Ross Dec 19 '15 at 1:18
• No worries, thanks for the answer and comparison. – Kuba Dec 19 '15 at 7:45
• @AndyRoss Thank you. This works. I had problems using RankedMax initially because my matrix had lists with values in it, for some reason, instead of just values. I managed to fix this by using Flatten on each column, before using transpose to make the final matrix. Afterwards I could use RankedMax – Bjoj Dec 19 '15 at 15:52 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9525741268224331,
"lm_q1q2_score": 0.8115482017998976,
"lm_q2_score": 0.8519528076067262,
"openwebmath_perplexity": 1714.045856864165,
"openwebmath_score": 0.2062503844499588,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/102351/how-to-map-the-second-highest-value-in-each-row-of-a-matrix"
} |
Lemma 10.89.10. If $M = \bigoplus _{i \in I} M_ i$ is a direct sum of $R$-modules, then $M$ is Mittag-Leffler if and only if each $M_ i$ is Mittag-Leffler. | {
"domain": "columbia.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513905984457,
"lm_q1q2_score": 0.8108029586957366,
"lm_q2_score": 0.822189134878876,
"openwebmath_perplexity": 165.02676095195073,
"openwebmath_score": 0.9783663153648376,
"tags": null,
"url": "https://stacks.math.columbia.edu/tag/059P"
} |
ros, ros-jade
moveit_visual_tools::MoveItVisualToolsPtr visual_tools_;
^
In file included from /home/zakizadeh/catkin_ws2/src/moveit_simple_grasps/src/simple_grasps.cpp:35:0:
/home/zakizadeh/catkin_ws2/src/moveit_simple_grasps/include/moveit_simple_grasps/simple_grasps.h:98:58: error: expected ‘)’ before ‘rviz_tools’
SimpleGrasps(moveit_visual_tools::MoveItVisualToolsPtr rviz_tools, bool verbose = false);
^
/home/zakizadeh/catkin_ws2/src/moveit_simple_grasps/src/simple_grasps.cpp:41:27: error: expected constructor, destructor, or type conversion before ‘(’ token
SimpleGrasps::SimpleGrasps(moveit_visual_tools::MoveItVisualToolsPtr visual_tools, bool verbose) :
^
/home/zakizadeh/catkin_ws2/src/moveit_simple_grasps/src/simple_grasps.cpp:328:1: error: expected ‘}’ at end of input
} // namespace
^
make[2]: *** [moveit_simple_grasps/CMakeFiles/moveit_simple_grasps.dir/src/simple_grasps.cpp.o] Error 1 | {
"domain": "robotics.stackexchange",
"id": 26077,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-jade",
"url": null
} |
specific-reference, geophysics
Title: Readings of the detectors at Japan and Izu-Bonin-Mariana Trenches Given the relevance of this subduction system, I would expect that a wide range of detectors (temperature, vibration, seismometers, whatever) are deployed in the depth of these trenches. What would be the canonical source at which one could access the readings of these detectors? The idea of seafloor observatories making their data available freely and online is a vision and there are observatories being proposed by several of the major oceanographic institutions. Search for the term "seafloor observatory."
You might also take a look here, or contact the researchers:
Realtime Data from the Deep Sea Floor Observatory (off Kushiro-tokachi, off Muroto, off Hatsushima) | {
"domain": "physics.stackexchange",
"id": 8887,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "specific-reference, geophysics",
"url": null
} |
electrostatics, charge, units, si-units
Title: What is the value of $e^2$ in CGS units? Seems yo me that units of the square power of electron charge $e^2$ are in the SI units system Coulombs squared, $[C^2]$.
But what are the corresponding units of $e^2$ in CGS units system? I am not sure if similarly, the "$[statC^2]$" applies here because the base units for CGS statC charge units are much more complicated,
$$
1 \mathrm{statC}=1 \mathrm{dyn}^{1 / 2} \cdot \mathrm{cm}=1 \mathrm{~cm}^{3 / 2} \cdot \mathrm{g}^{1 / 2} \cdot \mathrm{s}^{-1} \text {. }
$$
https://en.wikipedia.org/wiki/Statcoulomb#As_a_unit_of_charge
I am not so sure if that qualifies to be called as statC unit when raised to the power of 2?
So for example how you convert the electron charge $e^2$ from its value in $[C^2]$ SI units to CGS units system?
I am not so sure if $e^2 = 9 \cdot (1.602 \cdot 10^{-19})^{2} \cdot 10^{18}$ | {
"domain": "physics.stackexchange",
"id": 98615,
"lm_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, charge, units, si-units",
"url": null
} |
java, performance, random, comparative-review
import java.util.Objects;
import java.util.Random;
/**
* This class implements an abstract base class for probability distributions.
* Elements are added with strictly positive weights and whenever asking this
* data structure for a random element, their respective weights are taken into
* account. For example, if this data structure contains three different
* elements (<tt>a</tt>, <tt>b</tt>, <tt>c</tt> with respective weights
* <tt>1.0</tt>, <tt>1.0</tt>, <tt>3.0</tt>), whenever asking for a random
* element, there is 20 percent chance of obtaining <tt>a</tt>, 20 percent
* chance of obtaining <tt>b</tt>, and 60 percent chance of obtaining
* <tt>c</tt>.
*
* @author Rodion "rodde" Efremov
* @version 1.6 (Jun 11, 2016)
*/
public abstract class AbstractProbabilityDistribution<E> {
/**
* The amount of elements in this probability distribution.
*/
protected int size;
/**
* The sum of all weights.
*/
protected double totalWeight; | {
"domain": "codereview.stackexchange",
"id": 20457,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, random, comparative-review",
"url": null
} |
fft
You can find the exact formula for the bin values, the peak and "leakage", in my blog article "DFT Bin Value Formulas for Pure Real Tones".
You can also find a much more intuitive explanation of why leakage occurs in another one of my blog articles "DFT Graphical Interpretation: Centroids of Weighted Roots of Unity".
Hope this helps,
Ced | {
"domain": "dsp.stackexchange",
"id": 6006,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft",
"url": null
} |
For a countably infinite alphabet A; AxN is also countably infinite...where Nis the set of natural numbers.(finite product of countable sets)
A finite string is a finite subset of AxN.( An ordered set of symbols)
Set of all finite subsets of a countably infinite set is countably infinite.(why)
• > "A finite string is any finite subset of AxN.( An ordered set of symbols)." {(a, 0), (b, 0)} wouldn't be, right? Assuming you want to order the symbols based on the second index. There certainly is an injection from the set of finite sequences to the set of finite subsets of $A \times N$ though. – Timon Knigge Dec 31 '15 at 12:39
• A finite string is A finite subset of ...edited. @TimonKnigge – ARi Dec 31 '15 at 12:44 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769085257167,
"lm_q1q2_score": 0.8272577698700716,
"lm_q2_score": 0.847967764140929,
"openwebmath_perplexity": 531.9024194766139,
"openwebmath_score": 0.885423481464386,
"tags": null,
"url": "https://cs.stackexchange.com/questions/51319/number-of-finite-strings-over-a-countably-infinite-alphabet"
} |
cjdki, y2hnt, e3bdlu4, szlg, 4iizu2cse, vmasi, quz8n, jqa, w0, 8nynbgj4, 8ngism,
. | {
"domain": "preditrend-armand.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750484894196,
"lm_q1q2_score": 0.8140531260164027,
"lm_q2_score": 0.8244619177503206,
"openwebmath_perplexity": 345.51348512255754,
"openwebmath_score": 0.8277813196182251,
"tags": null,
"url": "https://preditrend-armand.com/yv5ansuspended/on-the-unit-circle-where-0-theta.php"
} |
robotic-arm, mechanism, electronics, movement
Title: How to find center of a disk using robotic arm Hello I am new to the field of robotics but have some knowledge of raspberry pi, arduino, python.
I want to make Robotic arm which can be used to find the centre of any disk.
There may be disk of different diameter coming one after another on conveyor.
I need to make hole at the center of disk using robotic arm. How can I do this ?
What techniques and sensors I should use to implement the mechanical and electronic part.
(I don't want to use camera and openCV). Thanks in advance. In this case the precision is the most important factor.
industrial robots have typically a precision of 0.1 mm. If you are building one without in depth machine design and manufacturing experience, it is expected that the precision for your robot arm will not be as good.
Instead of a robot arm I would recommend a portal type structure. Much easier to build from COTS components. | {
"domain": "robotics.stackexchange",
"id": 935,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "robotic-arm, mechanism, electronics, movement",
"url": null
} |
python, sorting
Script I wrote:
#! /usr/bin/python3
import sys
lines = []
for line in sys.stdin:
stripped = line.strip()
if not stripped:
break
lines.append(stripped)
a, b, c, d = lines
a = a.split(" ")
b = b.split(" ")
c = c.split(" ")
d = d.split(" ")
masses = [int(i) for i in b]
unsorted = [int(i) for i in c]
sorted = [int(i) for i in d] | {
"domain": "codereview.stackexchange",
"id": 42199,
"lm_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, sorting",
"url": null
} |
of Excel, Matlab (and optionally Python) to code …. Compare your result with the built-in Library function. However, because these terms are ignored, the terms in this series and the proper Taylor series expansion are off by a factor of 2 n + 1; for example the n = 0 term in formula is the n = 1 term in the Taylor series, and the n = 1 term in the formula is the n = 3 term in the Taylor series. in numerical methods to express functions in an approximate fashion—the Taylor series. To find the Maclaurin Series …. com/pythonkumarTwitter - https://twitter. method, and Runge–Kutta methods. Matlab Code For Du Fort Frankel Method matlab training program call matlab c c environment is windows7 vs2010 matlabr2010b here is the statement by calling the matlab engine to this is achieved by calling the crank nicolson method for approximating solutions to the heat conduction diffusion equation week 5 14 3 matlab …. The tool used here is MATLAB, it is a programming language used by engineers and | {
"domain": "buxtehuder-wollhaus.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.96741025335478,
"lm_q1q2_score": 0.8061667518708486,
"lm_q2_score": 0.8333245891029457,
"openwebmath_perplexity": 921.3362401111589,
"openwebmath_score": 0.7537301778793335,
"tags": null,
"url": "https://buxtehuder-wollhaus.de/taylor-series-approximation-matlab-code.html"
} |
machine-learning
Which is performing worse on '-' than even the base case. When I force max_depth = 8 it gives :
recall avg recall (++) recall (+) recall (-) recall (--)
RFC_force_8 0.842424 0.818182 0.871795 0.8 0.87234
When I choose 'greater_is_better = False' it actively tries to minimise the score. Is there something I'm screwing up here or is there a known issue that I'm missing out?
Also I'm a bit new to stack so let me know if there's something I'm missing. So I've just figured this out and I feel like a bit of an idiot. I didn't post this in the question - which is part of why I need to be better at stack.
So all of the scoring data was based on "test" scores. The optimised scoring data for the GSCV is obviously based on just the TRAINING data.
So I guess I was making some data leakage for my model when optimising based on test score data, and not the train score data. | {
"domain": "datascience.stackexchange",
"id": 8540,
"lm_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",
"url": null
} |
php
Title: PHP File Upload Script I've put together an example single file upload script that attempts to cover all the things PHP could check for prior to allowing a successful file upload. Is there anything else maybe now available in PHP 7.4+ I could use to make this more secure? For example, I use filter_input below even though I don't find it in many scripts out there.
Take a look
<?php
# EVALUATE REQUEST METHOD
$REQUEST_METHOD = filter_input(INPUT_SERVER, 'REQUEST_METHOD', FILTER_SANITIZE_ENCODED);
switch ($REQUEST_METHOD) {
# HTTP:POST - PAYLOAD:BLOB
case 'POST':
# POST IMAGE
if(\in_array(@$_FILES["files"], $_FILES) && \count($_FILES) === 1) {
upload();
}
break;
default:
methodInvalid();
break;
}
/**
* Function upload() uploads a single file.
*
*
*/
function upload() { | {
"domain": "codereview.stackexchange",
"id": 41770,
"lm_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",
"url": null
} |
gazebo, ubuntu, ros-fuerte, ubuntu-precise, 64bit
Originally posted by Matthias on ROS Answers with karma: 91 on 2012-05-07
Post score: 8
Original comments
Comment by kshitij on 2012-06-05:
been struggling with this for 3-4 days now
Comment by hsu on 2012-06-06:
are you running 1.6.10? (check /opt/ros/fuerte/stacks/simulator_gazebo/CMakeLists.txt).
Comment by Kai Bublitz on 2012-09-04:
for me the same problem appeared after the last gazebo update.(package version 1.6.14-s1346200794~precise). Gazebo worked (kind of) in the previous version. I guess there's nothing I can do except waiting for the next update and hoping it works again in the next version.
Update
Thanks again konradb3, [simulator_gazebo 1.6.15](http://ros.org/wiki/simulator_gazebo/ChangeList/1.6) with SSE4 disabled on the way. Please check [fuerte debbuild](http://www.ros.org/debbuild/fuerte.html) for updates. | {
"domain": "robotics.stackexchange",
"id": 9277,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, ubuntu, ros-fuerte, ubuntu-precise, 64bit",
"url": null
} |
thermodynamics, experimental-chemistry, combustion, environmental-chemistry, atmospheric-chemistry
How can I calculate $\ce{CH4}$ from landfill samples with the attached data and which reaction should be used?
(Bonus) What other considerations should be accounted for with any of the other data? (e.g. the Sulfur going into $\ce{SO2}$ emissions (etc.)). If you're just trying to get within an order of magnitude or so, here's one approach:
Assume that the landfill is completely sealed, so that no oxygen gas gets in and no hydrogen gas escapes. Also assume that the amount of inorganic redox reactions is negligible (for example sulfate or nitrate reduction).
Now, we'll convert your mass percentages into moles per kg and get:
H = 43 mol/kg
C = 44 mol/kg
N = 00.4 mol/kg
O = 6.6 mol/kg
S = 0.03 mol/kg
Converting this into a crude stoichiometry, we have roughly $\ce{C100H100NO15S_{0.1}}$. | {
"domain": "chemistry.stackexchange",
"id": 16959,
"lm_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, experimental-chemistry, combustion, environmental-chemistry, atmospheric-chemistry",
"url": null
} |
matrix, so this is a standard linear system. This linear system is called the normal equations for $$A\mathbf{x} = \mathbf{b}.$$ It’s solution is usually denoted $$\mathbf{\hat{x}}$$. Theorem. The set of least-squares solutions of $$A\mathbf{x} = \mathbf{b}$$ is equal to the (nonempty) set of solutions of the normal equations $$A^TA\mathbf{x} = A^T\mathbf{b}.$$ Proof. (1) The set of solutions is nonempty. The matrix on the left has the same column space as $$A^T$$ and the vector on the right is a vector in the column space of $$A^T.$$ And, by the arguments above, any least-squares solution of $$A\mathbf{x} = \mathbf{b}$$ must satisfy the normal equations $$A^TA\mathbf{x} = A^T\mathbf{b}.$$ (2) Now let’s show that any solution of $$A^TA\mathbf{x} = A^T\mathbf{b}$$ is a least squares solution of $$A\mathbf{x} = \mathbf{b}$$. If $$\mathbf{\hat{x}}$$ satisfies $$A^TA\mathbf{x} = A^T\mathbf{b},$$ then $$A^T(A\mathbf{\hat{x}} -\mathbf{b}) = {\bf 0},$$ which shows that $$A\mathbf{\hat{x}} - | {
"domain": "bu.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969670030071,
"lm_q1q2_score": 0.8196555505851443,
"lm_q2_score": 0.8333246015211008,
"openwebmath_perplexity": 3395.04396576232,
"openwebmath_score": 0.7953481078147888,
"tags": null,
"url": "https://www.cs.bu.edu/fac/crovella/cs132-book/L22LeastSquares.html"
} |
thermodynamics, temperature, thermal-radiation
I don't think this is consistent with the description of the setup. If all there is are two perfectly reflecting cavities whose insides are connected by a perfectly reflecting tube, each initially with different equilibrium radiation at $T_1, T_2$, there is no reason why, in time, radiation inside would turn into equilibrium radiation. Reflections from nonmoving walls can't change frequency or intensity of radiation, so they do not change its spectrum overall, and radiation does not interact with itself in classical physics. So radiation inside would keep having characteristics of both $T_1$ and $T_2$, only with smaller intensity than that of equilibrium radiation.
If we introduce some filter into the tube, this will be made of non-perfectly reflecting matter and then we have radiation interacting with real matter. That is what will, in time, turn radiation into equilibrium radiation. | {
"domain": "physics.stackexchange",
"id": 73062,
"lm_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, temperature, thermal-radiation",
"url": null
} |
quantum-mechanics, electromagnetism, topology
can't be deformed into each other. Removing a point isn't enough in three dimensions, but a line is: make a loop around the line singularity, you can't get it to not encircle the line without dragging it across the singularity. (In 2 dimensions a point is enough, because you can consider the projection of this example onto a plane.) | {
"domain": "physics.stackexchange",
"id": 14819,
"lm_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, electromagnetism, topology",
"url": null
} |
kalman-filter, pose
A linear Kalman filter will usually work OK for most purposes if you're using roll/pitch/yaw and pose measurements coming from the camera algorithm. This is always the first port of call because it's much easier than EKF/UKF/etc. If this does not give adequate results then you should consider more complex filters.
The "model" of the system is generally at least two models: a process model (how the system state evolves in time) and a measurement model (how the camera makes measurements based on the system state). Aside: "Pose estimation" is simply finding a pose, what the *KF does is state filtering. A widely used model ( and what seems to be the model you have pasted ) is the constant-velocity model; which assumes that between camera measurements the camera is a particle travelling with constant linear and angular velocity. | {
"domain": "robotics.stackexchange",
"id": 917,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kalman-filter, pose",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.