text stringlengths 1 1.11k | source dict |
|---|---|
catkin
?? moveit_ros/visualization/doc/rviz_plugin_invalid.png
?? moveit_ros/visualization/doc/rviz_plugin_motion_planning_add.png
?? moveit_ros/visualization/doc/rviz_plugin_planned_path.png
?? moveit_ros/visualization/doc/rviz_plugin_start.png
?? moveit_ros/visualization/doc/rviz_plugin_visualize_robots.png
?? moveit_ros/visualization/doc/tutorial.rst
?? moveit_ros/visualization/python/moveit_ros_visualization/__init__.py
?? moveit_ros/visualization/python/moveit_ros_visualization/moveit_joy.py
?? moveit_ros/visualization/rosdoc.yaml
?? replace_infile.py
Warning: the working copy contains other changes. Consider reverting/committing/stashing them before preparing a release.
Continue anyway [y/N]?y
Rename the forthcoming section of the following packages to version '0.9.1':
Bump version of all packages from '0.9.0' to '0.9.1'
Committing the package.xml files...
[kinetic-devel 90a62bf] 0.9.1
17 files changed, 17 insertions(+), 17 deletions(-)
Creating tag '0.9.1'... | {
"domain": "robotics.stackexchange",
"id": 25997,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "catkin",
"url": null
} |
• how did you get the ((1+n)/2) x n for fn? – Bryan Jul 11 '17 at 13:03
• and how does fn+1 is the same as the solution fn ? – Bryan Jul 11 '17 at 13:05
• It is the formula of the sum of $n$ terms of the arithmetic progression. The formula works for $n+1$ too. – farruhota Jul 11 '17 at 13:08
• Note that this is not a strict proof, and a strict version of this proof would still have to use induction, first of all to prove that $f_n=1+2+\cdots + n$ and second of all to prove (if you didn't yet) that $1+2+\cdots+n = \frac{n(n+1)}{2}$ – 5xum Jul 11 '17 at 13:10
• @5xum, thanks. However, in the OP $f_n=(n^2+n)/2$ was given and asked to be proved. Here I gave some insight where the formula comes from and $\textit{used}$ induction to prove the formula. – farruhota Jul 11 '17 at 13:33 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.975201841245846,
"lm_q1q2_score": 0.8018003581862091,
"lm_q2_score": 0.822189134878876,
"openwebmath_perplexity": 359.3378591430413,
"openwebmath_score": 0.9885806441307068,
"tags": null,
"url": "https://math.stackexchange.com/questions/2354740/prove-recursive-sequence-via-induction"
} |
bond
Title: Why do double bonds break So today we performed an experiment, where we mixed cyclohexene with Bromine water. The equation was | {
"domain": "chemistry.stackexchange",
"id": 5924,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bond",
"url": null
} |
datetime, vba
Title: Generating fiscal calendar dates I need to generate a T-SQL script for loading data into this table:
create table dwd.FiscalCalendars (
_Id int not null identity(1,1)
,_DateInserted datetime not null
,_DateUpdated datetime null
,CalendarDate date not null
,CalendarDayOfWeek int not null
,CalendarDayOfMonth int not null
,CalendarDayOfYear int not null
,CalendarWeekOfYear int not null
,CalendarMonthOfYear int not null
,CalendarYear int not null
,FiscalDayOfWeek int not null
,FiscalDayOfMonth int not null
,FiscalDayOfQuarter int not null
,FiscalDayOfYear int not null
,FiscalWeekOfMonth int not null
,FiscalWeekOfQuarter int not null
,FiscalWeekOfYear int not null
,FiscalMonthOfQuarter int not null
,FiscalMonthOfYear int not null
,FiscalQuarterOfYear int not null
,FiscalYear int not null
,Holiday nvarchar(50) null
,constraint PK_FiscalCalendars primary key clustered (_Id asc) | {
"domain": "codereview.stackexchange",
"id": 10761,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "datetime, vba",
"url": null
} |
strings, file, go
Title: Command called 'sprinkle' I have a command called sprinkle. I'm not going to explain anything about it, because I want whoever that reviews the code to also tell me how much of the command documentation they understood.
Here is what I need help with:
Is the documentation good enough? Is it too verbose?
Does the constant domainName help you understand the code below, or is it useless?
Should the transformations array be passed around instead of being defined as a global variable?
What else can I improve in the code? | {
"domain": "codereview.stackexchange",
"id": 18324,
"lm_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, file, go",
"url": null
} |
beginner, recursion, functional-programming, clojure
;=> {"1" \a, "2" \b, "3" \c, ... "26" \z}
One way to avoid using flatten
Personally, I think using flatten is fine, but some view it as being somewhat hacky, and I've heard it said that if you find yourself using flatten, there is usually a better way to do what you're trying to do. In this case, I would use mapcat -- it's like map, but it handily concatenates the results together into a single collection.
EDIT: This doesn't work! Please disregard :)
...
(mapcat (fn [[k v]]
(when (.startsWith number k index)
(possible-strings number (+ index (count k)) (str acc v))))
code->letter))))
or,
...
(mapcat (fn [[k v]] (possible-strings number (+ index (count k)) (str acc v)))
(filter #(.startsWith number (key %) index) code->letter))))) | {
"domain": "codereview.stackexchange",
"id": 8704,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, recursion, functional-programming, clojure",
"url": null
} |
c#, design-patterns, wpf
You can do the same for all of the AbsolutePath properties.
private string _assemblyShortName; can be a readonly variable
Redundant casts
public Uri ToUri() => (Uri) this;
You already have an implicit operator that does that for you
public static implicit operator Uri(PackUriBuilder builder)
Replacing the nasty switch case with a Dictionary
public static implicit operator Uri(PackUriBuilder builder)
{
switch (builder._uriKind)
{
case UriKind.Absolute:
return new Uri(builder.ToString(), UriKind.Absolute);
case UriKind.Relative:
return new Uri(builder.RelativePath, UriKind.Relative);
}
// todo: I know this needs a better message ;-)
throw new ArgumentOutOfRangeException("Invalid UriKind.");
} | {
"domain": "codereview.stackexchange",
"id": 23525,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, design-patterns, wpf",
"url": null
} |
angular-momentum, atomic-physics, quantum-spin, terminology, notation
In all angular momenta, as you know, $m$ can go from $-l$ to $+l$.
And also $m_s$ from $-s$ to $+s$; and $m_j$ from $-j$ to $+j$.
So, if you have $s=½$, you can have $m_s=\pm ½$
But if you add two spins, $s_1+s_2$, the resulting $j$ can be 0 or 1.
For $j=0$, $m_j$ can only be 0 as well.
But for $j=1$, $m$ can have three values: $m_j={-1,0,1}$.
So, "summing two spins" can mean that total spin is "J=1" but "M=0". | {
"domain": "physics.stackexchange",
"id": 63767,
"lm_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, atomic-physics, quantum-spin, terminology, notation",
"url": null
} |
immunology, virology, influenza
and 3.1. Fraser et al used data from the initial outbreak in Mexico to estimate R0 in the range of 1.2–1.6. Yang et al used reported case clusters in the United States to estimate R0 to be 1.3–1.7. Most estimates of R0 for pH1N1 virus, therefore, have indicated that the virus was at the low end of transmissibility, compared with the strains that caused the 1918 pandemic, and was comparable to or slightly less transmissible than the strains that caused the 1957 and 1968 pandemics. | {
"domain": "biology.stackexchange",
"id": 8208,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "immunology, virology, influenza",
"url": null
} |
Asymptotically this answer is no different from $b_n = \frac{1}{n\ln(n)}$ given in other responses, but I thought this would be a nice fact to share. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9888419707248646,
"lm_q1q2_score": 0.8537578593758572,
"lm_q2_score": 0.8633916082162403,
"openwebmath_perplexity": 136.84542803771276,
"openwebmath_score": 0.9650533199310303,
"tags": null,
"url": "https://math.stackexchange.com/questions/2809429/example-sequence-b-n-with-lim-n-rightarrow-infty-nb-n-0-but-s"
} |
particle-physics, symmetry, quantum-chromodynamics, color-charge
Your mesons will be automatically color singlets, $\bar q^a q^a$, but here the antiquark will be in the conjugate representation of the fundamental of SU(2), here, exceptionally, basically the same rep as the quark, with the identical color structure. (The Young tableaux for the fundamental and anti fundamental are just a box, here... You'll never see this again.) But, still, the baryon numbers of the mesons will be zero, so your won't have, e.g. a baryon decaying to two mesons... | {
"domain": "physics.stackexchange",
"id": 58997,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, symmetry, quantum-chromodynamics, color-charge",
"url": null
} |
algorithms, graphs, shortest-path
We now try to find a shortest path between the start of the chain and vertex $t$ that satisfies your requirement of traversing either all or none of the edges from each edge set.
Such a path must start by traversing the full chain, so it must contain all chain edges, so it must contain all copy edges, so it must visit every vertex of the original graph; therefore, omitting all special edges from it will produce a Hamiltonian path from $s$ to $t$, if one exists.
Deciding whether a Hamiltonian path between arbitrary edges $s$ and $t$ exists is known to be $NP$-complete, so your problem is $NP$-hard: if you can find a polynomial algorithm for it (such as Dijkstra's), you will have proved $P=NP$. | {
"domain": "cs.stackexchange",
"id": 3984,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, graphs, shortest-path",
"url": null
} |
nuclear-physics, fusion, nuclear-engineering, explosions
Oh yes, the so-far mythical pure-fusion bomb.
For a pure-fusion reaction, let's consider the easiest case, D-T. This is basically what an h-bomb uses, with intermediate steps.
The problem is the required (pressure * dwell time) to get enough reactions in the fuel in order that their output energy will heat the surrounding fuel so it also undergoes fusion. This is known as ignition.
In existing bomb designs, if the public literature is to be believed, the tamper pressure is estimated to be on the order of 1000 TPa and the fuel is pressed inward at perhaps 500 km/sec. That is going to be difficult to achieve without some serious energy input. | {
"domain": "physics.stackexchange",
"id": 62832,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nuclear-physics, fusion, nuclear-engineering, explosions",
"url": null
} |
homework-and-exercises, classical-mechanics, newtonian-mechanics, momentum, spring
Title: The time for which rear moving block remain in contact with spring in the following situation? I'm a physics tutor. I'm stuck up with this question. I've no clue about how to proceed with this question. Can any one help? | {
"domain": "physics.stackexchange",
"id": 2423,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, classical-mechanics, newtonian-mechanics, momentum, spring",
"url": null
} |
the secant through its endpoints. Example 1 Figure $$\PageIndex{3}$$: Demonstrating the Mean Value Theorem in Example $$\PageIndex{2}$$. So let's get started with that. The Mean Value Theorem is one of the most important theoretical tools in Calculus. əm] (mathematics) The proposition that, if a function ƒ (x) is continuous on the closed interval [a,b ] and differentiable on the open interval (a,b), then there exists x0, a <>x0<>b, such that ƒ(b) - ƒ(a) = (b-a)ƒ′(x0). The mean value theorem has also a clear physical interpretation. Mean Value Theorem and Rolle's Theorem Lesson:Your AP Calculus students will use the chain rule and other differentiation techniques to interpret and calculate related rates in applied contexts. And if you’re going less than 50 at one point and more than 50 at a later point (or vice versa), you have to hit exactly 50 at least once as you speed up (or slow down). In simple words, Lagrange’s theorem says that if there is a path between two points A(a, f(a)) | {
"domain": "apartments-rijeka.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846703886661,
"lm_q1q2_score": 0.8066409121958934,
"lm_q2_score": 0.8244619285331332,
"openwebmath_perplexity": 986.4324138427406,
"openwebmath_score": 0.7569544315338135,
"tags": null,
"url": "http://www.apartments-rijeka.com/uranium-hexafluoride-wjwp/language-mean-value-theorem-3b6183"
} |
python, python-3.x, sqlite, sqlalchemy
def create_password(name: str, value: str) -> None:
"""Create a password and a name for it.
Arguments:
name (str): Name of the password.
value (str): The password.
Returns:
None
"""
with SaferSession(record=Password(name, value)):
print(f"Successfully added {name} record.")
def is_master_password_valid(master_password: str) -> Optional[bool]:
"""Check if provided master password is valid or not.
Arguments:
master_password (str): The master password.
Returns:
True if the password matches or None otherwise
"""
with SaferSession() as session:
password_obj = session.query(MasterPassword).one_or_none()
return password_obj.value == master_password if password_obj else None
def get_password_by_name(name: str) -> Any:
"""Get a password by its name.
Arguments:
name (str): Name of the password. | {
"domain": "codereview.stackexchange",
"id": 37857,
"lm_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, sqlite, sqlalchemy",
"url": null
} |
python
sum_ = (sum_ - delta) % 2 ** 32
v1 = (
v1
+
(
(
(
(v0 << 4) % 2**32 ^ (v0 >> 5) % 2**32
) % 2**32 + v0
) % 2**32
^
(sum_ + k[(sum_ >> 11) % 2**32 & 3]) % 2**32
) % 2**32
) % 2**32
It looks strange and I'm not sure it's the best idea. What do you think of it? Is it something that needs improving? If so, how? The C code you quoted is part of an implementation of the XTEA block cipher. So the obvious thing to do is to search for existing Python implementations, and sure enough, ActiveState has this one by Paul Chakravarti, in which the loop you quoted is translated as follows:
sum,delta,mask = 0L,0x9e3779b9L,0xffffffffL
for round in range(n):
v0 = (v0 + (((v1<<4 ^ v1>>5) + v1) ^ (sum + k[sum & 3]))) & mask
sum = (sum + delta) & mask
v1 = (v1 + (((v0<<4 ^ v0>>5) + v0) ^ (sum + k[sum>>11 & 3]))) & mask | {
"domain": "codereview.stackexchange",
"id": 5262,
"lm_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",
"url": null
} |
Let's say I know that $$U_1|\Psi_1\rangle\otimes U_2|\Psi_2\rangle=e^{i\theta}|\Psi_1\rangle\otimes|\Psi_2\rangle.$$ Now, let's imagine that $$U_1|\Psi_1\rangle=|\phi_1\rangle$$ and $$U_2|\Psi_2\rangle=|\phi_2\rangle$$. So, $$|\phi_1\rangle\otimes |\phi_2\rangle=e^{i\theta}|\Psi_1\rangle\otimes|\Psi_2\rangle.$$ Now, I would just read off your desired relations, but as a proof, it depends on how deep we need to go... Let's take the inner product of both sides with $$|\phi_1\rangle\otimes |\phi_2\rangle$$, and calculate the absolute value. You have $$1=|\langle\phi_1|\Psi_1\rangle|\ |\langle\phi_2|\Psi_2\rangle|.$$ Both terms on the right-hand side satisfy $$|\langle\phi_1|\Psi_1\rangle|\leq 1$$, and can only achieve equality if $$|\phi_i\rangle=e^{i\theta_i}|\Psi_i\rangle$$ (do you need a detailed proof of that? Think of real unit vectors $$\underline{v},\underline{u}$$: $$\underline{u}\cdot\underline{v}=\cos\gamma\leq 1$$, where $$\gamma$$ is the angle between them.) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9591542864252023,
"lm_q1q2_score": 0.8094256105569472,
"lm_q2_score": 0.8438951084436076,
"openwebmath_perplexity": 150.24177311178886,
"openwebmath_score": 0.9775874018669128,
"tags": null,
"url": "https://quantumcomputing.stackexchange.com/questions/10158/is-kronecker-product-identifiable"
} |
• Thanks a lot, so you are sure about the dec = np.arcsin(2.*(ran2-0.5)) ? It seems to be good but I don't understand very well why arcsin and not arcos for instance. Aug 29, 2017 at 13:23
• Very nice! But when I try to rotate it only moves a little bit in the direction of my movement, after which I have to click/drag again for another little bit of movement. Aren't you supposed to be able to drag the plot around smoothly? Is it just me?
– pela
Aug 29, 2017 at 13:53
• OK, I get it: when you integrate the cos, you get -sin, so arcsin is apparently the right one to use.
– user21
Aug 29, 2017 at 15:25
• @pela it works nicely in my IDLE installation which I love, but the 3D plot response in my anaconda installation does not work well at all. This would be a good question for stackoverflow! You'd just edit the script down to the Minimal, Complete, and Verifiable example before posting. You could link here also, but make sure to get rid of as much as possible.
– uhoh
Aug 29, 2017 at 15:35 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357591818725,
"lm_q1q2_score": 0.8282078963345051,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 2327.8120653729266,
"openwebmath_score": 0.5672710537910461,
"tags": null,
"url": "https://astronomy.stackexchange.com/questions/22388/generate-a-uniform-distribution-on-the-sky/22397"
} |
electromagnetic-radiation, photons, electrons, potential-energy, chemical-potential
$$Ox + z e^- \to Ox^{z-}$$
The overall reaction is thus:
$$Re + Ox \to Re^{z+} + Ox^{z-}$$
The reaction is chosen so that the reaction equilibrium constant:
$$\frac{a_{Rez+}{a_{Oxz-}}}{a_{Re}a_{Ox}}=K$$
... is much larger than unity, so that the reaction is thermodynamically favourable, from left to right.
The battery is made of cells (arranged in series or parallel, or a single cell in some cases), each running such a reaction and providing a flow of electrons when the circuit is closed.
This provision of current continues until all the left hand reagents have been converted to right hand reaction products. Then the battery can no longer provide current and the potential across its electrodes is zero.
But remember that the chosen reactions are reversible: by running a current through a depleted battery and in the reverse direction of discharging mode, the reagents are converted back to the original reagents and the battery is as new. | {
"domain": "physics.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": "electromagnetic-radiation, photons, electrons, potential-energy, chemical-potential",
"url": null
} |
scrnaseq, 10x-genomics
It is very unfortunate and disappointing that 10X website is generating wrong sample sheet. Still we got very low mapping rates and trying to figure out what went wrong.
Update
I was supplying --sample-sheet= property, but it should be --samplesheet=. Now it is running fine (except for very low mapping rates) with all the headers on.
Update
It turned out that we were given the wrong indexes, so we made a sample sheet using sample sheet generator again and even with --samplesheet= correct parameter it was not running. Convertion of CLRF with perl or tr did not help. However, concise format of the sample sheet worked out well which looks like the following:
Lane,Sample,Index
1-4,17R,SI-GA-B8
1-4,19RL,SI-GA-B9
It needs to be supplied with --csv= parameter. | {
"domain": "bioinformatics.stackexchange",
"id": 1543,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scrnaseq, 10x-genomics",
"url": null
} |
algorithm, c, multithreading, matrix, portability
Title: Portable multithreaded matrix multiplication in C I essentially took this progam, and made it compile and run on Windows too. Also, I incorporated some nice points made by Toby Speight.
matrix.h
#ifndef NET_CODERODDE_LINEAR_ALGEBRA_MATRIX_H
#define NET_CODERODDE_LINEAR_ALGEBRA_MATRIX_H
#include <stdlib.h>
typedef struct matrix_t {
size_t m_rows;
size_t m_cols;
double* m_data;
} matrix_t;
matrix_t* matrix_t_alloc (const size_t rows, const size_t cols);
void matrix_t_init (matrix_t* matrix, size_t rows, size_t cols);
void matrix_t_clear (matrix_t* matrix);
void matrix_t_free (matrix_t* matrix);
double matrix_t_get (matrix_t* matrix, size_t x, size_t y);
void matrix_t_set (matrix_t* matrix, size_t x, size_t y, double value);
matrix_t* matrix_t_copy (matrix_t* matrix);
#endif /* NET_CODERODDE_LINEAR_ALGEBRA_MATRIX_H */#pragma once | {
"domain": "codereview.stackexchange",
"id": 27399,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, c, multithreading, matrix, portability",
"url": null
} |
newtonian-gravity, differential-geometry, conservation-laws, vector-fields
$$j_g = \mu(\boldsymbol g)$$
$\mu$ being the volume form. It doesn't bear the meaning of a flux propagating the gravity field $\boldsymbol g$ or anything else.
The question is specifically about gravity, and about classical gravity. Not about electromagnetic phenomena, general relativity or quantum gravity. The word "flux" is something of an accident of history. See for example it's use in Gauss' law or as a magnetic flux. Nothing is actually flowing e.g. for a static charge we would still refer to the flux through a surface surrounding the charge even though the system is time independant. | {
"domain": "physics.stackexchange",
"id": 89086,
"lm_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, differential-geometry, conservation-laws, vector-fields",
"url": null
} |
thermodynamics
Please note that the Kelvin-scale is used for temperature here. The boiling point is always above the melting point (we keep pressure constant to keep the example simple).
For most substances, the enthalpy of vaporization is greater than the enthalpy of fusion. It follows that the denominator for K_eb is greater, resulting in a smaller K_eb.
This means that the effect of greater enthalpy of vaporization compared with enthalpy of fusion outweighs the effect of boiling temperature being greater than the melting temperature (even though it's the square of absolute temperature). | {
"domain": "chemistry.stackexchange",
"id": 13269,
"lm_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",
"url": null
} |
quantum-mechanics, quantum-optics, second-quantization
Title: Finding the spectrum of a polynomial of the creation and annihilation operators Is there a general algorithm to find the spectrum of $S S^\dagger$, where $S$ is a homogenous polynomial (of degree $n$) of the annihilation operators (of $d$ variables)? The supspaces $V_n = Span \{ (a_1^{\dagger})^{n_1}, . . . (a_d^{\dagger})^{n_d} |0>\}$, $n_i \ge 0$, $ n_1 + . . . n_d = n$, constitute of invariant subspaces of the operator $ S S^{\dagger}$ action. The dimension of $V_n$ is $ \frac{(d+n-1)!}{(d-1)! n!}$. Thus the operator can be represented on each of these subspaces as a square matrix of size $ \frac{(d+n-1)!}{(d-1)! n!}$ for which the spectrum can be found by elementary linear algebra. The spectrum on the whole of the Fock space is the union of the spectra over $V_n$, $ n = 0, 1, . . .$ | {
"domain": "physics.stackexchange",
"id": 1348,
"lm_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-optics, second-quantization",
"url": null
} |
quantum-mechanics, condensed-matter, symmetry, quantum-spin, group-theory
But how about the quaternion group $Q_8=\left \{1,-1,e^{i\pi S_x}, e^{-i\pi S_x},e^{i\pi S_y},e^{-i\pi S_y},e^{i\pi S_z}, e^{-i\pi S_z}\right \}$, with $-1$ representing the $2\pi$ spin-rotation operator. On the other hand, consider the dihedral group $D_2=\left \{ \begin{pmatrix}1 & 0 &0 \\ 0& 1 & 0\\ 0&0 &1 \end{pmatrix},\begin{pmatrix}1 & 0 &0 \\ 0& -1 & 0\\ 0&0 &-1 \end{pmatrix},\begin{pmatrix}-1 & 0 &0 \\ 0& 1 & 0\\ 0&0 &-1 \end{pmatrix},\begin{pmatrix}-1 & 0 &0 \\ 0& -1 & 0\\ 0&0 &1 \end{pmatrix} \right \}$, and these $SO(3)$ matrices can also implement the $\pi$ spin rotation.
So, which one you choose, $G,Q_8$, or $D_2$ ? Notice that $Q_8$ is a subgroup of $SU(2)$, while $D_2$ is a subgroup of $SO(3)$. Furthermore, $D_2\cong Q_8/Z_2$, just like $SO(3)\cong SU(2)/Z_2$, where $Z_2=\left \{ \begin{pmatrix}1 & 0 \\ 0 &1\end{pmatrix} ,\begin{pmatrix}-1 & 0 \\ 0 &-1 \end{pmatrix} \right \}$. | {
"domain": "physics.stackexchange",
"id": 97432,
"lm_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, condensed-matter, symmetry, quantum-spin, group-theory",
"url": null
} |
opencv2
straight()
stop()
print(x)
print('24')
elif y < 5.9 and x < -7 and x > -8 and z > 2.498 and z < 2.6:
right()
stop()
print(y)
print('25')
elif x < -0.7 and y > 5.9 and y < 6.35 and z > 2.498 and z < 2.6:
back()
stop()
print(x)
print('26')
else:
stop()
find(sys.argv)
print(z) | {
"domain": "robotics.stackexchange",
"id": 18251,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "opencv2",
"url": null
} |
optics
$\frac{1}{4}=\frac{1}{-1}+\frac{1}{d_i}$, or $d_i=0.8\rm{mm}$.
So the focal point of the total system has changed from 4mm (without fish eye lens) to 0.8mm. Am I wrong? It is not quite this simple. The assumption you made is that the image of the fish eye lens is always on the focal point of the lens. This is only true for an object that is infinitely far away. In reality, the location of the image of the fish eye lens will depend on the distance the object is away from the fish eye lens.
In practice, however, the object you are taking a picture of is likely to be at a distance $d\gg 2\rm{mm}$ away, and your math is a good approximation. You should keep in mind however that in general two lens systems cannot be simplified as a single lens with one focal point. | {
"domain": "physics.stackexchange",
"id": 28254,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics",
"url": null
} |
asymptotics, recurrence-relation
Title: Calculate the Time complexity $T(n)=\sqrt{2T(n-1)}$
what will be the time complexity if $T(n)$ is given as this?
I tried substitution but no result was reached. The answer depends on the initial value. For example, if $T(0) = 2$ then you can prove by induction that $T(n) = 2$ for all $n$. More generally, let $S(n) = T(n)/2$. Then
$$
S(n) = \frac{T(n)}{2} = \frac{\sqrt{2T(n-1)}}{2} = \sqrt{\frac{T(n-1)}{2}} = \sqrt{S(n-1)}.
$$
Simple induction now shows that $S(n) = \sqrt[2^n]{S(0)}$, and so
$$ T(n) = 2 \sqrt[2^n]{\frac{T(0)}{2}}. $$
In particular, this shows that $T(n) \to 2$.
We can estimate the speed of convergence using the estimate
$$
\sqrt[2^n]{x} = \exp \frac{\log x}{2^n} = 1 + O\left(\frac{\log x}{2^n}\right).
$$
This shows that
$$ T(n) = 2 + O(2^{-n}). $$ | {
"domain": "cs.stackexchange",
"id": 11104,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "asymptotics, recurrence-relation",
"url": null
} |
c#, numbers-to-words
number = number % 1000;
if (number > 0 && number <= 99)
{
builder.Append("and ");
}
ConvertToString(number, builder);
return;
}
if (number <= 999999)
{
int firstPart = firstDigit * 100 + (int)Char.GetNumericValue(digits[1]) * 10 + (int)Char.GetNumericValue(digits[2]);
ConvertToString(firstPart, builder);
builder.Append(" thousand ");
number = number % (firstPart * 1000);
if (number > 0 && number <= 99)
{
builder.Append("and ");
}
ConvertToString(number, builder);
return;
}
builder.Append("One million");
}
But we still have some small code duplication here regarding
if (number > 0 && number <= 99)
{
builder.Append("and ");
} | {
"domain": "codereview.stackexchange",
"id": 15440,
"lm_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#, numbers-to-words",
"url": null
} |
python, algorithm, palindrome
def palindrome_from(letters):
"""
Forms a palindrome by rearranging :letters: if possible,
throwing a :ValueError: otherwise.
:param letters: a suitable iterable, usually a string
:return: a string containing a palindrome
"""
counter = Counter(letters)
sides = []
center = deque()
for letter, occurrences in counter.items():
repetitions, odd_count = divmod(occurrences, 2)
odd_count is a bit of a strange name, because its just whether its odd or even, not really an odd_count
if not odd_count:
sides.append(letter * repetitions)
continue
avoid using continue, favor putting the rest of the loop in an else block. Its easier to follow that way
if center:
raise ValueError("no palindrome exists for '{}'".format(letters))
center.append(letter * occurrences)
center.extendleft(sides)
center.extend(sides) | {
"domain": "codereview.stackexchange",
"id": 3695,
"lm_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, palindrome",
"url": null
} |
ros, pcl, source, package, ros-groovy
It seems like you have a Eigen version
installed that is too new for PCL. It
seems in 3.2 the sqrt function moved
from eigen::internal::sqrt to
eigen::sqrt. See this question:
http://answers.ros.org/question/128916/ros-groovy-compile-fails-at-pcl/
So you could either try to change the
source of PCL or make sure it is using
eigen 3.1 to compile.
Originally posted by demmeln with karma: 4306 on 2014-02-16
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 16843,
"lm_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, pcl, source, package, ros-groovy",
"url": null
} |
general, are any relationship which is not linear. Next, a number of non-linear relationships are mono… It is essential that you get a solid grasp of non-linear equations in Year 10. Confusion about definition of category using directed graph. These relationships between variables are such that when one quantity doubles, the other doubles too. I NEED TO HAVE AN EQUATION IN MY ANSWER! There are an endless variety of non-linear relationships that one can encounter. Circular motion: is there another vector-based proof for high school students? What type of targets are valid for Scorching Ray? Positive Correlation Examples in Real Life. * Begin Free Trial . Some other examples in line with Larry Storeteling post. MathJax reference. Sophia’s self-paced online courses are a great way to save time and money as you earn credits eligible for transfer to many different colleges and universities. By Jessica Smith. He is passionate about sharing his lessons with his readers and listeners. This | {
"domain": "secretsheep.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9353465116437761,
"lm_q1q2_score": 0.8075703272836608,
"lm_q2_score": 0.8633916064586998,
"openwebmath_perplexity": 1357.0612892008346,
"openwebmath_score": 0.25402581691741943,
"tags": null,
"url": "http://secretsheep.com/0tfvhql/1c9904-examples-of-non-linear-relationships-in-real-life"
} |
c++, game
{
//add player
player_room_number = get_random(1, rooms.size());
int index = player_room_number - 1;
while (rooms[index].has_wumpus || rooms[index].has_pit || rooms[index].has_bat) {
player_room_number = get_random(1, rooms.size());
}
rooms[index].has_player = true;
}
}
void Dungeon::indicate_hazards()
{
bool is_first_bat = true;
bool is_first_pit = true;
int index = player_room_number - 1;
for (auto& x : rooms[index].neighbors) {
if (x->has_wumpus) {
std::cout << "I smell the wumpus\n";
}
if (is_first_pit && x->has_pit) {
is_first_pit = false;
std::cout << "I feel a breeze\n";
}
if (is_first_bat && x->has_bat) {
is_first_bat = false;
std::cout << "I hear a bat\n";
}
} | {
"domain": "codereview.stackexchange",
"id": 31333,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, game",
"url": null
} |
allele, hardy-weinberg
Title: Hardy-Weinberg for triploids Problem:
A certain species has somatic cells with ploidy 3n (the organism inherits
three sets of homologous chromosomes from each of three parents). At a certain locus, there are three possible alleles A 1 , A 2 , A 3 , which are
completely dominant in the order A 1 > A 2 > A 3 . The proportion of organisms
exhibiting traits A 1 , A 2 , and A 3 are respectively 0.614, 0.306, and 0.08. In
addition, the proportion of organisms that are completely heterozygous
(genotype A 1 A 2 A 3 ) is 0.18. Which of the following are allele frequencies of A 1 , A 2 , and A 3 , respectively?
Answer Choices:
A. f(A 1 ) = 0.5, f(A 2 ) = 0.3, f(A 3 ) = 0.2
B. f(A 1 ) = 0.3, f(A 2 ) = 0.5, f(A 3 ) = 0.2
C. f(A 1 ) = 0.3, f(A 2 ) = 0.4, f(A 3 ) = 0.3
D. f(A 1 ) = 0.6, f(A 2 ) = 0.2, f(A 3 ) = 0.2
E. f(A 1 ) = 0.7, f(A 2 ) = 0.2, f(A 3 ) = 0.1
Correct Answer:
A
Solution: | {
"domain": "biology.stackexchange",
"id": 7805,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "allele, hardy-weinberg",
"url": null
} |
np-complete, clique
Title: Finding vertices of a maximum clique in polynomial time Say you were given a black box that solves a clique problem in constant time.
You give the black box an undirected graph G with a bound k and it outputs either "Yes" or "No" that the graph G has a clique with at least k vertices.
How would you use this black box to find the vertices of a maximum clique in polynomial time? You first give it $(G,k)$, and if it says yes, you do the following. You pick an arbitrary vertex $v$ and call your oracle with $(G-v,k)$. If the oracle says yes, throw away $v$ and forget about it. If it says no, then $v$ is in every clique of size at least $k$. Output $v$ and decrease $k$ by one and lather, rinse, repeat. | {
"domain": "cs.stackexchange",
"id": 3529,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "np-complete, clique",
"url": null
} |
optics, refraction, geometric-optics
But according to these assumptions, light rays should curve more as they go deeper through matter shouldnt they ? In other words that effect should be cumulative with the thickness of matter the light does through ?
No. There is nothing that would break the symmetry to cause the light to be bending one way or the other once it was in the uniform second medium.
why do prism split light at angle instead of curving it?
The index of refraction has a wavelength dependency, so if we send in something like white light that is not monochromatic, the superposition gets bent at different angles as it crosses the interfaces of the different media. Within each medium the light travels in a straight line. | {
"domain": "physics.stackexchange",
"id": 56470,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, refraction, geometric-optics",
"url": null
} |
python, battleship
Is it correct that GamePlan processes shooting (in the method hit)?
Is hit a good name for that method or should it be something like process_hit? Because GamePlan is being hit, it is not hitting anything. Is hit still good in such case? This is probably my biggest concern.
Should ships be represented as objects of a class Ship instead?
Is GamePlan a good thing to have or is it useless? I mean I could make class AI that directly owns ships but I am not sure where stuff like SHIP_COUNTS would go then. I have also planned that I will use GamePlan to generate ship positions (hence SHIP_COUNTS and DIMX, DIMY which are unused atm) but plan generation could also easily go to AI, I guess.
Is there anything else that is wrong? Perhaps GamePlan would better be named eg. Board? English is not my mother tongue, but AFAIK game plan == strategy. | {
"domain": "codereview.stackexchange",
"id": 3675,
"lm_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, battleship",
"url": null
} |
gravity, vacuum, ideal-gas, molecular-dynamics
Starting with a gas, i.e. water vapour, it's like the air at low density, like humid air at medium density, and like clouds or fog/mist at high density.
As you cool the water vapour, you'll begin seeing the water vapour condense - e.g. condensation on your windows, or rain droplets from a cloud. This is the water transitioning from a gas to a liquid. So from a gas to liquid it's like a cloud, and you would pass through it - not that you'd want to, it's cold and wet :(
This may be clearer if you think about the reverse, i.e. a liquid boiling into a gas. If you're boiling some water in a pan, you'll see steam coming off the surface of the water. The appearance of the steam depends on how much of it there is - a lot and it'll look like a cloud and start misting up the place, a little and you'll barely be able to see it. | {
"domain": "physics.stackexchange",
"id": 28051,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gravity, vacuum, ideal-gas, molecular-dynamics",
"url": null
} |
everyday-chemistry
Title: Is there any chemical that has a fire diamond (NFPA 704) of 3-4-2 COR OXY? At Walmart the other day I spotted this fire diamond. It was randomly there on a wall on the side of the store, with seemingly no explanation. There were no chemical tanks or anything near the sign, but there was a door that was a little bit away.
I cannot find anything that has this fire diamond, let alone a corrosive oxidizer.
Any help in finding this mystery chemical is appreciated.
The fire diamond is shown below. It does use the informal "COR" symbol, which means corrosive. I agree with Jon Custer's comment. This symbol (see below) is not for any specific chemical:
The ComplianceSins.com says following about this NFPA 704 Diamond with 3-4-2-COR_OXY Hazard Level Indicators: | {
"domain": "chemistry.stackexchange",
"id": 17302,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "everyday-chemistry",
"url": null
} |
java, binary-search
/* ------------------------------------------------------------- */
/* DATA DEFINITION(S) */
/* ------------------------------------------------------------- */
/**
* ZigZag interface instance
*/
private ZigZag zigZagInstance;
/**
* Tree node
*
*/
public class Node {
private int value;
private Node left;
private Node right;
public Node(int value, Node left, Node right) {
this.value = value;
this.left = left;
this.right = right;
}
public int getValue() {
return this.value;
}
public Node getLeft() {
return this.left;
}
public Node getRight() {
return this.right;
}
protected void setLeft(Node leftNode) {
this.left = leftNode;
}
protected void setRight(Node rightNode) {
this.right = rightNode;
}
@Override
public String toString() {
return String.valueOf( getValue() );
}
} | {
"domain": "codereview.stackexchange",
"id": 2936,
"lm_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, binary-search",
"url": null
} |
electromagnetism, energy-conservation, perpetual-motion, dissipation
Either way, all of the energy that we're talking about is the energy that you put into the system in the first place by separating the cars from each other, working against the attractive force of the magnet.
No new energy will be added or generated after you release car A. | {
"domain": "physics.stackexchange",
"id": 46328,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, energy-conservation, perpetual-motion, dissipation",
"url": null
} |
• Jan 16th 2013, 02:31 AM
Imonars
Pyramid
Hello guys, me and my friends are desperate.. We can't solve this, any ideas? Thanks!
http://i45.tinypic.com/140hx1t.png
• Jan 16th 2013, 03:44 AM
emakarov
Re: Pyramid
Introduce two notations and write two equations for the tangents of the angles shown.
• Jan 16th 2013, 03:49 AM
Imonars
Re: Pyramid
Thanks for the reply
We have tried to find x , h and then solve for h
tan (40.3) = h / x + 200
tan (40.27) = h / x + 100
then we found x and solved for h but we got numbers like 0.525 which seem impossible to represent a high
• Jan 16th 2013, 03:59 AM
emakarov
Re: Pyramid
First, it's 46.27, not 40.27. Second, your equations are wrong because of the order of operations. Last, make sure that the tangent function interprets its arguments as given in degrees, not radians. The correct system gives the height between 440 and 470 feet.
• Jan 16th 2013, 04:07 AM
Imonars
Re: Pyramid | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806501150427,
"lm_q1q2_score": 0.8016977026662417,
"lm_q2_score": 0.8175744673038222,
"openwebmath_perplexity": 7196.979940380719,
"openwebmath_score": 0.935497522354126,
"tags": null,
"url": "http://mathhelpforum.com/trigonometry/211396-pyramid-print.html"
} |
Since the sets $W_i$ come from a locally finite collection, they are closure preserving. Hence we have:
$\overline{\bigcup \limits_{i=1}^\infty W_i}=\bigcup \limits_{i=1}^\infty \overline{W_i}=L$
For each $i$, choose some $U_i \in \mathcal{U}$ such that $\overline{W_i} \subset U_i$. Then $\left\{U_1,U_2,U_3,\cdots \right\}$ is a countable subcollection of $\mathcal{U}$ covering the space $L$. $\blacksquare$
A space is said to be a perfectly normal if it is a normal space with the additional property that every closed subset is a $G_\delta$-set in the space (equivalently every open subset is an $F_\sigma$-set). We need two basic results about hereditarily Lindelof spaces. A space is Lindelof if every open cover of that space has a countable subcover. A space is hereditarily Lindelof if every subspace of that space is Lindelof. Proposition 4 below, stated without proof, shows that to prove a space is hereditarily Lindelof, we only need to show that every open subspace is Lindelof. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357561234474,
"lm_q1q2_score": 0.8282078861421961,
"lm_q2_score": 0.8459424295406088,
"openwebmath_perplexity": 474.6879401861211,
"openwebmath_score": 1.0000089406967163,
"tags": null,
"url": "https://dantopology.wordpress.com/category/metrizable-spaces/"
} |
power-spectral-density
I think the factor you were looking for can very likely be a combination of these two effects, your $1/(f_s N)$ is the same as my $t_0/N$. | {
"domain": "dsp.stackexchange",
"id": 7660,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "power-spectral-density",
"url": null
} |
beam, aerospace-engineering
Title: Simply supported beam with a truss i am trying to find out the best way to approach a design task for a plane wing with a truss support. i am treating the wing as a simply supported beam but i have no idea how to incorporate the truss except as and extra support but i don't know whether this is suitable.
i am assuming it can be done via truss and member methods, this is the layout i am attempting Your wing can be assumed roughly as a two-span continuous beam supported from left by pin support (or fixed support but more on that later), then by other pin support by the diagonal tension strut, and the last right part as a cantilever beam.
Assuming the distributed load of W upward
WE have the maximum moment above the strut at the middle of the beam
$$M_{L2}=-WL_2^2/$$
$$M_{L1}= -WL_1^2/8+1/2M_{L2}$$
And the tensin in strut is
$$T=sec( a )*(1/2 \ W*L1+W*L2)$$
' | {
"domain": "engineering.stackexchange",
"id": 4651,
"lm_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, aerospace-engineering",
"url": null
} |
java, linked-list
while (currentNext != null) {
currentNext = currentElement.getSuccessor();
if (this.getHead() == currentElement.getPredecessor()) {
currentElement.setSuccessor(null);
currentElement.setPredecessor(currentNext);
} else if (currentNext != null) {
currentElement.setSuccessor(currentElement.getPredecessor());
currentElement.setPredecessor(currentNext);
} else {
currentElement.setSuccessor(currentElement.getPredecessor());
currentElement.setPredecessor(this.head);
}
currentElement = currentNext;
}
this.head.setSuccessor(this.end);
this.head.setPredecessor(currentFirst);
this.end = currentFirst;
} | {
"domain": "codereview.stackexchange",
"id": 23563,
"lm_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, linked-list",
"url": null
} |
navigation, map-to-odom, gmapping, map-server, amcl
<gazebo reference="left_scanner">
<sensor type="gpu_ray" name="head_hokuyo_sensor2">
<pose>0 0 0 0 0 0</pose>
<visualize>false</visualize>
<update_rate>40</update_rate>
<ray>
<scan>
<horizontal>
<samples>720</samples>
<resolution>1</resolution>
<min_angle>-1.57079633</min_angle>
<max_angle>1.57079633</max_angle>
</horizontal>
</scan>
<range>
<min>0.10</min>
<max>30.0</max>
<resolution>0.01</resolution>
</range>
<noise>
<type>gaussian</type>
<mean>0.0</mean>
<stddev>0.01</stddev>
</noise>
</ray>
<plugin name="gazebo_ros_head_hokuyo_controller2" filename="libgazebo_ros_gpu_laser.so">
<topicName>/wheelchair_lasers/left</topicName>
<frameName>left_scanner</frameName>
</plugin>
</sensor>
</gazebo> | {
"domain": "robotics.stackexchange",
"id": 18194,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, map-to-odom, gmapping, map-server, amcl",
"url": null
} |
ros, rviz, ros-kinetic, 2dcostmap, avoid-obstacle
I am not able to generate obstacle as you can see in the following image of Rviz. (I have to upload the image through drive, because I do not have enough points)
Rviz Capture
What you see in red is the topic /move_base/local_costmap/pointcloud_layer/clearing_endpoints.
What you see in green is the topic /scan.
If I try to navigate, it does not avoid the obstacle even If it is seen in the pointcloud.
Anyone of them generate obstacle or inflation and I do not know why. If you know any reason or you see any error in the config files please tell me.
Thank you in advance
Best regrets.
Alessandro
Originally posted by Alessandro Melino on ROS Answers with karma: 113 on 2020-03-10
Post score: 0
Please your static layer first. The order matters.
Also, publishing your costmap at 50hz is really unnecessary and will cost you a ton of CPU. Reduce that to at most update rate. Its really there to throttle publishing to less than update rate to save cycles. | {
"domain": "robotics.stackexchange",
"id": 34569,
"lm_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, rviz, ros-kinetic, 2dcostmap, avoid-obstacle",
"url": null
} |
orbit
I cannot find any simulation on here, it includes 2 Centauri A and B does not include the third dwarf star Proxima.
We have been observing the system for many years, I would think a lot of simulations would come out of each new star system we find, or are they all very similar to one another. In the case of Alpha Centauri A&B and Proxima Centauri, A&B orbit each other at elliptical orbits, getting almost as close as the Sun is to Saturn and about as far as the Sun is to Neptune. Proxima Centauri is about 1,000 times further out and it's a tiny compared to the inner 2, so for simulation purposes, it's essentially a 2 star system with a far distant 3rd orbiting the inner 2. The 3rd star is so far and comparatively small that it has essentially zero effect on the simulation. | {
"domain": "astronomy.stackexchange",
"id": 1077,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbit",
"url": null
} |
c#, logging, .net-core, entity-framework-core
Title: EFCore Monitor Interceptor with logging queries I created a SqlMonitorInterceptor that will check the execution time of queries and log errors. The main idea is to log queries in such a way that they can be easily copied into SQL Server Management Studio and executed.
SqlMonitorInterceptor:
using System;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Logging;
namespace WebApplication.Data
{
public class SqlMonitorInterceptor : DbCommandInterceptor
{
private readonly ILogger<SqlMonitorInterceptor> logger;
public SqlMonitorInterceptor(ILogger<SqlMonitorInterceptor> logger)
{
this.logger = logger;
} | {
"domain": "codereview.stackexchange",
"id": 42841,
"lm_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#, logging, .net-core, entity-framework-core",
"url": null
} |
neural-networks
In the context of multi-class classification with neural networks, you'll only be able to use Perrone and Cooper's method with option #2, i.e., applying it to the confidence scores from the models. You can still use it in a multi-class classification setting straightforwardly, by applying it separately to each class: to get the confidence score of the ensemble for class $c$, take a weighted average of the confidence scores of each model in the ensemble, with weights derived based on the formulas you listed. Basically, for 10-class classification, you treat this as 10 separate univariate functions (each class is treated independently). | {
"domain": "cs.stackexchange",
"id": 15167,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks",
"url": null
} |
1) The length of line segment AC is greater than 8
2) The length of line segment CD is greater than 6
so from the given info....
AB is teh line..... C is the midpoint.....$$AC = BC = \frac{AB}{2}.....$$
D is the midpoint of CB..............$$CD = BD = \frac{BC}{2} = \frac{AB}{4}..$$
lets see the statements-
1) The length of line segment AC is greater than 8
$$BD = \frac{BC}{2} = \frac{AC}{2}$$ ..... so if AC>6, DB > 3.....
DB can be 4, 5 ,6 etc
Insuff
2) The length of line segment CD is greater than 6
$$BD = CD.$$.. so if CD >6, BD>6..
Suff
B
_________________
1) Absolute modulus : http://gmatclub.com/forum/absolute-modulus-a-better-understanding-210849.html#p1622372
2)Combination of similar and dissimilar things : http://gmatclub.com/forum/topic215915.html
3) effects of arithmetic operations : https://gmatclub.com/forum/effects-of-arithmetic-operations-on-fractions-269413.html
GMAT online Tutor | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9433475715065793,
"lm_q1q2_score": 0.807365102796893,
"lm_q2_score": 0.8558511488056151,
"openwebmath_perplexity": 1399.420706825754,
"openwebmath_score": 0.4721931517124176,
"tags": null,
"url": "https://gmatclub.com/forum/a-b-c-and-d-are-points-on-a-line-if-c-is-the-midpoint-of-line-segm-220333.html"
} |
circuit-construction
Title: Minimum number of T gates needed to perform two overlapping Toffolis Consider this circuit:
How many T gates are needed to implement it, in the stabilizer+T gate set? The circuit can use cliffords, measurement, classical feedback, ancilla qubits, and T gates. Only T gates cost.
I know how to do it with 8 T gates, but don't know an easy way to show it can't be done with 4. Here's an intermediate result: it takes at least 5 T gates.
The T count of the overlapping Toffoli construction has to be exactly equal to the T count of two Toffolis that overlap at exactly one control, and those two Toffolis can be used to produce a state known to require 5 T states to produce.
This circuit with single-common-control Toffolis:
Is equivalent to this circuit with the overlapping Toffolis accompanied by various stabilizer operations: | {
"domain": "quantumcomputing.stackexchange",
"id": 2834,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "circuit-construction",
"url": null
} |
shell, ubuntu, ros-electric, ros-fuerte, ubuntu-precise
Comment by dornhege on 2012-07-24:
Usually one only writes a ros interface wrapper file that uses the library API. If that is possible depends on your code.
Comment by KDROS on 2014-12-31:
DOMHEGE, How to do 1st method plz give me one example. Means how to call C on ROS | {
"domain": "robotics.stackexchange",
"id": 10311,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "shell, ubuntu, ros-electric, ros-fuerte, ubuntu-precise",
"url": null
} |
This estimation technique based on maximum likelihood of a parameter is called Maximum Likelihood Estimation or MLE.The estimation accuracy will increase if the number of samples for observation is increased. Try the simulation with the number of samples $$N$$ set to $$5000$$ or $$10000$$ and observe the estimated value of $$A$$ for each run. Suppose we have seen 3 tails out of 3 trials. Then we predict that the probability of heads is zero: ˆθML = N1 N1 +N0 = 0 0+3 (15) This is an example of overfitting and is a result of using maximum likelihood estimation.
This paper shows that the maximum likelihood estimate (MLE) for the dispersion parameter of the negative binomial distribution is unique under a certain condition. • To understand the binomial distribution and binomial probability. • To understand the binomial maximum likelihood function. • To determine the maximum likelihood estimators of … | {
"domain": "luvluv.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769092358046,
"lm_q1q2_score": 0.8021087222608457,
"lm_q2_score": 0.822189121808099,
"openwebmath_perplexity": 388.8990139053514,
"openwebmath_score": 0.8958356380462646,
"tags": null,
"url": "https://luvluv.net/sir-samuel/maximum-likelihood-estimation-of-binomial-distribution-pdf.php"
} |
graph, rust, depth-first-search
for vertex in graph.keys() {
state.parents.insert(*vertex, Option::None);
}
for vertex in graph.keys() {
if !seen.contains(vertex) {
state.forest.push_back(HashSet::new());
dfs_visit(graph, *vertex, &mut time, &mut seen, &mut state);
}
}
return state;
}
fn topological_sort(graph: &Graph) -> VecDeque<Vertex> {
let DFSResult{topologically_sorted, ..} = dfs(graph);
return topologically_sorted
}
fn main() {
let pairs = [(1, 2), (2, 1)];
let g = from_pairs(&pairs);
println!("{:?}", g);
println!("{:?}", dfs(&g));
println!("{:?}", topological_sort(&g));
} | {
"domain": "codereview.stackexchange",
"id": 28828,
"lm_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, rust, depth-first-search",
"url": null
} |
c++, array, unit-testing
Then inside the do-while-loop above you can write:
auto& value = get<N>(tensor, indices);
EXPECT_EQ(value, 0);
value = std::accumulate(indices.begin(), indices.end(), 1, std::multiplies<int>());
There are some variations possible on this theme regarding how exactly you pass the dimensions to the various functions. Maybe pass a std::array to test() as well, instead of using a variable number of arguments? That would simplify nd_for_loop(). | {
"domain": "codereview.stackexchange",
"id": 43798,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, array, unit-testing",
"url": null
} |
of considerable use in continuum mechanics.These derivatives are used in the theories of nonlinear elasticity and plasticity, particularly in the design of algorithms for numerical simulations.. What is the logic behind them. Divergence of the vector field is an important operation in the study of Electromagnetics and we are well aware with its formulas in all the coordinate systems. So we can summarize the derivatives of the Cylindrical unit vectors as follows: Same logic can be thought for the deriving the spherical unit vectors. Here, at therightgate.com, he is trying to form a scientific and intellectual circle with young engineers for realizing their dream. The y-coordinate is the perpendicular distance from the XZ plane, similarly, z-coordinate is the normal distance from XY plane. This tutorial will make use of several vector derivative identities.In particular, these: Again, in a Lagrangian reference, the velocity is only a function of time. material derivative in cylindrical | {
"domain": "els3turons.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9585377261041521,
"lm_q1q2_score": 0.8147294397902969,
"lm_q2_score": 0.8499711775577736,
"openwebmath_perplexity": 1457.2614873037692,
"openwebmath_score": 0.8109865784645081,
"tags": null,
"url": "https://els3turons.org/journal/archive.php?c7614e=material-derivative-in-cylindrical-coordinates"
} |
c#, reinventing-the-wheel, symbolic-math
if (obj == null || GetType() != obj.GetType())
{
return false;
}
var equals = true;
for (int i = 0; i < Children.Length; i++)
{
if (!Children[i].Equals(((Node)obj).Children[i]))
{
equals = false;
}
}
return equals;
}
public override int GetHashCode()
{
var hash = 17;
hash = hash * 23 + ArgumentNumber.GetHashCode();
hash = hash * 23 + Children.GetHashCode();
return hash;
}
}
} | {
"domain": "codereview.stackexchange",
"id": 26141,
"lm_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#, reinventing-the-wheel, symbolic-math",
"url": null
} |
general-relativity, differential-geometry, differentiation, vector-fields, covariance
Title: How to calculate the covariant derivative $\nabla_{\bf e_\beta}{\bf e}_\alpha$ of a basis vector along another basis vector? So in my relativity course, we recently learned about the covariant derivative. it is defined as:
\begin{equation}
\nabla_{\mu}V^{\nu} = \partial_{\mu}V^{\nu}+\Gamma^{\nu}_{\mu,\lambda}V^{\lambda}
\end{equation}
where $V^{\mu}$ is a vector, and $\Gamma^{\nu}_{\mu,\lambda}$ is the connection, or Christoffel symbol. So recently I came accross:
\begin{equation}
\nabla_{\mathbf{e}'_{\beta}}\mathbf{e}'_{\alpha} = \Gamma^{\tau'}_{\alpha'\beta'}\mathbf{e}'_{\tau'}
\end{equation} | {
"domain": "physics.stackexchange",
"id": 33805,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, differential-geometry, differentiation, vector-fields, covariance",
"url": null
} |
symmetry, crystals, vibrations, raman-spectroscopy
Your second question is based on the misconception that the the super cell is a physically different system than the single cell, which is not true. The translational symmetry of crystals is baked into solid state theory and both descriptions, super and single cell must yield the same results. Now you might ask: "Why do I get twice as many modes with my super cell?".
Raman and IR modes are nothing more than phonon modes at the $\Gamma$ point, i.e. $k=0$. Solid state theory tells us that only phonon modes with almost (dipole) or exactly zero (Raman) contribute to dipole interaction and Raman scattering Phonon modes are described through a phonon dispersion with respect to the k vector. The k vector basically tells you how the phase of a certain mode changes over several unit cells.
When you double the cell in real space you cut k space in half. All phonon branches that extend into the cut region are folded back as indicated by the figure below. | {
"domain": "physics.stackexchange",
"id": 52035,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "symmetry, crystals, vibrations, raman-spectroscopy",
"url": null
} |
c++, algorithm, strings, time-limit-exceeded, vectors
#include <bits/stdc++.h>
using namespace std;
#define std_modulo 1000000007
void minimal_rotation()
{
string s;
cin >> s;
if (s.size() == 1)
{
cout << s;
return;
}
// Just some code to extract smallest indices
vector<int> v;
v.reserve(1000000);
for (int i = 0; i < s.size(); i++)
{
if (v.empty())
{
v.push_back(i);
}
else
{
if (s[i] - 'a' <= s[v.back()] - 'a')
{
v.push_back(i);
}
}
} | {
"domain": "codereview.stackexchange",
"id": 44985,
"lm_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, strings, time-limit-exceeded, vectors",
"url": null
} |
c++, message-filters
self.i += 1
def main(args=None):
rclpy.init(args=args)
minimal_publisher = DoublePublisher()
rclpy.spin(minimal_publisher)
minimal_publisher.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()
I then tried to make a C++ node that would use message filters to subscribe to the two topics and call a callback if two messages have the same timestamp. I can't really find any solid examples on how to do this in ROS2. I tried to figure it out from the comments in the code from this repo. Below is my code and the compile errors that I get.
The code:
#include <memory>
#include <string>
#include <cstring>
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
#include "sensor_msgs/msg/temperature.hpp"
#include "message_filters/subscriber.h"
#include "message_filters/time_synchronizer.h"
using std::placeholders::_1;
using std::placeholders::_2; | {
"domain": "robotics.stackexchange",
"id": 35542,
"lm_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++, message-filters",
"url": null
} |
c, database, circular-list, embedded
/*
*====================
* Fxns
*====================
*/
int8_t _RegisteredFeedFreeSlot(void);
void _PrintFeedValue(cbucket_t *feed);
/****************************************************************
* Function Name : BucketZeroize
* Description : Zeroize the bucket
* Returns : None.
* Params :None.
****************************************************************/
void BucketZeroize(void){
memset(cbucketBuf, 0, sizeof(cbucketBuf));
} | {
"domain": "codereview.stackexchange",
"id": 40696,
"lm_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, database, circular-list, embedded",
"url": null
} |
classical-mechanics, hamiltonian-formalism, noethers-theorem
$$
[G,[H,q]] = [H,[G,q]] + [[G,H],q] = [H,[G,q]]
$$
Now you are finish since you can use the linearity of $[H,]$ to add this new equation into your old equation
$$
\frac{d}{dt}(q+\epsilon [G,q])=[H,(q+\epsilon [G,q])]
$$
The same is true for the $p$-equation. | {
"domain": "physics.stackexchange",
"id": 55930,
"lm_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, hamiltonian-formalism, noethers-theorem",
"url": null
} |
thermodynamics, black-holes
You can simplify your setting by considering a black hole in a closed box, without the initial blackbody. Because the black hole will emit blackbody radiation itself, and that radiation will fill the box and bring it to some temperature, it ends up being an equivalent situation. The equilibrium conditions of this setup have been studied by Hawking (1) and Page (2), and by the standards of scientific papers both are pretty readable.
Consider a box with some fixed total energy, $E_0$, that can be divided between a black hole and the radiation around it. The energy in the radiation is $E$ and the energy in the black hole is $E_0-E$. Then the temperatures of each are easily found:
$$k_BT_{BH}=\frac{\hbar c^5}{8\pi G(E_0-E)}$$
$$k_BT_{rad}=\left[\frac{15(\hbar c)^3}{\pi^2}\frac{E}{V}\right]^{1/4}$$ | {
"domain": "physics.stackexchange",
"id": 70979,
"lm_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, black-holes",
"url": null
} |
python, adventure-game
class Room(object):
def __init__(self,name,description):
self.name = name
self.description = description
self.paths = []
self.items = []
Start = Room('Start',"""
You are in a dark room.
There is a door to the West and East.
""")
BearRoom = Room('Bear Room',"""
There is a bear!
""")
TreasureRoom = Room('Treasure Room',"""
Treasure has Been Stolen.
The room is empty!
""")
Sword = Weapon('Sword of Truth',5, 'Propped up against the wall')
Lantern = Weapon('Lantern',100, 'In Inventory')
#[n,w,s,e]
Start.paths = [0,BearRoom,0,TreasureRoom]
Start.items = []
BearRoom.paths = [0,0,0,Start]
BearRoom.items = [Sword]
TreasureRoom.paths = [0,Start,0,0]
TreasureRoom.items = []
character = Character('Bob Loblaw',Start)
character.inv = [Lantern] #starting items | {
"domain": "codereview.stackexchange",
"id": 2909,
"lm_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, adventure-game",
"url": null
} |
ros-melodic, catkin, ros-kinetic, bloom-release
--- http://man7.org/linux/man-pages/man7/debhelper.7.html , "debhelper config files"
Comment by nuclearsandwich on 2019-08-27:
I am not completely sure that we want to recommend the installation of system-wide unit or init scripts via existing package managers since the units could collide with units from upstream or from other rosdistros on the same host. It would make the most sense to me to provide example unit or init files in share/$pkgname/examples which could be copied or symlinked into a location by a system administrator or configuration management utility.
Comment by rubicks on 2019-08-27:
@nuclearsandwich , what collision? Even if there were, assuming you can enumerate all values of $ROS_DISTRO, then you could use debian/control.em to declare a conflict with every ros distro except the current.
Comment by nuclearsandwich on 2019-08-28:\
what collision? | {
"domain": "robotics.stackexchange",
"id": 33677,
"lm_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-melodic, catkin, ros-kinetic, bloom-release",
"url": null
} |
# We choose $5$ numbers from $1$ to $100$. We order them by value. What is the expected difference between the second and the third?
I came across this peculiar problem.
We choose $$5$$ numbers from $$1$$ to $$100$$ (with repetition). We order them in decreasing order by value. What is the expected difference between the second and the third?
For example, we draw $$6,67,89,45,33$$. Difference is $$67-45=22$$.
• Are the five values distinct? Mar 27 '21 at 19:55
• The numbers are drawn with repetition so they can be the same. Also 2nd highest and third highest. For that matter, it doesn't matter. Let's define it order them in decreasing order. Mar 27 '21 at 19:57
• Was this an interview question, by any chance? Mar 27 '21 at 20:57
• The solution should be at least 40 pages long and the last 10 pages are unlocked with a key from a special mission in Zelda. Mar 27 '21 at 21:07
• this kind of problem is given by results of "order statistics"
– qwr
Mar 27 '21 at 22:06 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765622193214,
"lm_q1q2_score": 0.8442872561827529,
"lm_q2_score": 0.8615382129861583,
"openwebmath_perplexity": 340.9650205202172,
"openwebmath_score": 0.728655219078064,
"tags": null,
"url": "https://math.stackexchange.com/questions/4079714/we-choose-5-numbers-from-1-to-100-we-order-them-by-value-what-is-the-exp"
} |
performance, c, physics, openmp
continue; // 8.3 % of inner loop executions
}
// Get index for step divisible velocity
vmap_vk_idx = (size_t)(MAX(vkp1, vk) * fmapsvel->vmapstep_r + 0.5);
// Get max available traction force for max transition velocity
F_TRACTION_TRAIN = fmapsvel->trac_force_at_vq_[vmap_vk_idx]; | {
"domain": "codereview.stackexchange",
"id": 10214,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, c, physics, openmp",
"url": null
} |
ros, navigation, ros-kinetic, robot-localization
Originally posted by Delbina on ROS Answers with karma: 109 on 2021-08-17
Post score: 0
If GPS is missing then you will rely on continuous sensory data such as wheel odometry+Imu, despite being able to deal with accumulative drift errors, GPSs are not always reliable under bad weather or poor connection conditions. Depending on quality and setup of your GPS device you may also get constant jumps around.
Robot localization package wiki explains this thoroughly, you are encouraged to take a look into Integrating GPS data section.
As final word to your question, do your navigation and planning on continuous data instance of EKF, in that case even you miss some signals from GPS, the system still should be able to function
Originally posted by Fetullah Atas with karma: 819 on 2021-08-17
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 36805,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, navigation, ros-kinetic, robot-localization",
"url": null
} |
python
class Novel:
def __init__(self, title, pages, publicationDate):
self.title = title
self.pages = pages
self.publicationDate = publicationDate
def __repr__(self):
return f"Novel({self.title}, {self.pages}, {self.publicationDate})"
def __str__(self):
return f"Media: {self.title}"
class ComicBook(Novel):
def __init__(self, title, pages, publicationDate, artist):
super().__init__(title, pages, publicationDate)
self.artist = artist
def get_artist(self):
return f"Artist: {self.artist}"
def __repr__(self):
return (f"ComicBook({self.title}, {self.pages}, "
f"{self.publicationDate}, {self.artist})")
class ReadingList:
def __init__(self):
self.list = []
def add_book(self, book):
"""Add book to reading list"""
self.list.append(book)
def remove_book(self, book): | {
"domain": "codereview.stackexchange",
"id": 39552,
"lm_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",
"url": null
} |
ros, c++, orocos, ros-kinetic, c++11
-- [UseOrocos] Exporting libraries | {
"domain": "robotics.stackexchange",
"id": 31145,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, c++, orocos, ros-kinetic, c++11",
"url": null
} |
# Truth Table Precedence
#### lyd123
##### New member
Hello!
The question is attached.
I know that " $\implies$ " (implies) has precedence from right to left. But because " l- " appears after
P$\implies ($Q $\implies$ R ), in my truth table do I evaluate:
(P$\implies ($Q $\implies$ R ) ) $\implies$ ((P$\implies$Q ) $\implies$ R ) )
or
P$\implies ($Q $\implies$ R ) $\implies$ (P$\implies$Q ) $\implies$ R )
Thank you for any help.
#### Attachments
• 6.3 KB Views: 20
#### Evgeny.Makarov | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9489172615983309,
"lm_q1q2_score": 0.8175284818291448,
"lm_q2_score": 0.8615382129861583,
"openwebmath_perplexity": 1105.1651934581625,
"openwebmath_score": 0.8882349729537964,
"tags": null,
"url": "https://mathhelpboards.com/threads/truth-table-precedence.25506/"
} |
c++
/*
* Returns the currently logged in user
*/
std::string Bank::getCurrentUser() {
return user;
};
/*
* Generates test accounts that can be used to make sure the
* `login` method works
*/
void Bank::generateTestAccounts() {
for(int i = 0; i < 5; i++) {
usernames.push_back("user" + std::to_string(i));
passwords.push_back("pass" + std::to_string(i));
}
}
/*
* main method for testing bank class
*/
int main() {
Bank bank;
std::string us = "user1";
std::string pw = "pass1";
if(bank.login(us, pw)) {
std::cout << "Logged in as " + us << std::endl;
}
}
You don't check for the password in the login member function. This is the least secure user credential system I've ever seen :)
You have some unnecessarily verbose comments in your code, e.g.
//Include Statements
//Class Body
//Constructor
//Class Functions
user.clear(); //basically null | {
"domain": "codereview.stackexchange",
"id": 34068,
"lm_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
} |
extrema in this function, but the second partial derivative test fails with: the partial derivative with respect to x = 3x^2-12x+12. They perform the second derivative test, and identify the partial derivatives. Heyy all I have a test tomorrow on graphing (calculus) and this is not homework, I really need help with this. o f has a relative value at c if f ''(c) < 0. When dealing with the second derivative test, only the. First let us find the critical points. ANSWER: Find the critical numbers of the original function. The first derivative of y = x 3 is zero when x = 0 and the first derivative of y = x 1/3 does not exist at x = 0. Con rm using the First Derivative Test. We can use the second derivatives in a test to determine whether a critical point is a relative extrema or saddle point. From left to right, a function with a relative maximum where its derivative is zero; a function with a relative maximum where its derivative is undefined; a function with neither a maximum nor a | {
"domain": "brouwerverkeersopleidingen.nl",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9916842195563768,
"lm_q1q2_score": 0.8198370424180074,
"lm_q2_score": 0.8267117962054049,
"openwebmath_perplexity": 259.82261796467463,
"openwebmath_score": 0.7462790012359619,
"tags": null,
"url": "http://brouwerverkeersopleidingen.nl/how-to-find-relative-extrema-using-second-derivative-test.html"
} |
ecology, photosynthesis, trees, climate-change
Title: Will the climate change help the trees to grow? I've heard several contradictory views and I'm not sure which factor do climatologists count with. Counting with all the effects of the current climate change (including changes of biotopes on places such as Siberia, as well as the higher percent of CO2 in the atmosphere), will the conditions help make better conditions for growing trees (I know the effect on biosphere is usually claimed to be synergic, e.i. for example coral reefs will have less CaCO3 to work with so they will make the global warming appear faster. So please consider just the average effect on trees) I don't think anyone knows for sure. It will certainly depend on which spatial location, and which tree species, you're thinking of: while "global average effect on growth (e.g. measured by change in net ecosystem exchange of forested ecosystems) of all tree species" is at least well-defined, it will be an average across an enormously variable set of communities, and | {
"domain": "biology.stackexchange",
"id": 5915,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ecology, photosynthesis, trees, climate-change",
"url": null
} |
botany, plant-physiology, plant-anatomy
Title: Caudex vs Xylopodium difference I live in Brazil and many plants from the brazilian grasslands/prairies exhibit an structure called, by the brazilian literature, "xylopodium" (or "xilopódio" in portuguese) - which are tickened, underground, lignified structures (root or stem) to store water and nutrients. I couldn't really find any work outside Brazil that mentions this kind of strucutre, and as far as I know, the structure known as "caudex" fits the very same definition. That being said, are these two terms synonyms? The New York Botanic Garden gives the definition of xylopodium as:
An underground, woody, storage organ derived from stems or roots and common in cerrado vegetation.
And the definition of caudex as:
A short, vertical, usually woody and persistent stem at or just below the surface of the ground. | {
"domain": "biology.stackexchange",
"id": 12065,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "botany, plant-physiology, plant-anatomy",
"url": null
} |
python, beginner, excel
The reason why we use os.path.join is for cross-platform compatibility. Also try to avoid single letter names if there is a more expressive name available.
Lastly, the sum call in each loop could be done once after all the values have been gathered rather than every loop as the result would not matter at all.
To simplify code, look for parts that are common, and from that parts that take values that define the specific usage. From the three for loops we can see that it's just simply sheet identifier within the workbook, the cell identifier from the sheet. This is what it might look like (please note that I don't have the library installed, nor your Excel files, so I can't exactly test the following)
def process_workbooks_in_dir(excel_root, sheet_id, cell_id):
values = []
for path in glob(join(excel_root, '*.xlsx')):
workbook = openpyxl.load_workbook(path, data_only=True)
sheet = workbook[sheet_id]
value = sheet[cell_id].value | {
"domain": "codereview.stackexchange",
"id": 29338,
"lm_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, excel",
"url": null
} |
As the name suggests, convergence in distribution has to do with convergence of the distri-bution functions of random variables. De nition 5.18 | Convergence in distribution (Karr, 1993, p. … most sure convergence, while the common notation for convergence in probability is X n →p X or plim n→∞X = X. Convergence in distribution and convergence in the rth mean are the easiest to distinguish from the other two. We say that the sequence {X n} converges in distribution to X if … If X n ˘Binomial(n;p n) where p n! One or in mean square ) does imply convergence in distribution. ) all... H ) if X and all X. n. are continuous, convergence in distribution:... for example by... The CMT, and to some limiting random variable with a given distribution, or vice versa from the of! Notice that the outcomes actually converge “ slower ”, not that the distribution has small probability X ” than. Out, so some limit is involved ¡! D X industry and... Also Binomial ( n, p ) random variable has approximately | {
"domain": "vscienlight.net",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.96741025335478,
"lm_q1q2_score": 0.8040563044795402,
"lm_q2_score": 0.831143045767024,
"openwebmath_perplexity": 747.7855046478511,
"openwebmath_score": 0.8685283064842224,
"tags": null,
"url": "http://vscienlight.net/e3m56ur/03r3ir.php?7974dc=convergence-in-distribution-example"
} |
12. ## Re: 3*2 Matrix with complex elements
Originally Posted by Hartlw
Every element of the matrix is an ordered pair. If the matrix has only one non-zero element, all matrices with only this one element are a linear combination of two matrices, one with (0,1) as the sole element, and the other with (1,0) as the sole element. So for each element in the matrix you need two matrices with (1,0) and (0,1) as the sole elements. You need a total of 12 matrices, two for each element. The dimension of the vector space is 12.
For both the real case and the complex case? Is this not conflicting with post # 7
13. ## Re: 3*2 Matrix with complex elements
Originally Posted by bugatti79
For both the real case and the complex case? Is this not conflicting with post # 7
For the real case, every base matrix has a 1 in one element and every other element a 0, for a total of six, the dimension is six. For complex case, see my previous post. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924793940119,
"lm_q1q2_score": 0.8592795333460284,
"lm_q2_score": 0.8840392817460333,
"openwebmath_perplexity": 437.4005817626351,
"openwebmath_score": 0.8677421808242798,
"tags": null,
"url": "http://mathhelpforum.com/differential-geometry/190486-3-2-matrix-complex-elements.html"
} |
like the Euclidean or Cosine distance; Mahalanobis Distance - Measures the distance of two data sets with respect to the variance and covariance of the selected variables; Matrix Distance - Wraps a pre-computed Distance Matrix in a distance measure. K- means clustering with scipy K-means clustering is a method for finding clusters and cluster centers in a set of unlabeled data. toe length) -> standardise! (mean=0, std=1) But may affect variability Others metrics •Mahalanobis distance – Absolute without redundancies • Pearson correlation (unit indep. If the covariance matrix is diagonal, then the resulting distance measure is called the normalized Euclidean distance: Common Properties of a Distance. Euclidean distanceは、データが等方的なガウス分布であると仮定し、すなわち、各特徴を等しく扱う。一方、Mahalanobis distanceは、変数間の相関を測定し、ユークリッド距離の仮定を緩和し、その代わりに異方性ガウス分布を仮定します。. On the other hand, the Mahalanobis distance seeks to measure the correlation between variables and relaxes the assumption of the Euclidean distance, assuming | {
"domain": "pontevecchioparquet.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474872757474,
"lm_q1q2_score": 0.8134307460368096,
"lm_q2_score": 0.8221891261650247,
"openwebmath_perplexity": 1350.3428928883864,
"openwebmath_score": 0.776372492313385,
"tags": null,
"url": "http://chet.pontevecchioparquet.it/mahalanobis-distance-vs-euclidean-distance.html"
} |
signal-analysis, audio, window-functions
We can see that the resulting waveform is somehow inverted, i.e. the beginning of the original signal occurring in the middle.
I tried other window types (rect, hann, etc.) as well as w/ and w/o zero-padding the original signal, I get the same behavior. It turns out that the windowing function that is used performs by default "Zero-Phase Zero-Padding" on the input signal.
You can disable this feature by setting the zeroPhase parameter to False as follows:
w = std.windowing(type='hamming',
size=len(audio_pool['frames.actual-frames'][22]),
normalized=False,
zeroPhase=False) | {
"domain": "dsp.stackexchange",
"id": 6276,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, audio, window-functions",
"url": null
} |
reaction-mechanism, water, alkali-metals
I appreciate any advice provided. Actually, if one adds your two reactions:
$\ce{2 NaHCO3 <=> Na2CO3 + H2O + CO2}$
$\ce{Na2CO3 + H2O <=> NaHCO3 + NaOH}$
Upon cancelling, to derive the reaction:
$\ce{ NaHCO3 <=> NaOH + CO2}$
which implies that heated Sodium bicarbonate is a chemically active source of Lye, if one allows the CO2 gas to escape (which answers (a) of your question).
To answer (b) and (c), add Aluminum to the heated aqueous mix and it will dissolve, and you could collect the generated hydrogen gas over water and record volume increase over time. Reaction:
$\ce{2 Al + 6 NaOH -> 2 Al(OH)3 + 3 H2 (g)}$
Now, per this Aluminum shiny finish destroyed in dishwasher, you have an understanding as to why this occurs with Aluminum ware in the presence of NaHCO3, which is a popular spotless-rinse agent employed in dishwasher's washing powder. | {
"domain": "chemistry.stackexchange",
"id": 13478,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reaction-mechanism, water, alkali-metals",
"url": null
} |
python, performance, python-3.x, functional-programming
Title: Scraping and using JSON data from thousands of files in a directory I have a few thousand json files containing order histories sitting in a directory from one of our systems. Since customers can opt in to receive marketing I'm opening each json file and then processing the data to scrape our active subscribers. At a later date I plan to expand this to bring this data into our CRM.
As I'm not a Python programmer by trade so I'm wondering what I could do better to make this more functional and (for lack of a better term) 'pythonic'?
import sys, os, json
import pandas as pd
print("Scraping E-mail Subscribers")
print("Using Python version %s.%s.%s" % sys.version_info[:3])
json_path = 'D:/dev/order_archive/'
json_files = [pos_json for pos_json in os.listdir(json_path) if pos_json.endswith('.json')]
records = 0
opted_records = 0
unopted_records = 0 | {
"domain": "codereview.stackexchange",
"id": 16333,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-3.x, functional-programming",
"url": null
} |
thermodynamics, energy, statistical-mechanics, potential
Imagine now that you put your system in contact with a pressure reservoir (the analogous of a thermal bath, if you want to keep the pressure in your system constant). Essentially what that means is that the system now can exchange mechanical work with its surroundings, and that has the effect of influencing how the systems reaches its equilibrium state. Grossly speaking, in that case what you want to extremize is the internal energy of the system, plus the amount of work that had to be done against the pressure reservoir in order to put the system into that configuration, and that is exactly what is accounted for in the enthalpy $H = U + PV$; if you want a quicker explanation, check the answer mentioned above What exactly is enthalpy? . | {
"domain": "physics.stackexchange",
"id": 52835,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, energy, statistical-mechanics, potential",
"url": null
} |
# Definition:Order Product
## Definition
### Simple Order Product
Let $\struct {S_1, \preccurlyeq_1}$ and $\struct {S_2, \preccurlyeq_2}$ be ordered sets.
The simple (order) product $\struct {S_1, \preccurlyeq_1} \otimes^s \struct {S_2, \preccurlyeq_2}$ of $\struct {S_1, \preccurlyeq_1}$ and $\struct {S_2, \preccurlyeq_2}$ is the ordered set $\struct {T, \preccurlyeq_s}$ where:
$T := S_1 \times S_2$, that is, the Cartesian product of $S_1$ and $S_2$
$\preccurlyeq_s$ is defined as:
$\forall \tuple {a, b}, \tuple {c, d} \in T: \tuple {a, b} \preccurlyeq_s \tuple {c, d} \iff a \preccurlyeq_1 c \text { and } b \preccurlyeq_2 d$
### Lexicographic Order
Let $\struct {S_1, \preccurlyeq_1}$ and $\struct {S_2, \preccurlyeq_2}$ be ordered sets.
The lexicographic order $\struct {S_1, \preccurlyeq_1} \otimes^l \struct {S_2, \preccurlyeq_2}$ on $\struct {S_1, \preccurlyeq_1}$ and $\struct {S_2, \preccurlyeq_2}$ is the ordered set $\struct {T, \preccurlyeq_l}$ where: | {
"domain": "proofwiki.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.989671846566823,
"lm_q1q2_score": 0.8091304481589707,
"lm_q2_score": 0.8175744828610095,
"openwebmath_perplexity": 312.17433030057634,
"openwebmath_score": 0.9362227320671082,
"tags": null,
"url": "https://proofwiki.org/wiki/Definition:Order_Product"
} |
By the multiplication rule for conditional probability, $\P(X_1 = x_1, X_2 = x_2, \ldots, X_n = x_n) = \P(X_1 = x_1) \P(X_2 = x_2 \mid X_1 = x_1) \cdots \P(X_n = x_n \mid X_1 = x_1, \ldots, X_{n-1} = x_{n-1})$ Of course, if we know that the urn has, say, $$r$$ red and $$g$$ green balls at a particular time, then the probability of a red ball on the next draw is $$r / (r + g)$$ while the probability of a green ball is $$g / (r + g)$$. The right side of the displayed equation above has $$n$$ factors. The denominators are the total number of balls at the $$n$$ times, and form the product $$(a + b) (a + b + c) \ldots [a + b + (n - 1) c] = (a + b)^{(c,n)}$$. In the numerators, $$k$$ of the factors correspond to probabilities of selecting red balls; these factors form the product $$a (a + c) \cdots [a + (k - 1)c] = a^{(c,k)}$$. The remaining $$n - k$$ factors in the numerators correspond to selecting green balls; these factors form the product $$b (b + c) \cdots [b + (n - k - 1)c] = b^{(c, | {
"domain": "uah.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9953904287778247,
"lm_q1q2_score": 0.811474626066472,
"lm_q2_score": 0.8152324983301568,
"openwebmath_perplexity": 129.32421256597146,
"openwebmath_score": 0.974198579788208,
"tags": null,
"url": "http://www.math.uah.edu/stat/urn/Polya.html"
} |
homework-and-exercises, newtonian-mechanics, projectile
Title: Meeting point of one falling object and a climbing one We have this red ball, that falls free, with no inicial velocity, off of the top of a building 60 meters high.
A green ball is launched vertically, upwards, with inicial velocity of 20 m/s, after 2 seconds of the red ball launching.
How long does it take for them to meet (in the air, obviously), since the red ball is launched?
I tried to solve this using Newton's Laws of Motion, but my results are not the same of those of the solutions of the book (it gives me 2 seconds and in the book, the solution is 3 seconds, however they don't show us how did they get to that result). Red Ball:
$$y_r(t) = 60m -(5m/s^2)t^2$$
After 2 seconds:
$$y_r(2)=60m-20m = 40m,$$
$$v_r(2) = -20m/s.$$
Therefore the equation of motion of the red ball is (after 2 seconds):
$$y_r(t) = 40m -(20m/s)t-(5m/s^2)t^2.$$
Now the equation of motion of the green ball:
$$y_g(t)=(20m/s)t-(5m/s^2)t^2.$$
They meet when their positions are the same, so: | {
"domain": "physics.stackexchange",
"id": 17343,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, projectile",
"url": null
} |
• have u seen the solution in the question? Can u kindly explain it? – user366312 Apr 12 at 19:42
• the "solution" meaning the scanned handwritten note? i didn't check the details but that looks like a direct exact derivation of $P^n$ via eigen decomposition, maybe? anyway, if $0 < p+q < 2$ then $|1 - p - q| < 1$ and so $\lim (1 - p - q)^n = 0$ so all those terms vanish, and you can clearly see $P^\infty$ having two identical rows, both equal to $\pi$. – antkam Apr 12 at 19:49
• @antkam Being limiting distribution implies being stationary. Not backwards. – Phicar Apr 12 at 19:51
• @Phicar - thanks, I was not sure of the terminology (since I learned this literally decades ago). Then in the $p=q=1$ case there is no limiting distribution, while in the $p=q=0$ case every distribution is limiting. Right? – antkam Apr 12 at 19:55
• Are we mixing up Limiting Distribution and Stationary Distribution? – user366312 Apr 12 at 20:03 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668684574636,
"lm_q1q2_score": 0.8176304856215948,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 489.6487043284684,
"openwebmath_score": 0.8122987151145935,
"tags": null,
"url": "https://math.stackexchange.com/questions/3185387/finding-limiting-distribution/3185484"
} |
complexity-theory, vqe, pauli-gates
I should mention that you don't need to always decompose matrix into Pauli operators. Sometime it's best to decompose using different basis. For instance, you can decompose the following matrix $A$ | {
"domain": "quantumcomputing.stackexchange",
"id": 4242,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, vqe, pauli-gates",
"url": null
} |
fluid-dynamics, pressure, water, fluid-statics
A good schematic explanation is available in hyperphysics.
Edit:
Altough the diameter of the left pipe is bigger, the force exerted on the "slice" of water is not higher because the pressure on a given infinitesimal volume depends only on the height of the column of water above it. Imagine two simple straight vertical pipes filled with water and with equal height, one with a large diameter and the other with a smaller. It is true that the force on the bottom of the big one is higher, but the pressure will be the same, because the force acts on a larger surface. | {
"domain": "physics.stackexchange",
"id": 58800,
"lm_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, pressure, water, fluid-statics",
"url": null
} |
ros, roslaunch, rostopic, communication, ros-noetic
current_time.clock = next_time;
time_publisher.publish(current_time);
ROS_DEBUG("Synchronizer: Publishing next time %f", next_time.toSec());
external_clock.ResetCounter();
sim_colgada_counter=0;
}
if (sim_colgada_counter>30000){
std::system("rosnode kill --all");
} | {
"domain": "robotics.stackexchange",
"id": 38614,
"lm_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, roslaunch, rostopic, communication, ros-noetic",
"url": null
} |
sorting, probability-theory, quicksort
0: (0.5^7)(0.5^0)(C(7,7)) = (0.5^7)(1) = .0078125
1: (0.5^6)(0.5^1)(C(7,6)) = (0.5^7)(7) = .0546875
2: (0.5^5)(0.5^2)(C(7,5)) = (0.5^7)(21) = .1640625 | {
"domain": "cs.stackexchange",
"id": 13989,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sorting, probability-theory, quicksort",
"url": null
} |
Output :
You must install the amsmath package when denoting the matrix. And use the \usepackage command when installing a package.
### 4. Diagonal dots symbol
This symbol is located along the diagonal from N-W to S-E. And this symbol is mostly used to represent the elements located along the diagonal of the matrix.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{bmatrix}
a_{1} & & \\
& \ddots & \\
& & a_{n}
\end{bmatrix}
\end{document}
Output :
If you look at the program above, you will understand that \ddots has been used for the diagonal dots symbol.
### 5. Inverse Diagnal dots symbol
The inverse diagonal dots symbol will be located along the S-W to N-E direction. There is more than one command to represent this symbol but this tutorial will only discuss \iddots commands.
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathdots}
\begin{document}
$$\begin{bmatrix} & & a_{1}\\ & \ddots & \\ a_{n} & & \end{bmatrix}$$
\end{document}
Output : | {
"domain": "physicsread.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811601648195,
"lm_q1q2_score": 0.8002419064431462,
"lm_q2_score": 0.828938806208442,
"openwebmath_perplexity": 1804.693458070792,
"openwebmath_score": 0.9861055016517639,
"tags": null,
"url": "https://www.physicsread.com/latex-dots/"
} |
stereo, stere-image-proc
Sorry, I'm not able to upload any image of rosgraph, but the nodes seem connected.
I get the following warning:
[ WARN] [1469637939.617985018]: [stereo_view] Low number of synchronized left/right/disparity triplets received.
Left images received: 493 (topic '/stereo/left/image_rect')
Right images received: 492 (topic '/stereo/right/image_rect')
Disparity images received: 0 (topic '/stereo/disparity')
Synchronized triplets: 0
rostopic echo /stereo/left/image_rect and rostopic echo /stereo/right/image_rect show running data.
rosnode info /stereo_cam shows:
Node [/stereo_cam]
Publications:
* /rosout [rosgraph_msgs/Log]
Subscriptions:
* /stereo/left/image_rect_color [sensor_msgs/Image]
* /stereo/disparity [stereo_msgs/DisparityImage]
* /stereo/right/image_rect_color [sensor_msgs/Image]
Services:
* /stereo_cam/set_logger_level
* /stereo_cam/get_loggers | {
"domain": "robotics.stackexchange",
"id": 25369,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stereo, stere-image-proc",
"url": null
} |
human-biology, microbiology, virology, medicine, infection
Each of the studies I've linked here is quite different from the other, so plugging results from one into the other is introducing a lot of error, but hopefully the process was informative. | {
"domain": "biology.stackexchange",
"id": 10609,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology, microbiology, virology, medicine, infection",
"url": null
} |
javascript, game
Convert that distance to an index used to lookup speeds.
Use the sign of the distance to convert the speed to the correct sign.
Example
const SPEEDS = [0, 0.5, 1, 2, 4];
movePaddle(ball) {
const distance = ball.y - (this.y + this.height / 2);
const idx = Math.min(Math.abs(distance / 20) | 0, SPEEDS.length - 1);
this.y += SPEEDS[idx] * Math.sign(distance);
}
Smooth change
However I am guessing that the speeds are somewhat arbitrary and thus a functional approximation will do just as well. That the speed is a function of distance. A hermite curve looks like a close approximation.
The result is a smooth change in speed as he ball gets closer , but depending on how the ball moves this will need to be tuned to get the correct look and feel.
const MAX_SPEED = 4;
const MIN_SPEED_CUTOFF = 0.5;
const DISTANCE_RANGE = 80; | {
"domain": "codereview.stackexchange",
"id": 39963,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, game",
"url": null
} |
By definition $$(a+b)^n=\sum_{k=0}^n\binom{n}{k}a^kb^{n-k}.$$
Why this formula ? Let $A$ a set with $a$ elements and $B$ a set with $b$ element s.t. $A\cap B=\emptyset$. $(a+b)^n$ is the number of function from $\{1,...,n\}\longrightarrow A\cup B.$ But you can count them as following : The number of function that send $k$ elements of $\{1,...,n\}$ in $A$ is $$\binom{n}{k}a^kb^{n-k}$$ since you can take $k$ element from $\{1,...,n\}$ with $\binom{n}{k}$ possibilities, and each of those $k$ element has $a$ possibilities in $A$. After, the $n-k$ other are sent on $B$, and each element has $b$ possibilities in $B$. Notice that you can choose $n-k$ other element with $\binom{n-k}{n-k}=1$ possibility (in other way, you don't have the choice). If we denote $f_k$ a function that send $k$ element of $\{1,...,n\}$ in $A$ (and the other in $B$), finally, $$(a+b)^n=\sum_{k=0}^n|\{f_k:\{1,...,n\}\to A\cup B\}|=\sum_{k=0}^n\binom{n}{k}a^kb^{n-k}.$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.982287697666963,
"lm_q1q2_score": 0.8309588433798212,
"lm_q2_score": 0.8459424314825852,
"openwebmath_perplexity": 142.7905838469623,
"openwebmath_score": 0.9241266846656799,
"tags": null,
"url": "https://math.stackexchange.com/questions/1903442/why-does-n-choose-k-get-you-the-kth-starting-from-0-coefficient-of-a"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.