text stringlengths 1 1.11k | source dict |
|---|---|
strings, assembly
This would traverse the buffer pointed to by RDI for the first occurence of period for a maximum of 784 characters. This snippet had evolved from just scanning for NULL for a maximum of FFFFFFFFH bytes, to scanning for any of the values (0 - FF), to traversing buffer for specified number of bytes.
Question
Do you think I've achived the maximum utility with the least amount of code.
; Determine length, including terminating character EOS. Result may include
; VT100 escape sequences.
; ENTER: RDI = Pointer to ASCII string.
; RCX Bits 31 - 08 = Max chars to scan (1 - 1.67e7)
; 07 - 00 = Terminating character (0 - FF)
; LEAVE: RAX = Pointer to next string (optional).
; FLAGS: ZF = Terminating character found, NZ otherwise (overrun).
; DF = Unmodified incase it was already set. | {
"domain": "codereview.stackexchange",
"id": 22544,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "strings, assembly",
"url": null
} |
and x 0. Formula 1: Area = $$\int_a^b {\,\,\left| {f\left( x \right) - g\left( x \right)} \right|\,\,\,dx}$$ for a region bounded above by y = f(x) and below by y = g(x), and. two supports. 1 HP part number F2224-90010. For example, this is the heating curve for iron, a metal that melts at 1538°C and boils at 2861°C. cool math for kids. Z b a f(x) dx So the next question is, how do I nd the area of the shaded region below? 11. AP Calculus AB - Worksheet 57 Area Between Two Curves - y-axis Find the area of the shaded region analytically. For the time being, let us consider the case when the functions intersect just twice. Area Between Two Curves (Calc 1 Problem Solution Breakdown) Finding the area under a curve is a basic Calc 1 concept, but finding the area between two curves is a bit more difficult. We can calculate the impeller size required by linear interpolation. maths work for year 5. Thus a square is the shape that maximises the area. solving equations exam questions. EXAMPLE | {
"domain": "carlosfassanelli.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9706877717925421,
"lm_q1q2_score": 0.8250566284314385,
"lm_q2_score": 0.8499711775577736,
"openwebmath_perplexity": 601.1477546563357,
"openwebmath_score": 0.7026122808456421,
"tags": null,
"url": "http://vbsu.carlosfassanelli.de/area-between-two-curves-problems-and-solutions-pdf.html"
} |
# Given a non-countable subset $X$ of $\mathbb{R}$, prove that $X'$ is uncountable
$$\textbf{My solution} :$$
We will use this theorem: If a set $$X$$ only has isolated points then $$X$$ is countable or equivalently if $$X$$ is uncountable then $$X$$ contains some point of accumulation in $$X$$ ($$X \cap X'\neq \emptyset$$)
Suppose that $$X'$$ is countable, then $$Y=X-X'$$ is uncountable (if it were we would have X is countable) then by the theorem we would have that there is some $$a \in Y'\cap Y$$.
We affirm that $$a$$ is point of accumulation of $$X$$.
Indeed, for any $$\epsilon >0 : (a- \epsilon,a+ \epsilon) \cap Y-\{a\} \neq \emptyset$$, then exists $$x_1 \in (a- \epsilon,a+ \epsilon) \cap Y-\{a\}$$. As $$x_1$$ is in $$Y$$ then $$x_1$$ is in $$X$$ so $$x_1 \in (a- \epsilon,a+ \epsilon) \cap X-\{a\}$$ then $$a \in X'$$ a contradiction because $$a \in Y$$.
I wanted to know if my solution is correct, something to improve or maybe some other. Thank you | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137879323496,
"lm_q1q2_score": 0.8051465583400909,
"lm_q2_score": 0.8198933337131077,
"openwebmath_perplexity": 102.55198547488877,
"openwebmath_score": 0.9501792192459106,
"tags": null,
"url": "https://math.stackexchange.com/questions/3113337/given-a-non-countable-subset-x-of-mathbbr-prove-that-x-is-uncountable"
} |
c#
public LogicalValue Value
{
get
{
return _value;
}
}
public PinValue(LogicalValue value)
{
_value = value;
}
public PinValue(bool? value)
{
if (value == null)
{
_value = LogicalValue.Unknown;
}
else if (value == true)
{
_value = LogicalValue.High;
}
else
{
_value = LogicalValue.Low;
}
}
public override bool Equals(object obj)
{
return obj != null
&& obj is PinValue
&& Equals((PinValue)obj);
}
public bool Equals(PinValue obj)
{
return obj.Value == Value;
}
public override int GetHashCode()
{
return Value.GetHashCode();
}
public override string ToString()
{
return string.Format("{0}", Value);
} | {
"domain": "codereview.stackexchange",
"id": 16007,
"lm_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
} |
filters, filter-design, linear-systems, control-systems, pid
Title: What is the difference between a lag compensation and PI control? A lag filter or compensator has the Laplace transform transfer function
$$G_c(s) = \frac{s+z}{s+p},$$
with $-z < -p < 0$. In practice, the effect of lag compensation in feedback control, is to increase the DC gain of the open-loop system by the factor $G_c(0)=z/p$, which improves the ability of the closed-loop system to track low-frequency reference signals. The tradeoff is that the open-loop system incurs a phase shift of $-\pi/2$ at frequencies $z < \omega$.
However, in the limit as $p\rightarrow 0$, we are left with a PI controller, which has the form
$$G_c(s) = K_p + \frac{K_I}{s} = \frac{K_p s + K_I}{s},$$
which has infinite DC gain ($|G_c(0)|$), meaning the closed-loop system now achieves zero steady-state error in response to a step reference. The only tradeoff I can see compared to the lag filter is that there is a phase shift of $-\pi/2$ for $\omega < p$, but I don't see why this is a problem in practice. | {
"domain": "dsp.stackexchange",
"id": 4746,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, filter-design, linear-systems, control-systems, pid",
"url": null
} |
# Can the dimension of a basis be less than the space that it spans?
#### Pedro
##### New member
Let S be a subspace of $\mathbb{R^2}$, such that $S=\{(x,y):2x+3y=0 \}$.
Find a basis,$B$, for $S$ and write $u=(-9,6)$ in the $B$ basis.
So, I started to solve $2x+3y=0$ for $x$ and I got $x=-\frac{3}{2}y$. Then I could write,
$\left[ \begin{matrix} x \\ y \end{matrix}\right] = \left[ \begin{matrix} -\frac{3}{2} y \\ y \end{matrix} \right] = y\left[ \begin{matrix} -\frac{3}{2} \\ 1 \end{matrix} \right]$
So I was force to conclued that S is spaned by the vector $(-\frac{3}{2},1)$. My doubt is if it is correct to assume that $\{(-\frac{3}{2},1) \}$ is a basis of $S$. Because, in this circunstances, I don't know how to write the vector $u$ in the basis $B$.
Thanks for the help.
Last edited:
#### Klaas van Aarsen
##### MHB Seeker
Staff member
Let S be a subspace of $\mathbb{R^2}$, such that $S=\{(x,y):2x+3y=0 \}$.
Find a basis,$B$, for $S$ and write $u=(-9,6)$ in the $B$ basis. | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9715639677785087,
"lm_q1q2_score": 0.8218871909036828,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 329.4142402187011,
"openwebmath_score": 0.9296267032623291,
"tags": null,
"url": "https://mathhelpboards.com/threads/can-the-dimension-of-a-basis-be-less-than-the-space-that-it-spans.5269/"
} |
homework-and-exercises, general-relativity, black-holes, reference-frames, observers
A circular orbit at radius $r_c$ will have
$$V'_{eff}(r_c)=0$$
$$\left.\frac{dr}{d\tau}\right|_{r_c} = 0$$
and the latter equation together with the energy equation tells us
$$V_{eff}(r_c) = 0.$$
The pair of equations is
$$\frac{3 G \ell^2 M}{r^4}+\frac{G M}{r^2}-\frac{\ell^2}{r^3}=0$$
$$-\frac{G \ell^2 M}{r^3}-\frac{G M}{r}+\frac{\ell^2}{2 r^2}=0$$
which amounts to solving a pair of quadratics. You can check that the only solutions are
$$\ell = \pm 4GM,\quad r=4GM.$$
Not only is it possible, $r=4GM$ is the only possible orbit with the initial conditions we specified. Now maybe you can generalize to some finite amount of initial radial velocity to see if a closer orbit is possible. | {
"domain": "physics.stackexchange",
"id": 45227,
"lm_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, general-relativity, black-holes, reference-frames, observers",
"url": null
} |
c#, multithreading
//This is the use of the class. All threads do the same thing, but with different (or equal) keys.
object lockObj = DynamicLockGenerator.GetLock(key);
lock (lockObj)
{
//PROCESS THE KEY
}
DynamicLockGenerator.RemoveLock(key); I'm pretty sure you have the potential for a race condition if one thread releases the lock and removes it, after another thread has got the lock but not yet locked it.
Thread one GetLock(someKey) // Creates lock, returns dynamic key
Thread one Lock(dynamicKey)
Thread one complete processing (exits lock section)
Thread two GetLock(someKey) // returns existing key
Thread one RemoveLock // removes lock from collection (not yet being used)
Thread two Lock(dynamicKey) // Now we've locked an object no longer in collection
Thread two complete processing (exit lock block)
Thread two Remove lock // tries to remove a lock that's not in the collection | {
"domain": "codereview.stackexchange",
"id": 20009,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, multithreading",
"url": null
} |
ros, ros2, rclcpp, colcon
colcon will then be tricked into relinking the .o built from the right includes if I then go edit rclcpp sources without changing ros2_cpp_py.
In the past I've done the same for other packages and the expected precedence of colcon_ws works (TODO test that again), is there something special about rclcpp here? I wouldn't be surprised if this turns out badly for other reasons (and I should build from source https://index.ros.org/doc/ros2/Installation/Linux-Development-Setup/ and work with modified rclcpp inside that, and use nothing from opt debs at all?), but this particular failure was unexpected.
I realize this probably is the wrong development approach vs. what full time developers of core ros2 packages do, but I'd like to stay with crystal and released packages as much as possible, and I think other low frequency 'casual' contributors would be similar.
Reproduction
source /opt/ros/crystal/setup.bash
mkdir test_colcon_ws/src -p
cd test_colcon_ws/src | {
"domain": "robotics.stackexchange",
"id": 32475,
"lm_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, ros2, rclcpp, colcon",
"url": null
} |
beam, columns, buckling, moments
Is this effect significant compared to the increased axial compressive force, or is it trivial and dominated by the increase in axial compression? Do I need to allow for an additional bending moment in my buckling calculations, in this situation, to ensure the column profile is adequate? | {
"domain": "engineering.stackexchange",
"id": 940,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beam, columns, buckling, moments",
"url": null
} |
scattering-cross-section
In general the differential cross section can be given in a number of different ways depending on how one treats the phase space integral. In fact, the differential cross section for a two particle scattering process is given by $$d\sigma = \frac{1}{4\sqrt{(p_1p_2)^2-m_1^2m_2^2}}(2\pi)^4\delta^4\left(\sum_f p_f-\sum_i p_i\right)|\mathcal{M}_{fi}|^2\prod_{i=1}^n\frac{d^4p_i}{(2\pi)^3 2E_i}$$
and as you can see there are $n$ integrations to be done, one for every phase space of every particle. One could even not bother to integrate over any phase space and instead study the differential cross section $$\frac{d\sigma}{dp_1\,dp_2\,\dots dp_n} = \frac{1}{4\sqrt{(p_1p_2)^2-m_1^2m_2^2}}(2\pi)^4\delta^4\left(\sum_f p_f-\sum_i p_i\right)|\mathcal{M}_{fi}|^2\prod_{i=1}^n\frac{1}{(2\pi)^3 2E_i}$$ or instead, which is often done, integrate over some specific phase space and leave behind others. One example of that is exactly the differential cross section over the solid angle. | {
"domain": "physics.stackexchange",
"id": 69174,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scattering-cross-section",
"url": null
} |
$$\{ (1,2,3)(1,2,3), (1,2,3)(1,3), (1,3)(1,2,3), (1,3)(1,3)\} = \{(1,3,2), (2,3), (1,2), e\}$$
which is not a coset. If we multiply using representatives, as in the original question,we also run into problems: if we multiply $(1,2,3)H\cdot(1,3,2)H$ as $(1,2,3)(1,3,2)H$, we get $eH$. But $(1,2,3)H = (1,3)H$, and $(1,3,2)H = (2,3)H$, and if we multiply them by looking at these alternative representatives/names, we get $(1,3)H\cdot (2,3)H = (1,3)(2,3)H = (1,3,2)H\neq eH$. That is, the multiplication rule depends on the name we give the coset, rather than on what the coset is. This means that the rule is not well-defined. | {
"domain": "mathzsolution.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429575500227,
"lm_q1q2_score": 0.825746479382022,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 61.07912090283539,
"openwebmath_score": 0.9774006009101868,
"tags": null,
"url": "https://mathzsolution.com/why-do-we-define-quotient-groups-for-normal-subgroups-only/"
} |
ros, md5, publisher
[WARN] [WallTime: 1455522139.729356] Could not process inbound connection: Client [/control_panel] wants topic [/imu] to have datatype/md5sum [os5000_imu/imu_data/20a63a1c6bab175e3bbe310358cd3614], but our version has [os5000_imu/imu_data/cb87164d6e531601e0b13c83388dee16] Dropping connection.{'message_definition': 'std_msgs/String raw\nstd_msgs/Float32 heading\nstd_msgs/Float32 pitch\nstd_msgs/Float32 roll\nstd_msgs/Float32 temp\nstd_msgs/Float32 depth\n\n================================================================================\nMSG: std_msgs/String\nstring data\n\n================================================================================\nMSG: std_msgs/Float32\nfloat32 data\n', 'callerid': '/control_panel', 'tcp_nodelay': '0', 'md5sum': '20a63a1c6bab175e3bbe310358cd3614', 'topic': '/imu', 'type': 'os5000_imu/imu_data'} | {
"domain": "robotics.stackexchange",
"id": 23778,
"lm_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, md5, publisher",
"url": null
} |
Disclaimer: I wouldn't have come up with the above "closed-form" solution on my own; I ran the differential equation through Mathematica, saw the result, and reverse-engineered the solution.
If there is some $$x_0$$ with $$f(x)>0$$ then there is also some $$x_1$$ with $$f(x_1)=\max_{x\in[a,b]}f(x)$$. Because $$f$$ is differentiable, $$f'(x_1)=0$$. But then also $$f''(x_1)=g(x_1)f(x_1)>0$$ so that locally $$f(x_1+s)=f(x_1)+\frac12f''(x_1)s^2+o(s^2)$$, which provides values larger than $$f(x_1)$$, for instance using $$f(x_1+s)\ge f(x_1)+\frac14f''(x_1)s^2$$ for $$|s|<\delta$$ for some small $$δ>0$$, in contradiction to the construction. Thus the first assumption is wrong, there is no such $$x_0$$.
Then repeat the same argument for $$-f(x)$$ to find that only $$f=0$$ remains. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9532750387190132,
"lm_q1q2_score": 0.8212828665642701,
"lm_q2_score": 0.8615382058759129,
"openwebmath_perplexity": 60.70532502782708,
"openwebmath_score": 0.9838752150535583,
"tags": null,
"url": "https://math.stackexchange.com/questions/2998648/show-that-fx-exfx-with-fa-fb-0-makes-f-equiv-0-forall-x-in?noredirect=1"
} |
$$\sum_{n=0}^{+\infty}\frac{3^n}{n!\left(n+3\right)}=\frac{1}{27}\sum_{n=0}^{+\infty}\frac{1}{n!}\frac{3^{n+3}}{n+3}$$ And $$\frac{3^{n+3}}{n+3}=\int_{0}^{3}x^{n+2}\text{d}x$$ Hence it becomes ( using uniform convergence on every compact of $\mathbb{R}$ especially $\left[0,3\right]$ ) $$\sum_{n=0}^{+\infty}\frac{3^n}{n!\left(n+3\right)}=\frac{1}{27}\sum_{n=0}^{+\infty}\frac{1}{n!}\int_{0}^{3}x^{n+2}\text{d}x=\frac{1}{27}\int_{0}^{3}\sum_{n=0}^{+\infty}\frac{1}{n!}x^{n+2}\text{d}x$$ Then $$\sum_{n=0}^{+\infty}\frac{3^n}{n!\left(n+3\right)}=\frac{1}{27}\int_{0}^{3}x^2e^{x}\text{d}x$$ Hence you conlude ( integrating by parts ) $$\sum_{n=0}^{+\infty}\frac{3^n}{n!\left(n+3\right)}=\frac{1}{27}\left(5e^3-2\right)$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750477464142,
"lm_q1q2_score": 0.8162746013586158,
"lm_q2_score": 0.8267117983401362,
"openwebmath_perplexity": 217.87280694093965,
"openwebmath_score": 0.8908015489578247,
"tags": null,
"url": "https://math.stackexchange.com/questions/2605142/computing-sum-n-0-infty-frac3nnn3"
} |
newtonian-mechanics, forces, energy-conservation, work
Title: How does kinetic energy work in braking a vehicle?
Do the brakes have to do more work (ignoring air resistance) slowing a vehicle from $10\ \mathrm{m/s}$ to $8\ \mathrm{m/s}$ than from $8\ \mathrm{m/s}$ to $6\ \mathrm{m/s}$? | {
"domain": "physics.stackexchange",
"id": 61787,
"lm_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, energy-conservation, work",
"url": null
} |
mathematical-physics, hilbert-space, metric-tensor, mathematics, metric-space
Example 1: In Quantum Mechanics one can associate a pure state with an element $|\phi\rangle$ of a Hilbert Space $\mathcal H$, and its naturally corresponding yes/no observable with an element $\langle \phi |$ of the dual $\mathcal H^*$. The probability of a positive outcome for a measurement of $\langle \chi |$ in the state $|\psi\rangle$ is given by $|\langle\chi|\psi\rangle|^2$. Without referencing the dual, we could alternatively just use the symbols $\chi,\psi\in \mathcal H$, and the same calculation would be represented by using the inner product $|(\chi,\psi)|^2$. Now, however, we have to explain what this means since both of the symbols in the inner product are naturally interpreted as states, and there appear to be no measurements involved. In other words, we have two vectors which each have different physical interpretations and the use of the dual distinguishes them perfectly. Not to mention all the other symbolic advantages of the Dirac notation, which are mathematically | {
"domain": "physics.stackexchange",
"id": 42336,
"lm_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, hilbert-space, metric-tensor, mathematics, metric-space",
"url": null
} |
Now assuming that your inequality is true for $n$, let us show it is also true for $n+1$:
$$\prod_{i=1}^{n+1} (1+a_i) \ge 1 + \sum_{i=1}^{n+1} a_i \iff$$
$$\iff (1 + a_{n+1})\prod_{i=1}^n (1+a_i) \ge 1 + a_{n+1} + \sum_{i=1}^n a_i$$
Again expanding the left hand side should now make it obvious:
$$(1 + a_{n+1})\prod_{i=1}^n (1+a_i) \ge 1 + a_{n+1} + \sum_{i=1}^n a_i \iff$$
$$\iff \prod_{i=1}^n (1+a_i) + a_{n+1}\prod_{i=1}^n (1+a_i) \ge a_{n+1} + (1 + \sum_{i=1}^n a_i) \iff$$
but you know, from the inductive step, that
$$\prod_{i=1}^{n} (1+a_i) \ge 1 + \sum_{i=1}^{n} a_i$$
so it suffices to show that
$$a_{n+1}\prod_{i=1}^n (1+a_i) \ge a_{n+1}$$ but that is trivially true since
$k = \prod_{i=1}^n (1+a_i) \ge 1$; then you can write $ka_n \ge a_n$ which holds true in our case: $a_n \ge 0$ and $k \ge 1$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.984810951192016,
"lm_q1q2_score": 0.8290391144536217,
"lm_q2_score": 0.8418256452674008,
"openwebmath_perplexity": 163.1397570239892,
"openwebmath_score": 0.9366137385368347,
"tags": null,
"url": "https://math.stackexchange.com/questions/2003343/multiplicative-sum-is-bigger-than-sum-prove"
} |
# Task parameters: | {
"domain": "bookdown.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126513110865,
"lm_q1q2_score": 0.8024399741234667,
"lm_q2_score": 0.8198933293122507,
"openwebmath_perplexity": 3506.343945840964,
"openwebmath_score": 0.3427765369415283,
"tags": null,
"url": "https://bookdown.org/hneth/ds4psy/A-12-iter-sol.html"
} |
newtonian-gravity, mass, units, weight
How many Newtons are in a kilogram, exactly. I thought that it was 9.80665 by definition. However, I found numerous sources on the web that seem to give the exact same answer for g, the acceleration due to gravity. Most all of them seem to give 9.80665002864 meters/sec^2. What gives? | {
"domain": "physics.stackexchange",
"id": 41641,
"lm_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-gravity, mass, units, weight",
"url": null
} |
python, scikit-learn, feature-engineering, pipelines
Here's an example of how you might create a transformer class to create custom features as part of a pipeline:
from sklearn.base import BaseEstimator, TransformerMixin | {
"domain": "datascience.stackexchange",
"id": 11378,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, scikit-learn, feature-engineering, pipelines",
"url": null
} |
c
return result;
} size_t pathLength = strlen(cache->path) + strlen(key);
char *path = malloc(pathLength);
strcpy(path, cache->path);
strcat(path, key);
Try this instead:
size_t path_len = strlen(cache->path);
size_t key_len = strlen(key);
size_t total_len = path_len + key_len + 1;
char *path = malloc(total_len);
if (!path) { /* TODO: handle error */ }
mempcy(path, cache->path, path_len);
memcpy(path + path_len, key, key_len + 1);
This is better for the following reasons: | {
"domain": "codereview.stackexchange",
"id": 934,
"lm_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
} |
vba, rubberduck
Case Else:
Dates = VBA.Format$(StartDate, "dd mmmm yyyy") & " - " & VBA.Format$(EndDate, "dd mmmm yyyy")
End Select
MonitoringDates = Dates
End Function | {
"domain": "codereview.stackexchange",
"id": 42719,
"lm_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, rubberduck",
"url": null
} |
terminology
Let me skip this discussion as matter for another SE site.
However, a quick Google chemical oriented search showed me that apolar is less diffused than what I expected, and seems to be more recurrent in biochemistry and astrochemistry, or as suggested in a comment, computational chemistry.
For the point more relevant to Chemistry SE,
"1) Is "apolar" an accepted or commonly-used word in chemistry as 2) a synonym for "electrically neutral," and if so, in what context has this appeared?"
For 1) see above. For 2) the answer is NOT. It just means, closer to the general definition that OP has found and reported, that a chemical entity has not (electrical) poles, i.e. no excess or partial electrical charges are present over its part. | {
"domain": "chemistry.stackexchange",
"id": 15550,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "terminology",
"url": null
} |
sampling, analog-to-digital, digital-to-analog
Take the Z transform of the difference equation.
Determine the transfer function form as a polynomial ratio $H(z) = Y(z)/X(z)$
From this know that the frequency response is determined by restricting $z$ to the unit circle ($z= e^{j\omega}$) with $\omega$ extending uniquely over the normalized radian frequency from $-\pi$ to $+\pi$ which corresponds to $-f_s/2$ to $+f_s/2$ where $f_s$ is the sampling rate.
Given this is an FIR structure, the transfer function will result in simply a 2nd order polynomial in the numerator (whos roots are the "zeros" of the filter). Place the zeros of this polynomial such that they corresponds to the 60 Hz locations on the unit circle (+/- 60 Hz for a real filter, mapped to the angular frequency as described above), which would provide complete attenuation at f = 60 Hz. | {
"domain": "dsp.stackexchange",
"id": 10081,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sampling, analog-to-digital, digital-to-analog",
"url": null
} |
c++, datetime
int main()
{
auto now = std::chrono::system_clock::now();
std::cout << now;
return 0;
}
Output: 2017 Jun 04 12:07:48.
The only problem with implementation is that it can't be used from multiple threads, since std::localtime() returns pointer to static variable. The format could be mutable by some function, but I wouldn't care about it at this point.
Since we can manipulate std::chrono::time_point, and std::chrono::duration, let's use everything we have:
convert given date to std::chrono::time_point<system_clock>:
A good news, at last! From std::mktime():
Converts local calendar time to a time since epoch as a time_t object. time->tm_wday and time->tm_yday are ignored. The values in time are permitted to be outside their normal ranges.
Hooray! So we can just fill in the std::tm structure with year, month, and day since January 1 and we are done!
#include <iostream>
#include <chrono>
#include <iomanip> | {
"domain": "codereview.stackexchange",
"id": 25896,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, datetime",
"url": null
} |
ros, ros-melodic, state
Originally posted by joao.aguizo on ROS Answers with karma: 53 on 2020-11-17
Post score: 1
Hi, you are right in that a priority container will prevent other states from executing as soon as it is entered. More precisely, it pauses execution. For an active state, it will be the same as if the user pressed "pause" at the moment when the priority container is entered and "resume" when it is left.
The catch is only that a regular state machine would execute one state after the other, there is no way for a priority container to become active at the same time as another state. To achieve this, place a priority container somewhere within a concurrency container. In a concurrency container, all direct children are active at the same time and if at any time the priority container in one of the sub-statemachines becomes active, it will pause all other states that are otherwise active at the same time. | {
"domain": "robotics.stackexchange",
"id": 35770,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, state",
"url": null
} |
c++, concurrency
queue_node(const T& element, const size_t index) :
m_element{element},
m_element_index{index},
m_next{nullptr}
{
}
};
std::mutex m_mutex;
queue_node* m_head;
queue_node* m_tail;
public:
queue(std::initializer_list<T> list)
{
m_head = nullptr;
size_t index = 0;
for (const auto& element : list)
{
queue_node* new_node = new queue_node(element,
index++); | {
"domain": "codereview.stackexchange",
"id": 20781,
"lm_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++, concurrency",
"url": null
} |
quantum-mechanics, quantum-field-theory, quantum-electrodynamics, second-quantization
grounds we must reject the identification made by OP if we want a viable QFT with particles. Now what mathematical mistake did led OP to this erroneous conclusion, I believe @yu-v has done a good job explaining that. | {
"domain": "physics.stackexchange",
"id": 65351,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, quantum-electrodynamics, second-quantization",
"url": null
} |
hash, hashing
Thank your for your input! Suppose that $t=11$, $i=5$, $j=6$. Then $i+j \bmod t = 0$, and there is no contradiction. However, in this example $i < t/2$ while $j > t/2$. This sort of example cannot happen if $i,j < t/2$, since then $i+j < t$. | {
"domain": "cs.stackexchange",
"id": 17439,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "hash, hashing",
"url": null
} |
electrical-engineering, optics, lasers
If we define the length of the two arms of the Michelson to be $L_1$ and $L_2+\delta\ell$, where $L_1$ and $L_2$ are macroscopic distances on the order of meters and $\delta\ell$ is a microscopic distance on the order of micrometers, then the interference properties of the Michelson only depend on $\delta\ell$ for highly coherent light like a laser. However, the interference properties of the Michelson for incoherent light depend on the relative macroscopic distances. If $|L_1-L_2|\gg L_c$, where $L_c$ is the coherence length of the incoherent light, then the Michelson will not display any interference regardless of $\delta\ell$. | {
"domain": "engineering.stackexchange",
"id": 916,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrical-engineering, optics, lasers",
"url": null
} |
java, strings
return sb.toString();
}
It would be much easier with BigDecimals:
String input = "00007.880000";
BigDecimal hundred = BigDecimal.valueOf(100);
BigDecimal result = new BigDecimal(input).multiply(hundred).stripTrailingZeros();
System.out.println(result.toString()); // prints "788"
It works with big numbers well:
String input = "0000123456789123456789.123456789123456789123456789123456789880000";
BigDecimal hundred = BigDecimal.valueOf(100);
BigDecimal result = new BigDecimal(input).multiply(hundred).stripTrailingZeros();
// prints "12345678912345678912.345678912345678912345678912345678988"
System.out.println(result.toString());
Two readings:
Effective Java, 2nd Edition, Item 48: Avoid float and double if exact answers are required
Why not use Double or Float to represent currency?
The original code returns 788.0000 for 00007.880000 which I guess does not fulfill the specification.
Java developers usually start method names with lowercase letters. | {
"domain": "codereview.stackexchange",
"id": 6662,
"lm_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, strings",
"url": null
} |
quantum-mechanics, photons, double-slit-experiment
So it will emit a photon at a definite frequency when the electron comes back from the excited state, which will spread like a spherical wave. | {
"domain": "physics.stackexchange",
"id": 66439,
"lm_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, photons, double-slit-experiment",
"url": null
} |
special-relativity, conventions, speed, one-way-speed-of-light
Note that this is a statement in the philosophy literature. Indeed, philosophers continue to debate this sort of thing endlessly. Among physicists this is settled. The OWSOL is purely conventional based on your choice of synchronization convention. This is well established by Reichenbach and later by Anderson (R. ANDERSON, I. VETHARANIAM, G.E. STEDMAN, "CONVENTIONALITY OF SYNCHRONISATION, GAUGE DEPENDENC AND TEST THEORIES OF RELATIVITY", Physics Reports 295 (1998) 93-l80) in a more complete form. At this point, any debate in the physics community is limited to people who are unfamiliar with the literature on the topic.
In this case, is our speed limit still c or is it 2/3c, 2c, or something else? Does it depend on the direction of travel?
The "speed limit" is the speed of light, which is no longer equal to c in these anisotropic coordinates. | {
"domain": "physics.stackexchange",
"id": 86298,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, conventions, speed, one-way-speed-of-light",
"url": null
} |
Sorry, I often write it C plus dx. Do you mind if I put the constant term first in the highly difficult equation here for a straight line? So let me tell you what I'm-- so these are the points where you have a measurement-- x1, x2, up to xn. And these are the actual measurements, b1 up to bm, let's say .
And then my equations are-- I just want to set up a matrix here. I just want to set up the matrix. So I want C to get multiplied by ones every time. And I want D to get multiplied by these x's-- x1, x2, x3, to xm, the measurement places. And those are the measurements. Anyway. | {
"domain": "mit.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.987946222968067,
"lm_q1q2_score": 0.8455349135177815,
"lm_q2_score": 0.8558511524823263,
"openwebmath_perplexity": 472.62105521153546,
"openwebmath_score": 0.7132152318954468,
"tags": null,
"url": "https://ocw.mit.edu/courses/mathematics/18-065-matrix-methods-in-data-analysis-signal-processing-and-machine-learning-spring-2018/video-lectures/lecture-9-four-ways-to-solve-least-squares-problems/"
} |
python, python-3.x, async-await
Title: Creating API clients that are "async agnostic" Python3's async/await syntax is great, but it does create a divide between libraries which are async-based and those which are not. For example, boto3 (AWS API library) currently doesn't work with async. There is a separate project, aiobotocore, attempts to recreate some of this functionality in an async context.
I have been thinking for a while about how to create HTTP API clients which can be run async and sync contexts. I have come up with a strategy that involves creating a separation between the logic (preparation of requests, interpretation of responses), and the sending. The logic is implemented as a generator function, which yields out an object which represents the request, and receives back an object representing the response. This generator is "run" by a runner function, which does the actual sending, and may be sync or async. | {
"domain": "codereview.stackexchange",
"id": 34022,
"lm_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, async-await",
"url": null
} |
These cycle indices are easy to compute and we do not need to iterate over all $$n!\times m!$$ pairs of permutations (acting on $$A$$ and $$B$$) but instead it is sufficient to iterate over pairs of terms from the cycle indices $$Z(S_n)$$ and $$Z(S_m)$$ of the symmetric groups $$S_n$$ and $$S_m$$ according to their multiplicities to obtain the cycle index $$Z(Q_{n,m})$$ of the combined action on $$A$$ and $$B$$. The number of terms here is the much better count of the number of partitions of $$n$$ and $$m$$ (upper bound).
The classic approach to the calculation of these cycle indices is based on the simple observation that for two cycles, one of length $$l_1$$ from a permutation $$\alpha$$ of $$A$$ and another of length $$l_2$$ from a column permutation $$\beta$$ of $$B$$ their contribution to the disjoint cycle decomposition product for $$(\alpha,\beta)$$ in the cycle index $$Z(Q_{n,m})$$ is by inspection | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138144607745,
"lm_q1q2_score": 0.8562690370894727,
"lm_q2_score": 0.8757869884059266,
"openwebmath_perplexity": 1273.553374674751,
"openwebmath_score": 0.5907314419746399,
"tags": null,
"url": "https://math.stackexchange.com/questions/1151538/finding-the-spanning-subgraphs-of-a-complete-bipartite-graph/"
} |
$(A, {\mathfrak m}, k)$ is a Noetherian local ring which is Cohen-Macaulay of dimension $1$. Assume also that the embedding dimension of $A$ is $2$, i.e., assume that $$\dim_k {\mathfrak m}/{\mathfrak m}^2 = 2.$$ Notations: $f$, $F$, $x, y\in {\mathfrak m}$, $I$ as in Ex.\ 6 above. Please use any results from the problems above. \begin{enumerate} \item Suppose that $z\in {\mathfrak m}$ is an element whose class in ${\mathfrak m}/{\mathfrak m}^2$ is a linear form $\alpha \bar x + \beta \bar y \in k[\bar x, \bar y]$ which is coprime with $f$. \begin{enumerate} \item Show that $z$ is a nonzerodivisor on $A$. \item Let $d = \deg(F)$. Show that ${\mathfrak m}^n = z^{n + 1-d}{\mathfrak m}^{d-1}$ for all sufficiently large $n$. (Hint: First show $z^{n + 1-d}{\mathfrak m}^{d-1} \to {\mathfrak m}^n/{\mathfrak m}^{n + 1}$ is surjective by what you know about $Gr_{\mathfrak m}(A)$. Then use NAK.) \end{enumerate} \item What condition on $k$ guarantees the existence of such a $z$? (No proof | {
"domain": "github.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964220125032,
"lm_q1q2_score": 0.8080019446376565,
"lm_q2_score": 0.8198933315126792,
"openwebmath_perplexity": 120.73245969658541,
"openwebmath_score": 0.9982831478118896,
"tags": null,
"url": "https://github.com/stacks/stacks-project/blob/master/exercises.tex"
} |
# n <- length(law2$LSAT) # i <- 1 # total <- choose(2*n - 1, n - 1) # gray_codes <- matrix(0, nrow = total, ncol = n) # # r <- array(0, n) # r[1] <- n # t <- n # h <- 0 # gray_codes[i, ] <- r # i <- i + 1 # # while (r[n] != n) { # if (t != 1) { # h <- 0 # } # h <- h + 1 # t <- r[h] # r[h] <- 0 # r[1] <- t - 1 # r[h + 1] <- r[h + 1] + 1 # gray_codes[i, ] <- r # i <- i + 1 # } # proc.time() - ptm Now, we recompute the complete enumerations bootstrap after removing Observation 11. We compute both the new correlation of the bootstrap sample as well as its multinomial probability of obtaining that particular bootstrap sample. We see that the distribution of using the complete enumeration is about the same as the one obtained in the lecture slides. The distribution and the code is shown below. # Complete Enumerations Simulation # ptm <- proc.time() # enumData <- mclapply(1:total, function(i) { # index <- t(gray_codes)[,i] # law_list <- lapply(1:n, function(j) matrix(rep(law2[j,], index[j]), | {
"domain": "github.io",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9724147209709196,
"lm_q1q2_score": 0.8322422578460973,
"lm_q2_score": 0.8558511506439708,
"openwebmath_perplexity": 1125.6926208544794,
"openwebmath_score": 0.7551544904708862,
"tags": null,
"url": "http://christofseiler.github.io/stats205/Homework2/Solution2.html"
} |
pcl, tf2, pcl-ros, transform, velodyne
Originally posted by OMC on ROS Answers with karma: 74 on 2016-10-06
Post score: 3
The TransformListener needs time to store some transforms so that interpolation can be done. I usually try to create transform listeners as member variables of my class so that they are persistent during runtime. If you are declaring listener as a local variable in a function and then immediately trying to use it then you will get those types of errors.
Edit:
If you want to use the latest transform I suggest using the pcl_ros::transformPointCloud that accepts a target_frame and a tf::TransformListener as opposed to manually converting transforms yourself.
Originally posted by Thomas D with karma: 4347 on 2016-10-06
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 25910,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pcl, tf2, pcl-ros, transform, velodyne",
"url": null
} |
$$\int\limits_0^x {\sqrt {1 - {t^2}} dt} = \frac{\pi }{4}- \frac{{{{\cos }^{ - 1}}x}}{2} + \frac{{x\sqrt {1 - {x^2}} }}{2}$$
Note that your solution is incorrect. It should be
$$\int {\sqrt {1 - {x^2}} dx} = \frac{{{{\sin }^{ - 1}}x}}{2} + \frac{{x\sqrt {1 - {x^2}} }}{2} + C$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180635575531,
"lm_q1q2_score": 0.8338607373564232,
"lm_q2_score": 0.8459424334245617,
"openwebmath_perplexity": 347.91999851906166,
"openwebmath_score": 0.878262460231781,
"tags": null,
"url": "http://math.stackexchange.com/questions/109379/integrating-sqrt1-x2-by-interpreting-it-geometrically-as-an-area-within-a"
} |
python, beginner, python-3.x, random, role-playing-game
if ch4 in ['y', 'Y', 'YES', 'Yes', 'yes']:
intro()
elif ch4 in ['n', 'N', 'No', 'NO', 'no']:
print("Thank you for playing")
def its_getting_late():
time.sleep(1)
print("Its starting to get late")
ch2 = str(input("Do you wanna go to sleep? [y/n]: "))
if ch2 in ['y', 'Y', 'YES', 'Yes', 'yes']:
print("You were shot dead last Night")
elif ch2 in ['n', 'N', 'No', 'NO', 'no']:
print("You stay up")
print("You see a person")
ch3 = str(input("Do you wanna attack the person? [y/n]: "))
if ch3 in ['y', 'Y', 'YES', 'Yes', 'yes']:
time.sleep(1)
fight_enemy_2('Enemy', 4, 9, 1, 7)
elif ch3 in ['n', 'N', 'No', 'NO', 'no']:
print("You try to run away")
print("But the Enemy is faster than you and stabs you")
game_over()
def game_over():
print("You lost")
ch5 = str(input("Do you wanna play again? [y/n] ")) | {
"domain": "codereview.stackexchange",
"id": 15150,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-3.x, random, role-playing-game",
"url": null
} |
c#
return users.Convert(RecipientType.User).Concat(groups.Convert(RecipientType.Group)).ToArray();
}
}
}
class PrincipalEqualityComparer<TPrincipal> : IEqualityComparer<TPrincipal> where TPrincipal : Principal
{
public bool Equals(TPrincipal x, TPrincipal y)
{
if (x != null && y == null || x == null && y != null) return false;
return ReferenceEquals(x, y) || string.Equals(x.Name, y.Name) || string.Equals(x.DisplayName, y.DisplayName);
}
public int GetHashCode(TPrincipal obj)
{
return 0; // obj.GetHashCode();
}
} | {
"domain": "codereview.stackexchange",
"id": 33858,
"lm_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
} |
gazebo, simulation
Originally posted by erkmns on ROS Answers with karma: 91 on 2011-10-19
Post score: 2
Original comments
Comment by Arkapravo on 2011-11-04:
Can you put your result in some website or video ? Should be very interesting.
Comment by erkmns on 2011-10-27:
We came up with a work-around, making external forces interact with both objects, using the apply_body_wrench service.
The reference frame being the frame of the other object, and the wrench defined as a negative force in direction z.
Comment by Arkapravo on 2011-10-20:
Good question !
Usually, it is much better to use Gazebo plugins instead of the apply_body_wrench service. The reason is that a Gazebo plugin is run exactly once for every simulation cycle, while the apply_body_wrench service interacts with the simulation in irregular intervals, leading to instabilities.
To do this:
specify each cubelet in an URDF file
add a Gazebo controller which excerts the magnetic forces | {
"domain": "robotics.stackexchange",
"id": 7025,
"lm_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, simulation",
"url": null
} |
ros, turtlebot, gyro
Does anybody have any suggestions?
Alaina - Singularity University - Mountain View, CA | {
"domain": "robotics.stackexchange",
"id": 5995,
"lm_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, turtlebot, gyro",
"url": null
} |
rosdep, catkin
But now I don't know how to allow users to install existing packages and their dependences (e.g. ros_tutorials).
I know that the usual way is to use rosdep, but it always work with existng binaries with apt-get, or with pip commands, am I right? Users can use pip if they setup a virtualenv, but they cannot use apt-get...
Is there any way to make it download and build sources?
I know that they can clone the repository in their catkin_ws (with or without wstool) and just catkin_make... and this is quite fine!
But... is there any way to at least download/clone all the dependencies of the desired not already in the catkin_ws or in the ROS installation path?
The rosinstall_generator looks as the tool I'm asking for... but it includes all depedencies althought they are alrady installed?
What is the standard way to work with source packages and source dependencies?
Thanks!
Albert | {
"domain": "robotics.stackexchange",
"id": 25756,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosdep, catkin",
"url": null
} |
kepler, keplers-laws
While I feel you should reduce this to the range 0-2pi, you should be able to solve Kepler's equation with this value, and your solution is correct (I checked by graphing M = E-e sin(E) online with GeoGebra). As expected with a nearly circular orbit (e=0.0489), $M\approx E=8.72$ I'd still reduce this to the range 0-2pi, to get the book value of E=2.43. | {
"domain": "astronomy.stackexchange",
"id": 6074,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kepler, keplers-laws",
"url": null
} |
angular-momentum, rotational-dynamics, reference-frames
$$ \sum_i m_i r_i = \sum_i m_i R = m\, R $$
$$ R = \frac{ \sum_i m_i r_i }{\sum_i m_i } $$
But since $r_i = R + r'_i$, the above is also
$$ \require{cancel} \sum_i m_i r_i = \sum_i m_i (R+r'_i) = \sum_i m_i R + \cancel{ \sum_i m_i r'_i } $$
So the definition of the CoM, implies that $ \sum_i m_i r'_i =0$.
Note that the derivative of the above is $\sum_i m_i v'_i =0 $ must also be true which is used in the derivation of angular momentum.
As a result, you can state that At every instant, only the vector $R$ tracks the center of mass. and the vector $r'_i$ cancels out of the calculation. Essentially this is the definition of center of mass. | {
"domain": "physics.stackexchange",
"id": 59885,
"lm_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, rotational-dynamics, reference-frames",
"url": null
} |
10 times. For example, the probability of rolling at least one 6 out of two dice is 11/36. Probability refers to a measure quantifying the likelihood that certain events will occur. It's just saying, look, this is a reasonable prediction. So, the probability of rolling any pair can be computed as the sum of. Because you are rolling comparatively few dice (compared to thousands), Mathhammer on the tabletop means that you can have an expectation of what “should” happen, but no guarantees. All you have to do is provide the input values and hit calculate. You can decide on the range of numbers on your dice or spinner (1-6 or 0-9), and you can roll/spin two at a time if you wish. While it is a good idea to know your dice basics, doing so will only help you in the case of an easy dice problem. However, anytime you add another die the outcome is multiplied by an additional six making the dice odds a bit trickier to calculate. Upon entering these two values, the dice probability calculator | {
"domain": "solotango.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462222582661,
"lm_q1q2_score": 0.8167467980664752,
"lm_q2_score": 0.8267117983401363,
"openwebmath_perplexity": 423.0144392656807,
"openwebmath_score": 0.5905336737632751,
"tags": null,
"url": "http://vumm.solotango.it/dice-probability-calculator.html"
} |
graph-theory, graph-algorithms, shortest-path, hamiltonian-paths
Edit 2 Another interesting example for the possibilities is: If you are taking a graph that all the weights are 1 or 2. The minimum offset will be exactly 1. It is an open problem to lower bound the difference between two distinct Euclidean TSP tours by an inverse polynomial in the input size. Such a lower bound would show that Euclidean TSP is an NP optimizaition problem, which is not known.
Let us assume that a Euclidean TSP instance is given by a collection of points in $(\mathbb{Z} \cap [-N, N])^2$ (i.e. points with integer coordinates bounded in absolute value by $N$). It is not known how to decide the following problem in polynomial time: given two tours $T_1$, $T_2$ over the same set of points, is the cost $c(T_1)$ of $T_1$ less than the cost $c(T_2)$ of $T_2$. To solve this problem it is sufficient to upper bound $-\log |c(T_1) - c(T_2)|$ by a polynomial in n and $\log N$, which is equivalent to your question. | {
"domain": "cstheory.stackexchange",
"id": 2315,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graph-theory, graph-algorithms, shortest-path, hamiltonian-paths",
"url": null
} |
angular-momentum, magnetic-moment
Title: Why don't we use earth's magnetic field to desaturate the reaction wheels of satellites? While reading about the James Webb Telescope I learned that the sun's radiation pressure exerts a torque on Webb's big sunshield that needs to be countered by reaction wheels. Every once in a while, when the wheels start to spin too fast, they need to be slowed down again using the vehicle's thrusters. But since thruster fuel is limited this can't go on forever. So we either refuel James Webb sometime in the future or it goes out of operation. | {
"domain": "physics.stackexchange",
"id": 85992,
"lm_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, magnetic-moment",
"url": null
} |
identity work in Commander? Like... suppose you decided to measure square angles in terms of the surface area on a sphere swept by an arc of $x$ radians. (Mathematically, the solid angle is unitless, but for practical reasons, the steradian is assigned.) Thanks for contributing an answer to Mathematics Stack Exchange! Steradians are equivalently referred to as 'square radians.' rev 2021.1.21.38376, The best answers are voted up and rise to the top, Mathematics Stack Exchange works best with JavaScript enabled, Start here for a quick overview of the site, Detailed answers to any questions you might have, Discuss the workings and policies of this site, Learn more about Stack Overflow the company, Learn more about hiring developers or posting ads with us. A steradian is a 'solid radian'. geometry. Radian and steradian are two supplementary fundamental units. Initially the area swept by $x$ would be close to $\pi x^2$, but as you approached $x \rightarrow 2\pi$ the swept area would not be | {
"domain": "com.br",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9674102524151827,
"lm_q1q2_score": 0.8203327013138006,
"lm_q2_score": 0.8479677564567912,
"openwebmath_perplexity": 1194.1398768879587,
"openwebmath_score": 0.8582568168640137,
"tags": null,
"url": "http://sissistemas.com.br/c925w0/radian-and-steradian-9f3185"
} |
python, game, python-2.x, ascii-art, minesweeper
Strange formatting when inputting coordinates – This is a minor detail, but I get confused when reading the code where you input coordinates. The kind of loose "Enter the coordinates" I see the reasoning behind, but the following lines with long lines and breaking of indentation makes it a little hard to read. Here are some ideas to clean it up: | {
"domain": "codereview.stackexchange",
"id": 17218,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, game, python-2.x, ascii-art, minesweeper",
"url": null
} |
transcription, microrna
For those microRNAs that reside in a parent gene, the direction of transcription is generally, although not exclusively, the same as that of the transcript (ca. 70%, according to this review).
The question arises whether the intronic microRNAs are generated from the spliced introns of transcripts of their parent genes. One of many papers which consider this is by Ramalingam et al. (2014). It appears that in some cases this may be so, but in other cases this appears to be ruled out by a disparity between the expression profiles of parent genes and microRNAs, and between different microRNAs encoded in the same intron. | {
"domain": "biology.stackexchange",
"id": 8076,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "transcription, microrna",
"url": null
} |
classical-mechanics, statistical-mechanics, galilean-relativity, integrals-of-motion
Independence of Constants of Motion:
In the context of Lie groups, each generator $X_i$ corresponds to a distinct symmetry transformation. The independence of these generators implies that no $X_i$ can be expressed as a linear combination of other generators. In physics, this means each conserved quantity $C_i$ (derived via Noether's theorem) is independent, as they correspond to different symmetries.
Additivity of Integrals of Motion:
The additivity of integrals of motion, represented as $f = \sum_{i=1}^n f_i$, arises from the linear nature of the symmetry group's generators. These generators correspond to linear transformations, making the associated conserved quantities naturally additive over subsystems. | {
"domain": "physics.stackexchange",
"id": 98316,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, statistical-mechanics, galilean-relativity, integrals-of-motion",
"url": null
} |
ho w to solv e linear programs. 5. Integer programming can also be solved in polynomial time if the total number of variables is two [6]; Tutorial on solving linear programming word problems and applications with two variables. Each Danio eats 4 grams/day of fish flakes while the slower Gourami eats 2 grams/day. 4 Determine the number of each type that must be produced each week to make a Set Up a Linear Program, Problem-Based Convert a Problem to Solver Form. In this notebook, we’ll explore how to construct and solve the linear programming problem described in Part 1 using PuLP. For additional formulation examples, browse Section 3. Maximize 3x + 4y subject the variables. Table 1. Please check image below for reference. Minimize f LINEAR PROGRAMMING: EXERCISES - V. Package ‘lpSolve’ August 19, 2019 Version 5. 4X – 7Y – 5Z < 2 (b) Adding slack variables in the constraints . Linear programming example 1997 UG exam. Customer A needs fifty sheets and Customer B needs seventy sheets. In | {
"domain": "makariharlem.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513873424045,
"lm_q1q2_score": 0.8585407040574128,
"lm_q2_score": 0.8705972684083609,
"openwebmath_perplexity": 606.6295555419894,
"openwebmath_score": 0.5247300267219543,
"tags": null,
"url": "http://makariharlem.com/qt6hqml/linear-programming-2-variables-examples.html"
} |
thermodynamics, evaporation, condensation
A fly spends about 25% of its time re-digesting and it only can eat liquids. It mixes the eaten food with the appropriate enzyme for digestion. The fly does this by retrieving the eaten food from its digestive system (a vomit of sorts), and drop by drop it is placed on the surface on which the fly is sitting. Only then is it sucked back up after they are mixed. The small black dots, that are left in various places, such as the ceiling, are not fly droppings, but actually the remains which are not sucked back up. | {
"domain": "physics.stackexchange",
"id": 98968,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, evaporation, condensation",
"url": null
} |
I suppose you could say that adding a dimension "makes the volume bigger" for the hypersphere, but it does so even more for the unit you measure the volume with, namely the unit cube. So the numerical value of the volume does go towards zero.
Really, of course, it is apples to oranges because volumes of different dimensions are not commensurable -- it makes no sense to compare the area of the unit disk with the volume of the unit sphere.
All we can say is that in higher dimensions, a hypersphere is a successively worse approximation to a hypercube (of side length twice the radius). They coincide in dimension one, and it goes downward from there. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969645988575,
"lm_q1q2_score": 0.8418125921136481,
"lm_q2_score": 0.8558511488056151,
"openwebmath_perplexity": 235.3146041047291,
"openwebmath_score": 0.8841640949249268,
"tags": null,
"url": "https://math.stackexchange.com/questions/67039/why-does-the-volume-of-the-unit-sphere-go-to-zero"
} |
formal-languages, context-free, formal-grammars
[I guess I would need induction to prove my grammar generates every possible word in the language. But right now I'm more interested in the thought process behind coming up with a grammar, and as far as I know, induction (in general) doesn't help much in synthesising a solution/rule/formula/etc.; it principally serves to verify a purported solution.] Here is the thought process I would use. I would notice that your language $L$ can be written as $L= L_1 \cap L_2$, where $L_1$ is the set of words that begin and end with the same symbol, and $L_2$ is the set of words that have equal quantities of a's and b's.
Then, I would note that $L_1$ is regular and so can be expressed by a simple DFA (with 5 states). Also, I would note that $L_2$ is context-free and can be expressed by a simple CFG: e.g., $S \to \varepsilon \mid aSb \mid bSa \mid SS$. | {
"domain": "cs.stackexchange",
"id": 5935,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, context-free, formal-grammars",
"url": null
} |
objective-functions, pytorch
Title: What should I think about when designing a custom loss function? I'm trying to get my toy network to learn a sine wave.
I output (via tanh) a number between -1 and 1, and I want the network to minimise the following loss, where self(x) are the predictions.
loss = -torch.mean(self(x)*y) | {
"domain": "ai.stackexchange",
"id": 3356,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "objective-functions, pytorch",
"url": null
} |
c++
Don't loop on eof()
The code currently contains this in Game.cpp:
void Game::Intro() {
//Opens text file "intro.txt"
std::ifstream intro;
intro.open("intro.txt");
//Outputs text from file
if(intro.is_open()) {
std::string str;
//While file has not reached the end
while(!(intro.eof())) {
getline(intro, str);
std::cout << str << std::endl;
}
std::cout << std::endl << std::endl;
intro.close();
}
} | {
"domain": "codereview.stackexchange",
"id": 40703,
"lm_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
} |
# Show why the value converges to $\pi$
$a_0=1$
$a_{n+1}=a_n+\sin{(a_n)}$
Explain why the following occurs:
$a_0=1$
$a_1=1+\sin{(1)}\approx 1.841470985$
$a_2=1+\sin{(1)}+\sin{(1+\sin{(1)})}\approx 2.805061709$
$a_3=1+\sin{(1)}+\sin{(1+\sin{(1)})}+\sin{(1+\sin{(1)}+\sin{(1+\sin{(1)})})}\approx 3.135276333$
$a_4\approx 3.141592612$
$a_5\approx 3.141592654\approx\pi$
Note by Jack Han
4 years, 11 months ago
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant: | {
"domain": "brilliant.org",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9884918533088547,
"lm_q1q2_score": 0.896870739222537,
"lm_q2_score": 0.907312221360624,
"openwebmath_perplexity": 899.8362535967503,
"openwebmath_score": 0.9868111610412598,
"tags": null,
"url": "https://brilliant.org/discussions/thread/show-why-the-value-converges-to-pi/"
} |
turing-machines, computability, logic, undecidability, oracle-machines
Title: Can the higher-order oracle Turing machines simulate the lower-order machines so that the current oracle does not contradict the simulated oracle? Here is a quote from the Source 1:
For example, if $M$ is a machine with an oracle for the halting problem, then obviously there isn't in general an equivalent machine that can simulate the oracle.
But here is a quote from the Source 2:
If you have an oracle for the halting problem, then you can compute the Busy Beaver function. Given an input $n$, just search through all Turing machines with $n$ states and check whether they halt or not. For the TMs that halt, run them through to completion, and count the number of steps or symbols printed. Keep track of the maximum score. After you have run through all possible Turing machines, you will have the Busy Beaver number. | {
"domain": "cs.stackexchange",
"id": 11173,
"lm_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, computability, logic, undecidability, oracle-machines",
"url": null
} |
quantum-field-theory, general-relativity, renormalization, quantum-gravity, effective-field-theory
Title: What is the problem with quantizing GR in the Effective Field Theory approach? In the modern view due to Wilson, the cut-off $\Lambda$ is an intrinsic property of a theory and renormalization just means that the theory is invariant under scale transformations below $\Lambda$. The divergences are now absent due to the cut-off. In this case, what would be the problem in performing the Feynmann path integral using the Einstein-Hilbert (EH) action and then get a quantized theory for gravity?
I understand that what is done is to add higher order terms to the Lagrangian, but why the EH action is to be seen as a low energy theory? I think my confusion is related to how we determine $\Lambda$ itself. For example, what is the value for $\Lambda$ that makes EH action be a low energy theory? | {
"domain": "physics.stackexchange",
"id": 29560,
"lm_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, general-relativity, renormalization, quantum-gravity, effective-field-theory",
"url": null
} |
geology, geophysics, core
The main factor slowing down the cooling is radioactive decay of long living atoms, namely Uranium-238, Uranium-235, Thorium-232, and Potassium-40, with half-lives of roughly 4.47 billion years, 704 million years, 14.1 billion years, and 1.28 billion years, respectively. From the half-lives of these isotopes and a comparison with the age of Earth, you can see that internal heat production via radioactive decay will likely persist at near current levels for quite some time to come. Verhoogen gives 5000 K as the core temperature now, and a 250 K cooling since the formation of the Solar System, 4.5 billion years ago. If it really does cool at that rate (55 degrees per billion years), it would take something like 91 billion years to cool to 0 Kelvin.
But don't worry, it won't happen, as I said.
Edited to add detail | {
"domain": "earthscience.stackexchange",
"id": 228,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "geology, geophysics, core",
"url": null
} |
javascript
There is no need to continue with the loops if a decomposition into a sum of
two squares has been found.
Now note that one integer in the decomposition determines the other. If we have
a test candidate \$ a \$ for \$ c = a^2 + b^2 \$ then it suffices
to check if \$ \sqrt{c - a^2} \$ is an integer. Also we can assume that \$ a \le b \$,
which restricts the range of \$ a \$:
var judgeSquareSum = function(c) {
let aMax = Math.sqrt(c/2);
for (let a = 0; a <= aMax; a++) {
let b = Math.sqrt(c - a * a);
if (b === Math.round(b)) {
return true;
}
}
return false;
};
Only one loop instead of two nested loops now!
Further improvement is possible with the help of mathematics. As stated in
Sum of two squares theorem,
An integer greater than one can be written as a sum of two squares if and only if
its prime decomposition contains no prime congruent to 3 (mod 4) raised to an odd power. | {
"domain": "codereview.stackexchange",
"id": 28487,
"lm_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",
"url": null
} |
# Restate Feynman's "Great Identity"
In a letter dated July 7, 1948, Richard Feynman, a Nobel laureate in physics (1965) made a claim:
I am the possessor of a swanky new scheme to do each problem in terms of one with one less energy denominator. It is based on the great identity $\frac{1}{ab} = \int \limits_{0}^{1} \frac{1}{(ax+b(1-x))^2}\;dx$.
(The Beat of a Different Drum: The Life and Science of Richard Feynman, by Jagdish Mehra, page 262)
Assuming non-zero constants $a, b$ are both real but otherwise arbitrary, let’s check the validity of Feynman’s “great identity”.
If $a \ne b$,
$\int \frac{1}{(ax+b(1-x))^2}\;dx$
$= \int \frac{1}{((a-b)x+b)^2}\;dx$
$= \int \frac{1}{a-b}\cdot \frac{a-b}{((a-b)x+b)^2}\;dx$
$= \frac{1}{a-b}\int \frac{((a-b)x+b)'}{((a-b)x+b)^2}\;dx$
$= \frac{1}{a-b}\cdot \frac{-1}{(a-b)x+b}$.
Using Leibniz’s rule, | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180656553328,
"lm_q1q2_score": 0.81268701314862,
"lm_q2_score": 0.8244619242200082,
"openwebmath_perplexity": 874.8258982034189,
"openwebmath_score": 0.8976935148239136,
"tags": null,
"url": "https://vroomlab.wordpress.com/category/mathematics/"
} |
cell-biology, neuroscience, physiology, neurotransmitter, cell-signaling
No.
There are two general types of receptors for neurotransmitters, ligand gated ion channels and receptors that activate second messenger systems, for example, G protein coupled receptors. They are sometimes referred to as ionotropic and metabotropic receptors. This figure from Principles of Neural Science, Ch. 10 illustrates the difference nicely: | {
"domain": "biology.stackexchange",
"id": 8958,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cell-biology, neuroscience, physiology, neurotransmitter, cell-signaling",
"url": null
} |
lagrangian-formalism, conservation-laws, symmetry, hamiltonian-formalism, noethers-theorem
Title: What does a symmetry that changes the Lagrangian by a total derivative do to the Hamiltonian $H$? A tiny symmetry transformation may change the Lagrangian $L$ by a total time derivative of some function $f$. This is a basic fact used in the proof of Noether's theorem.
How can we see the effect of this total derivative term in the Hamiltonian framework? Is there a good example to work out? I can't think of one off the top of my head. It just seems strange to me that all this fuss about total derivatives seem to disappear in the Hamiltonian framework. I suppose I figured out the "answer" to my very vague question, although the other answers here are also helpful. The "Hamiltonian Lagrangian" is
$$
L = p_i \dot q_i - H.
$$
Say we have a conserved charge $Q$, that is
$$
\{Q, H\} = 0.
$$
If we make the tiny symmetry variation
$$
\delta q_i = \frac{\partial Q}{\partial p_i} \hspace{1cm} \delta p_i = - \frac{\partial Q}{\partial q_i}
$$
then
\begin{align*} | {
"domain": "physics.stackexchange",
"id": 55160,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, conservation-laws, symmetry, hamiltonian-formalism, noethers-theorem",
"url": null
} |
javascript, beginner, html, image
</section>
</div>
</body> Note: you're cloning a DOM element not an actual image..
About .querySelector
The great thing about .querySelector is that you can use any DOMString (CSS string selectors) to select the elements. However in your case you're using the action attribute on the button. So essentially you're already naming your buttons (here there's only one). You can actually get away with not naming them at all. If you have multiple buttons you could simply select them with .querySelectorAll which returns a NodeList that you can either: | {
"domain": "codereview.stackexchange",
"id": 31076,
"lm_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, beginner, html, image",
"url": null
} |
____________________________________________________________________
A ZFC Theorem
We now prove a result that is similar to Corollary 2 but uses no set-theory beyond the Zermelo–Fraenkel set theory plus axiom of choice (abbreviated by ZFC). Of course the conclusion is not as strong. Even though the assumption $2^\omega<2^{\omega_1}$ is removed in Theorem 6, note the similarity between the proof of Theorem 1 and the proof of Theorem 6.
Theorem 6
Let $X$ be a CCC space with character $\le 2^\omega$. Then the following conditions hold:
• If $X$ is normal, then every closed and discrete subset of $X$ has cardinality less than continuum.
Proof of Theorem 6
Let $X$ be a normal CCC space with character $\le 2^\omega$. Let $Y$ be a closed and discrete subset of $X$. We show that $\lvert Y \lvert < 2^\omega$. Suppose that $\lvert Y \lvert = 2^\omega$. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9910145691243959,
"lm_q1q2_score": 0.807907278620123,
"lm_q2_score": 0.8152324938410783,
"openwebmath_perplexity": 70.97457507235224,
"openwebmath_score": 0.982619047164917,
"tags": null,
"url": "https://dantopology.wordpress.com/2014/04/"
} |
java, beginner, swing
public void mouseDragged(MouseEvent event) {
statusBar.setText(String.format("Dragging mouse at %d, %d",
event.getX(), event.getY()));
}
public void mouseMoved(MouseEvent event) {
statusBar.setText(String.format("Moving mouse at %d, %d",
event.getX(), event.getY()));
} | {
"domain": "codereview.stackexchange",
"id": 11195,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner, swing",
"url": null
} |
• The rings with property $\dim R=\mathrm{ht}(\mathfrak n)$ for every maximal ideal $\mathfrak n$ are called equicodimensional. Now notice that if $R$ is a Jacobson equicodimensional ring, then $\dim R_f=\dim R$. Once again, both examples of Mohan's satisfy this condition (see this answer). – user26857 May 21 '17 at 9:14 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517443658748,
"lm_q1q2_score": 0.8171461268465422,
"lm_q2_score": 0.8354835330070838,
"openwebmath_perplexity": 128.0234544171211,
"openwebmath_score": 0.9465066194534302,
"tags": null,
"url": "https://math.stackexchange.com/questions/2289083/when-is-dim-r-f-dim-r"
} |
optimization, ruby
# new table
1 2 3 4 5
1 1 2 3 4 5
2 4 6 8 10
3 9 12 15
4 16 20
5 25
# final multiplication table
arr = [
[1,2,3,4,5],
[4,6,8,10],
[9,12,15],
[16,20],
[25]
]
To access a*b where a >= b, the answer is in arr[a-1][b-a]
To access 3*4, the answer is in row 3-1, element 4-3 = arr[3-1][4-3] = arr[2][1] = 12
To access 5*2 (= 2*5), the answer is in row 2-1, element 5-2 = arr[2-1][5-2] = arr[1][3] = 10
To access 100x100 (assuming the range goes high enough), arr[99][0]
You'll need to do something slightly different if you are passing an array that isn't 1..x - in that case, first look up the index of each of the two numbers in the original array and use THEM in the arr[a-1][b-a] lookup. I suspect you'll need to subtract 1 from the indices but I haven't worked it out in my head. | {
"domain": "codereview.stackexchange",
"id": 12216,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optimization, ruby",
"url": null
} |
frequency-spectrum, sampling, dft, spectrogram
if(generateFigures == ON)
saveas(hFigure,['Figure', num2str(figureIdx, figureCounterSpec), '.png']);
end
%% Analysis - DFT of the Non Uniformly Sampled Data
vY = cos(2 * pi * signalFreq * vTD);
mD = exp(1j * 2 * pi * (vTD / timeInterval) * vK.') / numSamples;
vFy = pinv(mD) * vY;
figureIdx = figureIdx + 1;
hFigure = figure('Position', figPosLarge);
hAxes = axes();
set(hAxes, 'NextPlot', 'add');
hLineSeries = plot(vT, vX);
set(hLineSeries, 'LineWidth', lineWidthNormal);
hLineSeries = plot(vTD, vY);
set(hLineSeries, 'LineWidth', lineWidthNormal, 'LineStyle', ':', 'Marker', '*');
set(get(hAxes, 'Title'), 'String', {['Uniform Signal & Non Uniform Signal']}, ...
'FontSize', fontSizeTitle);
set(get(hAxes, 'XLabel'), 'String', {['Time Index']}, ...
'FontSize', fontSizeTitle);
set(get(hAxes, 'YLabel'), 'String', {['Sample Value']}, ...
'FontSize', fontSizeTitle);
hLegend = ClickableLegend({['Uniform Signal'], ['Non Uniform Signal']}); | {
"domain": "dsp.stackexchange",
"id": 7983,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "frequency-spectrum, sampling, dft, spectrogram",
"url": null
} |
algorithm, strings, pathfinding, matlab, edit-distance
Title: Matlab implementation of Needleman-Wunsch algorithm This code (an implementation of the path finding Needleman-Wunsch algorithm), given two sequences, correctly aligns and calculates the similarity of them. For example, given two sequences:
AAA,CCC
or
AA,CA
it correctly aligns them as
---AAA
CCC---
and
-AA
CA- | {
"domain": "codereview.stackexchange",
"id": 21116,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, strings, pathfinding, matlab, edit-distance",
"url": null
} |
Order the As first: $A_1,A_2,A_3,A_4$.
Now, $B_2$ can be placed at any one of $5$ slots.
When $B_2$ is placed at slot #$n$:
• $B_1$ can be placed at any one of $n$ slots
• $B_3$ can be placed at any one of $6-n$ slots
Hence the total number of ways to order the Bs is $\sum\limits_{n=1}^{5}n(6-n)=35$.
• @ barak, Can the solution be extended?($A_1,\dots,A_n,B_1,\dots,B_m,C_1,\dots, C_s$) – Angel Nov 19 '16 at 18:39 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969713304754,
"lm_q1q2_score": 0.8399059994121307,
"lm_q2_score": 0.8539127548105611,
"openwebmath_perplexity": 293.7191551242476,
"openwebmath_score": 0.9555800557136536,
"tags": null,
"url": "https://math.stackexchange.com/questions/2021561/how-many-permutations-of-a-1-a-2-a-3-a-4-b-1-b-2-b-3-have-the-as-and"
} |
image-processing, matlab, python
To be specific, I'm looking for some operation that will detect the 2 rivers in the above image, but not have too many other false positive detections.
EDIT: endolith asked why I am pursuing a image-processing-based approach given that in TeX we have access to the glyph positions, spacings, etc, and it might be much faster and more reliable to use an algorithm that examines the actual text. My reason for doing things the other way is that the shape of the glyphs can affect how noticeable a river is, and at the text level it is very difficult to consider this shape (which depends on the font, on ligaturing, etc). For an example of how the shape of the glyphs can be important, consider the following two examples, where the difference between them is that I have replaced a few glyphs with others of almost the same width, so that a text-based analysis would consider them equally good/bad. Note, however, that the rivers in the first example are much worse than in the second. | {
"domain": "dsp.stackexchange",
"id": 2765,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, matlab, python",
"url": null
} |
python, python-3.x
class FixedRange(BoundType):
# params is range
def generate(self):
lo, hi = (self.params.get("lohi"))
if self.dType == "int":
return rnd.randint(lo, hi)
elif self.dType == "float":
return round(rnd.uniform(lo, hi), roundPrecision)
else:
return None
class FromPossibleValues(BoundType):
# params is a list
def generate(self):
possibleval = self.params.get("set", set())
return rnd.choice(possibleval)
def createcsv(rows, filename, schema):
with open(f'./output/{filename}.csv', 'w', encoding='UTF8', newline='') as f:
writer = csv.writer(f)
writer.writerow(schema.keys())
for _ in range(rows):
writer.writerow([x.generate() for x in schema.values()])
Test:
from csvGen.csvGenerator import FixedLength, FixedRange, FromPossibleValues, createcsv | {
"domain": "codereview.stackexchange",
"id": 43946,
"lm_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
} |
cc.complexity-theory, time-complexity
Do runtimes for algorithms in P require EXP resources to upper-bound? ... are concrete examples known?
After some thought, I posted this question on MathOverflow, rather than here on TCS Theory in consequence of a (possibly wrong) intuition that the answers would be "yes" and "yes" ... for details, see the MathOverflow question.
In the event that the answer is known to TCS cognoscenti to be "no"—such that a runtime bounding algorithm (itself in P) that encompasses all algorithms in P can be concretely given—then that answer too would be very interesting and valuable.
Please consider contributing an answer to this cross-disciplinary question on MathOverflow ... or if you prefer to post your answer(s) here in TCS Theory, then eventually I will summarize them on MathOverFlow too. | {
"domain": "cstheory.stackexchange",
"id": 625,
"lm_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, time-complexity",
"url": null
} |
algorithm-analysis
Title: Counterexample to an Algorithm Complexity Statement Say I have the following statement:
If $f(n) = O(s(n))$ and $g(n) = O(r(n))$, then $f(n) - g(n) = \Theta(s(n) - r(n))$.
What would be a counterexample to this? A lot of counterexamples! $f(n) = n, s(n) = n, g(n) = n, r(n) = n^2$. $f(n) - g(n) = 0 = \Theta(n^2 - n) = \Theta(n^2)$. | {
"domain": "cs.stackexchange",
"id": 12688,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm-analysis",
"url": null
} |
python, algorithm, python-2.x, balanced-delimiters
Title: Balanced smileys check algorithm (part 2) This is a follow-up for here.
Problem
Your friend John uses a lot of emoticons when you talk to him on
Messenger. In addition to being a person who likes to express himself
through emoticons, he hates unbalanced parenthesis so much that it
makes him go :(
Sometimes he puts emoticons within parentheses, and you find it hard
to tell if a parenthesis really is a parenthesis or part of an
emoticon.
A message has balanced parentheses if it consists of one of the
following:
An empty string ""
One or more of the following characters: 'a' to 'z', ' ' (a space) or ':' (a colon)
An open parenthesis '(', followed by a message with balanced parentheses, followed by a close parenthesis ')'.
A message with balanced parentheses followed by another message with balanced parentheses.
A smiley face ":)" or a frowny face ":("
Write a program that determines if there is a way to interpret his message while leaving the parentheses balanced. | {
"domain": "codereview.stackexchange",
"id": 24209,
"lm_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-2.x, balanced-delimiters",
"url": null
} |
c++, c++17, iteration
This alternative is slightly faster because there isn't an if in the body but that's not a big deal. The if is true for all but the last iteration so the branch predictor will probably only miss on the last iteration. I also have to repeat code that has to be executed for every element which means that I need to hoist that into a function.
The first snippet is the best that I can come up with but I feel like this could be done better. Note that writing to std::cout is just an example. If you are just doing a single-shot printing of a container, just print the first element and then print delim-value pairs. This reduces the iterator requirements to being equality comparable, dereferenceable, and incrementable.
if (!vec.empty()) { // invert to return immediately if this is a function
auto first = vec.cbegin();
std::cout << *first;
while (vec.cend() != ++first) {
std::cout << ", " << *first;
}
} | {
"domain": "codereview.stackexchange",
"id": 32498,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++17, iteration",
"url": null
} |
Can anybody help?
Rolle's theorem.
MHB Math Scholar
MHB Math Scholar
Thanks.
#### Ackbach
##### Indicium Physicus
Staff member
Another result of interest, which I found here: the Darboux theorem. If a function is differentiable, then its derivative must satisfy the Intermediate Value property.
#### Deveno
##### Well-known member
MHB Math Scholar
Let us suppose by way of contradiction a counter-example exists.
Thus we have two points $c < d \in (a,b)$ such that:
$f(c) = f(d)$, but $c \neq d$.
By supposition, $c$ and $d$ are, of course, interior points of $(a,b)$, and thus since $f$ is differentiable on $(a,b)$, $f$ is continuous on $[c,d]$ and differentiable on $(c,d)$.
Hence we may apply the mean value theorem to deduce there exists a point $x_1 \in (c,d)$ such that:
$f'(x_1) = \dfrac{f(d) - f(c)}{d - c} = 0$
violating the condition $f'(x) \neq 0$ for all $x \in (a,b)$. | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137868795702,
"lm_q1q2_score": 0.8460423943480462,
"lm_q2_score": 0.8615382040983515,
"openwebmath_perplexity": 258.866835889385,
"openwebmath_score": 0.8908919095993042,
"tags": null,
"url": "https://mathhelpboards.com/threads/if-derivative-is-not-zero-anywhere-then-function-is-injective.7993/"
} |
the-sun, observational-astronomy
Due to this, there is potentially a little bit extra in altitude that the sun may travel throughout the course of a day (since the path of the ecliptic is neither aligned with the celestial coordinate system, nor aligned with the local alt/az coordinate system of the observer; unless you're at the north or south poles in which case your local alt/az coordinate system is the same as the celestial coordinate system, however both are still mis-aligned with the coordinate system of the solar system). I think the word "approximate" needs to be there. | {
"domain": "astronomy.stackexchange",
"id": 171,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "the-sun, observational-astronomy",
"url": null
} |
thermodynamics, temperature, boiling-point
So the freezing point of water was not decided to be 273.15, it was decided that it was 0 in celsius and, when absolute zero was measured and the new Kelvin scale set, that demanded that the freezing point of water had that value in the new scale. | {
"domain": "chemistry.stackexchange",
"id": 17162,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, temperature, boiling-point",
"url": null
} |
java, performance, sql, oracle
Each time you change a record, the block it is stored in is changed, and the difference is recorded in the redo log. The number of blocks you change is a key factor in determining the amount of redo-log work that you do. The number of blocks is closely related to the amount of data you are changing, and the way that the data is distributed.
If you are deleting a bunch of records that are all stored really close to each other, then the chances are that the number of blocks that are affected will be small. If the records are scattered on many blocks, then the number of blocks affected is high.
Based on the key you have specified for your data "DEAL_ID", "RUN_ID" it appears to me that your data for a specific RUN_ID will be scattered all over the database.
This means that, for each time you delete the data, you are actually inserting 400,000 redo-log entries, modifying 400,000 blocks of storage (let's say 8K each, so that's 3GB of IO), and generally processing the system quite hard. | {
"domain": "codereview.stackexchange",
"id": 7846,
"lm_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, sql, oracle",
"url": null
} |
fluid-dynamics, terminology, boundary-conditions, flow
Stating the deductions and boundary conditions of the situation.
Using these insights to eliminate terms and simplify the Navier-Stokes equations.
Solving whatever quantities and profiles from the simplified Navier-Stokes. | {
"domain": "physics.stackexchange",
"id": 33123,
"lm_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, terminology, boundary-conditions, flow",
"url": null
} |
Proposition 14 (General combinatorial sieve) Let ${z > 0}$. For each natural number ${r}$, let ${A_r(p_1,\dots,p_r)}$ be a predicate pertaining to a sequence ${z > p_1 > \dots > p_r}$ of ${k}$ decreasing primes, thus ${A_r(p_1,\dots,p_r)}$ is either true or false for a given choice of such primes. Let ${{\mathcal D}_+}$ (resp. ${{\mathcal D}_-}$) denote the set of ${d|P(z)}$ which, when factored as ${d = p_1 \dots p_m}$ for ${z > p_1 > \dots > p_m}$, are such that ${A_r(p_1,\dots,p_r)}$ holds for all odd (resp. even) ${1 \leq r \leq m}$. Thus
$\displaystyle {\mathcal D}_+ := \{ p_1 < z: A_1(p_1) \} \cup \{ p_1 p_2: p_2 < p_1 < z; A_1(p_1)\}$
$\displaystyle \cup \{p_1 p_2 p_3: p_3 < p_2 < p_1 < z; A_1(p_1) \wedge A_3(p_1,p_2,p_3) \}$
$\displaystyle \cup \{p_1 p_2 p_3 p_4: p_4 < p_3 < p_2 < p_1 < z; A_1(p_1) \wedge A_3(p_1,p_2,p_3) \}$
$\displaystyle \cup \dots$
and
$\displaystyle {\mathcal D}_- := \{ p_1 < z \} \cup \{ p_1 p_2: p_2 < p_1 < z; A_2(p_1,p_2)\}$ | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682444653242,
"lm_q1q2_score": 0.8012947666000314,
"lm_q2_score": 0.8104789155369048,
"openwebmath_perplexity": 248.19796379327,
"openwebmath_score": 0.9931489825248718,
"tags": null,
"url": "https://terrytao.wordpress.com/2015/01/21/254a-notes-4-some-sieve-theory/"
} |
Example, you confirm that the only chocs box is labelled as only mints. This means that the box labelled as only chocs must be the mixed box, and the box labelled as mixed must be the only mints box. It's kinda confusing, you can use a diagram to help understand what's going on . If you want, you can think of the boxes as numbered 1,2, and 3, and the position of the number is its label. So 1,2,3 is the correct positions of the boxes so that they're labelled correctly. 2,3,1 is a valid list where all the boxes are labelled incorrectly, but 2,1,3 is not because 3 is in its right position. Again, this is under the assumption stated before.
If you remove that assumption, and allow for repeated labels, then you'd need to empty out two boxes, which isn't very helpful, so I doubt this case would be an appropriate interpretation. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407121576652,
"lm_q1q2_score": 0.8089022497671895,
"lm_q2_score": 0.8311430457670241,
"openwebmath_perplexity": 1211.671647715642,
"openwebmath_score": 0.7539382576942444,
"tags": null,
"url": "http://mathhelpforum.com/discrete-math/202667-help-conjectures-proof.html"
} |
x-axis and y-axis. MGRS Distance and Direction Calculator. 14159265359). All numbers and return values should be of type double. The formulas are very simple: for two given points and distance is the hypotenuse of right triangle, and it is calculated like this: and middle point is the average of both coordinates. Another method for calculating the distance between two points that fall on the same line is to plot the points and count the amount of boxes in between the two points. To find the flight distance between two places, please insert the locations in the control of flight distance calculator and Calculate Flight Distance to get the required results while travelling by air. It accepts a variety of formats:. I've found this code for calculating distance. 0 (sobolsoft. The first class calculates the distance between two locations. Calculate Distance Between 2 Coordinates alias Memperhitungkan jarak antara 2 titik koordinat. The purpose of the function is to calculate the distance | {
"domain": "ciiz.pw",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226300899743,
"lm_q1q2_score": 0.8637263751995081,
"lm_q2_score": 0.8840392725805822,
"openwebmath_perplexity": 449.43494686701194,
"openwebmath_score": 0.6425132751464844,
"tags": null,
"url": "http://sbwt.ciiz.pw/distance-between-two-coordinates-calculator.html"
} |
c++, algorithm, template
public:
template <typename U, typename V>
static V fastFibo(U n){
if( n < 4 )
return initFibo[5 - n];
else {
V buf[4];
fastFibo_impl<U, V>(n, buf)
return buf[0];
}
}
}; | {
"domain": "codereview.stackexchange",
"id": 3956,
"lm_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, template",
"url": null
} |
thermodynamics, fluid-dynamics, entropy, thermal-conductivity
This then gives the final equation
$$
\partial_t \left( \frac{1}{2} \rho v^2 + \rho \varepsilon \right)
= - \vec{\nabla} \cdot \left[ \rho \vec{v} \left( \frac{1}{2} v^2 +w \right)
- \vec{v}\cdot \sigma -\kappa \vec{\nabla} T \right]
$$
This is fine, however to derive energy flux $\rho \vec{v} \left(\frac{1}{2} v^2 +w \right)$ for the ideal fluid case we assume the general adiabatic equation
$$
\partial_t s + v_i \partial_i s = 0
$$
with $s$ denoting the entropy per unit mass. Which requires the absence of heat exchange, i.e. an adiabatic motion of the fluid. Assuming this we are able to cancel terms | {
"domain": "physics.stackexchange",
"id": 74952,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, fluid-dynamics, entropy, thermal-conductivity",
"url": null
} |
inorganic-chemistry, coordination-compounds, molecular-orbital-theory, crystal-field-theory, ligand-field-theory
The NO ligand can be rendered as a three-electron donor, if we take
it as uncharged. It is actually similar to CO, really, in that it
interacts through its $\pi^*$ orbitals as well as its $\sigma$
orbital; but NO unlike CO has an electron to offer from its $\pi^*$.
That plus the $\sigma$ electrons makes three.
We then may identify the central metal atom as having 18 valence
electrons. When this happens with multiple ligands we typically see
an arrangement with highest order symmetry, thus tetrahedral for
four-coordination. This gives the best possible bonding to the
entire set of valence orbitals involved in the 18-electron
structure. This is seen in the tetrahedral four-coordinationn of
$\ce{Ni(CO)4}$, and in the octahedral six-coordination of the series
$\ce{[V(CO)6]^-}$, $\ce{Cr(CO)6}$, $\ce{[Mn(CO)6]+}$, $\ce{[Fe(CO)6]^{2+}}$. So, we should expect $\ce{Cr(NO)4}$ to be tetrahedral. | {
"domain": "chemistry.stackexchange",
"id": 13899,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, coordination-compounds, molecular-orbital-theory, crystal-field-theory, ligand-field-theory",
"url": null
} |
linear-systems
Title: I somehow "proved" that given any LTI system, its transfer function has to be constant. What am I missing?
A transfer function is defined as the Laplace transform of the ratio of output to input.
Also, every LTI system has an eigenfunction. Given such eigenfunction as an input, the ratio of the output to input is a constant, which means the transfer function is constant. You're basically right: the frequency response evaluated at a single frequency point is a complex constant. Note that a better notation for the input signal would have been $x(t)=e^{j\omega_0t}$, emphasizing that $\omega_0$ is just an arbitrary but fixed frequency, and not equal to $\omega$, which is commonly used as the independent variable of the Fourier transform. So the constant you came up with is simply $H(j\omega_0)$. | {
"domain": "dsp.stackexchange",
"id": 8020,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "linear-systems",
"url": null
} |
good luck
8. change the order of integration
Question:
According to
$\displaystyle \int _{b}^{a} dx \int _d ^{c} f(x,y) \;dy = \displaystyle \int _{d}^{c} dy \int _b ^{a} f(x,y) \;dx$,
if I solve
$\displaystyle \int _{0}^{2\pi } d\theta \int _0 ^{3} (9- r^2 ) r \;dr$
as
$\displaystyle \int _{0}^{3} dr \int _0 ^{2\pi } (9- r^2 ) r \;d\theta$
I should get same answer. Right?
Ah... sorry, this was answered at preveus post
9. Originally Posted by Revy
Question:
if I solve
$\displaystyle \int _{0}^{2\pi } d\theta \int _0 ^{3} (9- r^2 ) r \;dr$
as
$\displaystyle \int _{0}^{3} dr \int _0 ^{2\pi } (9- r^2 ) r \;d\theta$
I should get same answer. Right?
i this case you can do it like that, but in general can't (can but different limits ) ... look at this for example :
$\displaystyle \int_1 ^e dx \int _0 ^{\ln{x}} f(x,y) dy$
if you are to change the order of integration it's going to be
$\displaystyle \int_0 ^1 dy \int _{e^y} ^{e} f(x,y) dx$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540734789343,
"lm_q1q2_score": 0.8074401502492602,
"lm_q2_score": 0.8244619306896955,
"openwebmath_perplexity": 737.5424105239123,
"openwebmath_score": 0.8809195160865784,
"tags": null,
"url": "http://mathhelpforum.com/calculus/155843-integral-volume.html"
} |
ros
Title: Can't Install ardrone_autonomy
Currently I am running an instance of ROS Kinetic on an Ubuntu MATE 16.04 LTS and trying to install the package ardrone-autonomy. However, the instructions on the linked page say that I can simply invoke the command:
apt-get install ros-kinetic-ardrone-autonomy
Is it because the package is not available on kinetic? Do I have to build from source using these instructions below?
$ cd ~/ros_catkin_ws
$ rosinstall_generator ros_desktop <package_name> --rosdistro kinetic --deps --wet-only --tar > kinetic-custom_ros.rosinstall
$ wstool merge -t src kinetic-custom_ros.rosinstall
$ wstool update -t src
$ rosdep install --from-paths src --ignore-src --rosdistro kinetic -y -r --os=debian:jessie
$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic
If so, where exactly is the /ros_catkin_ws folder? I used sudo apt-get install ros-kinetic-desktop-full install ROS, and the folder does not exist. | {
"domain": "robotics.stackexchange",
"id": 26766,
"lm_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
} |
supermassive-black-hole, dust, accretion-discs, identify-this-object, sagittarius-a
The cause of the flickering is probably the same for the video sequence you showed.
A October 2018 ESO publication states:
ESO’s GRAVITY instrument on the Very Large Telescope (VLT) Interferometer has been used by scientists from a consortium of European institutions, including ESO [1], to observe flares of infrared radiation coming from the accretion disc around Sagittarius A*, [...]. The observed flares provide long-awaited confirmation that the object in the centre of our galaxy is, as has long been assumed, a supermassive black hole. The flares originate from material orbiting very close to the black hole’s event horizon — making these the most detailed observations yet of material orbiting this close to a black hole.
(Source)
ESO also has another video showing the therory with more detail: skip to about 1:00.
Flares associated with Sgr A* are also described in this answer.
Artist's illustration of heated gas orbiting the black hole:
(Screengrab from 1:25 of that video) | {
"domain": "astronomy.stackexchange",
"id": 3388,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "supermassive-black-hole, dust, accretion-discs, identify-this-object, sagittarius-a",
"url": null
} |
ros, ros-kinetic, simpleactionclient, network
Original comments
Comment by Dragonslayer on 2021-01-02:
What catches my eye is that at stamp 13:09:04 +pub, publisher updates. Then nothing and at 13:09:34 -sub, -pub. Thats 30 seconds later, seems to correspond to ac.waitForServer(ros::Duration(30.0). Coincidence? Timeout? Your ROS_INFO("Connecting to robot ========================"); isnt in this log, so I wouldnt expect ROS_WARN(" Error connecting to Robot. Terminate"); to be in it either. Where are they loged?
Comment by fabian on 2021-01-02:
Thank you very much indeed for your comment, @Dragonslayer. That is a very astute observation and indeed I cannot observe such delay when I run the node locally on the robot. I just figured out the solution to the problem as I report below.
I have figured out the solution to the problem I described above. | {
"domain": "robotics.stackexchange",
"id": 35922,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-kinetic, simpleactionclient, network",
"url": null
} |
quantum-mechanics, wavefunction, hilbert-space, boundary-conditions
Example.
I construct here a true monster without physical meaning, but permitted by mathematical requirements of QM.
Consider a function $\psi \in L^2(\mathbb R)$ costructed this way. It attains the value $0$ everywhere except for every interval $$I_n= \left(n -\frac{1}{2(n^4+1)^{2}},\:\: n+ \frac{1}{2(n^4+1)^{2}}\right) $$ thus of length $(n^4+1)^{-2}$ and centered on every $n\in \mathbb Z$. In these intervals $$\psi(x) = n^2 \quad x\in I_n\:.$$ It is clear that $\int_{\mathbb R} |\psi(x)|^2 dx$ for some constant $C>0$ satisfies $$\int_{\mathbb R} |\psi(x)|^2 dx \leq C \sum_{n=0}^{+\infty} \frac{n^4}{(n^4+1)^2} <+\infty\:.$$
It is clear that this function oscillates with larger and larger oscillation as $|x|\to +\infty$, but these oscillations are sharper and sharper.
Next, smoothly modify $\psi$ in every interval $I_n$ to produce a smooth non-negative function $0\leq \phi(x) \leq \psi(x)$ with $\phi(n)=\psi(n)$ thus preserving finiteness of the integral of $|\phi|^2$. | {
"domain": "physics.stackexchange",
"id": 46142,
"lm_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, wavefunction, hilbert-space, boundary-conditions",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.