text stringlengths 1 1.11k | source dict |
|---|---|
ros, package, ros-kinetic
Title: How to install diagnostic-updater?
By mistake I un-installed diagnostic-updater via PyCharm and I am confused how to install same ?
Originally posted by nalin1997 on ROS Answers with karma: 11 on 2018-01-21
Post score: 0
Did you try
sudo apt-get install ros-kinetic-diagnostic-updater
?
Originally posted by jayess with karma: 6155 on 2018-01-21
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 29811,
"lm_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, package, ros-kinetic",
"url": null
} |
mass, neutrinos
It turns out, though, that for neutrinos, the flavor eigenstates are not, in fact, mass eigenstates. A flavor eigenstate is a superposition of mass eigenstates, and vice-versa. This means that the flavors of neutrinos don't actually have individual, well-defined masses. There simply are "three neutrino flavors" and "three neutrino masses", but we can't assign a one-to-one correspondence between them. | {
"domain": "physics.stackexchange",
"id": 54052,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mass, neutrinos",
"url": null
} |
other player makes an attempt to write a specification. Play this game with the following functions, whose spec is suggested by their names. Alternate which player goes first. - num_vowels : string -> int - is_sorted : 'a list -> bool - sort : 'a list -> 'a list - max : 'a list -> 'a - is_prime : int -> bool □ ## Specifying a data abstraction Let's create a *data abstraction* (a module that represents some kind of data) for single-variable integer polynomials of the form \$c_n x^n + \ldots + c_1 x + c_0.\$ Let's assume that the polynomials are *dense*, meaning that they contain very few coefficients that are zero. Here is an incomplete interface for polynomials: (* [Poly] represents immutable polynomials with integer coefficients. *) module type Poly = sig (* [t] is the type of polynomials *) type t (* [eval x p] is [p] evaluated at [x]. For example, if [p] represents * $3x^3 + x^2 + x$, then evaluating [p] at [10] would yield [3110]. *) val eval : int -> t -> int end (The use | {
"domain": "cornell.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9449947163538935,
"lm_q1q2_score": 0.8292109233517617,
"lm_q2_score": 0.8774767826757122,
"openwebmath_perplexity": 1515.4455203694918,
"openwebmath_score": 0.29014790058135986,
"tags": null,
"url": "http://www.cs.cornell.edu/courses/cs3110/2016fa/l/11-specs/rec.html"
} |
ros, transform, ros-kinetic, tf2
/opt/ros/kinetic/include/tf2_ros/buffer_interface.h:168:8: note: candidate: template<class A, class B> B& tf2_ros::BufferInterface::transform(const A&, B&, const string&, ros::Duration) const
B& transform(const A& in, B& out,
^
/opt/ros/kinetic/include/tf2_ros/buffer_interface.h:168:8: note: template argument deduction/substitution failed:
/home/gavin/catkin_ws/src/robot_setup_tf/src/tf_listener.cpp:20:60: note: cannot convert ‘base_point’ (type ‘geometry_msgs::PointStamped {aka geometry_msgs::PointStamped_<std::allocator<void> >}’) to type ‘const string& {aka const std::__cxx11::basic_string<char>&}’
tfBuffer.transform("base_link", laser_point, base_point);
^
In file included from /opt/ros/kinetic/include/tf2_ros/buffer.h:35:0,
from /opt/ros/kinetic/include/tf2_ros/transform_listener.h:40,
from /home/gavin/catkin_ws/src/robot_setup_tf/src/tf_listener.cpp:3: | {
"domain": "robotics.stackexchange",
"id": 31623,
"lm_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, transform, ros-kinetic, tf2",
"url": null
} |
bond, molecular-structure
I suspect that the textbook uses this representation because it connects readily to earlier discussions of integer hybridization, i.e. "$sp$" orbitals are familiar and easy to visualize. And presumably the concept of a 3c/4e bond has also been previously introduced. Making a composite of familiar concepts is perhaps easier than introducing the idea of delocalized molecular orbitals, but in this case they are simple enough that it's worth going through them to show that the result is the same. | {
"domain": "chemistry.stackexchange",
"id": 11316,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bond, molecular-structure",
"url": null
} |
homework-and-exercises
(a)√(1+2Vο/E)
(b)√(1+Vο/E)
(c)1+Vο/E
(d)1+2Vο/E
I am using snell's law
nsinθ=n'sinθ'
sinθ/sinθ'=v/v'
but it gives wrong answer. The error is in the formulation of Snell's law for massive particles.
Due to conservation of momentum parallel to the interface, we obtain Snell's law which states that:
$$p\sin\theta = p'\sin\theta',$$
where p is the momentum of the particle. This can be rewritten as:
$$\frac{\sin\theta}{\sin\theta'}=\frac{p'}{p} $$
For massless particles, the group velocity is given by $v=\frac{dE}{dp}=\frac{E}{p}$. The velocity is thus inversely proportional to the momentum (for a fixed energy). This leads to the well known forulation of Snell's law for massless particles:
$$\frac{\sin\theta}{\sin\theta'}=\frac{p'}{p}=\frac{v}{v'} $$
For massive particles on the other hand, the group velocity is $v=\frac{dE}{dp}=\frac{d\left(\frac{1}{2m}p^2\right)}{dp}=\frac{p}{m}$. The velocity is in this case thus proportional to the momentum. This leads to: | {
"domain": "physics.stackexchange",
"id": 39239,
"lm_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",
"url": null
} |
quantum-mechanics, operators, hilbert-space, hamiltonian
For example, if you apply standard time-dependent perturbation theory, you will find that there is a non-zero contribution to transition from state $|1\rangle$ to state $|2\rangle$ (and vice versa), given by:
$$
c_2(t) = -i\int_0^t dt' V_{21}(t')e^{-i(E_1 - E_2)t'}+O(V^2)\;,
$$
where $c_2 =\langle 2|\Psi\rangle$, and where the notation $O(V^2)$ means there are additional contributions of higher orders in the interaction strength (which are assumed to be relatively small).
In this example, we see that the terms $\omega$ and $\gamma$ will enter the calculation as:
$$
c_2(t) = -i\gamma\int_0^t dt' e^{-i(\omega + E_1 - E_2)t'}\;,
$$
where I have set $\hbar=1$. So, we see that the transition probability should be proportional (at lowest order) to $|\gamma|^2$ and that $\hbar \omega$ can be interpreted as something like the photon energy. | {
"domain": "physics.stackexchange",
"id": 93932,
"lm_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, hilbert-space, hamiltonian",
"url": null
} |
But when thinking of polar coordinates I'm confused. In polar coordinates, θ is like our "x" and r is like our "y". So it seems the analogue to this situation would be when r is negative. But when thinking of this in terms of reimann sums, that doesn't seem like the case. Since the area of a sector of a circle is (1/2)r2θ, if r is negative it just becomes positive when we square it. So the only thing that would make this amount negative is if θ is negative. in the integral, dθ takes the place of θ in this equation. Does dθ ever become "negative"? Do we have to worry about negative area when dealing with integrating using polar coordinates? | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9674102514755852,
"lm_q1q2_score": 0.8163927771793995,
"lm_q2_score": 0.8438951064805861,
"openwebmath_perplexity": 302.5802163403782,
"openwebmath_score": 0.909303605556488,
"tags": null,
"url": "https://www.physicsforums.com/threads/area-under-the-curve-using-polar-coordinates-help.631325/"
} |
game, vba, excel, winapi
Private Function ButtonCaption(ByRef color As GamePieceColor) As String
Select Case color
Case rgbBlack
ButtonCaption = "Black"
Case rgbBlue
ButtonCaption = "Blue"
Case rgbGreen
ButtonCaption = "Green"
Case rgbRed
ButtonCaption = "Red"
Case rgbWhite
ButtonCaption = "White"
Case rgbYellow
ButtonCaption = "Yellow"
End Select
End Function
Private Function ButtonFontColor(ByRef color As GamePieceColor) As GamePieceColor
Select Case color
Case rgbBlack
ButtonFontColor = rgbWhite
Case rgbBlue
ButtonFontColor = rgbWhite
Case rgbGreen
ButtonFontColor = rgbBlack
Case rgbRed
ButtonFontColor = rgbBlack
Case rgbWhite
ButtonFontColor = rgbBlack
Case rgbYellow
ButtonFontColor = rgbBlack
End Select
End Function
'SHOW ANSWER | {
"domain": "codereview.stackexchange",
"id": 34957,
"lm_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, vba, excel, winapi",
"url": null
} |
# how many 5-digit numbers satisfy the following conditions
How many five-digit numbers divisible by 11 have the sum of their digits equal to 30?
I am able to get the 5-digit numbers divisible by 11
and
I am also able to get the five-digit numbers whose sum of their digits equal to 30.
But i am not able to get how i can get the count of 5 digit numbers satisying both the condition.
combinatorics permutations
-
Perhaps the following rule helps: A number is divisible by 11 if the sum the digits with alternating $\pm$ signs is zero or divisible by 11 – Peter Grill Jun 7 '12 at 3:01
Rereading your questions it seems that perhaps it is not complete:You talk about 5 digit numbers, and 7 digit numbers. – Peter Grill Jun 7 '12 at 3:03
A number is divisible by $11$ if the sum of the digits in the tens and thousands place minus the sum of the digits in the ones, hundreds, and ten thousands place is divisible by 11.
So take a number:
$a b c d e$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226247376173,
"lm_q1q2_score": 0.8120455682806766,
"lm_q2_score": 0.831143054132195,
"openwebmath_perplexity": 84.05277254066225,
"openwebmath_score": 0.880216121673584,
"tags": null,
"url": "http://math.stackexchange.com/questions/154949/how-many-5-digit-numbers-satisfy-the-following-conditions"
} |
javascript, angular.js
app.controller('CurrencyConverter', function($scope, $filter)
{
$scope.currencies = getCurrencies();
$direction = 0;
$scope.convert = function(from, to, amount)
{
var fromFound = $filter('filter')($scope.currencies, {currency: from}, true);
var toFound = $filter('filter')($scope.currencies, {currency: to}, true);
var IndianAmount = 0;
if(fromFound.length)
IndianAmount = amount/fromFound[0].value;
var toAmount = toFound[0].value*IndianAmount
return toAmount;
}
$scope.updateTarget = function()
{
$scope.to.amount =
$scope.convert(
$scope.from.selectedcurrency.currency,
$scope.to.selectedcurrency.currency,
$scope.from.amount)
if($scope.to.amount == 0)
$scope.to.amount = '';
} | {
"domain": "codereview.stackexchange",
"id": 18331,
"lm_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, angular.js",
"url": null
} |
Arithmetic-geometric mean
In mathematics, the arithmetic-geometric mean (AGM) of two positive real numbers "x" and "y" is defined as follows:
First compute the arithmetic mean of "x" and "y" and call it "a"1. Next compute the geometric mean of "x" and "y" and call it "g"1; this is the square root of the product "xy":
:$a_1 = frac\left\{x+y\right\}\left\{2\right\}$
:$g_1 = sqrt\left\{xy\right\}.$
Then iterate this operation with "a"1 taking the place of "x" and "g"1 taking the place of "y". In this way, two sequences ("a""n") and ("g""n") are defined:
:$a_\left\{n+1\right\} = frac\left\{a_n + g_n\right\}\left\{2\right\}$
:$g_\left\{n+1\right\} = sqrt\left\{a_n g_n\right\}.$
These two sequences converge to the same number, which is the arithmetic-geometric mean of "x" and "y"; it is denoted by M("x", "y"), or sometimes by agm("x", "y").
Example
To find the arithmetic-geometric mean of "a"0 = 24 and "g"0 = 6, first calculate their arithmetic mean and geometric mean, thus: | {
"domain": "enacademic.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9959927118867241,
"lm_q1q2_score": 0.8024037933346923,
"lm_q2_score": 0.8056321936479701,
"openwebmath_perplexity": 1267.0372111565682,
"openwebmath_score": 0.8263034820556641,
"tags": null,
"url": "https://enacademic.com/dic.nsf/enwiki/1577/Arithmetic-geometric_mean"
} |
c#, object-oriented, database
default:
throw new ArgumentException ($"* * * DataFileType is not a supported data file format. Database DataProvider could not be determined.");
}
} | {
"domain": "codereview.stackexchange",
"id": 29447,
"lm_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, database",
"url": null
} |
• Thanks for these insights @Bernard. I'll take a look on those topics in order to learn more about analytical functions – David O. Nov 14 '19 at 10:43
• @DavidO.- just FYI, the term is "analytic", not "analytical". If you search for "analytical", you will have to rely on the search engine's ability to correctly determine what you are really after. – Paul Sinclair Nov 14 '19 at 17:56
HumanStampedist has adequately answered the question. I'd like to mention that, just as there are continuous functions that are nowhere differentiable, such as the Weierstrass function, there are smooth functions (all $$n$$th derivatives exist at every point) that are nowhere analytic, i.e. at no point does the Taylor series converge to the original function. An example is the Fabius function. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138170582865,
"lm_q1q2_score": 0.8038656774062762,
"lm_q2_score": 0.822189134878876,
"openwebmath_perplexity": 261.77182920690467,
"openwebmath_score": 0.8931723833084106,
"tags": null,
"url": "https://math.stackexchange.com/questions/3435144/doubt-about-taylor-series-do-successive-derivatives-on-a-point-determine-the-wh/3435157"
} |
1 Introduction, Spherical Harmonics on the Circle In this chapter, we discuss spherical harmonics and take a glimpse at the linear representa-tion of Lie groups. Both the change of variables are correct. The main use of Jacobian is found in the transformation of coordinates. Exercises: 17. If the jth joint is a rotational joint with a single degree of freedom, the joint angle is a single scalar µj. Arithmetic leads to the law of sines. The proposed 3PSS&PU parallel perfusion. Chapter 2 Lagrange’s and Hamilton’s Equations In this chapter, we consider two reformulations of Newtonian mechanics, the Lagrangian and the Hamiltonian formalism. The hard way. If the point. to a set (and sum of) two dimensional integrals. Integrals in cylindrical, spherical coordinates (Sect. More general coordinate systems, called curvilinear coordinate. Spherical coordinate system questions and answers Find the Jacobians for changes to polar, cylindrical, spherical coordinates. Solution We cut V into two | {
"domain": "ol3roma.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.8174988355515703,
"lm_q2_score": 0.824461932846258,
"openwebmath_perplexity": 585.6846455806344,
"openwebmath_score": 0.8959506750106812,
"tags": null,
"url": "http://ol3roma.it/jacobian-of-spherical-coordinates-proof.html"
} |
Coordinate System, Distance and Midpoint Formula The Cartesian Coordinate System consists of two number lines perpendicular to each other at their 0's. Converting Rectangular coordinates to polar coordinates my only problem is that I do not understand how my professor got the end result for the y-value coordinate. Testing Polar Equations for Symmetry. And that can be kind of tricky because remember that the polar coordinates for a point are not unique. Normally, angle x is. Also in this video I show how we can visually draw a triangle inside the circle to illustrate the polar equation r = 2cosθ. Polar to Rectangular Coordinates We apply transformation from polar to cartesian coordinates to express the polar equation {eq}r= \frac{8}{4-2\sin(\theta)} {/eq} in rectangular coordinates. Let’s look at a quick example. Correct parantheses-handling and special functions like polar to rectangular convertion will have high priority. When we think about plotting points in the plane, we usually | {
"domain": "gesuitialquirinale.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226287518853,
"lm_q1q2_score": 0.8055179522932492,
"lm_q2_score": 0.8244619199068831,
"openwebmath_perplexity": 486.69841462743466,
"openwebmath_score": 0.8996694087982178,
"tags": null,
"url": "http://gesuitialquirinale.it/arxd/polar-to-rectangular-coordinates-calculator.html"
} |
c#, performance, coordinate-system
public static Vector3 operator +(Vector3 left, float value)
{
left.X += value;
left.Y += value;
left.Z += value;
return left;
}
public static Vector3 operator +(Vector3 left, Vector3 right)
{
left.X += right.X;
left.Y += right.Y;
left.Z += right.Z;
return left;
}
public static Vector3 operator -(Vector3 left)
{
left.X = (-left.X);
left.Y = (-left.Y);
left.Z = (-left.Z);
return left;
}
public static Vector3 operator -(Vector3 left, float value)
{
left.X -= value;
left.Y -= value;
left.Z -= value;
return left;
} | {
"domain": "codereview.stackexchange",
"id": 35995,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, performance, coordinate-system",
"url": null
} |
logic, lambda-calculus, normal-forms
Let $M = (\lambda x.y \ (\lambda x.(x \ \ x) \ \lambda x.(x \ \ x)))$
Why is it that under applicative order, $M \rightarrow$ infinite loop,
but under normal order, $M \rightarrow y$? $(\lambda x.y \ (\lambda x.(x \ \ x) \ \lambda x.(x \ \ x)))$ is an infinite loop because $$\lambda x.(x \ \ x) \ \lambda x.(x \ \ x) \to \lambda x.(x \ \ x) \ \lambda x.(x \ \ x)$$
Notice that $\lambda x.(x \ \ x)$ just writes it's argument twice. | {
"domain": "cs.stackexchange",
"id": 861,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "logic, lambda-calculus, normal-forms",
"url": null
} |
python, neural-network, numpy, activation-function
~0 for (0, 0) and (1, 1)
~1 for (0, 1) and (1, 0)
Can somebody explain why this example with sigmoid doesn't work with XOR? I found the answer by myself. The reason of the difference is that the definition of prime of tanh in BogoToBogo (tanh_prime) takes arguments that's already applied with activation function:
def tanh_prime(x):
return 1.0 - x**2
while sigmoid_prime is not. It calls sigmoid in it:
def sigmoid_prime(x):
return sigmoid(x)*(1.0-sigmoid(x)) | {
"domain": "datascience.stackexchange",
"id": 3709,
"lm_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, neural-network, numpy, activation-function",
"url": null
} |
And we have $$D\subset X\iff \forall x\;(x\in D \iff (x\in D\land x\in X))$$ .
So if $$D\subset X$$ then for all $$x$$ we have $$[x\in D\setminus C]\iff$$ $$\iff [x\in D\land x\not \in C] \iff$$ $$\iff [(x\in D\land x\in X)\land x\not \in C] \iff$$ $$\iff [x\in D \land (x\in X\land x \not \in C)]\iff$$ $$\iff [x\in D\land x\in X\setminus C] \iff$$ $$\iff [ x\in D\cap (X\setminus C)].$$ And it doesn't matter whether or not $$C\subset X.$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692271169855,
"lm_q1q2_score": 0.815991052450215,
"lm_q2_score": 0.8354835289107307,
"openwebmath_perplexity": 547.5530576512327,
"openwebmath_score": 0.9999332427978516,
"tags": null,
"url": "https://math.stackexchange.com/questions/3074001/proof-verification-for-the-equivalence-of-two-sets"
} |
homework-and-exercises, electromagnetism, magnetic-fields, magnetostatics
Whenever I try to validate these two laws the equation is always slightly mismatched with $J$ with the $a$, $b$, and $\rho$ terms (specifically in the curl one). What is the process for validating both of the laws algebraically? An example using my derivations would be appreciated.
Below are my derivations of the magnetic field for reference: The solution looks valid to me. We have the following magnetic field in space:
$$\mathbf{B}=\mu_0J_0a\hat{\mathbf{\varphi}}\begin{cases}0&\rho\leq a\\\frac{\rho-a}{\rho}&a<\rho<b\\\frac{b-a}{\rho}&\rho\geq b\end{cases}$$
We now consider the form of the relevant differential operators in cylindrical coordinates. Since our $\mathbf{B}$ only has a nonzero $\varphi$ component, we ignore all terms concerning $\mathbf{B}_\rho$ and $\mathbf{B}_z$.
Taking the divergence, we have that:
$$\nabla\cdot\mathbf{B}=\frac{1}{\rho}\frac{\partial\mathbf{B}_\varphi}{\partial\varphi}=0$$ | {
"domain": "physics.stackexchange",
"id": 83588,
"lm_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, electromagnetism, magnetic-fields, magnetostatics",
"url": null
} |
homework-and-exercises, newtonian-mechanics, forces, classical-mechanics, free-body-diagram
Title: Net force on links in chain? Suppose there is a chain with 5 links in it where each link has a mass of $m=0.1kg$, and the chain is being accelerated upward at $2.5 m/s^2$. I want to find the net force on each link in the chain.
I would have thought that the net force is the sum of the force from gravity (i.e., its weight) with the upward acceleration. But the book answer has 0.25N, indicating that only the upward acceleration is relevant.
After thinking about it, I realized that the downward force on each link is being offset since each link is supported by the link above it (with the top one supported by the rope accelerating it upward). Thus for each $W=mg$ force vector downward, there is a normal force going upward to offset it because of the normal force from the supporting link above it, leaving only the upward acceleration of the chain as a whole as the net force, which gives $F=(0.1kg)(2.5m/s^2)=0.25 N. $ Is my reasoning correct? | {
"domain": "physics.stackexchange",
"id": 74728,
"lm_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, forces, classical-mechanics, free-body-diagram",
"url": null
} |
newtonian-mechanics, forces, friction, everyday-life
The angle of the peg, $\alpha$
The fraction of the towel past the cap of the peg, $\eta$.
The fraction of the towel on the circular cap, $\gamma$.
Lets make some graphs:
The above graph shows what $\mu_s$ would have to be with a $\gamma = 0$ (no end cap, just a 1D stick).
The above graph shows what $\mu_s$ would have to be with a $\eta = 0$ (no stick, just a circular cap that the towel drapes over. | {
"domain": "physics.stackexchange",
"id": 46214,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, forces, friction, everyday-life",
"url": null
} |
vba, excel
ProgressIndicatorForm.Show
End Sub
You have 3 conditional formats when you need only one. Comparing the target cell to each possible value and wrapping that in with the OR function does this. =OR(C2="Picked Up",C2="In transit",C2="Delivered") produces a True value for each of the values. Building up the logic to check these values leads to the code below. Now if you need to add or remove a value you can do so easily.
Private Sub SetConditionalFormattingStatusColumnofStatusSheet(ByVal interiorColor As Long)
Dim targetArea As Range
Set targetArea = shStatus.Range("tbl_FedEx[Status]")
Dim prefix As String
prefix = targetArea.Cells(1, 1).Address(False, False) & "="""
Dim suffix As String
suffix = ""","
Dim comparisonsToStringValues As String
comparisonsToStringValues = Join(Array("Picked Up", "In transit", "Delivered"), suffix & prefix)
Dim builtFormula As String
builtFormula = "=OR(" & prefix & comparisonsToStringValues & """)" | {
"domain": "codereview.stackexchange",
"id": 37189,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vba, excel",
"url": null
} |
python, pandas, csv
# time
# the backfill has the effect, that the first
# row gets diff=0
time_diff= ser - ser.shift(1).fillna(method='backfill')
# now assign the id which is increased any time the
# time difference between two records is greather than 60
return (time_diff > 60).cumsum() | {
"domain": "datascience.stackexchange",
"id": 6095,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, pandas, csv",
"url": null
} |
statistical-mechanics, entropy, arrow-of-time
What you think of as the entropy of a specific microstate or of a string can, however, be made a strict concept, which is called Kolmogorov complexity. Instead of supplying the entropy of the ensemble/distribution you can quantify the "amount of information" by determining the length $K_L(s)$ of the shortest program in a Turing complete language $L$ required to generate the specific string $s$.
This of course depends on the language chosen to encode the string, however, one can prove that given to encoding languages $L_1$ and $L_2$ there exists a constant $c$ only dependent on the languages that bounds the difference of the Kolmogorov complexities of any string with respect to $L_1$ and $L_2$: | {
"domain": "physics.stackexchange",
"id": 91775,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, entropy, arrow-of-time",
"url": null
} |
c#, programming-challenge
if (i <= 16) //vertical "|"
{
if (workon[i][j] * workon[i + 1][j] * workon[i + 2][j] * workon[i + 3][j] > biggestnum)
{
best4 = new int[] { workon[i][j] , workon[i + 1][j] , workon[i + 2][j] , workon[i + 3][j] };
biggestnum = workon[i][j] * workon[i + 1][j] * workon[i + 2][j] * workon[i + 3][j];
}
} | {
"domain": "codereview.stackexchange",
"id": 20262,
"lm_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",
"url": null
} |
bacteriology, pathology, virus
Experiments with rhinoviruses and influenza viruses have shown potential survival times ranging from a few minutes to 48 hours or more. They remain active longer on stainless steel, plastic and similar hard surfaces than on fabric and other soft surfaces.
This is because many enveloped viruses rely on the proteins on the surface of the membrane to attach to the host cell, this envelope is generally sensitive to degradation to sunlight and normal cleaning procedures.
Outbreaks associated with the non-enveloped viruses can continue for many months due to their relative stability in the environment, think of winter vomiting outbreaks, hand foot and mouth in animals as good examples of this phenomenon.
Bacteria | {
"domain": "biology.stackexchange",
"id": 1938,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bacteriology, pathology, virus",
"url": null
} |
we can write a[x,v]= some equation. 15) will have the same order of accuracy as the Taylor's method in (9. Any second order differential equation can be written as two coupled first order equations, $$$\frac{dx_1}{dt} =f_1(x_1,x_2,t)\qquad\frac{dx_2}{dt} =f_2(x_1,x_2,t). With a sound background, one can use methods properly (especially when a method has its own. In other sections, we have discussed how Euler and Runge-Kutta methods are used to solve. Learn the Heun's method of solving an ordinary differential equation of the form dy/dx=f(x,y), y(0)=y0. we have a second order method General 2nd order Runge-Kutta Methods w 0 = ; for j = 0;1; ;N 1, w Example Initial Value ODE dy dt. • It is single step method as Euler’s method. The Backward Differentiation Formula (BDF) solver is an implicit solver that uses backward differentiation formulas with order of accuracy varying from one (also know as the. That's the classical Runge-Kutta method. To solve the Blasius equation we will make use of | {
"domain": "freccezena.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750529474512,
"lm_q1q2_score": 0.8072526373313896,
"lm_q2_score": 0.817574471748733,
"openwebmath_perplexity": 695.2215890655395,
"openwebmath_score": 0.7012003660202026,
"tags": null,
"url": "http://gwqt.freccezena.it/runge-kutta-2nd-order-method-solved-examples.html"
} |
quantum-field-theory, linear-algebra, klein-gordon-equation, classical-field-theory
Indeed, in your vision, the C-H theorem amounts to a functor "promoting" a characteristic polynomial with n roots $\lambda_n$ to the same polynomial of a diagonal (direct sum) operator with these roots along its diagonal; and then scrambling the operator to a generic hermitian one (you seem to think of strictly diagonalizable operators, the all but trivial case of the theorem, which is fine for your purposes). | {
"domain": "physics.stackexchange",
"id": 85296,
"lm_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, linear-algebra, klein-gordon-equation, classical-field-theory",
"url": null
} |
electrochemistry, home-experiment, crystal-structure
Title: Copper (II) Acetate from 5% vinegar + salt, electrochemically I'm trying to create Copper (II) Acetate crystals, but in these times of Coronavirus it's difficult to come by hydrogen peroxide. I could be patient, but I'm not, so I'm trying to make it electrochemically. I have 5% vinegar and lots of copper scrap, and an adjustable power supply. Unfortunately I can't barely get any current going, so I've thought of adding salt, regular NaCl. I'm curious what effect this will have on the final outcome though. Balancing equations is something I struggle with, but I'd really like to learn the chemistry here. Will the salt interfere with or alter the growth of the copper acetate crystals? Ultimately I'm trying to make calcium copper acetate crystals, I've already made the calcium acetate. To prepare copper acetate absence H2O2, employ a known method from hydrometallurgy to process copper ore employing aqueous ammonia, air (a source of oxygen) and a small amount of salt (acting as an | {
"domain": "chemistry.stackexchange",
"id": 13421,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry, home-experiment, crystal-structure",
"url": null
} |
cc.complexity-theory, pcp, interactive-proofs
Title: $\mathcal{MA}$ in terms of $\mathcal{PCP}$ The probabilistic proof system $\mathcal{PCP}[f(n),g(n)]$ is commonly referred to as a restriction of $\mathcal{MA}$, where Arthur can only use $f(n)$ random bits and can only examine $g(n)$ bits of the proof certificate sent by Merlin (see, http://en.wikipedia.org/wiki/Interactive_proof_system#PCP).
However, In 1990 Babai, Fortnow, and Lund proved that $\mathcal{PCP}[poly(n), poly(n)] = \mathcal{NEXP}$, so its not exactly a restriction. What are the parameters ($f(n),g(n)$) for which $\mathcal{PCP}[f(n), g(n)] = \mathcal{MA}$? If you want to restate the definition of MA in terms of PCP, you need another parameter for PCP, namely the proof length. MA is clearly the same as PCP with polynomial randomness, polynomial queries, and polynomial-length proofs. Usually the proof length in PCP is not restricted (that is, it is bounded only implicitly by randomness and queries), but this is insufficient to restate the definition of MA. | {
"domain": "cstheory.stackexchange",
"id": 1678,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, pcp, interactive-proofs",
"url": null
} |
mathematical-physics, history, mathematics, big-list
3) What are examples that insisting on rigour delayed progress in physics.
This has happened several times, unfortunately. | {
"domain": "physics.stackexchange",
"id": 3594,
"lm_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, history, mathematics, big-list",
"url": null
} |
electrostatics, mathematical-physics, boundary-conditions
This result leads to the following uniqueness theorem which can be improved making weaker some hypotheses on the behaviour of the function on the "regular" boundary.
Theorem. Suppose $\Omega \subset \mathbb R^n$ is non-empty open and $\overline{\Omega}$ is compact. Let $p \in \Omega$ and consider the problem:
$$\Delta \varphi(x) =\rho \quad x \in \Omega \setminus \{p\}$$
with boundary conditions
$$\varphi|_{\partial \Omega} = f$$
where
$$\varphi \in C^2(\Omega \setminus \{p\}) \cap C^0(\partial \Omega \cup \Omega \setminus \{p\} )$$ and $f \in C^0(\partial \Omega)$ and $\rho \in C^0(\Omega \setminus \{p\})$ are assigned.
If both $\varphi_1$ and $\varphi_2$ are solutions of the problem and $$ \lim_{x\to p} (\varphi_1(x)- \varphi_2(x))=0\:,$$
(where the limits can diverge or not exist, if considered separately in order to embody the case of a point charge at $q$) then
$$\varphi_1 = \varphi_2\:.$$ | {
"domain": "physics.stackexchange",
"id": 16430,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, mathematical-physics, boundary-conditions",
"url": null
} |
• The axiom of choice is needed when choosing from infinitely many sets simultaneously. Not when choosing from a single infinite set. Sep 13, 2015 at 4:37
• This answer should have received the most up votes in my opinion. Thanks Nov 25, 2021 at 3:53 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126494483641,
"lm_q1q2_score": 0.8001704904174198,
"lm_q2_score": 0.8175744850834648,
"openwebmath_perplexity": 114.50556514594733,
"openwebmath_score": 0.9375435709953308,
"tags": null,
"url": "https://math.stackexchange.com/questions/468889/how-is-every-subset-of-the-set-of-reals-with-the-finite-complement-topology-comp/468894"
} |
optics, reflection
Also when you leave them resting onto the wall they will bend more and this will make the distortion slightly worse, so hanging them onto wall would be advantageous, but is not likely to fix the problem completely.
Frame rigidness can be fixed by enforcing the frame - the first thing that comes to my mind is attaching some thin rigid hollow metal bars on the frame but if you're interested you can ask on DIY SE. | {
"domain": "physics.stackexchange",
"id": 1387,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, reflection",
"url": null
} |
c++, design-patterns, c++20
/// End of the header for decorator.
// Example of decorator with parameter in constructor.
template <typename T>
class LogDuration
{
public:
using RootType = typename T::RootType;
template <typename... Args>
LogDuration(std::shared_ptr<RootType>& impl,
std::shared_ptr<spdlog::logger> log,
// Need args if more constructor decorator needs argument.
Args&&... args)
: t(impl, std::forward<Args>(args)...), log_(std::move(log))
{
}
LogDuration(const LogDuration&) = default;
LogDuration(LogDuration&&) = delete;
LogDuration& operator=(const LogDuration&) = delete;
LogDuration& operator=(LogDuration&&) = delete;
~LogDuration() = default; | {
"domain": "codereview.stackexchange",
"id": 42156,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, design-patterns, c++20",
"url": null
} |
homework-and-exercises, special-relativity, field-theory, lorentz-symmetry, phase-space
An alternative way to "derive" the factor of $1/\gamma$:
$$\delta (p^2-m^2)\theta(p_0)=\frac{1}{E_{\vec p}}\delta(p_0-E_{\vec{p}})$$
Now, as $dp_0$ transforms to $\gamma dp_0$, the $\delta(p_0-E_{\vec{p}})$ should transform to $\gamma^{-1}\delta(p_0-E_{\vec{p}})$, as can be shown with an analogous argument to the one shown in the document. The $E_{\vec{p}}$ also transforms to $\gamma(E_{\vec{p}}-v p_x)$ for an $x$-boost, but this doesn't seem to solve it. I've come across an answer in Peskin's Introduction to Quantum Field theory where he looks at how to make the 3-momentum delta function invariant that might satisfy you. Look at a boost in the $p_3$ direction so that $p'_3= \gamma(p_3+\beta E),E'=\gamma(E+\beta p_3).$
$$ \delta^3(p-q)= \delta^3(p'-q')\frac{dp'_3}{dp_3}$$
$$ = \delta^3(p'-q')\gamma(1+\beta\frac{dE}{dp_3})= \delta^3(p'-q')\frac{\gamma}{E}(E + \beta E\frac{dE}{dp_3})$$
$$ = \delta^3(p'-q')\frac{\gamma}{E}(E+\beta p_3)= \delta^3(p'-q')\frac{E'}{E}.$$ | {
"domain": "physics.stackexchange",
"id": 20076,
"lm_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, special-relativity, field-theory, lorentz-symmetry, phase-space",
"url": null
} |
```Theorem plus_rearrange_firsttry : ∀ n m p q : nat,
(n + m) + (p + q) = (m + n) + (p + q).```
An initial thought would be to rewrite the goal with the commutativity property of addition, which has been proved before. However, there are multiple occurrences of `+` in the goal, and Coq will first apply commutativity to the outer `+`, which yields `(p + q) + (n + m) = (m + n) + (p + q)`. This is not what we want, as we only need to rewrite `n + m` to `m + n`. In this case, we can use `assert` to rewrite a certain part in the goal. Consider the following proof.
```Theorem plus_rearrange : ∀ n m p q : nat,
(n + m) + (p + q) = (m + n) + (p + q).
Proof.
intros n m p q.
assert (H: n + m = m + n).
{ rewrite → plus_comm. reflexivity. }
rewrite → H. reflexivity. Qed.``` | {
"domain": "github.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.985271387015241,
"lm_q1q2_score": 0.8078174464481017,
"lm_q2_score": 0.8198933381139645,
"openwebmath_perplexity": 2386.5500511944606,
"openwebmath_score": 0.8877028226852417,
"tags": null,
"url": "https://github.com/yuchong-pan/blog/wiki/Software-Foundations-Reading-Note-2:-Proof-by-Induction"
} |
between 0 and M-1 by starting with x 0 = c and iterating: We can check theparameters in use satisfy this condition: Schrage's method restates the modulus m as a decompositionm=aq+r where r=mmoda andq=m/a. When using a large prime modulus m such as 231−1, themultiplicative congruential generator can overflow. The case of mixed congruential method, i.e. c ≠ 0, is much more complicated. Linear Congruential Generator Calculator. Section II: Linear Congruential Generator I. The theory behind them is relatively easy to understand, and they are easily implemented and fast, especially on computer … LCGs tend to exhibit some severe defects. We provide sets of parameters for multiplicative linear congruential generators (MLCGs) of different sizes and good performance with respect to the spectral test. Seed: a: b: n: So m is chosen to be very big, e.g. Wolfram Demonstrations Project Embedding is allowed as long as you promise to follow our conditions. This video explains how a simple RNG can be | {
"domain": "aayhcs.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.979976554032175,
"lm_q1q2_score": 0.8387140613725503,
"lm_q2_score": 0.8558511506439708,
"openwebmath_perplexity": 1086.942660211881,
"openwebmath_score": 0.7285389304161072,
"tags": null,
"url": "https://aayhcs.com/rachel-kelly-plogpi/93b5fb-linear-congruential-generator"
} |
organic-chemistry, intermolecular-forces, hydrogen-bond
Title: Halogen bond definition I was looking for an accurate definition of halogen bonding.
I was able to find quite a few good ones, but none of them would explain if a X---H intermolecular interaction would count as a form of halogen bonding. Where X is any halogen and H is a hydrogen from another molecule. Does this count as halogen or hydrogen bonding? Or maybe as both?
Thank you, I would say no, it is only a hydrogen bond, not a halogen bond.
To be a halogen bond, the halogen atom must accept electron density from the other member of the bond. If the other member of the bond is a hydrogen atom bonded to a more electronegative element, I don't see have the halogen atom could be an acceptor of electron density. | {
"domain": "chemistry.stackexchange",
"id": 2427,
"lm_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, intermolecular-forces, hydrogen-bond",
"url": null
} |
matlab, digital-filters
Thank you No, that's not right:
Your polyphase components need to be ... well, phases of your signal, and hence, only take every $N$th component. What you do is something different.
To say "these are polyphase components of $h$", you need to define how many components you'll have. You're mixing different $N$s in your code, but overall, your code is just confused – it never selects the $N$th input samples.
Hence, you'd need something like
\begin{align}
p^4_0[n] &= h[4n]\\
p^4_1[n] &= h[4n+1]\\
p^4_2[n] &= h[4n+2]\\
p^4_3[n] &= h[4n+3]
\end{align}
for a $N=4$-phase polyphase decomposition of $h$ (of a specific type; "type" specifies in which order you take the $+0$,$+1$, $+2…$ components and declare them as $p_0$, $p_1$ and so on). | {
"domain": "dsp.stackexchange",
"id": 6497,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, digital-filters",
"url": null
} |
rust
Title: Parse input string into vector of i16 in Rust I'm new to Rust and I'm working through the exercises found at the bottom of this page. The following code parses a space deliminated input string from the user into a Vec<i16>. If the input string is invalid, the code loops and prompts again. If the string is valid, it prints out the debug value of the Vec<i16> and prompts again.
The code works, but I feel there is a more idomatic Rust way to deal with this. Particularly, in the get_input function's looping and how its assigning the return value. Behold.
use std::io::Write;
fn main() {
while let Some(ary) = get_input() {
println!("{:?}", ary);
}
println!("Peace!");
} | {
"domain": "codereview.stackexchange",
"id": 27459,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rust",
"url": null
} |
c, search, mergesort
Title: C-based hash matching cracker How can I improve this hash matching program using either abstraction or search/sort algorithms?
We briefly were introduced to searching methods such as bubble sort and merge sort, but I'm not sure how they can be implemented to improve my code.
The program takes a command-line hash input, compares it against generated hashes, and if it finds a match, prints out the key used to generate the matched hash.
(This is part of Harvard's CS50 on eDx Week 2 Problem Set)
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <crypt.h>
#define _XOPEN_SOURCE
#include <unistd.h>
/*
* Goal: Program that takes cmd ln arg of password hash
* and compares it to program generated hashes until a
* match is found.
* Assumptions: password is max 5 chars && all chars alpha
*/
bool crack(string hash); | {
"domain": "codereview.stackexchange",
"id": 35509,
"lm_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, search, mergesort",
"url": null
} |
c#, unit-testing
var output = _sut.HandleMessage(input);
output.Should().Be("error.grid.size.invalid");
}
[Fact]
public void WhenMessageHasInvalidXForGridSize_ReturnsErrorCode()
{
var input = Lines(
"x 5",
"1 2 N",
"LMLMLMLMM",
"3 3 E",
"MMRMMRMRRM");
var output = _sut.HandleMessage(input);
output.Should().Be("error.message.invalid");
}
[Fact]
public void WhenMessageHasInvalidYForGridSize_ReturnsErrorCode()
{
var input = Lines(
"x 5",
"1 2 N",
"LMLMLMLMM",
"3 3 E",
"MMRMMRMRRM");
var output = _sut.HandleMessage(input);
output.Should().Be("error.message.invalid");
} | {
"domain": "codereview.stackexchange",
"id": 37714,
"lm_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#, unit-testing",
"url": null
} |
java, performance, stack, queue
private int shift;//count internal movement from one stack to another.
You never use this outside of a single method. Rather than creating an object field, just use a local variable.
public twoStacksInOneQueue()
{
counter = 1;
shift = 0;
oddStack = new Stack<Integer>();
evenStack = new Stack <Integer>();
}
This gets simpler.
public twoStacksInOneQueue()
{
stacks[0] = new Stack<Integer>();
stacks[1] = new Stack<Integer>();
}
No need for the other two here.
public void addToQueue(int num)
{
if(counter % 2 == 0)
{
evenStack.push(num);
System.out.println("evenStack: " + num);
}
else
{
oddStack.push(num);
System.out.println("oddStack: " + num);
}
counter++;
}
And this becomes just
public void addToQueue(int num)
{
int index = ((stacks[0].size() + stacks[1].size()) % 2;
stacks[index].push(num);
System.out.println(((index == 0) ? "evenStack: " : "oddStack: ") + num);
} | {
"domain": "codereview.stackexchange",
"id": 20930,
"lm_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, stack, queue",
"url": null
} |
fluid-dynamics, continuum-mechanics
Title: Physical description of momentum flux tensor In the field of fluid mechanics, what is the momentum flux tensor? Is there an easy explanation for how it "works"? The momentum flux tensor comes from the momentum equation of Navier-Stokes equations:
$$
\frac{\partial\left(\rho\mathbf{u}\right)}{\partial t}+\nabla\cdot\mathbf{P}=0\tag{1}
$$
Or, using indices (where it is easier to see that $\mathbf{P}$ is a rank-2 tensor):
$$
\frac{\partial\left(\rho u_i\right)}{\partial t}+\frac{\partial\Pi_{ij}}{\partial x_j}=0\tag{2}
$$
We can split this tensor into three components:
advection of $i$-momentum in the $j$-direction: $\left(\rho u_i\right)u_j$
pressure: $p\delta_{ij}$
stress tensor: $\sigma_{ij}$ | {
"domain": "physics.stackexchange",
"id": 10879,
"lm_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, continuum-mechanics",
"url": null
} |
computability, proof-techniques
In general, what are the catches when doing diagonalization pertaining to computability? There are no catches. Diagonalization is a very general proof technique that works in classical, constructive and computable setting. It is used to prove: | {
"domain": "cs.stackexchange",
"id": 16743,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability, proof-techniques",
"url": null
} |
general-relativity, black-holes, angular-momentum, centrifugal-force, kerr-metric
Is there any experimental/observational documentation where I could read about that they have calculated/measured the rotational speed of a black hole (and how did they measure it) and how much faster it needed to rotate to start falling apart (if it is possible at all) or stop being a black hole? A black hole is described by its mass $M$, angular momentum per unit mass $a$, electric charge $Q$ and magnetic charge $P$. However the essential features persist in the absence of charges, so a rotating black hole $(M, a)$ as described by the Kerr metric is representative of cosmological black holes.
The outer event horizon in Kerr is given by
$$r_+ ~=~ M + \sqrt{M^2 -a^2} \,,$$
where:
natural units are used such that $c = G = 1$;
$\left(t, r, \theta, \phi \right) =$ Boyer-Lindquist coordinates;
$a = \frac{J}{M}$;
$J =$ angular momentum . | {
"domain": "physics.stackexchange",
"id": 48830,
"lm_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, black-holes, angular-momentum, centrifugal-force, kerr-metric",
"url": null
} |
are still disadvantages such as low solution accuracy and poor global search ability. introduction. Looks like MatPlotLib to me. Thefront panel of this instrument is 225 mm wide by 100 mm tall (8. However, in the real world all objects are three dimensional, so it is important that we extend the application of the area, sine and cosine formulae to three dimensional situations. The graphs of the sine and cosine functions are used to model wave motion and form the basis for applications ranging from tidal movement to signal processing which is fundamental in modern telecommunications and radio-astronomy. 2-5) Complete Notes pp. By thinking of the sine and cosine values as coordinates of points on a unit circle, it becomes clear that the range of both functions must be the interval[latex]\,\left[-1,1\right]. Hyperbolic Functions in Real Life. The exponential function, exp(X) or e^X, is a special function that comes from calculus. More Graphing Trigonometric Functions Worksheet Answers Sec | {
"domain": "salesianipinerolo.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.990291521799369,
"lm_q1q2_score": 0.8655912851267503,
"lm_q2_score": 0.8740772450055544,
"openwebmath_perplexity": 489.46033083010536,
"openwebmath_score": 0.754558265209198,
"tags": null,
"url": "http://salesianipinerolo.it/ubdl/real-life-applications-of-sine-and-cosine-functions.html"
} |
gazebo-11
Running it on a faster PC -> well... no change but the RTF in simulation
Target is to run it as fast as possible however for the sim itself real time is no requirement.
My next step would be to compile ODE from source inserting some line to see at which body/joint the LCP fails, but I figured before I do that it would be appropriate to at least ask for some help.
So:
Does anyone have an idea on why this is happening and if and how it is solvable?
Or any hint on debug tools I could use?
I'd be happy with any input, so just shoot... :)
Setup:
Gazebo 11.9.0
ODE -> built-in version
Solver: World
Rest -> world file
Std-ROS installation ROS noetic, so ROS 1
World file
Model file .sdf
Anything else on request
Originally posted by differentiatingDuck on Gazebo Answers with karma: 1 on 2021-11-29
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 4628,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo-11",
"url": null
} |
algorithms, optimization
It seems to me that a polynomial time algorithm can be obtained by reduction to a minimum-cost flow problem, which can be solved in polynomial time. Create a network with $k + n + 1$ nodes: $n$ rock nodes, $k$ bucket nodes, and $1$ source node. The source node is adjacent to each of the rock nodes, with edge capacity 1 and edge cost equal to the weight of the rock. Each rock node is also adjacent to all the bucket nodes it can be put into, with edge capacity 1 and edge cost 0. The source node has a supply of $2k$ units, and each bucket node has a demand of 2 units. Any integer flow of value $2k$ corresponds to a feasible assignment of $2k$ rocks to the buckets. The minimum cost integer flow corresponds to an assignment of minimum weight. | {
"domain": "cs.stackexchange",
"id": 14740,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, optimization",
"url": null
} |
php, wordpress
/**
* Register the settings with register_setting()
*
* @since 1.0
*/
private function registerSettings()
{
foreach ($this->pages as $page)
{
register_setting(
$page['id'],
$page['id']
);
}
} | {
"domain": "codereview.stackexchange",
"id": 7638,
"lm_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, wordpress",
"url": null
} |
general-relativity, de-sitter-spacetime
Title: Negative energy/mass bounds on de-Sitter spacetime There exists a Positive Energy theorem for General Relativity in Anti-de Sitter and asymptotically flat spacetimes, but there is no equivalent theorem for de Sitter spacetimes Is there a lower bound theorem on negative mass-energy density on de Sitter spacetimes? | {
"domain": "physics.stackexchange",
"id": 15202,
"lm_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, de-sitter-spacetime",
"url": null
} |
c++, template-meta-programming, sfinae
Try o << t (with o being a test_framework::ostream).
If that fails, try o.wrapped_stream << t (where the wrapped stream is a std::ostream).
If that fails, error.
And again, you can provide defaults for std::pair, iterables, and whatever you like.
The key thing here is that that special stream type, test_framework::ostream, is specific to the test framework, and thus won’t interact/interfere with the environment or type-under-test.
In summary, what you’ve done so far is correct… but instead of working around the standard interface incantation operator<<(std::ostream&, T), you should use a custom interface incantation that won’t interact or get entangled with the environment or the type-under-test. There are several ways to do that (I just mentioned 2), and you can still use operator<<(std::ostream&, T) as a default.
Okay, now onto the code itself:
// checks whether T has declared output iterator or not
template<typename T>
class has_output_operator
{
private: | {
"domain": "codereview.stackexchange",
"id": 39616,
"lm_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++, template-meta-programming, sfinae",
"url": null
} |
time-complexity, randomized-algorithms, minimum-spanning-tree
Title: Expected linear-time algorithm for finding MST with probability for sampling an edge other than 1/2 I'm trying to understand this algorithm : https://en.m.wikipedia.org/wiki/Expected_linear_time_MST_algorithm
As described in the wiki article, it works in 5 steps to find the MSF for a graph $G = (V, E)$:
Do two iterations of Boruvka resulting in a graph $G'= (V', E') $
Select each edge from $E'$ with probability $1/2$ and get set of selected edges $E''$
Call yourself recursively on the graph $G'' = (V', E'')$ and get an MST $F = (V', E''') $
Find the set $L$ of all F-light edges
Call yourself recursively on the graph $G''' = (V', E''' \cup L) $ | {
"domain": "cs.stackexchange",
"id": 19152,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "time-complexity, randomized-algorithms, minimum-spanning-tree",
"url": null
} |
java, performance, beginner
int whole;
for (Integer key : mapa.keySet()) {
whole = (int)mapa.get(key)/2;
pairs=pairs+whole;
}
return pairs;
} Prefer assigning variables to the most generally applicable type. If it doesn't matter what kind of list you have, use List. If it doesn't matter what kind of map you have, use Map.
Use whitespace consistently. =, +, and / should have whitespace on both sides.
Code doesn't need to declare the generic type on the right hand side of an assignment. The compiler will infer it from what is declared on the left hand side. Use <> instead.
Arrays.asList() is probably easier to read than adding multiple values to the list. Do note that this type of list is fixed size after it is created.
list is not very descriptive, nor is mapa. Descriptive names are very important.
It would be preferable for the code to use an enhanced for loop. Iterators are more efficient at going over some List types than calling get(). They are also easier to read. | {
"domain": "codereview.stackexchange",
"id": 41615,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, beginner",
"url": null
} |
ros-hydro, ubuntu-precise, ubuntu
Title: Package cannot find nav_msgs even though its listed as a dependency?
Hello, I am trying to run a ROS node for the ax2550 motor controller, found here:
https://github.com/wjwwood/ax2550
However, when I try to compile with catkin_make, I get the following error:
CMake Error at /opt/ros/hydro/share/genmsg/cmake/genmsg-extras.cmake:255 (message):
Messages depends on unknown pkg: nav_msgs (Missing find_package(nav_msgs?))
Call Stack (most recent call first):
ax2550/CMakeLists.txt:22 (generate_messages)
Everything I can find about this error online simply indicates that I need to specify nav_msgs as a dependency to my package, but it's already there:
<build_depend>nav_msgs</build_depend>
<run_depend>nav_msgs</run_depend>
Any ideas as to what could br going wrong?
Originally posted by mysteriousmonkey29 on ROS Answers with karma: 170 on 2014-07-15
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 18625,
"lm_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-hydro, ubuntu-precise, ubuntu",
"url": null
} |
• @QuantIbex does that dependence necessarily imply $E[\varepsilon_i\varepsilon_j]\neq 0$? Jul 31, 2014 at 3:07 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347864479427,
"lm_q1q2_score": 0.8376862578899273,
"lm_q2_score": 0.8596637451167997,
"openwebmath_perplexity": 806.6445531985748,
"openwebmath_score": 0.7714518904685974,
"tags": null,
"url": "https://stats.stackexchange.com/questions/64938/if-linear-regression-is-related-to-pearsons-correlation-are-there-any-regressi"
} |
php, mysqli
$clauses .= '`'.$this->tableName.'`';
$clauses .= '.`'.$opt['groupby']['field'].'`';
}
$nb_clauses = 0;
if (isset($opt['orderby']) AND is_array($opt['orderby']))
{
foreach ($opt['orderby'] AS $clause)
{
if ($nb_clauses == 0)
$clauses .= ' ORDER BY ';
else
$clauses .= ', ';
if (!empty($clause['table']))
$clauses .= "`".$clause['table']."`.";
else
$clauses .= "`".$this->tableName."`.";
$clauses .= "`".$clause['field']."`";
if (!empty($clause['sort']))
$clauses .= " ".$clause['sort']; | {
"domain": "codereview.stackexchange",
"id": 4813,
"lm_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, mysqli",
"url": null
} |
noise, snr, digital-filters
(a+b)/2
b ---- ----
At the receiver, the first thing you do is simply subtract the average of the received signal intensity; that way, what you receive becomes:
c ---- -------- ----
0
-c ---- ---- | {
"domain": "dsp.stackexchange",
"id": 6544,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "noise, snr, digital-filters",
"url": null
} |
Example where $X$ and $Z$ are correlated, $Y$ and $Z$ are correlated, but $X$ and $Y$ are independent
$$X,Y,Z$$ are random variables. How to construct an example when $$X$$ and $$Z$$ are correlated, $$Y$$ and $$Z$$ are correlated, but $$X$$ and $$Y$$ are independent?
Intuitive example: $$Z = X + Y$$, where $$X$$ and $$Y$$ are any two independent random variables with finite nonzero variance. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773708019443872,
"lm_q1q2_score": 0.8101805857867679,
"lm_q2_score": 0.828938806208442,
"openwebmath_perplexity": 285.7691043422103,
"openwebmath_score": 0.45126277208328247,
"tags": null,
"url": "https://stats.stackexchange.com/questions/498551/example-where-x-and-z-are-correlated-y-and-z-are-correlated-but-x-an/498561"
} |
java, battleship
private ShipType shipType;
private Rectangle bounds;
private int lifePoints;
public BattleShips(ShipType typeOfShip, Coordinate pos) {
super();
shipType = typeOfShip;
bounds = new Rectangle(shipType.getDimension, pos);
lifePoints = shipType.getLifePoints();
}
public Rectangle getBounds() {
return bounds();
}
...
}
the dimension of the Rectangle (width/height) and the amount of lifepoints can be determind by the ShipType
public Enum Shiptype {
DESTROYER(2,4,2), SUBMARINE(1,3,1), ...; //don't use shiptype P or shiptype Q
private final Dimension dimension;
final int lifePoints;
public ShipType(int w, int h, int life){
dimension = new Dimension(w,h);
lifePoints = life;
}
public Dimension getDimension(){
return dimension;
}
public int getLifePoints(){
return lifePoints();
}
} | {
"domain": "codereview.stackexchange",
"id": 29696,
"lm_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, battleship",
"url": null
} |
c#
private static async Task GetWoWDirectory()
{
var directory = await Task.Factory.StartNew(() => FindWoWDirectory());
if (directory == null)
{
MessageBox.Show("Cannot find WoW Directory. Please choose.");
var dialog = new FolderBrowserDialog();
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
directory = dialog.SelectedPath;
}
}
Settings.Default.WoWFolder = directory;
Settings.Default.Save();
}
private void Register_Click(object sender, RoutedEventArgs routedEventArgs)
{
Process.Start(Settings.Default.RegisterUrl);
}
private void SetRealmlist_Click(object sender, RoutedEventArgs routedEventArgs)
{
SetRealmlist();
} | {
"domain": "codereview.stackexchange",
"id": 15326,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#",
"url": null
} |
d-wave, annealing, embedding
Early in the anneal, the Ising (classical/user-input/final) Hamiltonian has no effect, which means that two spins in a chain are not compelled to agree.
As the anneal progresses, the chain couplings become increasingly impactful... so do the other Ising terms (h's and J's).
You want the chain terms to become important just before the other Ising terms become important. This is a fine balance that can be influenced by the strength of the chains (relative to the other terms), and by anneal offsets, which can make some qubits anneal slightly in advance of others. This D-Wave whitepaper shows an example where anneal offsets can be effective.
More generally I would start "debugging" an embedding by answering, in order, the following questions: | {
"domain": "quantumcomputing.stackexchange",
"id": 556,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "d-wave, annealing, embedding",
"url": null
} |
jquery, html, css
const stdSpace = "1em"; // for ruby annotation spacing
$(function () {
$("rb").each(rubyAdjust);
});
function rubyAdjust(i, el) { // for each ruby base
const rbW = $(el).width(), // take its width
rtW = $(el).next("rt").width(), // its associated ruby text width
diff = (rtW - rbW).toFixed(0), // excess amount
addSpace = diff > 0
? `calc(${stdSpace} + ${diff.toString()}px)`
: stdSpace;
$(el).css("margin-right", addSpace);
}
rb {
display: inline-block /* fluid word spacing with margin using JS */
}
rt {
text-align: left /* to work together with rb margin */
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ruby>
<rb>是</rb><rt>Thị</rt>
<rb>故</rb><rt>cố</rt>
<rb>空</rb><rt>không</rt>
<rb>中</rb><rt>trung</rt>
</ruby> | {
"domain": "codereview.stackexchange",
"id": 41607,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "jquery, html, css",
"url": null
} |
communication, moveit, nodes, services, movegroup
Title: Using MoveGroup in different nodes (moveit!)
Hi!,
Right now im working with a custom robot and moveit!, and what Im trying to do, is to generate some services nodes, and use them to move my robot using moveit!.
The problem is that for optimization reasons, i dont want to have to initialize a MoveGroup in my node services every time i call one of them, as i have to do right now. However i couldnt find any way to send an already defined MoveGroup to another node, and work with it.
So the question is, Is ther anyway to do this? To work with the same defined MoveGroup in different nodes?
Thank you in advance! any help will be welcome :D | {
"domain": "robotics.stackexchange",
"id": 22879,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "communication, moveit, nodes, services, movegroup",
"url": null
} |
javascript, jquery
function ObjectString(obj, type) { //~0.001-0.003 seconds
let objString = obj;
if (typeof objString == "string" && !objString.match(/<.*?>/g))
objString = "<font color='red'>\"" + objString + "\"</font>";
else if (/<.*?>/g.test(objString))
objString = ((type == "normal") ? "<pre>" + process(objString).replace(/</g, '<').replace(/>/g, '>') + "</pre>" + objString : "<font color='red'>\"...\"</font>");
else if (typeof objString == "number" || typeof objString == "boolean")
objString = "<font color=' #947cf6'>" + objString + "</font>";
return objString
}
function process(str) {//~0.001 seconds
var div = document.createElement('div');
div.innerHTML = str.trim();
return format(div, 0).innerHTML;
} | {
"domain": "codereview.stackexchange",
"id": 36293,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery",
"url": null
} |
electromagnetism, condensed-matter, magnetic-fields, material-science
When we split it along the two poles, the two resulting magnet pieces will repel each other.
Note that the colors are just representations of the poles of the magnet, and when the colors change, they don't represent any change in the pieces of the magnet itself.
My question: If there is a repulsive force within the magnet that is pushing the magnet horizontally apart (in my picture), then what is keeping it together?
It seems to me that the stability of the magnet can't be explained with electromagnetic forces alone, but that doesn't seem quite correct. What keeps the domains of the magnet together? And at the atomic level, what keeps the atoms together? The chemical bonds of the material keep it together. | {
"domain": "physics.stackexchange",
"id": 64692,
"lm_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, condensed-matter, magnetic-fields, material-science",
"url": null
} |
constants are 3, 2, −1. For example, the box for is: \begin{array}{|c|c|c} \hline x^2 & 3x & x \\ \hline 2x & 6 & 2 \\ \hline x & 3 \\ \end{array} Therefore Contents. Example: x 2 - 12x + 27. a = 1 b = -12 c = 27. Obviously, this is an “easy” case because the coefficient of the squared term x x is just 1. Quadratic Polynomial. Cubic Polynomial. Think of a pair of numbers whose sum is the coefficient of the middle term, +3, and whose product is the last term, +2. A quadratic trinomial is a polynomial with three terms and the degree of the trinomial must be 2. For example- 3x + 6x 2 – 2x 3 is a trinomial. This video contains plenty of examples and practice ... Factoring Perfect Square Trinomials Factoring Perfect Square Trinomials door The Organic Chemistry Tutor 4 jaar geleden 11 minuten en 3 seconden 267.240 weergaven This algebra video tutorial focuses on , factoring , perfect square , trinomials , . If a is one, then we just need to find what two numbers have the product c and the | {
"domain": "openidauthority.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.963779946215714,
"lm_q1q2_score": 0.8010390059935452,
"lm_q2_score": 0.8311430520409023,
"openwebmath_perplexity": 981.2715992223876,
"openwebmath_score": 0.5485056638717651,
"tags": null,
"url": "https://openidauthority.com/gum-arabic-gfghi/archive.php?id=0a0c3b-quadratic-trinomial-examples"
} |
$D=x^2\vert_1^2-\frac{1}{8}\ln \vert x\vert_1^2=\left(4-1\right)-\frac{1}{8}\left(\ln 2-0\right)$
Simplifying gives
$$D=3-\frac{1}{8}\ln2\approx 2.913$$
## Problem 4
This is a challenge problem.
Calculate the length of the function $f(x)=e^x$ from $x=0$ to $x=1$.
Let’s denote the requested length as $D$. Using the arc length integral formula and the fact that $\frac{df}{dx}=e^x$, we have
$D=\int_0^1dx\text{ }\sqrt{1+e^{2x}}$
Notice that we can rewrite this integral as
$D=\int_0^1dx\text{ }e^{x}\sqrt{1+e^{-2x}}$
This is achieved through factoring out a factor of $e^x$
Let’s define the variable $u=1+e^{-2x}$, such that $du=-2e^{-2x}dx$, or equivalently, $dx=\frac{-1}{2}e^{2x}du$. However, notice from the definition of $u$ that $\frac{1}{u-1}=e^{2x}$, and so
$dx=\frac{-1}{2}\frac{1}{u-1}du$ | {
"domain": "michaelsyao.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.993902438349265,
"lm_q1q2_score": 0.8055369726577017,
"lm_q2_score": 0.8104789178257654,
"openwebmath_perplexity": 113.50640902191317,
"openwebmath_score": 0.9929381012916565,
"tags": null,
"url": "http://michaelsyao.com/calculus/arc-length-sol/"
} |
newtonian-mechanics, reference-frames, rotational-dynamics, computational-physics, gyroscopes
\left( \vartheta \right) +\sin \left( \psi \right) \cos \left(
\vartheta \right) \right) \left( aM-bm \right)
$$
$J_\varphi\,,J_\vartheta\,,J_\psi$
are the inertia about the axes and $T_\vartheta\,,T_\psi$ are the torques given in body fixed frame.
to do the animation you need the rotation matrix between body fixed frame and inertial frame
$$R= \left[ \begin {array}{ccc} 1&0&0\\ 0&\cos \left(
\varphi \right) &-\sin \left( \varphi \right) \\ 0
&\sin \left( \varphi \right) &\cos \left( \varphi \right)
\end {array} \right] \, \left[ \begin {array}{ccc} \cos \left( \vartheta \right) &0&\sin
\left( \vartheta \right) \\ 0&1&0
\\ -\sin \left( \vartheta \right) &0&\cos \left(
\vartheta \right) \end {array} \right] \,\left[ \begin {array}{ccc} \cos \left( \psi \right) &-\sin \left(
\psi \right) &0\\ \sin \left( \psi \right) &\cos
\left( \psi \right) &0\\ 0&0&1\end {array} \right]
$$
notice that you get singularity if $\vartheta=\pi/2$ | {
"domain": "physics.stackexchange",
"id": 65649,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, reference-frames, rotational-dynamics, computational-physics, gyroscopes",
"url": null
} |
python, algorithm, python-3.x, graph
Now, were looking up distance[k] only 100 times, and distance[i] only 10000 times. This will be a speed improvement.
We can do the for loops better: getting the indices and looking up the values together, using enumerate, and looping over the rows of the distance matrix:
for k, distance_k in enumerate(distance):
for i, distance_i in enumerate(distance):
for j in range(len(vertices)):
if distance_i[j] > distance_i[k] + distance_k[j]:
distance_i[j] = distance_i[k] + distance_k[j]
next_vertices[i][j] = next_vertices[i][k] | {
"domain": "codereview.stackexchange",
"id": 39200,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, algorithm, python-3.x, graph",
"url": null
} |
population-genetics
Some caveats
Until now, we have assumed that everyone has exactly three children. However, this is not the case. Since we only need an approximate for our final answer, we will be using the average birth rate value. This means that most people will have x number of children. Some might have none, some might have many. However, using this value should give us a fairly good approximation.
Also, according to Rutgers anthropology professor Robin Fox, 80% of all marriages in history have been between second cousins or closer. This means that there you will have a lot less cousins than predicted by the equation, since even though we are assuming everyone to have x number of children, two people together are having x number of children, and so the total number of children in a generation will be much lower than predicted. Since inbreeding is so common, there's also a chance that you could be much further from someone than predicted by the equation. | {
"domain": "biology.stackexchange",
"id": 11880,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "population-genetics",
"url": null
} |
turing-machines
I was thinking in the end of list I will run out of space for xxx, but I will not, xxx is only POTENTIALLY (because it's a process like 1,2,3,...) (countably) infinite, xxx will never be ACTUALLY REALIZEDLY INFINITE, it will always be FINITE !! (it doesn't matter if our universe has finite or infinite amount of atoms or I need to build program from atoms in finite amount of time from finite amount of matter, I will not run out of building blocks)
Note: I say that xxx is both finite and potentially infinite. Is this a problem? TODO | {
"domain": "cs.stackexchange",
"id": 21611,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turing-machines",
"url": null
} |
performance, image, rust, graphics
background
.par_chunks_exact_mut(3)
.enumerate()
.for_each(|(pixel_num, pixel)| {
let x_dist = i32::try_from(pixel_num).unwrap() % geometry.0 - geometry.0 / 2;
let y_dist = i32::try_from(pixel_num).unwrap() / geometry.0 - geometry.1 / 2;
let scaled_dist = (distance(x_dist, y_dist) - (foreground_size / 2) as f64) / max_dist;
for (i, subpix) in pixel.iter_mut().enumerate() {
*subpix = ((outer_color[i] as f64 * scaled_dist)
+ (inner_color[i] as f64 * (1.0 - scaled_dist)))
as u8
}
});
background
} Things I changed: | {
"domain": "codereview.stackexchange",
"id": 43536,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, image, rust, graphics",
"url": null
} |
angular-momentum, centripetal-force
Title: Does a cylinder/cone being spun around on an arm have angular momentum? This question comes after seeing a video about the SpinLaunch company and their "centrifuge" launch system. As shown in the basic illustration below, a "rocket" shaped projectile will be spun around at very high speeds and then released.
Since the projectile is being held so that it's always facing tangent to the circle, is a torque being applied to the projectile? If a torque is being applied, does that mean that when it's released, it will want to keep spinning? I feel like this might depend on the arm being attached to the exact center of gravity of the projectile, but I can't put all the pieces together in my mind. | {
"domain": "physics.stackexchange",
"id": 89788,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "angular-momentum, centripetal-force",
"url": null
} |
ros, catkin-make, include, viso2-ros
Originally posted by Miquel Massot with karma: 1471 on 2015-07-14
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Tonystark124 on 2015-07-14:
I got the package from the link mentioned
Comment by Tonystark124 on 2015-07-14:
can you please point to where I can look for it?
Comment by Tonystark124 on 2015-07-14:
fatal error: pcl/point_cloud.h: No such file or directory
I got this error while compiling/installing. Any ideas if you had the same?
Comment by Miquel Massot on 2015-07-14:
Remove the word include from this line, and check if you have PCL libraries (libpcl-1.7-all) installed.
Comment by Tonystark124 on 2015-07-14:
issues resolved. thanks,! :) | {
"domain": "robotics.stackexchange",
"id": 22180,
"lm_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, catkin-make, include, viso2-ros",
"url": null
} |
radius: dΩ=sinϑϑϕdd. Then the. m in the Matlab editor, then enable cell mode from the Cell Menu. Where x n is the x coordinate of vertex n,. In rectangular coordinates and spherical coordinates the Laplacian takes the following forms, which follow from the expressions for the gradient and divergence. In these notes, we want to extend this notion of different coordinate systems to consider arbitrary coordinate systems. Compute the measurement Jacobian in spherical coordinates. Relationships Among Unit Vectors Recall that we could represent a point P in a particular system by just listing the 3 corresponding coordinates in triplet form: x,,yz Cartesian r,, Spherical and that we could convert the point P’s location from one coordinate system to another using coordinate transformations. Consider the Earth’s North and South poles. We have step-by-step solutions for your textbooks written by Bartleby experts!. Evaluate a double integral using a change of variables. 4 Relations between | {
"domain": "ol3roma.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.8174988355515703,
"lm_q2_score": 0.824461932846258,
"openwebmath_perplexity": 585.6846455806344,
"openwebmath_score": 0.8959506750106812,
"tags": null,
"url": "http://ol3roma.it/jacobian-of-spherical-coordinates-proof.html"
} |
no problem: ' specify a single point. Strangely enough, when that grid is a grid of pixel data, bicubic interpolation is a common method for resizing images! Bicubic interpolation can also used in realtime rendering to make textures look nicer when scaled than standard bilinear texture interpolation. Quadratic interpolation is made with polynomials of degree two, while cubic uses degree 3 polynomials. The smoothed median function smooth() doesn't do much better - there simply is too much variance in the data. Cubic spline is used as the method of interpolation because of the advantages it provides in terms of simplicity of calculation, numerical stability and smoothness of the interpolated curve. , when x and y are both integers Image interpolation refers to the "guess" of intensity values at missing locations, i. On the other hand, splines provide examples of infinite-support interpolation functions that can be realized exactly at a finite, surprisingly small computational cost. (Note | {
"domain": "100per100sicily.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750514614408,
"lm_q1q2_score": 0.8206499013913631,
"lm_q2_score": 0.8311430394931457,
"openwebmath_perplexity": 858.9108399567517,
"openwebmath_score": 0.5121351480484009,
"tags": null,
"url": "http://xzqc.100per100sicily.it/cubic-interpolation.html"
} |
machine-learning, python, scikit-learn, logistic-regression, kaggle
When I print(predictions) to confirm, this is what it gives:
[0 0 0 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0
0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 1 0 0 0
0 1 1 0 0 0 0 0 1 0 0 1 1 0 1 1 0 0 0 1 1 0 1 0 0 1 0 0 0 0 1 0 1 0 0 1 0
1 0 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1
1 0 0 1 1 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 1 0 1 1 0 0 0]
This is my full code:
import pandas as pd
import warnings
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
warnings.filterwarnings("ignore", category=FutureWarning)
train = pd.read_csv("https://raw.githubusercontent.com/oo92/Titanic-Kaggle/master/train.csv")
test = pd.read_csv("https://raw.githubusercontent.com/oo92/Titanic-Kaggle/master/test.csv") | {
"domain": "datascience.stackexchange",
"id": 5354,
"lm_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, python, scikit-learn, logistic-regression, kaggle",
"url": null
} |
ros
Pinging localhost or my domain name "Kai-System" is fast(no more than 0.03ms) so it should not be a hosts problem.
Any idea how to debug this? I really dont want to reinstall my Ubuntu(it has been upgraded all the way up from 10.04 and I am glad with this)
Update2:
Well... At last I solved this problem by debugging roscore using pdb, and it was caused by a TOO-LARGE $ROS_PACKAGE_PATH.
More detail:
In fact I mistakenly put too many folders(symbolic links) into one of the folder in $ROS_PACKAGE_PATH, so each time when roslaunch starts, it will call a subroutine to walk through all subfolders under it, which costs too much time and as a result, the rosparent thought it could not contact rosmaster and throw a RLException to terminate the program.(Don't ask me for details because I only understand part of the codes..)
To close:
In short, just check if your $ROS_PACKAGE_PATH contains any large folders(symbolic link counts), and remove them out of it, then start a new shell and it works. | {
"domain": "robotics.stackexchange",
"id": 11315,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
performance, android, xml, gui, layout
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_alignParentLeft="true"
android:text="to:"
android:gravity="start"
android:maxLines="1"
android:layout_alignBottom="@+id/txtsetSearch_To"/> | {
"domain": "codereview.stackexchange",
"id": 10524,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, android, xml, gui, layout",
"url": null
} |
Let $S$ be the Sorgenfrey line as in Example 2 above. Assuming Martin’s Axiom and the negation of the continuum hypothesis (abbreviated by MA + not CH), for any uncountable $X \subset S$ with $\lvert X \lvert < c$, $X \times X$ is normal but not paracompact (see Example 6.3 in [1] and see [3]). Even though $X \times X$ is not exactly a comparable example, this example shows that restricting to a smaller subset on the anti-diagonal seems to make the space normal. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787868650146,
"lm_q1q2_score": 0.8047802154199303,
"lm_q2_score": 0.8152324848629215,
"openwebmath_perplexity": 107.99715693191011,
"openwebmath_score": 0.9666374921798706,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/the-sorgenfrey-line/"
} |
$A = A \cap U = A \cap (B \cup B') = (A \cap B) \cup (A\cap B')$. Or if that's a little too abstract, I rather like to do an element by element proof:
Let $x \in A$ either $x \in B$ or $x \in B'$. If $x \in B$ then $x \in A \cap B$. If $x \in B'$ then $x \in A \cap B'$. Either way $x \in A \cap B$ or $x \in A\cap B'$ so $x \in (A \cap B) \cup (A\cap B)$. So $A \subseteq (A\cap B) \cup (A \cap B)$. Likewise if $y \in (A \cap B) \cup (A\cap B)$ then either $y \in (A \cap B) \subset A$ or $y \in (A\cap B') \subset A$. Either way, $y \in A$ so $(A\cap B)\cup (A\cap B') \subseteq A$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575167960731,
"lm_q1q2_score": 0.8638122554498614,
"lm_q2_score": 0.8791467580102419,
"openwebmath_perplexity": 279.08457198967204,
"openwebmath_score": 0.9979856610298157,
"tags": null,
"url": "https://math.stackexchange.com/questions/2110681/prove-a-cap-b-cup-a-cap-b-a-using-set-identities"
} |
javascript, performance, comparative-review, chess
Code duplication
I notice some code duplication for the Knight piece. Code duplication causes unnecessary complexity, and makes correcting the code harder.
Usage of == (abstract equality)
In javascript it is usually safer to use strict equality ===, unless you have a very good reason to use abstract equality. Abstract equality is not transitive, which can cause odd bugs and unexpected behaviour. Reading material is available on Stackoverflow. | {
"domain": "codereview.stackexchange",
"id": 21692,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, comparative-review, chess",
"url": null
} |
c++, algorithm, object-oriented, c++20, number-systems
// We unfortunately cannot use llroundl in a constexpr function.
mills = static_cast<decltype(mills)>( mills_per_GBP * pounds );
} else {
throw std::invalid_argument(invalid_arg_msg);
}
} | {
"domain": "codereview.stackexchange",
"id": 42736,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, object-oriented, c++20, number-systems",
"url": null
} |
general-relativity, spacetime, metric-tensor, symmetry
and these will typically be one or two special points. As a rule, if you have an isotropic space you constructed it that way, or there is some special reason why it must be isotropic, and it won't happen "by accident". | {
"domain": "physics.stackexchange",
"id": 10887,
"lm_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, spacetime, metric-tensor, symmetry",
"url": null
} |
c++, matrix, c++17, iterator, overloading
Title: Matrix implementation I am trying to implement an optimal and fast running matrix in C++. I need some review of the code and ideas on how to improve the code quality if it shall be.
class Matrix {
// Some static assertions and useful types
static_assert(std::is_arithmetic_v<T>, "Matrix template parameter type must be arithmetic");
using DataType = std::vector<T>;
// Default constructors
public:
Matrix() : mCols(0), mRows(0), mData(0) { };
Matrix(const Matrix &other) = default;
Matrix(Matrix &&other) noexcept = default;
Matrix &operator=(const Matrix &other) = default;
Matrix &operator=(Matrix &&other) noexcept = default; | {
"domain": "codereview.stackexchange",
"id": 42920,
"lm_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++, matrix, c++17, iterator, overloading",
"url": null
} |
gazebo
Originally posted by ufr3c_tjc with karma: 885 on 2017-07-03
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 28002,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo",
"url": null
} |
c#
Edit - Code sample added. Note. I think it would be better to store a list of Items for the player in their inventory as opposed to just an ID. If you want to go the ID route then you should really create an enum for the items and then in the world class or some other more global class maintain a Dictionary that maps the Enum to the Item object (to make easy retrieval of item information). I also added a ParseCommand method that you can call from the Do method. I am sorry that I don't have more time to work on this.:
[DataContract]
[KnownType(typeof(Player))]
[KnownType(typeof(Enemy))]
abstract class Entity
{
#region Declarations
[DataMember]
public string Name { get; protected set; }
[DataMember]
public string Description { get; protected set; }
[DataMember]
public int Health { get; protected set; }
[DataMember]
public int Magic { get; protected set; }
#endregion | {
"domain": "codereview.stackexchange",
"id": 1952,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#",
"url": null
} |
conservation-laws, gauge-theory, supersymmetry, research-level, noethers-theorem
A linear multiplet is defined as $\Sigma=\epsilon^{\dot{\alpha}\beta}\bar{D}_{\dot{\alpha}}D_{\beta}V$ where $V$ is the vector multiplet corresponding to a U(1) gauge symmetry. | {
"domain": "physics.stackexchange",
"id": 49828,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "conservation-laws, gauge-theory, supersymmetry, research-level, noethers-theorem",
"url": null
} |
#### HallsofIvy
##### Elite Member
As has been said, the distinction between 1040 and 1040. is a convention. It has been agreed that if there is a decimal point after an integer then all digits in the number are "significant" and that if there is no decimal point then the significant digits are end with the rightmost non-zero digit.
#### Denis
##### Senior Member
...and if 1040. was at end of sentence, then you'd have 1040.. :cool: | {
"domain": "freemathhelp.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105293899019,
"lm_q1q2_score": 0.8599314630131287,
"lm_q2_score": 0.8807970795424088,
"openwebmath_perplexity": 922.9623029438295,
"openwebmath_score": 0.671176016330719,
"tags": null,
"url": "https://www.freemathhelp.com/forum/threads/how-many-significant-digits-are-in-1040-and-1040-0.111578/"
} |
# Arc Length: Definite and Indefinite Integration
Several authors state the formula for finding the arc length of a curve defined by ##y = f(x)## from ##x=a## to ##x=b## as:
$$\int ds = \int_a^b \sqrt{1+(\frac{dy}{dx})^2}dx$$
Isn't this notation technically wrong, since the RHS is a definite integral, and the LHS is an indefinite integral (family of antiderivatives)?
I understand that no limits are placed on the integral of ##ds## since ##ds## can be defined in several equivalent ways: y as the independent variable, x as the independent variable, parametrically, or in terms of polar coordinates.
But why can't we write the integral as:
$$\int_{x=a}^{x=b} ds$$
Writing it this way makes it explicit that the variable ##x## is changing from ##a## to ##b##.
Alternatively, can't we also write it as:
$$\int_P ds$$
Where P is the path I have defined above.
Last edited: | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9511422158380862,
"lm_q1q2_score": 0.8246743203248753,
"lm_q2_score": 0.8670357666736772,
"openwebmath_perplexity": 305.4228006334381,
"openwebmath_score": 0.9694549441337585,
"tags": null,
"url": "https://www.physicsforums.com/threads/arc-length-definite-and-indefinite-integration.789179/"
} |
java, android
static int bombed = 5;
Rect fromRect1;
Rect toRect1;
Rect fromRect2;
Rect toRect2;
boolean waitForTimer = false;
boolean recent = false;
boolean increment = false;
boolean toggleDeltaY = true;
boolean toggleGround = true;
boolean jump = false;
boolean shoot = false;
boolean checkpointComplete = false;
boolean runOnce = true;
boolean passed = false;
boolean donotdrawBuggy = false; // keep track of whether to not draw anything at all during the wait between being bombed and getting a new life
final int buggyXDisplacement = 450;
int numberOfshots = 0; // change to 0
int[] missiles = new int[200];
/* int alienBombYDelta = 0;
int alienBombYDelta2 = 0;
int alienBombXDelta = 20;
int alienBombXDelta2 = 30;*/
int p = 7;
int p2 = 13;
int index = 0;
int missileOffSetY = 0;
int jumpHeight = 0;
int xbuggy2 = 0;
int craterX = -550; | {
"domain": "codereview.stackexchange",
"id": 31261,
"lm_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, android",
"url": null
} |
c#, performance, strings, programming-challenge, comparative-review
char[] chars = new char[input.Length];
for(int i = 0, j = input.Length -1; i <= j; i++, j--)
{
chars[i] = input[j];
chars[j] = input[i];
}
return new string(chars);
}
} | {
"domain": "codereview.stackexchange",
"id": 33246,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, performance, strings, programming-challenge, comparative-review",
"url": null
} |
For the undirected graph, we will select one node and traverse from it. For finding paths of length r between vertices v(i) & v(j), we find A^r and the (i,j)th entry of this matrix would give you the number of paths. Graph. In this case the traversal algorithm is recursive DFS traversal. I need help implementing directed weighted graph in java using adjacency matrix. We can simply do a depth-first traversal or a breadth first-first traversal on the graph and if the traversal successfully traversal all the nodes in the graph then we can conclude that the graph is connected else the graph has components. The idea is also simple - imagine an n by n grid, where each row and each column represents a vertex. Undirected graph with no loops and no multi-edges. Vote. Sign in to comment. To check connectivity of a graph, we will try to traverse all nodes using any traversal algorithm. After completing the traversal, if there is any node, which is not visited, then the graph is not connected. | {
"domain": "railwayphotos.net",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9504109798251322,
"lm_q1q2_score": 0.8307325968395357,
"lm_q2_score": 0.874077230244524,
"openwebmath_perplexity": 414.27426330965716,
"openwebmath_score": 0.5063043236732483,
"tags": null,
"url": "http://railwayphotos.net/3unjduhn/c7ab88-check-if-graph-is-connected-adjacency-matrix"
} |
python, python-3.x
Title: String cut by a separator with the separator in the respective list element in python Python 3.6.5
Is there any better solution than this one? Particularly the last line. I don't like it.
import re
s = "my_separator first thing my_separator second thing"
data = re.split("(my_separator )", s)[1:]
data = [even+odd for i, odd in enumerate(data) for j, even in enumerate(data) if i%2==1 and j%2==0 and i==j+1] You can exploit zip and iterators to allow you to pair things together:
data = [a + b for a, b in zip(*[iter(data)]*2)]
You could use just re, and change the separator with a look ahead assertion.
data = re.split(" (?=my_separator)", s)
You can use str.split, and just add the separator back:
sep = 'my_separator '
data = s.split(sep)[1:]
data = [sep + i for i in data]
data = [sep + i for i in s.split(sep)] | {
"domain": "codereview.stackexchange",
"id": 30593,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x",
"url": null
} |
ros, executive-smach, smach
FixPoseX = 0
FixPoseY = 0
FixPoseZ = 10
class Ch1():
rospy.init_node('ch1_state_machine')
sm = smach.StateMachine(outcomes=['Done'])
with sm:
def exploration_request_cb (userdata,request):
exploration_request = navigation().Request
exploration_request.srvtype=1
exploration_request.wayPointX = FixPoseX
exploration_request.wayPointY = FixPoseY
exploration_request.wayPointZ = FixPoseZ
exploration_request.LDFlag = 0
return exploration_request
smach.StateMachine.add('EXPLORATION',
ServiceState('controller_service',
navigation,
request = exploration_request_cb),
transitions={'succeeded':'MARKER_DETECTION' , 'aborted':'Done', 'preempted':'EXPLORATION'})
### MORE STATES HERE
sis = smach_ros.IntrospectionServer('server_name', sm, '/SM_ROOT')
sis.start() | {
"domain": "robotics.stackexchange",
"id": 26952,
"lm_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, executive-smach, smach",
"url": null
} |
genetics, homework
My work so far:
The genotype must be $Xy^+X?$ for the female and $Xy^+Y$ for the male.
There are two cases to consider: $?=y^+$ or $?=y$.
In the former we get $\frac{3}{8}$ grey females and $\frac{1}{8}$ yellow females and $\frac{2}{8}$ grey and yellow males each; that seems correct except for the yellow females.
In the latter, we get twice as many yellow females.
Perhaps the XXyy (yellow females) genotype is lethal but this doesn't help in determining the parents' genotypes.
If $? = y$ then cross-over from $Xy^+\mathbf{Xy} \; x \; \mathbf{Xy^+}Y$ would not eliminate yellow females.
I don't know of other effects to take into account, so I am stuck.
$ $
If you'd like to suggest resources (websites, textbooks $\ldots$) pertaining to this subject or on biology at this level in general, I would very much appreciate it.
Thank you. | {
"domain": "biology.stackexchange",
"id": 2243,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "genetics, homework",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.