text stringlengths 1 1.11k | source dict |
|---|---|
statistics, coronavirus
Title: Why do coronavirus cases graphs have a sinusoidal like shape? Some screenshots from a canadian website:
See this sinusoidal shape? Why is it there? Shouldn't it be a single curve?
My main guess is when cases are counted: is it possible that they are counted something like every monday or so? I can't believe the virus progression really has sinusoidal-shaped curve.
It is not an error in the website, since other sources seem to show the same thing: worldometers, nbc news, and many others It's a weekly cycle due to reporting disruptions over the weekend.
Use a 7-day moving average to get a better picture. Holidays and such can still be disruptive but the 7-day average solves most of it. | {
"domain": "biology.stackexchange",
"id": 10877,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistics, coronavirus",
"url": null
} |
python, optimization, datetime, formatting
PS: I have implemented a similar function here:
days, rem = divmod(seconds, 86400)
hours, rem = divmod(rem, 3600)
minutes, seconds = divmod(rem, 60)
if seconds < 1:seconds = 1
locals_ = locals()
magnitudes_str = ("{n} {magnitude}".format(n=int(locals_[magnitude]), magnitude=magnitude)
for magnitude in ("days", "hours", "minutes", "seconds") if locals_[magnitude])
eta_str = ", ".join(magnitudes_str) | {
"domain": "codereview.stackexchange",
"id": 38787,
"lm_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, optimization, datetime, formatting",
"url": null
} |
special-relativity, lorentz-symmetry, wavelength, doppler-effect
Title: How is relativistic wavelength shift for a moving detector - stationary source explained? Relativistic wavelength shift for a stationary source and an receding detector is given by
$\frac{\lambda_s}{\lambda_d}=\sqrt\frac{{1-\beta}}{{1+\beta}}=\frac{{1-\beta}}{\sqrt{1-\beta^2}}=\gamma(1-\beta)$
Now, the $\gamma$ can be explained as a result of Lorentz length contraction. In other words, distance between two points in the source frame will be Lorentz contracted when seen by a moving detector.
But how is the $(1-\beta)$ factor explained by the source?
In other words, the source sees the detector detect a higher frequency due to time dilation as well as due to its motion. It also sees the wavelength to be Lorentz contracted in the frame of the detector. How does the source explain the additional factor $(1-\beta)$ needed to explain the same speed of light measured by the detector? | {
"domain": "physics.stackexchange",
"id": 62878,
"lm_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, lorentz-symmetry, wavelength, doppler-effect",
"url": null
} |
python, beginner, python-3.x, parsing, csv
else:
if ana_alarm_key not in ana_alarm_missing:
ana_alarm_missing_keys.write(str(ana_alarm_key) + '\n')
ana_alarm_missing.append(ana_alarm_key)
else:
break
return None
# looks at alarm files and if the points have a match in the cross refrence dictionary, it creates an output
# keeps track of points that do not have a match in the cross refrence file and create a txt file for later review
def Digital_points():
global dig_exc_input_path, global_dic, ffd_digital_path, missing_key_w, ffm_all_w, file_name_digital
count_path = 0
ana_digital_missing = []
ana_ffm_dup = [] | {
"domain": "codereview.stackexchange",
"id": 22520,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-3.x, parsing, csv",
"url": null
} |
rviz, moveit, ros-melodic
Title: Error When running tutorial on moveit
Hello,
I just install moveit for melodic from that tutorial:
http://docs.ros.org/en/melodic/api/moveit_tutorials/html/doc/getting_started/getting_started.html
When I run the demo example, I get that error:
roslaunch panda_moveit_config demo.launch
Error:
[ INFO] [1621332924.648205185]: Loading robot model 'panda'...
[ INFO] [1621332925.050765019]: Loading robot model 'panda'...
[ERROR] [1621332925.103988618]: Group 'hand' is not a chain
[ERROR] [1621332925.104022297]: Kinematics solver of type 'kdl_kinematics_plugin/KDLKinematicsPlugin' could not be initialized for group 'hand'
[ERROR] [1621332925.104066937]: Kinematics solver could not be instantiated for joint group hand.
And then I want to run the move group tutorial:
roslaunch moveit_tutorials move_group_interface_tutorial.launch | {
"domain": "robotics.stackexchange",
"id": 36434,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rviz, moveit, ros-melodic",
"url": null
} |
diagram making salient values. 6 (173 ratings) Course Ratings are calculated from individual students' ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately. Draw the shear force diagram and bending moment diagram for the beam. 3 ft 5 ft 7 ft 8 ft < x < 15 ft Draw a free-body diagram of the portion of the beam to the left of the section and find V and M. However, application of these definitions, developed for a horizontal beam, to a frame structure will require some adjustments. numericals 8. Question No. Problem 2: State the maximum shear force and bending moment values. Uniformly Distributed Loads. This program calculates the shear force and bending moment profiles, draw the free body, shear force and bending moment diagrams of the problem. Draw the Axial Force Diagram. Draw shear force and bending moment diagram of cantilever beam carrying UDL and point loads. SHEAR FORCE DIAGRAM BENDING MOMENT | {
"domain": "lotoblu.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992932829918,
"lm_q1q2_score": 0.8107317627032639,
"lm_q2_score": 0.8376199552262967,
"openwebmath_perplexity": 963.8127792262379,
"openwebmath_score": 0.6833874583244324,
"tags": null,
"url": "http://lotoblu.it/llhb/questions-on-shear-force-and-bending-moment-diagrams.html"
} |
python-3.x
not_run_flag = True
continue
elif data.startswith('run'):
chk_cell_data[check_name]['run'] = []
not_run_flag = False
run_flag = True
continue
if not_run_flag:
chk_cell_data[check_name]['not_run'].append(data)
elif run_flag:
chk_cell_data[check_name]['run'].append(data)
print(chk_cell_data)
if __name__ == "__main__":
main() Type strength
Unless you have a really (really) good reason to use a dict - such as planning to immediately serialize to JSON for some network operation - dict is a poor choice for an internal representation. Use a @dataclass.
Parsing strictness
You should be a little more strict about your parsing; your current implementation considers
check_name_for_something_that_makes_no_sense | {
"domain": "codereview.stackexchange",
"id": 40654,
"lm_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-3.x",
"url": null
} |
quantum-mechanics, energy, harmonic-oscillator
Now let's look at two lowest energy states of the Hamiltonian
$$H=-\frac1m \frac{\partial^2}{\partial x^2}+U,$$
taking for definiteness $m=50$, so that the lowest energy states are sufficiently deep. Now, at the origin of oscillator at left it can be shown to be
$$U_L=\frac14(x+4)^2+O((x+4)^4),$$
and the for right one we'll have
$$U_R=(x-4)^2+O((x-4)^4)$$
If two lowest levels are sufficiently deep that their wavefunction don't overlap, then we can approximate them as eigenstates of each of the harmonic oscillators $U_L$ and $U_R$. See how these two states look: | {
"domain": "physics.stackexchange",
"id": 12278,
"lm_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, energy, harmonic-oscillator",
"url": null
} |
navigation, move-base, costmap
Title: Possible to have local costmap aligned with base link?
I am wondering if there is an option to have the local costmap aligned with your robot?
My point is that if you have a car-like robot which moves mostly forward and cant turn in place, most of the space in a local costmap is useless.
So I would reduce the length of the costmap behind the robot and also the width but would increase the length in front of the robot.
Is there already such an option from which I am not aware?
Originally posted by madmax on ROS Answers with karma: 496 on 2018-01-01
Post score: 0
Costmaps are generally aligned to a semi-fixed frame like odometry for efficiency of moving the costmap. If the costmap needs to move forward , the operation of moving rows is much quicker than calculating a transform and applying that to existing costmap data. The code is not even set up to monitor rotations. So I think the short answer is no. | {
"domain": "robotics.stackexchange",
"id": 29640,
"lm_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, costmap",
"url": null
} |
php, object-oriented, mysql, json, mysqli
public function validate() {
foreach ($this->formvalues as $key => $value){
$santizedinput=$this->sanitizeAndEmptyValueValidate($key,$value);
if($santizedinput ){
for ($i=0; $i < count($this->customerformrequestingKeys);$i++){
if($key==$this->customerformrequestingKeys[$i]){
array_push($this->collectedFormData,[$this->customerformrequestingKeys[$i]=>$santizedinput]);
}
}
}
else
{
return false;
}
}
return true;//return true if all values are validated and filled
}
//sanitize and empty value check userinput
public function sanitizeAndEmptyValueValidate($key,$value){
$valuea=(filter_var($value,FILTER_SANITIZE_STRING));
if(!empty($valuea)){ | {
"domain": "codereview.stackexchange",
"id": 41697,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, object-oriented, mysql, json, mysqli",
"url": null
} |
fluid-dynamics, elasticity, continuum-mechanics, solid-mechanics
The shape of boundary of a solid is determined by the fact that the material is a solid, unlike a fluid whose the shape is constrained by the boundary conditions imposed on the model. Trying to use a Eulerian type of discretization that is "fixed in space" isn't very useful for most solid modeling applications, because it doesn't accurately represent boundary of a solid object when it deforms. | {
"domain": "physics.stackexchange",
"id": 68364,
"lm_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, elasticity, continuum-mechanics, solid-mechanics",
"url": null
} |
quantum-field-theory, standard-model
Title: What would be the most general effective Lagrangian involving one Higgs and two gluons? Two different possibilities come into my mind
$\mathcal{L}\sim{}HG_{\mu}G^{\mu}$
where $G^{\mu}$ is the gluon field and $H$ the Higgs, or either
$\mathcal{L}\sim{}HG_{\mu\nu}G^{\mu\nu}$
Where $G_{\mu\nu}=\partial_{\mu}G_{\nu}-\partial_{\nu}G_{\mu}$.
I can't think of any argument to decide, so, which of this is best and why? or is there a better choice? First of all, since we are talking about an effective theory, there are infinitely many terms. Since the theory does not have to be renormalizable, we can include all operators with $D>4$. So I think you want the easiest one, namely only one additional operator giving you the $Hgg$-vertex.
This would, as you say correctly, be something like
$\delta \mathcal{L}\sim \frac{g}{\Lambda}H G_{\mu\nu}^a G^{\mu\nu\ a} + h.c.$
BTW: $G_{\mu\nu}^a=\partial_\mu A_\nu^a - \partial_\nu A_\mu^a+ g_s f^{abc}A_\mu^b A_\nu^c$. Gluons interact with each other. | {
"domain": "physics.stackexchange",
"id": 19093,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, standard-model",
"url": null
} |
ros, ros-kinetic, learning-tf, tf2, tf-tutorial
Comment by yanjunyang on 2021-03-08:
Hi @r7vme, I also met the same problem and I compiled it using catkin build. I'm using Ubuntu18.04 and ROS Melodic. The result shows all packages are successfully compiled. After I source the workspace, I still get the same error. Would you mind give me more help and what details I need to provide>
Comment by apprentice_user on 2021-06-23:
the error disappeared when I followed the instructions. but now i get a different error
ConnectionRefusedError: [Errno 111] Connection refused
how can ı correct this error
Comment by Mike Scheutzow on 2021-07-07:
This question is tagged "kinetic", so this user should be using Ubuntu 16. In kinetic, ros uses python2. Why are all of you sending him/her down this path with python3? | {
"domain": "robotics.stackexchange",
"id": 33218,
"lm_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-kinetic, learning-tf, tf2, tf-tutorial",
"url": null
} |
Plugging in known values to this equation with the correct value for angular velocity $\vec \omega = \vec r \times \vec v$ gives the accepted answer:
$$I = 0.000187\textrm{ kgm}^2\quad.$$
As for part B, the height of the can is irrelevant because as long as we know the mass and radius of the can, we can solve the problem. The ‘extra mass’ resulting from lengthening the can would be centered about the can's original center of mass, and as such the moment of inertia would not be affected for this problem. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.974821157567904,
"lm_q1q2_score": 0.8014873557079328,
"lm_q2_score": 0.8221891261650247,
"openwebmath_perplexity": 308.53212467404313,
"openwebmath_score": 0.8250154852867126,
"tags": null,
"url": "http://physics.stackexchange.com/questions/45734/kinetic-energy-and-rotational-motion"
} |
ros-indigo
Title: No executable file is generated after catkin_make
I was trying to use c++ to publish a Twist message. I added a couple of sentences introduced in wiki tutorials.
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(test src/test.cpp)
target_link_libraries(test ${catkin_LIBRARIES})
add_dependencies(test beginner_tutorials_generate_message_cpp)
But after running catkin_make, there was no executable file generated. I do not know how to solve this problem.
I am using ROS Indigo running on Ubuntu 14.04.
Originally posted by percy_liu on ROS Answers with karma: 23 on 2016-02-12
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 23735,
"lm_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-indigo",
"url": null
} |
homework-and-exercises, electrostatics, electric-fields, electric-current, electrical-resistance
The last way is when we allow both the conducting fluid and the grounded sphere to move charges such that the electric field at every point in space is E=0. | {
"domain": "physics.stackexchange",
"id": 78998,
"lm_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, electric-current, electrical-resistance",
"url": null
} |
organic-chemistry, reaction-mechanism, reactivity
Title: Functional Group compatibility in organic chemistry As a continuation to the question:
Predicting reaction among compounds
I found the list of functional group on wikipaedia:
https://en.wikibooks.org/wiki/Organic_Chemistry/Overview_of_Functional_Groups
Now in the previously mentioned question, I got a clue that if the functional groups are compatible then reaction can occur, can you please tell me which are compatible with which? As I mentioned in my answer to this question, you are asking for something about which my two-semester organic chemistry course sequence just scratches the surface.
After covering the basics of organic structure and reactivity, most introductory organic chemistry texts have 15-20 chapters organized by functional group containing the reactions of and syntheses of said functional groups | {
"domain": "chemistry.stackexchange",
"id": 3818,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, reaction-mechanism, reactivity",
"url": null
} |
general-relativity, gravitational-waves
\begin{equation}
h = \frac{\Delta L}{L} = \frac{L - L'}{L}. \tag{1}
\end{equation}
The emphasis here is that this is a very general definition of strain — which Wikipedia tells us is also called the "Cauchy strain" or "engineering strain". It just describes the change caused by any deformation, induced by any type of force, applied to any length in some chosen direction (which is chosen implicitly in the definition). Gravitational waves are just one particular type of deformation that happens to be adequately described as a strain. So our task is to understand how this type of strain is related to the quantity $h^{ij}$.
Recall that we usually start with some definition like(*)
\begin{equation}
h^{\alpha \beta} = \eta^{\alpha \beta} - g^{\alpha \beta}, \tag{2}
\end{equation} | {
"domain": "physics.stackexchange",
"id": 58146,
"lm_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, gravitational-waves",
"url": null
} |
within absolute value equation who score within 20 points of will... Just transformations ( shifts and stretches ) of the function as piecewise function 2 & )! Excel, there is no solution to [ latex ] \, x\, [ /latex ] the! Numbers remain unaffected write an equation in which the unknown variable now you 're taking absolute! Determine it, games, and other study tools touched on the same magnitude as a given number return... Of understanding absolute value function, and will not be negative, though an absolute value of number... And fun math activities ends - Infinity is not definite and has null vectors magnitude as given! Or decimal, without its sign is within an absolute value equation, an unknown variable within... | {
"domain": "genesisconsortiumllc.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9697854103128328,
"lm_q1q2_score": 0.808146028566973,
"lm_q2_score": 0.8333245891029457,
"openwebmath_perplexity": 451.748810600166,
"openwebmath_score": 0.7222049832344055,
"tags": null,
"url": "https://genesisconsortiumllc.com/ft-lbs-btc/absolute-value-function-c44a3b"
} |
homework-and-exercises, quantum-field-theory, path-integral
$$\langle\phi_b|e^{-iHT}|\phi_a\rangle=\int\cal{D}\phi\cal{D}\pi{}e^{i\int_ 0^Td^4x\,(\frac{i}{\sqrt{2}}\pi-\frac{i}{\sqrt{2}}\partial_t\phi)^2}e^{i\int_0^Td^4x\,\cal{L}}$$
now, my question. How do you get rid of the first exponent? My teacher said something about Gaussian integrals but this doesn't convince me. This is not a regular integral, this is a functional integral, so we shouldn't use directly the formula for Gaussians here. How do you perform this integral without resorting to hand wavy arguments? That's not a handwaving and I think that this particular question is covered in practically every textbook containing path integrals. First of all you should note that we can integrate by $\pi$ not touching the second exponent, i.e.
$$\langle\phi_b\vert e^{-iHT}\vert\phi_a\rangle =\int \mathcal{D}\phi e^{i\int_0^T d^4x\mathcal{L}}\int\mathcal{D}\pi e^{i\int_0^Td^4x\Big(\frac{i}{\sqrt{2}}\pi-\frac{i}{\sqrt{2}}\partial_t\phi\Big)^2}$$ | {
"domain": "physics.stackexchange",
"id": 19692,
"lm_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, quantum-field-theory, path-integral",
"url": null
} |
We have $(3x^3+xy^2)(yx^2+3y^3)=(x-y)^7$, which can be expressed as $xy(3x^2+y^2)(x^2+3y^2)=(x-y)^7$. At this point, we think of substitution. A substitution of form $a=x+y, b=x-y$ is slightly derailed by the leftover x and y terms, so instead, seeing the xy in front, we substitute $x=a+b, y=a-b$. This leaves us with $(a^2-b^2)(4a^2+4ab+4b^2)(4a^2-4ab+4b^2)=128b^7$, so $(a^2-b^2)(a^2+ab+b^2)(a^2-ab+b^2)=8b^7$. Expanding yields $a^6-b^6=8b^7$. Rearranging, we have $b^6(8b+1)=a^6$. To satisfy this equation in integers, $8b+1$ must obviously be a $6th$ power, and further inspection shows that it must also be odd. Also, since it is a square and all odd squares are 1 mod 8, every odd sixth power gives a solution. Since the problem asks for positive integers, the pair $(a,b)=(0,0)$ does not work. We go to the next highest odd $6th$ power, $3^6$ or $729$. In this case, $b=91$, so the LHS is $91^6*3^6=273^6$, so $a=273$. Using the original substitution yields $(x,y)=(364,182)$ as the first | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513893774302,
"lm_q1q2_score": 0.8039426586804621,
"lm_q2_score": 0.8152324960856175,
"openwebmath_perplexity": 142.77378868331724,
"openwebmath_score": 0.9561612010002136,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=2017_USAJMO_Problems/Problem_2&oldid=89307"
} |
homework-and-exercises, newtonian-mechanics, acceleration, free-body-diagram, string
\\
m_1\,a_1 &= \left(
2T - \delta m\,(a_\delta+g)
\right) - m_1\,g
\\
\delta m\,a_\delta + m_1 a_1 &= 2T - (\delta m + m_1)g
\\
\widetilde m_1\,a &= 2T - \widetilde m_1\,g
\tag1
\end{align}
Since $\delta m \ll m_1$, there's not very much difference between $m_1$ and $\widetilde m_1 = m_1 + \delta m$, and the upward force on the latter is $2T$.
The final line (1) encodes the statement that your author makes, that the upward force on $m_1$ is $2T$, and that approximation gets better in the limit that $\delta m$ is very small. | {
"domain": "physics.stackexchange",
"id": 49843,
"lm_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, acceleration, free-body-diagram, string",
"url": null
} |
orbitals, hybridization
(A) At the top I've drawn the HOMO and LUMO, because I know that the reaction coordinate belongs to the $\ce{C_{$2v$}}$ point group. These two orbitals of the HOMO (green) lies in the O-C-O plane. In each $p$ orbital I would locate one electron (triplett state is favoured because of Hunds rule). Oxygen has six valence electrons, so I must bring four electrons in orbitals of each oxygen. I can place two electrons in a $p$ orbital perpendicular to the greenish depicted orbital. Then I would place the other two electrons in a $sp$ hybrid orbital. | {
"domain": "chemistry.stackexchange",
"id": 3650,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbitals, hybridization",
"url": null
} |
electromagnetism, electrostatics, electric-fields, gauss-law, vector-fields
Title: Why does the density of electric field lines make sense, if there is a field line through every point? When we're dealing with problems in electrostatics (especially when we use Gauss' law) we often refer to the density of electric field lines, which is inversely proportional to the radius in the case of a single point charge (all field lines are directed radially).
My question may sound dumb, despite the fact that this concept is quite intuitive, but if you think about it there is actually an infinite amount of field lines which we can draw everywhere (one through every point), so speaking of an area where field lines are more "dense" or "sparse" doesn't make much sense to me.
With this in mind, why can we still use such a concept? Why does it really work? Field lines draw all of their validity from Gauss's law for the electrostatic field,
$$
\nabla\cdot \mathbf{E}=\frac1{\epsilon_0}\rho,\ \text{or equivalently}\ | {
"domain": "physics.stackexchange",
"id": 11674,
"lm_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, electric-fields, gauss-law, vector-fields",
"url": null
} |
turtlebot, ros-kinetic
Originally posted by aaditya_saraiya with karma: 105 on 2017-08-09
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 26387,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turtlebot, ros-kinetic",
"url": null
} |
java, thread-safety
}
}
Is it guaranteed that thread B sees the item ("HI") in bag,
Or is it true that thread B may in fact see the item in the bag as null, and will never see the item "HI" in the bag? Chapter 3.5. Safe Publication in Java Concurrency in Practice contains a very similar example. To cut a long story short: it's not thread safe. ThreadB could see its bag reference as null. Furthermore, ThreadB could see its bag reference as not null, but the referenced Bag's item field could be seen as null by ThreadB.
On my machine sometimes it's an endless loop but I can't reproduce the second scenario when just the Bag.item is null.
Please note that making the Bag.item field final does not make it thread-safe, access to ThreadB.bag also have to be synchronized:
public class ThreadB extends java.lang.Thread {
private Bag bag;
public synchronized void setBag(Bag bag) {
this.bag = bag;
} | {
"domain": "codereview.stackexchange",
"id": 940,
"lm_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, thread-safety",
"url": null
} |
machine-learning, scikit-learn
Title: data splitting into 3 sets based on years let's suppose we have a customer data from the year 2015 to 2019, I want to train_test_split() my data such that my data gets divided into three sets, set-1 is from 2015 to 2017 (3 years) on which i will train my model, set-2 i.e. 2018(1 year) on which i will validate my model , set 3 is 2019(1 year) on which I will test my model. I want a code to divide data into 3 sets based on time(years). Seems to me the best (or at least quickest) way to do this would be have all the data in a Pandas dataframe, then create masks based on year and create new dataframes for each group. Ex:
train_df = data[data['year'].isin(['2015', '2016', '2017'])
validate_df = data[data['year'] == '2018']
test_df = data[data['year'] == '2019']
Hope this is what you're looking for. If not, let me know and we can work out another solution. | {
"domain": "datascience.stackexchange",
"id": 6772,
"lm_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, scikit-learn",
"url": null
} |
inverse). Watch for generating impulse. Dado que MATLAB® es un lenguaje de programación, es posible una infinita variedad de señales diferentes. The function file you create should be named example2. I have an LTI SISO system for which I want to estimate the transfer function using input and output data. This indicates a ramp function starting from t=5 seconds. I know there is a block for ramp function in Simulink. Here’s how to build the triangle function shown in the figure, using ramp functions: Turn on a ramp with a slope of 1 starting at time t = 0. Of course you can define everything in Matlab, and I believe is far better to define a continuous function instead than a discrete number of values. The output, y , is always an unoriented vector. Step response using Matlab Example. the function of matlab to create different types of signal and observe them. m How to execute command in Matlab ?: For this you need to go to command window and give a value for a time. A minimal knowledge | {
"domain": "campercom.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9518632288833653,
"lm_q1q2_score": 0.8109425485157867,
"lm_q2_score": 0.8519528057272543,
"openwebmath_perplexity": 1004.8363287323104,
"openwebmath_score": 0.5590897798538208,
"tags": null,
"url": "http://orlv.campercom.it/ramp-function-matlab.html"
} |
# A Wild Arctan Formula
### 23 May 2021
Yesterday a good friend of mine sent me the following bizarre formula:
$4^{1/\pi} = \lim_{n \to \infty} \frac{\pi}{2 \arctan(n)} \frac{\pi}{2 \arctan(n+1)} \frac{\pi}{2 \arctan(n+2)} \cdots \frac{\pi}{2 \arctan(2n)}$
This is listed as formula $(130)$ at the bottom of the wolfram mathworld page on formulas for $\pi$, where it is called “A fascinating result due to Gosper”. There are $3$ citations for Gosper on that page, but I can’t actually figure out how to see any of them. That’s fine, though – We’ll just have to prove it ourselves. I ended up heavily using computer tools (by which, of course, I mean sage) to crack this, and it almost felt like cheating (since I knew my friend was doing it by hand). But I hope that, in addition to showing off a cool formula, this blog post can showcase how one might use sage to solve problems in the wild (even though in this case we used sage in a fairly mundane way). | {
"domain": "grossack.site",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.978712645102011,
"lm_q1q2_score": 0.8155853209320274,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 386.3390500906697,
"openwebmath_score": 0.986748456954956,
"tags": null,
"url": "https://grossack.site/2021/05/23/wild-arctan-formula.html"
} |
roslaunch
Originally posted by Mike Scheutzow with karma: 4903 on 2022-05-29
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by vane on 2022-05-29:
I compared the dumps of the param server with both clear_params true/false and they are identical
Comment by Mike Scheutzow on 2022-05-29:
That is unexpected, because in the git repo there are parameter values assigned in settings.yaml and tags.yaml. Do you see those properties in the list?
It looks like the wiki only tells part of the story. The behavior I see is that this flag is executed before any parameter server properties are set to their new values. This is useful when a rosparam property is no longer present in the current launch file.
Comment by vane on 2022-05-30:
Yeah, that would be a consistent scenario that makes sense and would be useful in niche situations. I personally hate having implicit/default settings of any kind | {
"domain": "robotics.stackexchange",
"id": 37720,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "roslaunch",
"url": null
} |
fft, frequency-spectrum, magnitude
Title: Correction Factor for np.fft.rfft I tested the function np.fft.rfft using the following code and determined the magnitude of a $50 \, \textrm{Hz}$ sine wave.
import numpy as np
import matplotlib.pyplot as plt
frequency = 50
f_sam = 192000 # sampling freq
dt = 1/f_sam # time step
t = np.arange(0, 1/frequency*2, dt)
# 5V 50Hz-sine wave
y = 5 * np.sin(2 * np.pi * frequency * t)
# Compute the one-sided frequency spectrum
fft_freq = np.fft.rfftfreq(len(y), dt)
fft_magnitude = np.abs(np.fft.rfft(y)) / len(fft_magnitude)
As the sine wave has an amplitude of $5 \, \textrm{V}$ I get an expected peak at $50 \, \textrm{Hz}$ with $5 \, \textrm{V}$.
However, why doesn't it require a correction factor of $2$ (e.g. fft_magnitude = **2** * np.abs(np.fft.rfft(y)) / len(fft_magnitude))?
This should be done when discarding the left-hand side (negative frequencies) of the frequency spectrum, but why isn't it necessary here? Presumably because of the following line | {
"domain": "dsp.stackexchange",
"id": 12442,
"lm_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, frequency-spectrum, magnitude",
"url": null
} |
c#, programming-challenge, unit-testing
Feedback on any aspect of the tests/solution is welcome. One thing I'd change would be to have tests for each of the individual methods. Notice how the test has to provide an empty list to test IsPalindrome() or IsSequence()? Palindromes have nothing to do with awesome phrase arrays, yet here they are, adding confusion to the tests.
Isolating the tests will also allow you to test uninteresting hits. Is 101 a hit because it's Awesome, or because it's a palindrome (of course does it really matter, when palindromes are clearly awesome anyway?) But what about 102?
IsSequence() might benefit more from isolated tests, because the intent of the ==9 or ==1 check isn't clear. 7890 is a sequence, but what about 7899? 7891? 78901? What about 890123, or 210987?
I see no error handling. My car has no minus sign, so I doubt -1 is a valid odometer reading. What about 4294967295? 4294967296? I might find it interesting if I could cause an integer overflow or underflow. | {
"domain": "codereview.stackexchange",
"id": 22252,
"lm_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#, programming-challenge, unit-testing",
"url": null
} |
java, performance, array
@Override
public boolean equals(Object obj) {
if (!(obj instanceof IntArray)) {
return false;
}
if (obj == this) {
return true;
}
final IntArray them = (IntArray)obj;
if (them.hwm != this.hwm) {
return false;
}
final int limit = getMatrixRow(hwm);
for (int r = 0; r <= limit; r++) {
final int[] a = r < this.data.length ? this.data[r] : null;
final int[] b = r < them.data.length ? them.data[r] : null;
if (a == null && b == null) {
continue;
}
if (a == null && !IntStream.of(b).allMatch(IntOps.ISZERO)) {
return false;
}
if (b == null && !IntStream.of(a).allMatch(IntOps.ISZERO)) {
return false;
}
if (!Arrays.equals(a, b)) {
return false;
}
}
return true;
}
} | {
"domain": "codereview.stackexchange",
"id": 12403,
"lm_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, array",
"url": null
} |
quantum-mechanics, classical-mechanics, atomic-physics, semiclassical
Can anyone explain how these equations are obtained? The Bohr problem has just radius, this problem has two radii.
At the moment you decide the system is quantum mechanical, you cannot have a classical trajectory anymore. You cannot see or define a single revolution path anymore, rather you can describe it statistically - e.g. how much motion system has in separate axes. Every measurement trying to reconstruct the ellipse is limited by Heisenberg uncertainty, in that sense there are two degrees of freedom.
you strictly stick to the ellipse (you use just one degree of freedom) it will surely not reflect the quantum mechanical motion, but represent some artificial input condition - and you will go the Bohr direction with just one quantum number and probably some like-deformation parameter described by excentricity $\epsilon$. Or you should find a way to quantize $\epsilon$. | {
"domain": "physics.stackexchange",
"id": 37547,
"lm_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, classical-mechanics, atomic-physics, semiclassical",
"url": null
} |
thermodynamics, energy, statistical-mechanics, entropy, probability
This is because when we write
$$
\frac{\partial S}{\partial U}
$$
with the intention of getting inverse of thermodynamic temperature, we have to assume that all the other thermodynamic state variables that $S$ depends on are constant; otherwise the derivative need not be function of temperature. In thermodynamics, $S$ is function of at least $U,V,N$, so the derivative is actually
$$
\frac{\partial S}{\partial U}\bigg{|}_{V,N} = \frac{1}{T}.
$$
Assuming constant $V,N$ in quantum theory implies constant Hamiltonian, and thus constant energy levels $E_j$. Changing $U$ in this partial derivative is thus allowed to happen only via changing the probabilities $\rho_j$'s, not via changing the energy levels $E_j$'s. | {
"domain": "physics.stackexchange",
"id": 97151,
"lm_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, energy, statistical-mechanics, entropy, probability",
"url": null
} |
java, beginner, game, formatting, number-guessing-game
/**
* Takes in the user's guess, validates it, and tells them when they win
*/
public static void userGuess(int obj, int max) {
int userGuess;
do {
userGuess = getIntFromUser("Guess a number between 1 and " + max + ": ", 1, max);
userWinLose(userGuess, obj);
} while (userGuess != obj);
}
/**
* Tells the user whether their guess was high, low, or correct
*/
public static void userWinLose(int guess, int objective) {
if (guess < objective)
JOptionPane.showMessageDialog(null, "Too low!");
else if (guess > objective)
JOptionPane.showMessageDialog(null, "Too high!");
else
JOptionPane.showMessageDialog(null, "You win!");
}
/**
* Asks the user if they want to play again or quit
*/
public static boolean playAgain() {
return (getIntFromUser("Enter 0 to quit or 1 to play again", 0, 1) == 1);
}
} | {
"domain": "codereview.stackexchange",
"id": 5702,
"lm_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, game, formatting, number-guessing-game",
"url": null
} |
javascript, functional-programming, node.js, json
The code can then use this encapsulated information as input, doing its thing and spitting out the result. Many changes can be made by just changing some text and never going near the logic.
function transform(data, rules) {
const items = {}, types = new Set();
const addTypes = from => rules.ids.forEach(key =>
from[key] !== undefined && (types.add(from[key]));
const addProps = from => rules.keep.reduce((obj, key) =>
from[key] !== undefined ? (obj[key] = from[key], obj) : obj, {});
const transformLoc = loc => {
const lName = loc[rules.itemName];
if (lName !== undefined) {
items[lName] = addProps(loc);
if (loc.contents) { loc.contents.forEach(addTypes) }
addTypes(loc);
}
}
data[rules.itemsName].forEach(transformLoc);
return {
[rules.name]: {
[rules.typesName]: [...types],
[rules.itemsName]: items
}
};
} | {
"domain": "codereview.stackexchange",
"id": 35539,
"lm_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, functional-programming, node.js, json",
"url": null
} |
trials, p is the probability of a success, and number is the value. Probability Theory on Coin Toss Space 1 Finite Probability Spaces 2 Random Variables, Distributions, and Expectations 3 Conditional Expectations. Last time we found the following probability distribution for X: X P(X) 0 1/16 1 4/16 2 6/16 3 4/16 4 1/16 Find the expected number of heads for a trial of this experiment, that is nd E(X). 5 I should get an output of 0 half of the time, and 1 half of the time. How much should you pay to play this game if your net winnings, the difference between the payoff and cost of playing, are to have mean 0?. Calculate the probability that Alan will lose the game. e head or tail. In 1947, the coin flipping was held 30 minutes before the beginning of the game. more than 3 tails. Coin toss probability Coin toss probability is explored here with simulation. Re: Coin Toss Game I do not know what your formula is purported to show. The event 'getting a head' in the second toss is independent | {
"domain": "insitut-fuer-handwerksmanagement.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754461077708,
"lm_q1q2_score": 0.8072468556338093,
"lm_q2_score": 0.8198933447152497,
"openwebmath_perplexity": 314.30131142717147,
"openwebmath_score": 0.8584415912628174,
"tags": null,
"url": "http://rhpa.insitut-fuer-handwerksmanagement.de/3-coin-toss-probability-calculator.html"
} |
ros, ros-kinetic, update, git, wstool
Originally posted by Juan on ROS Answers with karma: 208 on 2019-04-05
Post score: 1
I'm not sure I understand you correctly, but the .rosinstall format supports specifying a destination for clones/checkouts of repositories with the local-name property.
The documentation on the file format describes it as:
Inside every top level dictionary there is one required key, local-name this represents the path where to install files. It will support both workspace relative paths as well as absolute paths.
So if you want to keep things in a different directory than directly in your source space, you could do that by setting local-name to something like:
some_dir/other_dir/baxter/..
Each entry has its own local-name key, so each repository can be placed in a different directory.
Originally posted by gvdhoorn with karma: 86574 on 2019-04-05
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Juan on 2019-04-10:
Great!!! Thanks for that tip! | {
"domain": "robotics.stackexchange",
"id": 32821,
"lm_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-kinetic, update, git, wstool",
"url": null
} |
c, linked-list
/******************************************************************************
******* prototypes ***********************************************************
******************************************************************************/
__attribute__((nonnull))
int alx_llist_init (struct Alx_LinkedList **list);
__attribute__((nonnull))
int alx_llist_deinit (struct Alx_LinkedList *list);
__attribute__((nonnull))
int alx_llist_first_element (struct Alx_LinkedList *list,
const void *data, size_t size);
__attribute__((nonnull))
int alx_llist_remove_last (struct Alx_LinkedList *list);
__attribute__((nonnull))
int alx_llist_prepend (struct Alx_LinkedList *list,
const void *data, size_t size);
__attribute__((nonnull))
int alx_llist_append (struct Alx_LinkedList *list,
const void *data, size_t size);
__attribute__((nonnull))
int alx_llist_insert_before (struct Alx_LinkedList *list, | {
"domain": "codereview.stackexchange",
"id": 36846,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, linked-list",
"url": null
} |
electromagnetism, electrostatics
if you wanted to "derive" the Coulomb force between two electrons from quantum electrodynamics (this is done as an exercise in Peskin and Schroeder), then you need to consider scattering events like the following: | {
"domain": "physics.stackexchange",
"id": 17822,
"lm_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",
"url": null
} |
python, python-3.x, antlr
return output
def main():
code = argv[1]
extract(code)
if __name__ == '__main__':
main()
gen_fragments.py
import sys
from scripts.extract_fragment import extract
def main(name):
if name:
print('// Generated by {}'.format(__file__[__file__.rfind('scripts'):]))
print()
print('lexer grammar {};'.format(name))
print()
print('// [C] Other')
print('fragment C : Cc | Cf | /* Cn | Co | Cs */ ;')
print()
print('// [Cc] Other, Control')
print(extract('Cc'))
print()
print('// [Cf] Other, Format')
print(extract('Cf'))
print()
print('// [Cn] Other, Not Assigned')
print(extract('Cn'))
print()
print('// [Co] Other, Private Use')
print(extract('Co'))
print()
print('// [Cs] Other, Surrogate')
print(extract('Cs'))
print()
print('// [L] Letter')
print('fragment L : /* LC | */ Ll | Lm | Lo | Lt | Lu ;')
print() | {
"domain": "codereview.stackexchange",
"id": 21612,
"lm_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, antlr",
"url": null
} |
electromagnetism, atomic-physics, collision, gas, matter
critical for it being impossible to walk through walls? In particular, is it fair to say that there is an attractive force at play, and if so what is that force? Solids don't pass through each other because the molecules are rigidly connected to each other and the "empty space" is not really empty, it is full of molecular wavefunctions. As described in the referenced answer to Why doesn't matter pass through other matter if atoms are 99.999% empty space?, solids cannot pass through each other without the electron wavefunctions overlapping and repelling each other because of electromagnetic forces and the Pauli Exclusion Principle. To pass through each other they would have to break the rigid chemical bonds between molecules. | {
"domain": "physics.stackexchange",
"id": 92694,
"lm_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, atomic-physics, collision, gas, matter",
"url": null
} |
tensor-calculus, group-theory, representation-theory
Title: Why is rank-3 tensor in 3D with two antisymmetric indices equivalent to rank-2 tensor? I'd like to know how many irreducible representations of $SO(n)$ when it comes to rank 3 tensor. Here $n=3$. Among the rank 3 tensor components, there might be antisymmetric parts and symmetric parts and goes on. According to A.Zee's "Group Theory for Physicists in a nutshell" p.193, he mentions that we actually don't need to concern about partially antisymmetrized tensor since it's nothing new but old representation that merged in rank 2 tensor representation.
We don’t care about the antisymmetric combination $T^{[ij]k}$ , because we know that secretly it is just a 2-indexed tensor $B^{lk}$ ≡ $\epsilon_{ijl}T^{[ij]k}$, and we have already disposed of all 2-indexed tensors. Our attack is inductive, as I said. | {
"domain": "physics.stackexchange",
"id": 94098,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "tensor-calculus, group-theory, representation-theory",
"url": null
} |
Engineering San Jose State University San Jose, California, USA ME 130 Applied Engineering Analysis. IJDSDE is a international journal that publishes original research papers of high quality in all areas related to dynamical systems and differential equations and their applications in biology, economics, engineering, physics, and other related areas of science. These equations provide a convenient method for the construction of Markov processes that have pre-specified statistical properties and that are very useful as models for random disturbances in process plants. [Shair Ahmad; M Rama Mohana Rao]. 1 INTRODUCTION. Air resistance: with First we do the modeling, using another of Newton’s laws:. Solve a system of several ordinary differential equations in several variables by using the dsolve function, with or without initial conditions. An Advance Course in Engineering Mathematics. Maths for Engineering. Usually students at the Engineering Requirements Unit (ERU) stage of the Faculty | {
"domain": "cmsilsole.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9915543738075945,
"lm_q1q2_score": 0.8305457402413107,
"lm_q2_score": 0.8376199653600372,
"openwebmath_perplexity": 691.2710942727588,
"openwebmath_score": 0.4605239927768707,
"tags": null,
"url": "http://onts.cmsilsole.it/applications-of-differential-equations-in-engineering.html"
} |
proof-techniques, asymptotics, recurrence-relation, master-theorem
$$
Substituting $f(n)$ with $\Theta(n^{\log_b a} \log_b^k n)$, moving $\Theta$ outside and applying Lemma A we get
$$T(n) = \Theta (n^{\log_b a }\log_b^{k+1} n).$$
Generalizing this to an arbitrary integer $n$ that is not a power of $b$ is beyond the scope of this post. | {
"domain": "cs.stackexchange",
"id": 913,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "proof-techniques, asymptotics, recurrence-relation, master-theorem",
"url": null
} |
quantum-mechanics, hilbert-space, atomic-physics, superposition, quantum-states
Title: What's an atomic superstate/superposition, and how is it possible? What's an atomic superstate/superposition, and how is it possible?
I understand the basics - being something can be moving and staying still at the same time; the observer changes the behaviour - but I'd like to know a little more, as it interests me, and how is it possible without actually interfering with said thing? Superposition is often claimed, particularly in popular physics texts, to be "an object that is in two states at once", but this is in fact quite misleading. Superposition states, in fact, go beyond this property.
Say I have a box, and I claim that it
contains a cat that's both dead and alive, with the proviso that when you actually look at it you will only see one of the states, with probability 1/2 for each. | {
"domain": "physics.stackexchange",
"id": 57957,
"lm_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, hilbert-space, atomic-physics, superposition, quantum-states",
"url": null
} |
parallel-computing
A slightly different example is the quadratic sieve. In this algorithm, we need to find a certain number of smooth integers and factor them. If we aim at finding $n$ such integers and there are $N$ processors available, we can assign each of them to find $n/N$ integers. A more complicated approach would be to have one central processor assign "jobs" (integers) to processors: each time a processor finishes factoring a smooth integer, it receives a new one. (In practice, since the algorithm sieve for smooth integers, each processor will get a range of potential smooth integers.) This scheme is also embarrassingly parallel.
In contrast, consider the simple Pollard's $p-1$ method. The algorithm is iterative in nature and there doesn't seem to be a simple way to run it in parallel; we can perhaps run the FFTs associated with modular exponentiation using a sophisticated parallel scheme, but this is no longer embarrassingly parallel. | {
"domain": "cs.stackexchange",
"id": 2905,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "parallel-computing",
"url": null
} |
navigation
Title: Navigation Stack Set up Problems
HI,
Seems I have one or many things mis-configured. My set up is a diff drive robot running most of the sensory code and PC running gmapping and the navigation stack.
I don't want to use a prior map but have the robot build on for itself.
In summary I'm currently getting the following errors from the navigation stack: | {
"domain": "robotics.stackexchange",
"id": 26082,
"lm_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",
"url": null
} |
homework-and-exercises, newtonian-mechanics, fluid-dynamics, drag, estimation
Title: Can I move an oil tanker? Let's say that I'm standing at the edge of a basin made of concrete. This basin is filled with salt water and a ship floats on the water close to the edge of the basin. The ship is neither anchored nor does it touch the bottom of the basin with its hull.
There are no waves since the basin is closed (let's say the ship was brought in with a crane) and there's no wind.
My question is: How big a ship (in kilograms) can I move if I push against the ship? Assume that my strength is average for a mid-twenty male.
Edit: I'd like to move the ship ten centimeters. In terms of how long I'm willing to push: ten minutes. To work out the force needed to move a ship there are two considerations:
the mass of the ship
the hydrodynamic drag due to the ship's motion through the water | {
"domain": "physics.stackexchange",
"id": 76882,
"lm_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, fluid-dynamics, drag, estimation",
"url": null
} |
complexity-theory
P.S.(2019/05/03)
The concept of the pair (a,b) and the subset Sa,b are used in the following context to construct the truth table of a symmetric circuit.
(Since I'm not so good at English and not an expert of this field, I'd be sorry if there's any inappropriate expressions or mistakes.) The fact that the same letter is used twice doesn't mean that it signifies the same thing. In particular, in your first question, clearly $a \in \{0,\ldots,s\}$ and $b \in \{0,1\}$, whereas in the second question, it is explicitly stated that $a,b \in \{0,\ldots,t\}$. From your excerpts, it seems that the second $a,b$ are of the same "type" as the $a$ in your first question.
Your third question is unanswerable given your excerpts. It could be that the construction is instantiated with several different values of $t$. In any case, I would look at the place in which the construction is invoked to find out what the value of $t$ should be. | {
"domain": "cs.stackexchange",
"id": 13854,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory",
"url": null
} |
game, objective-c
switch (jobType) {
//simple jobs
case JobTypeMining:
if (floor.floorBuildState & FloorHasLadder && (int)floor.groundBlocks.count > 0) {
return YES;
}
break;
case JobTypeHaulItem:
if (floor.itemsNeedingHauling.count > 0 && (int)floor.groundBlocks.count <= 0) {
return YES;
}
break; | {
"domain": "codereview.stackexchange",
"id": 9473,
"lm_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",
"url": null
} |
$H(\omega)=\frac{1}{1-\frac{1}{2}e^{-j\omega}}+\frac{1}{2}\frac{e^{-j\omega}}{1-\frac{1}{2}e^{-j\omega}}$
2: Take the inverse Fourier transform of H($\omega\$) (Fourier Transform Table),
$h[n]={\left(\frac{1}{2} \right)}^{n}u[n]+\frac{1}{2}{\left(\frac{1}{2} \right)}^{n-1}u[n-1]$
3: Simplify if so inclined,
for n = 0
$h[n] = 1\$
for n > 0
$h[n] = {\left(\frac{1}{2} \right)}^{n-1}$ | {
"domain": "projectrhea.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429160413819,
"lm_q1q2_score": 0.8430501113168498,
"lm_q2_score": 0.8558511488056151,
"openwebmath_perplexity": 1306.297873807096,
"openwebmath_score": 0.7508476972579956,
"tags": null,
"url": "https://www.projectrhea.org/rhea/index.php?title=ECE_301_Fall_2007_mboutin_Examples&oldid=485"
} |
thermodynamics, visible-light, radiation, infrared-radiation
Title: Understanding radiation of objects I am trying to understand Greenhouse effect. I have heard that during the day the earth absorbs heat from the sun in the form of visible light, and during the night it looses heat in the form of infrared radiation.
Does earth emit infrared light during the day as well? I mean does it loose heat in the form of infrared light while absorbing visible light?
My assumption is that any object with a temperature above absolute zero emits some sort of radiation and loose heat - is this correct?
If this assumption is correct, why some objects like the sun emit heat in the form of visible light while other objects like earth emit heat in the form of infrared radiation?
My assumption is that any object with a temperature above
absolute zero emit some sort of radiation and loose heat
- is this a correct? | {
"domain": "physics.stackexchange",
"id": 61014,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, visible-light, radiation, infrared-radiation",
"url": null
} |
cc.complexity-theory, complexity-classes, lambda-calculus, typed-lambda-calculus
The other 3 calculi of the Lambda Cube which include polymorphism are therefore at least as expressive as System F. These include System F$_\omega$ (polymorphism + higher order), which can express exactly the provably total functions in higher order PA, and the Calculus of Constructions (CoC), which is the most expressive calculus of the Cube (all dependencies are enabled). I don't know a characterization of the expressiveness of the CoC in terms of arithmetical theories or set theories, but it must be pretty frightening :-)
I am much more ignorant regarding the calculi obtained by just enabling dependent types (essentially Martin-Löf type theory without equality and natural numbers), higher order types or both. In these calculi, types are powerful but terms can't access this power, so I don't know what you get. Computationally, I don't think you get much more expressiveness than with simple types, but I may be mistaken. | {
"domain": "cstheory.stackexchange",
"id": 5517,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, complexity-classes, lambda-calculus, typed-lambda-calculus",
"url": null
} |
python, comparative-review, unit-conversion
# Selects the calculated equation for the selected conversion
temp_conversion = (select_equation[conversion_temp - 1])
What does temp_conversion mean? What does conversion_temp mean?
I recommend changing the terminology this way:
initial_temp → from_scale
conversion_temp → to_scale
temp → from_temp
temp_conversion → temp or result
The way converter() accepts its parameters is rather weird:
def converter(function):
# Assigned returned values variable names for readability.
initial_temp = function[0]
conversion_temp = function[1]
temp = function[2]
What function are you talking about? A more conventional way to write that would be
def converter(from_scale, to_scale, from_temp):
…
… which you can call using a "splat":
def main():
converter(*declare_var()) | {
"domain": "codereview.stackexchange",
"id": 17952,
"lm_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, comparative-review, unit-conversion",
"url": null
} |
quantum-mechanics, operators, hamiltonian-formalism, phase-space, deformation-quantization
Instead one often considers an algebra isomorphism between the algebra of operators $\hat{A},\hat{B},\ldots$ (using composition $\circ$) and an algebra
of symbols $A,B,\ldots $ (which are functions on phase space equipped with a corresponding star product $\star$).
The most common symbol is the Weyl/symmetric symbol, cf. e.g. this Phys.SE post. The corresponding star product $\star$ is the Groenewold-Moyal star product.
When a symbols $A$ is differential function, it makes mathematical sense to consider derivatives
$$ \frac{\partial A}{\partial q}, \quad \frac{\partial A}{\partial p}, \quad\text{etc},\tag{2} $$
cf. OP's question.
The Heisenberg EOM for an operators$^1$
$$ i\hbar\frac{d\hat{A}}{dt}~=~[\hat{A},\hat{H}]~\equiv~\hat{A}\circ\hat{H}-\hat{H}\circ\hat{A} \tag{3}$$
can then be transformed into an EOM for a symbol
$$ i\hbar\frac{dA}{dt}~=~[A\stackrel{\star}{,}H]~\equiv~A\star H-H\star A. \tag{4}$$
--
$^1$ We assume for simplicity no explicit time dependence. | {
"domain": "physics.stackexchange",
"id": 96652,
"lm_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, operators, hamiltonian-formalism, phase-space, deformation-quantization",
"url": null
} |
navigation, ekf, robot-localization
<rosparam param="process_noise_covariance">[0.05, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, | {
"domain": "robotics.stackexchange",
"id": 22182,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ekf, robot-localization",
"url": null
} |
continuous-signals, phase, delay
As you said, given a sine signal with time shift $t_1$, which is $x(t)=\sin(w(t-t_1))$, this becomes $x(t)=\sin(w t - wt_1)=\sin(wt+\phi)$ and $\phi=-wt_1$.
Now, if you encounter a signal $x(t)=\sin(\frac{\pi}{4} t - \frac{\pi}{4})$ you identify $w=\frac{\pi}{4}$ and $\phi=-\frac{\pi}{4}$. What remains is to solve $\phi=-w t_1$ for $t_1$ and you have it. | {
"domain": "dsp.stackexchange",
"id": 6471,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "continuous-signals, phase, delay",
"url": null
} |
quantum-field-theory, condensed-matter, second-quantization
Title: Kitaev Chain Spectrum (Unpaired Majorana Fermions in quantum wires) How does one arrive at the spectrum equation(13):
$$\epsilon (q)=\pm \sqrt{(2w \cos q +\mu)^2+4\cdot \mid {\Delta} \mid^2 \sin ^{2} q}$$
from the initial Hamiltonian.
Also, shouldn't (12) in the paper be a diagonal matrix as per the canonical Hamiltonian in (11) in terms of b' and b''?
The paper can be found here.
EDIT: The related Hamiltonian is:
$H_1 = \sum_{j} [-w(a_j^\dagger a_{j+1} + a_{j+1} ^\dagger a_j)-\mu(a_j^\dagger a_j - \frac{1}{2}) + \Delta a_j a_{j+1} + \Delta ^{*} a_{j+1}^\dagger a_j^\dagger]$
It is from the famous paper by Kitaev on unpaired Majorana Modes at the ends of a chain on the surface of a p-wave superconductor. | {
"domain": "physics.stackexchange",
"id": 31324,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, condensed-matter, second-quantization",
"url": null
} |
c, programming-challenge, sorting, linked-list, factors
Anyway, the customary name for a ListElem is ListNode, which though the same length avoids curious abbreviations.
"Do I cast the result of malloc?" No, we are writing C here.
Getting any resource, even memory, can fail. Handle it, don't ignore it.
Also, prefer sizeof expr over sizeof(TYPE), doing so couples size requested and the use of the memory, making errors less likely, whether at first writing or after re-factoring.
listAppend() is mis-named, it should be listPrepend(). I also wonder why it returns the new node, which the caller probably doesn't care about, and can easily and efficiently get anyways.
listPrint() has Undefined Behaviour for an empty list. findDeficients() for example can result in an empty list.
listSort() doesn't really have to re-order the nodes to sort the values. Not doing so allows for some simplification.
There is no reason to use the lists size to iterate over the whole list. That way, your code gets simpler and more efficient: | {
"domain": "codereview.stackexchange",
"id": 31873,
"lm_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, programming-challenge, sorting, linked-list, factors",
"url": null
} |
sql, mysql
Title: Selecting countries with different situations I'm trying to select two groups of countries with different situations.
SELECT cou.id,
cou.title
FROM continents con
RIGHT OUTER JOIN countries cou
ON con.id = cou.continents_id
WHERE con.deliver = 1
AND con.active = 1
UNION ALL
SELECT cou2.id,
cou2.title
FROM countries cou2
LEFT OUTER JOIN continents con2
ON con2.id = cou2.continents_id
WHERE cou2.deliver = 1
AND con2.deliver = 0
Continent has to be deliver = 1 and then select all countries inside it.
If Continent is deliver = 0 but there are countries with deliver = 1 inside, then select it. | {
"domain": "codereview.stackexchange",
"id": 8869,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sql, mysql",
"url": null
} |
operators, eigenvalue
Title: Inverse of a sum of two easy matrices Let $A$ be a symmetric positive semidefinite matrix and $I$ the identity matrix.
Given the linear equation
$$
y = A(A + \sigma^2I)^{-1} x
$$
Write $A$ in terms of its eigenvectors $|u_i\rangle$,
$$
A=\sum_{i=1}^n \lambda_i|u_i\rangle\langle u_i|
$$
and assume
$$
x = \sum_{i=1}^n \gamma_i |u_i\rangle
$$
How can one prove that
$$
y = \sum_{i=1}^n \frac{\gamma_i\lambda_i}{\lambda_i + \sigma^2}|u_i\rangle
$$
I have been trying to use the matrix inversion lemma, but I can't get the result. Is there something fundamental that I am missing?
Thanks First note that
\begin{align}
(A+\sigma^2 I) &= \sum_i \lambda_i |u_i\rangle \langle u_i| + \sigma^2\sum_i|u_i\rangle \langle u_i|\\
&=\sum_i (\lambda_i +\sigma^2)|u_i\rangle \langle u_i|
\end{align}
It's diagonal with respect to $|u_i\rangle$, so the inverse is simply,
\begin{align}
(A+\sigma^2 I)^{-1} &=\sum_i \frac{1}{(\lambda_i +\sigma^2)}|u_i\rangle \langle u_i|
\end{align} | {
"domain": "physics.stackexchange",
"id": 3706,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "operators, eigenvalue",
"url": null
} |
I will try to reach unto you a new way of thinking.
Suppose that all parts are given randomly a distinct number from $\{1,2,\cdots,25\}$.
What is the probability that e.g. part numbered $17$ is one with excessive shrinkage?
It is $\frac5{25}=\frac15=0.2$ and this also for parts with other numbers. Every number has the same probability on this and $5$ of the $25$ parts are "gifted".
In (a) and (b) you are somehow giving numbers too. However in (a) you stop this if after giving $2$ numbers (the first selected gets number $1$, the second gets number $2$...) and in (b) after giving $3$ numbers. Nothing stops you from going on with the numbering until you reach $25$.
You can also think of $25$ numbered parts. Then $5$ of the numbers are randomly chosen and get the stamp "with excessive shrinkage". What is the probability then number $17$ is among those $5$? Same answer.
Take care of it that you master this way of thinking. It will bring you great profit in the study of probabilities. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850852465429,
"lm_q1q2_score": 0.8275862323392177,
"lm_q2_score": 0.8418256412990657,
"openwebmath_perplexity": 498.42448686709963,
"openwebmath_score": 0.7420231103897095,
"tags": null,
"url": "https://math.stackexchange.com/questions/1879806/probability-for-second-sample-random-selection-without-replacement/1879852"
} |
evolution, biochemistry, mitochondria
Title: Is there any advantage of having mitochondria for aerobic respiration? If we consider the pathway of breakdown of glucose which includes glycolysis, the citric acid cycle and the electron transport chain, all these processes takes place in some prokaryotes and eukaryotes. In prokaryotes all these processes take place in cytoplasm while in eukaryotes the last two processes take place in mitochondria.
So is there any advantage of performing the last two processes in the mitochondria? Does it yield more energy? If there is no advantage, what is the point of having a mitochondria (at least for this process)? From the evolutionary point of view, the eukaryotes acquired these metabolisms (except glycolysis) from their prokaryotic endosymbionts. Not all prokaryotes have the ETC. The free living ancestor of mitohondria is supposed to be the alpha-proteobacterium. | {
"domain": "biology.stackexchange",
"id": 1338,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "evolution, biochemistry, mitochondria",
"url": null
} |
r… When we simplify our second derivative we get; This means that f(x) is concave downward up to x = 2 f(x) is concave upward from x = 2. If you're seeing this message, it means we're having trouble loading external resources on our website. Concavity may change anywhere the second derivative is zero. Definition by Derivatives. then y' = e^2x 2 -e^x. The second derivative of a function may also be used to determine the general shape of its graph on selected intervals. And a list of possible inflection points will be those points where the second derivative is zero or doesn't exist. Therefore possible inflection points occur at and .However, to have an inflection point we must check that the sign of the second derivative is different on each side of the point. For there to be a point of inflection at (x 0, y 0), the function has to change concavity from concave up to concave … exists but f ”(0) does not exist. When we simplify our second derivative we get; 6x = 12. x = 2. We observed | {
"domain": "luxmicro.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517469248845,
"lm_q1q2_score": 0.8171461309877754,
"lm_q2_score": 0.8354835350552604,
"openwebmath_perplexity": 413.2545491078615,
"openwebmath_score": 0.5936368107795715,
"tags": null,
"url": "https://magazine-redux.luxmicro.net/19eyvwe7/5m3zqv.php?59a9b3=point-of-inflection-second-derivative"
} |
c++, multithreading, parsing
You should decouple the size of the chunk from the number of cores. For example, if you have 8 cores and 16 chunks, you start 8 threads and have each thread process 2 chunks.
Is it worth to extract one line of obvious code only with a sole purpose to name it?
If it becomes even more obvious afterwards, yes.
Of course, I am aware of Amdahl's law, but do you really think it should be a showstopper for parallel algorithms? Even if on N cores I could achieve N/2 speed up, doesn’t it worth doing on today’s CPU and GPU? | {
"domain": "codereview.stackexchange",
"id": 45443,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, multithreading, parsing",
"url": null
} |
acid-base
So my question is, how does one define degree of dissociation for polyprotic acids? I think this resembles the question Confused about strong/weak dibasic and tribasic acids?
Saying that the degree of dissociation $(\alpha)$ of citric acid is greater because its triprotic is not correct. The degree of dissociation should be calculated for each dissociation separately. The degree of dissociation of citric acid's first dissociation $\ce{C6H8O7 <=> C6H7O7- + H+}$ is greater than that of acetic acid, because its $\mathrm{p}K_\mathrm{a}$ is smaller (3.13 vs 4.76)$^1$, meaning it's a stronger acid.
The second value of $\alpha$ for citric acid, however, will be very to close to acetic acid's, because the second dissociation has approximately the same $\mathrm{p}K_\mathrm{a}$ (4.76)$^1$. The third $\alpha$ will be smaller, since the $\mathrm{p}K_\mathrm{a}$ of the third dissociation is greater (6.40)$^1$. | {
"domain": "chemistry.stackexchange",
"id": 3106,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base",
"url": null
} |
swift, serialization
The code, start to finish:
import Foundation
extension UInt16 {
init?(bytes: [UInt8]) {
if bytes.count != 2 {
return nil
}
var value: UInt16 = 0
for byte in bytes.reverse() {
value = value << 8
value = value | UInt16(byte)
}
self = value
}
}
extension UInt32 {
init?(bytes: [UInt8]) {
if bytes.count != 4 {
return nil
}
var value: UInt32 = 0
for byte in bytes.reverse() {
value = value << 8
value = value | UInt32(byte)
}
self = value
}
}
let bytes: [UInt8] = [0x4e, 0x5b, 0xa2, 0x56, 0x12, 0x19, 0x00, 0x00, 0x22, 0x00, 0x12,0x19, 0x07, 0x00]
let data = NSData(bytes: bytes, length: bytes.count)
class Information {
let startTime: UInt32
let duration: UInt32
let temperature: UInt16
let estimatedDistance: UInt16
let knockCount: UInt8
let reserved: UInt8 | {
"domain": "codereview.stackexchange",
"id": 18093,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "swift, serialization",
"url": null
} |
# How would you integrate $\int x\cos(x)\sin(2nx)\,dx$?
How would you integrate $$\int x\cos(x)\sin(2nx)\,dx?$$ I have no idea how to integrate this. take one of the trig functions away and I could do integration by parts. I would really appreciate the help!
• Use the formula $2\cos A \sin B =\sin (A+B)-\sin(A-B)$ – Samrat Mukhopadhyay Nov 6 '14 at 17:22
The first thing I would do is use the product-to-sum identity $$\sin \alpha \cos \beta = \frac{1}{2} (\sin (\alpha+\beta) + \sin(\alpha-\beta)).$$
• Oh okay. So for my problem I could rewrite it as $\displaystyle\frac{1}{2}x\sin(x(2n+1)) + \displaystyle\frac{1}{2}x\sin(x(2n-1))$? – Nick Freeman Nov 6 '14 at 17:35
• That is correct. Now you may integrate each term by whatever method you see fit. – heropup Nov 6 '14 at 17:48
Integrating by parts,
$\displaystyle\int x\cos(x)\sin(2nx)dx$
$$=x\displaystyle\int\cos(x)\sin(2nx)dx-\int\left(\frac{dx}{dx}\int\cos(x)\sin(2nx)dx\right)dx$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018390836985,
"lm_q1q2_score": 0.8189101154820593,
"lm_q2_score": 0.8397339736884712,
"openwebmath_perplexity": 178.80295065949278,
"openwebmath_score": 0.9713692665100098,
"tags": null,
"url": "https://math.stackexchange.com/questions/1009266/how-would-you-integrate-int-x-cosx-sin2nx-dx"
} |
-
Thanks, this argument is very nice! I guess it is not very hard to find a space with non trivial Bockstein, e.g.$M=RP^2$, we have $H^i(M,Z/2)=H^i(M,Z/4)=Z/2$for i=1,2, and if I look at the reduced cohomology long exact sequence $H^0(M,pt,Z/2)=H^0(M,pt,z/4)=0$. Then the Bockstein from $H^2$to $H^1$will not be trivial, otherwise we will have $0\to Z/2\to Z/2\to Z/2\to 0$ contradiction. Although I used the reduced cohomology, since I only use maps to K(z/2,2) and K(Z/2,1) to represent $H^1$ and $H^2$ I am fine. From this example, we get a non null-homotopic map from $CP^{\infty}$ to $RP^\infty$! – Ying Zhang Apr 4 '10 at 4:05 | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.966410494349896,
"lm_q1q2_score": 0.8343907126123139,
"lm_q2_score": 0.8633916099737806,
"openwebmath_perplexity": 261.29563138243856,
"openwebmath_score": 0.9473708271980286,
"tags": null,
"url": "http://mathoverflow.net/questions/20275/maps-inducing-zero-on-homotopy-groups-but-are-not-null-homotopic"
} |
# How to find a standard deviation determined by a Normal distribution probability?
The question is
A liquid drug is marketed in phials containing a nominal 1.5ml but the amounts can vary slightly. The volume in each phial may be modeled by a normal distribution with the mean 1.55ml and standard deviation $$\sigma$$ ml. The phials are sold in packs of 5 randomly chosen phials . It is required that in less than 0.5% of the packs will the total volume of the drug be less than 7.5ml. Find the greatest possible value of $$\sigma$$.
I need to find the greatest possible value of the standard deviation ($$\sigma$$). I worked out the following:
$$\mu= 1.55*5 = 7.75.$$
We are asked to find value of $$\sigma$$ such that probability of (total volume of $$5$$ packs $$\lt 7.5)\lt0.5\%$$
$$P(X\lt7.5)\lt0.005.$$
After standardizing, $$P(X\le\frac{7.5-7.75}{\sigma/5})<0.005$$ and I found $$\sigma=0.2170.$$ However, the answer provided is $$0.0434.$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668690081643,
"lm_q1q2_score": 0.8576156112242174,
"lm_q2_score": 0.874077222043951,
"openwebmath_perplexity": 747.9623359942079,
"openwebmath_score": 0.9138047099113464,
"tags": null,
"url": "https://stats.stackexchange.com/questions/218019/how-to-find-a-standard-deviation-determined-by-a-normal-distribution-probability"
} |
ros2
Title: Index_pos meaning in rosbag
Hy,
Can someone please explain purpose of index_pos field in bag header record. Description of it is: offset of first record after the chunk section.
When i use audio_capture packages to record mp3 sound, index_pos is pointing to connection record. Shouldn't it be pointing to Index data record, becouse chunk record consist of message records and connection records? Why 2 Connection redords exist?
Bag header record |
Chunk record |
Connection record |
Msg records |
Index data record |
Connection record <----- index_pos |
Chunk info record | | {
"domain": "robotics.stackexchange",
"id": 32057,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
java
Title: Generic wrapper with variable number of arguments I had to write a generic wrapper that enables me to pass variable number of arguments for execution of some methods and repeat it up to a few times when it fails because of network connection problems.
What I came up is this class and a helper method. Well I can't say it's perfect - it is sufficient for my need, but is there anything that I could have done better ?
The main idea is behind command class
public abstract class Command<R, A1, A2, A3> {
protected final SomeService someService;
private Bundle<A1, A2, A3> bundle;
public Command(SomeService someService) {
this.someService = someService;
}
public void setBundle(Bundle<A1, A2, A3> bundle) {
this.bundle = bundle;
}
public Bundle<A1, A2, A3> getBundle() {
return bundle;
}
public abstract R execute(Bundle<A1, A2, A3> bundle) throws Exception;
} | {
"domain": "codereview.stackexchange",
"id": 15104,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
Where we used the substitution $u = \frac{2x+1}{\sqrt{3}}$.
Hint:
There's no need to split the integral that way (IMO), we can instead write, \begin{align} \int \frac{3x+2}{x^2+x+1}\,\mathrm dx&=\frac{3}{2}\int\frac{2x+\tfrac{4}{3}}{x^2+x+1}\,\mathrm dx\\ &=\frac32\int\dfrac{2x+1+\tfrac13}{x^2+x+1}\,\mathrm dx\\ &=\dfrac32\left(\int\dfrac{2x+1}{x^2+x+1}\,\mathrm dx+\int\dfrac{{\small 1/3}}{x^2+x+1}\,\mathrm dx\right). \end{align} The first one is obvious. For the second one we should complete the square in the denominator, like this, $$\int\dfrac{1}{x^2+x+1}\,\mathrm dx=\int\dfrac{1}{\color{royalblue}{x^2+x+\tfrac14}+1-\tfrac14}\,\mathrm dx=\int\dfrac1{\color{royalblue}{\left(x+\tfrac1{2}\right)^2}+\tfrac34}\,\mathrm dx.$$ Now try to proceed further by rewriting that last expression so as to exploit the fact that the integral of $\frac{u'(x)}{u(x)^2+1}$ is $\arctan u(x)+\rm C$, you may have to factor something, and do one or more substitutions.
Let $3x+2=A\dfrac{d(x^2+x+1)}{dx}+B$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936096877063,
"lm_q1q2_score": 0.8550068851064676,
"lm_q2_score": 0.8688267830311354,
"openwebmath_perplexity": 284.37319270552496,
"openwebmath_score": 0.9540920853614807,
"tags": null,
"url": "https://math.stackexchange.com/questions/1638942/how-can-i-solve-int-frac3x2x2x1dx"
} |
algorithm, c, mathematics
Here CGL_float, CGL_int, etc are just standard C types renamed with typedefs.
aabb_min is the min point of the n-dim box (it's an array of n elements)
Similar for aabb_max. aabb_min_out and aabb_max_out are pre-allocated float arrays of size (2ⁿ * n) to store the result aabb min and max values for all the resulting aabb.
I tested this using:
CGL_float test_for_n_dim(CGL_int n)
{
CGL_float* aabb_minn = (CGL_float*)malloc(sizeof(CGL_float) * n); if (!aabb_minn) return;
CGL_float* aabb_maxn = (CGL_float*)malloc(sizeof(CGL_float) * n); if (!aabb_maxn) return;
for (CGL_int i = 0; i < n; i++) { aabb_minn[i] = 0; aabb_maxn[i] = 1; }
CGL_float* aabb_out_minn = (CGL_float*)malloc(sizeof(CGL_float) * n * (1 << n)); if (!aabb_out_minn) return;
CGL_float* aabb_out_maxn = (CGL_float*)malloc(sizeof(CGL_float) * n * (1 << n)); if (!aabb_out_maxn) return;
CGL_float time_before = CGL_utils_get_time(); | {
"domain": "codereview.stackexchange",
"id": 44656,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, c, mathematics",
"url": null
} |
mathematical-physics
By taking a small sphere centered at the point of radius $r$, I was able to show that the difference between $\psi$ at a point and the average value of $\psi$ at neighboring points equals $-\frac{1}{6}r^2\nabla ^2\psi$. But I have not been able to get the expression given in the book. Thanks. | {
"domain": "physics.stackexchange",
"id": 965,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mathematical-physics",
"url": null
} |
organic-chemistry, nmr-spectroscopy
Title: Distinguishing pentanol isomers in 13C DEPT NMR spectroscopy Pentanol has eight isomers as shown below. The circles represent carbon atoms that I think are equivalent.
Below there are eight DEPT-spectra that should represent these eight substances.
As you can see some won’t line up. What’s the problem? In an ideal non-moving world at $0\,\mathrm{K}$, every atom would give exactly one peak in NMR spectra. So the actual question is why some of these spectra have less signals. Partly this is due to local symmetry. If, e.g., two methyl groups are attached to the same carbon atom, these two are said to be chemically equivalent, i.e. one can rotate bonds to overlap one over the other. A different example of chemical equivalence is pentan-3-ol which you can rotate around the $\ce{C-OH}$ axis to give an almost identical molecule, putting the $\ce{CH2}$ groups on top of each other and the methyl groups, too.
With that, you did the circling right, and we should expect: | {
"domain": "chemistry.stackexchange",
"id": 9806,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nmr-spectroscopy",
"url": null
} |
ros, opencv, pcl, pcl-1.7, linking
################################################
## Declare ROS messages, services and actions ##
################################################ | {
"domain": "robotics.stackexchange",
"id": 24501,
"lm_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, opencv, pcl, pcl-1.7, linking",
"url": null
} |
python, data-visualization, genetic-algorithm
Use dictionaries instead of tuples:
def create_member(genes):
return {'sum': sum(genes), 'genes': genes}
Use generators instead of list-expressions:
def mutate_pool(pool, rate=1):
for member in pool:
yield mutate_member(member, rate)
Yay, lazy lists! (kind of...)
Write code for the next person which will be reading it. You shouldn't put comments only where you had some trouble ("[::2] selects one gene out of two") but try to make any function easy to understand and modify in isolation.
Prefer longer functions and document them using docstrings. A nice function name is usually not enough for documentation:
def mutate_genes(genes, rate):
"""
Given a list of genes, flip some of them according to rate.
"""
for gene in genes:
yield 1 - gene if random.random() <= rate else gene | {
"domain": "codereview.stackexchange",
"id": 5997,
"lm_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, data-visualization, genetic-algorithm",
"url": null
} |
... and if $m \ne 1$ the (3) becomes...
$\displaystyle \frac{v^{\ '}}{1-m} + a\ v = -b$ (5)
... which is linear...
Kind regards
$\chi$ $\sigma$
You might want to check step (4).
#### Jester
##### Well-known member
MHB Math Helper
To the OP - Are A, B and C constant.
#### crevoise
##### New member
Yes, A, B and C are constant for the moment.
#### Jester
##### Well-known member
MHB Math Helper
Then your ODE is separable. A much different animal if $A, B$ and $C$ are functions of $x$.
#### chisigma
##### Well-known member
Let write the DE as...
$\displaystyle \frac{y^{\ '}+c}{y^{m}} + \frac{a}{y^{m-1}}=-b$ (1)
First we set...
$\displaystyle u=y+c\ x \implies u^{\ '}= y^{\ '} + c\ ,\ y^{m}= (u-c\ x)^{m}$ (2)
... so that (1) becomes...
$\displaystyle \frac{u^{\ '}} {(u-c\ x)^{m}} + \frac{a} {(u-c\ x)^{m-1}}= -b$ (3)
Proceeding in correct way from (3) now we set...
$\displaystyle v=\frac{1}{(u-cx)^{m-1}} \implies v^{\ '}= \frac{1-m}{(u-c\ x)^{m}}\ (u^{\ '}-c)$ (4) | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806501150427,
"lm_q1q2_score": 0.8354084268924966,
"lm_q2_score": 0.8519527963298946,
"openwebmath_perplexity": 3496.0858300658547,
"openwebmath_score": 0.9135581254959106,
"tags": null,
"url": "https://mathhelpboards.com/threads/bernoulli-riccati-equation.1421/"
} |
Two of the squareroots of A are given by Y1 and Y2:
${Y}_{1}=\left[\begin{array}{cc}1.5667& 1.7408\\ 2.6112& 4.1779\end{array}\right]$
${Y}_{2}=\left[\begin{array}{cc}1& 2\\ 3& 4\end{array}\right]$
Confirm that Y1 and Y2 are squareroots of matrix A.
A = [7 10; 15 22];
Y1 = [1.5667 1.7408; 2.6112 4.1779];
A - Y1*Y1
ans = 2×2
10-3 ×
-0.1258 -0.1997
-0.2995 -0.4254
Y2 = [1 2; 3 4];
A - Y2*Y2
ans = 2×2
0 0
0 0
The other two squareroots of A are -Y1 and -Y2. All four of these roots can be obtained from the eigenvalues and eigenvectors of A. If [V,D] = eig(A), then the squareroots have the general form Y = V*S/V, where D = S*S and S has four choices of sign to produce four different values of Y:
$S=\left[\begin{array}{cc}±0.3723& 0\\ 0& ±5.3723\end{array}\right]$
Calculate the squareroot of A with sqrtm. The sqrtm function chooses the positive square roots and produces Y1, even though Y2 seems to be a more natural result.
Y = sqrtm(A)
Y = 2×2 | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9859363750229257,
"lm_q1q2_score": 0.8340454143740199,
"lm_q2_score": 0.8459424314825853,
"openwebmath_perplexity": 1528.9608608468798,
"openwebmath_score": 0.7659097909927368,
"tags": null,
"url": "https://la.mathworks.com/help/matlab/ref/sqrtm.html"
} |
While your question could have multiple answers, perhaps the closest to what you are looking for is the notion of a non-metrizable vector space.
In the general setting of topological vector spaces, we consider (as one might guess from the name) vector spaces endowed with a topology so that we can discuss ideas like the continuity of linear operators. Normed vector spaces are examples of topological vector spaces where the topology is induced by a given norm.
A non-metrizable vector space is a topological vector space whose topology does not arise from any metric. These are rather common in functional analysis. For example, if $X$ is a Banach space, then the weak-* topology on $X^*$ is never metrizable unless $X$ is finite-dimensional. Another family of examples are locally convex spaces, a natural generalization of Banach spaces, which are not metrizable unless their topology is generated by a countable collection of seminorms that separate points. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773707993078212,
"lm_q1q2_score": 0.8080039690544811,
"lm_q2_score": 0.8267117962054048,
"openwebmath_perplexity": 285.659994866592,
"openwebmath_score": 0.8974916934967041,
"tags": null,
"url": "https://math.stackexchange.com/questions/1075222/is-there-such-thing-as-an-unnormed-vector-space"
} |
rviz, ros-kinetic
[ERROR] [1549745353.013344071, 94.949000000]: Could not load model 'package://evarobot_description/meshes/base_orange.stl' for link 'basecolor_link': OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource package://evarobot_description/meshes/base_orange.stl in resource group Autodetect or any other group. in ResourceGroupManager::openResource at /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreResourceGroupManager.cpp (line 756)
[rospack] Error: package 'evarobot_description' not found
[librospack]: error while executing command
[ERROR] [1549745353.033654420, 94.964000000]: Could not load resource [package://evarobot_description/meshes/xtion_pro_camera.dae]: Unable to open file "package://evarobot_description/meshes/xtion_pro_camera.dae". | {
"domain": "robotics.stackexchange",
"id": 32441,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rviz, ros-kinetic",
"url": null
} |
elasticity, continuum-mechanics, soft-matter
Title: Helfrich energy derivation The Helfrich elastic energy of membranes is given by
$F = \int dS (\kappa H^2 + \kappa_G K)$ | {
"domain": "physics.stackexchange",
"id": 52287,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "elasticity, continuum-mechanics, soft-matter",
"url": null
} |
fft, frequency-response, frequency-domain
For example: Once you have a target, you can simply start truncating and calculate the relative error of the truncation as
$$E(L) = \frac{(\sum_{k=0}^{L}h[k]x[M-k])^2}{\sum y^2[n]}$$
and determine the required impulse response length, $L$ by setting a threshold for the error.
The most suitable error criteria depends on what you want to with the impulse response. You can also evaluate the truncation error over a certain frequency band or with a specific frequency weighting, etc.
Please note that it's important to choose a suitable excitation spectrum. Assuming that the noise $N[k]$ is additive after the system, we can write the transfer function as
$$\hat{H}[k] = \frac{Y[k]+N[k]}{X[k]} = \frac{Y[k]}{X[k]} + \frac{N[k]}{X[k]} = H[k] + \frac{N[k]}{X[k]} $$
So the error to the transfer function is the noise weighted with the inverse of the input spectrum. That can be a big problem if the input signal is bandlimited or has a very different spectral shape than the noise. | {
"domain": "dsp.stackexchange",
"id": 11752,
"lm_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, frequency-response, frequency-domain",
"url": null
} |
human-biology
One thing I am still curious about is at what stage of growth the pattern is formed and why a unique pattern is created in the fingerprint of each person (including identical twins). I assume it has something to do with the mechanism by which the patterns form, but I couldn't find any detailed research into this. Any insight would be very welcome. I would say genetic diversity is the primary reason which results in other reasons that you are looking for. At the lowest level, random crossing over at prophase I, random separation of homologous chromosomes at anaphase I, random separation of sister chromatids at anaphase II, and random fertilization: one sperm fertilizes one egg randomly.
The skin is developed from ectoderm so need to look at the formation of embryonic disc and specifically to the genesis of germ layers: ectoderm. | {
"domain": "biology.stackexchange",
"id": 468,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology",
"url": null
} |
c#, .net, reinventing-the-wheel
public T Item1 { get; set; }
public V Item2 { get; set; }
#endregion Public Properties
#region Public Constructors
public Tuple(T item1, V item2)
{
Item1 = item1;
Item2 = item2;
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Determines whether the specified <see cref="System.Object" />, is equal to this instance.
/// </summary>
/// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj)
{
var objAsTuple = obj as Tuple<T, V>;
return objAsTuple != null && IsEqualTo(objAsTuple.Item1, Item1) && IsEqualTo(objAsTuple.Item2, Item2);
} | {
"domain": "codereview.stackexchange",
"id": 14156,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, .net, reinventing-the-wheel",
"url": null
} |
homework-and-exercises, classical-mechanics, lagrangian-formalism, geometry
Title: For a disk within a ring, why is arclength proportional to $R*\theta$ but not $a*\phi$? Here is an example problem, why is $\phi$ not by itself in the constraint equation? Can someone explain this geometrically? It seems like the curve of the surface curves away from the disk, but that seems hand-wavy and incorrect. Because the surface that the sphere is on isn't flat. If it were flat, the distance would just be $a\phi$.
Think of it this way: Imagine a marking on the edge of the sphere that is originally facing upwards. On a flat track, after having rolled one round, $2\pi a$, the marking will still be pointing up. This is also true for a curved track. However, notice that it will no longer point toward the center of the curved track, which we will call the radial direction. In other words, the "upwards" direction no longer coincides with the radial direction, but is instead offset by an angle $\theta$. | {
"domain": "physics.stackexchange",
"id": 80962,
"lm_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, classical-mechanics, lagrangian-formalism, geometry",
"url": null
} |
java, beginner, hangman
System.out.println(" | | |");
System.out.println(" | | 0");
System.out.println(" | | /|\\");
System.out.println(" | | |");
System.out.println(" | | ");
System.out.println(" | |");
System.out.println(" | |");
System.out.println(" ___________");
break;
case (0):
System.out.println(" ______________"); | {
"domain": "codereview.stackexchange",
"id": 26791,
"lm_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, hangman",
"url": null
} |
electrical-engineering, control-engineering, process-engineering, machine-design
Title: What type of electrical machine component for counting time? I am looking for the proper piece of hardware to do what I'm looking for on my current prototype machine build.
I want a timer to begin counting upwards in seconds when a switch is activated, and reset back to zero when the switch is deactivated.
I know I can probably make some kind of Arduino based set up for this, and I know for a fact how to do this with a PLC/HMI, but I am having a hard time finding a cost effective, easily solution for this as its only a prototype at this stage. Everything I search keeps pointing me towards what looks like timer relays, but I'm not sure if that's what I need. I don't need to throw any outputs at any set points, basically just a cycle time readout for the operator.
EDIT: I suppose I could also use a 1 second pulse generator wired to the input on a basic counter, but lets see if we can find the right stuff.. | {
"domain": "engineering.stackexchange",
"id": 4107,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrical-engineering, control-engineering, process-engineering, machine-design",
"url": null
} |
homework-and-exercises, classical-mechanics, kinematics
We got: $2yv_y=-4av_x$
Rewriting $v_y=-\dfrac{2av_x}{y} \tag{1}$
Also we got : $v_x^2+v_y^2=v^2 \tag{2}$
Subsitute value of $v_y$ in eqn 2.
$v_x^2+{(-\dfrac{2av_x}{y})}^2=v^2$
Solving gives $v_x=\pm \dfrac{vy}{4a^2+1},$
Substitute this value of $v_x$ in eqn 2 gives:
$v_y=\mp\dfrac{2av}{\sqrt{4a^2+1}}$
We know $v_x$ and $v_y$. velocity is as we know $\vec v=v_x {\hat i}+v_y\hat j$ and can be found now. It should be clear that $\vec v$ depends upon the $y$ co-ordinate. | {
"domain": "physics.stackexchange",
"id": 12089,
"lm_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, classical-mechanics, kinematics",
"url": null
} |
c#, datetime, interview-questions
For the logic you don't need to do a loop.
var numberOfDaystoStart = 0;
if (startOfTask.DayOfWeek == DayOfWeek.Saturday)
{
numberOfDaystoStart = 2;
}
else if (startOfTask.DayOfWeek == DayOfWeek.Sunday)
{
numberOfDaystoStart = 1;
}
else if (startOfTask.TimeOfDay > endTime)
{
// Start time after the end of the work day need to move to the next day
numberOfDaystoStart = 1;
}
var startOffset = TimeSpan.Zero;
if (numberOfDaystoStart > 0 || startOfTask.TimeOfDay < startTime)
{
// IF started on weekend or after work hours adjust for first work day and start of working hours
var startOfTaskDate = startOfTask.AddDays(numberOfDaystoStart);
startOffset =
new DateTime(startOfTaskDate.Year, startOfTaskDate.Month, startOfTaskDate.Day,
startTime.Hours, startTime.Minutes, startTime.Seconds, startTime.Milliseconds) - startOfTask;
}
var workingtime = endTime.Subtract(startTime);
var nonWorkingTime = TimeSpan.FromDays(1) - workingtime; | {
"domain": "codereview.stackexchange",
"id": 23458,
"lm_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#, datetime, interview-questions",
"url": null
} |
ros, driver, ros-melodic
[ INFO] [1622623635.196384182]: IK Using joint link_1 -3.14159 3.14159
[ INFO] [1622623635.196401766]: IK Using joint link_2 -2.18166 2.18166
[ INFO] [1622623635.196411470]: IK Using joint link_3 -2.40855 2.40855
[ INFO] [1622623635.196418858]: IK Using joint link_4 -4.71239 4.71239
[ INFO] [1622623635.196427415]: IK Using joint link_5 -2.0944 2.33001
[ INFO] [1622623635.196435571]: IK Using joint link_6 -4.71239 4.71239
[ INFO] [1622623635.196482942]: Looking in common namespaces for param name: arm/position_only_ik
[ INFO] [1622623635.197170328]: Looking in common namespaces for param name: arm/solve_type
[ INFO] [1622623635.197803875]: Using solve type Speed
[ INFO] [1622623635.228551897]: Publishing maintained planning scene on 'monitored_planning_scene'
[ INFO] [1622623635.229847210]: MoveGroup debug mode is OFF
Starting planning scene monitors... | {
"domain": "robotics.stackexchange",
"id": 36479,
"lm_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, driver, ros-melodic",
"url": null
} |
general-relativity, lagrangian-formalism, field-theory, covariance, variational-calculus
from which the equations of motion are immediately $\mathrm{d}F=0$
and $\mathrm{d}\star F=-e^2\star\,j$, assuming $\delta A$ has no support on $\partial\mathcal{M}$.
Does there exist a similar completely covariant and coordinate-independent derivation of the Einstein field equations from the Einstein-Hilbert action? First of all, it is a bit unclear what do you want exactly. As in: | {
"domain": "physics.stackexchange",
"id": 53100,
"lm_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, lagrangian-formalism, field-theory, covariance, variational-calculus",
"url": null
} |
temperature, astrophysics, thermal-radiation, atmospheric-science, stars
Title: Effect of Sun temperature on the thermosphere Correct me if I’m wrong here.
The thermosphere is hot due to its absorption of moderately high energy UV radiation. (<200nm)
Cooler stars emit fewer high energy photons. So if the Earth orbited an orange dwarf, the earth would receive less moderately high energy UV radiation, causing the thermosphere to be much colder.
Additionally this would potentially allow helium to stay in the atmosphere for longer before escaping.
Is this correct? The UV radiation that heats the thermosphere is actually not that highly energetic. Molecular oxygen is dissociated by UV radiation of 240nm already, which is only half the wavelength of blue light. Molecular nitrogen requires radiation of about 127nm which is about twice as energetic but you still could not call this high-energy UV radiation as it is not even able to ionize any elements, merely dissociate them. | {
"domain": "physics.stackexchange",
"id": 96116,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "temperature, astrophysics, thermal-radiation, atmospheric-science, stars",
"url": null
} |
waves, velocity
In order to do this, there must be a well defined oscillation to draw the envelope around. That means that our wave must be made up of individual frequencies that are close to one central frequency. To make things convenient, let's write that schematically as
$$\text{wave} = \sum_{k'} \sin(k'x - \omega(k') t) \text{ for a bunch of } k' \approx k$$
However, if we just have one frequency, the wave is just an infinite sinusoid $\sin(kx)$. This doesn't have an envelope, strictly speaking, because it just goes on forever at the same amplitude. We must have waves of other frequencies, which will constructively and destructively interfere with each other, to actually get an envelope.
So we've concluded that the envelope is defined by where a bunch of sinusoids making up our wave constructively or destructively interfere. Their phases are, as a function of space and time,
$$\phi(k') = k'x - \omega(k') t$$ | {
"domain": "physics.stackexchange",
"id": 91608,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, velocity",
"url": null
} |
Edit:
Since comments are not permanent, I just want to edit in the link from Ethan Bolker's comment, to an excellent answer with a similar viewpoint to this one in reply to a similar (in spirit) question about "what actually is a polynomial?" The second paragraph in particular really captures what I wanted to say in my answer, (paraphrasing Ethan's answer) what really matters isn't what something actually is, but rather how it behaves. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018419665618,
"lm_q1q2_score": 0.8062108622714075,
"lm_q2_score": 0.8267117919359419,
"openwebmath_perplexity": 269.48593233507637,
"openwebmath_score": 0.8399896621704102,
"tags": null,
"url": "https://math.stackexchange.com/questions/3599410/what-exactly-is-an-arrow-in-a-category/3599637"
} |
c++, object-oriented
We are required to create a class with both private and public member functions.
You don't have any private methods yet. Just food for thought, in regard to the Separation of Concerns, you could actually structure your API like this:
class inventory {
private:
// Actually stores the product
void storeUnchecked(product p);
...
public:
// Validates that the product fulfills the requirements
// If yes, passes down to storeUnchecked()
bool store(product p);
...
}
Since adding a product can obviously fail if validation fails, you want to account for that by allowing your API to signal the success or failure back to the calling location. | {
"domain": "codereview.stackexchange",
"id": 22123,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented",
"url": null
} |
electromagnetism, magnetic-fields, plasma-physics, gas
Now we see that if we want to deform the orbit so that the binding energies of an electron in the atom $\sim 10 eV$ are shifted to zeros and the electrons are freed, we need a magnetic field of order $10^6 T$. This is an immense magnetic field. To my knowledge, such a field can be produced only on extreme astrophysical objects such as white dwarfs, neutron stars, or near accreting black holes. Certainly not your terrestrial laboratory, where we are typically able to produce fields up to tens of tesla (tokamaks, particle accelerators). | {
"domain": "physics.stackexchange",
"id": 39273,
"lm_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, magnetic-fields, plasma-physics, gas",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.