text stringlengths 1 1.11k | source dict |
|---|---|
fluid-mechanics, chemical-engineering, pipelines
Title: Estimating Darcy Friction Factors for Critical Flow The Darcy-Weisbach equation is used to calculate the frictional pressure losses in pipes transporting incompressible fluids. This equation uses a dimensionless Darcy friction factor, also known as the Moody factor, to account for the relative roughness of the pipe surface.
This empirical factor was experimentally determined by Moody and is normally read off of the Moody Chart. However I am implementing the pressure drop calculation in software, so I need a non-graphical way to find the Darcy friction factor.
Equations for calculating the Darcy friction factor under laminar (Re < 2320) and turbulent (Re > 4000) flow are readily available. But I haven't been able to find one that is valid for the transitional region which exists between laminar and turbulent flow (2320 < Re < 4000), also known as the 'critical zone'. | {
"domain": "engineering.stackexchange",
"id": 387,
"lm_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-mechanics, chemical-engineering, pipelines",
"url": null
} |
8048337: 58 pop %eax
8048338: 60 pusha
8048339: 59 pop %ecx
804833a: cd 80 int \$0x80 | {
"domain": "grocid.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9848109520836027,
"lm_q1q2_score": 0.8484522660367423,
"lm_q2_score": 0.8615382112085969,
"openwebmath_perplexity": 2297.7335466269597,
"openwebmath_score": 0.8094127774238586,
"tags": null,
"url": "https://grocid.net/page/4/"
} |
algorithms, graphs, algorithm-analysis, dynamic-programming, dag
A topological sort will be useful. | {
"domain": "cs.stackexchange",
"id": 19080,
"lm_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, algorithm-analysis, dynamic-programming, dag",
"url": null
} |
Lagrange Remainder
Section 10.10 differentiating and integrating power series
Differentiating power series Integrating power series
Differentiation
Integration
Examples online
Bibliography http://mathworld.wolfram.com/
Anton, Bivens, Davis. Calculus. Anton textbooks, 2002.
Download ppt "Chapter 10 Infinite Series by: Anna Levina edited: Rhett Chien."
Similar presentations | {
"domain": "slideplayer.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682468025243,
"lm_q1q2_score": 0.8173436937231984,
"lm_q2_score": 0.8267117876664789,
"openwebmath_perplexity": 869.0625639929649,
"openwebmath_score": 0.9522554278373718,
"tags": null,
"url": "http://slideplayer.com/slide/3248840/"
} |
swing, postgresql, groovy
/**
* Open DB connection, create a table, insert data.
* @TODO Extract credentials to configuration file.
* @TODO Extract SQL queries to a separate file
*/
def dbUrl = 'jdbc:postgresql://localhost/GroovyTest'
def dbUser = 'Phrancis'
def dbPassword = 'test'
def dbDriver = 'org.postgresql.Driver'
def sql = Sql.newInstance(dbUrl, dbUser, dbPassword, dbDriver)
println 'Sql Instance: ' + sql
sql.execute 'SET SEARCH_PATH TO groovy_test;'
sql.execute createTestTable
def personData = [userInput.firstName, userInput.lastName, userInput.phone, userInput.dateOfBirth]
sql.execute insertQuery, personData | {
"domain": "codereview.stackexchange",
"id": 14844,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "swing, postgresql, groovy",
"url": null
} |
# Toronto Math Forum
## APM346-2016F => APM346--Lectures => Chapter 6 => Topic started by: Shentao YANG on November 05, 2016, 07:14:10 PM
Title: Domain of the theta function in section 6.4
Post by: Shentao YANG on November 05, 2016, 07:14:10 PM
Can any explain why we need the $\Theta$ function in section 6.4 (and onward) defined on $[0,2\pi ]$ instead of on $[0,2\pi )$ so that we can remove the periodic assumption of the $\Theta$ function and the boundary conditions related to $\theta$.
http://www.math.toronto.edu/courses/apm346h1/20169/PDE-textbook/Chapter6/S6.4.html
From Wikipedia, a standard convention for defining polar coordinate system to achieve Uniqueness of polar coordinates is restrict the domain to $[0, 2\pi)$ or $(−\pi, \pi]$. | {
"domain": "toronto.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9688561694652216,
"lm_q1q2_score": 0.8094633794092901,
"lm_q2_score": 0.8354835371034368,
"openwebmath_perplexity": 1174.4388690823555,
"openwebmath_score": 0.8726722598075867,
"tags": null,
"url": "http://forum.math.toronto.edu/index.php?action=printpage;topic=828.0"
} |
lagrangian-formalism, linear-systems
\dfrac{\partial \mathrm L}{\partial \dot{V}_2} \vphantom{\dfrac{a}{b}}
\end{bmatrix}
\tag{A-06}\label{A-06}
\end{equation}
Comparing equations \eqref{A-04} and \eqref{A-05} we note that the Lagrangian $\mathrm L\left(\mathbf{V},\mathbf{\dot{V}},t\right)$ must satisfy, except constants, the following two equations
\begin{align}
\dfrac{\partial \mathrm L}{\partial \mathbf{\dot{V}}} & \boldsymbol{=}\mathbf{\dot{V}}\vphantom{\dfrac{a}{\dfrac{a}{b}}}
\tag{A-07a}\label{A-07a}\\
\dfrac{\partial \mathrm L}{\partial \mathbf{V}} & \boldsymbol{=}C^{\boldsymbol{-}1}\mathbf{J}\boldsymbol{+}\Omega^{\boldsymbol{-}1}\mathbf{K}\boldsymbol{-}\Omega^{\boldsymbol{-}1}\mathbf{V}
\tag{A-07b}\label{A-07b}
\end{align}
From equation \eqref{A-07a} and partly because of the first two terms in the rhs of equation \eqref{A-07b} we note that one part $\mathrm L_1\left(\mathbf{V},\mathbf{\dot{V}},t\right)$ of the Lagrangian would be
\begin{equation} | {
"domain": "physics.stackexchange",
"id": 66518,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, linear-systems",
"url": null
} |
c++, exception
Simple Rules of thumb.
If you can not fix the issue locally then throw an exception.
You can not solve the problem of not having enough memory locally so throw an exception. This will allow the stack to unwind memory be released and you "May" get to a point where this can be solved (or if not let the application exit). An example of where it can be stopped is when you are creating independent task and one of these tasks fails. It does not mean that all tasks will fail. Log the fact that this task has failed allow the exception to release all the memory it used and then try the next task. | {
"domain": "codereview.stackexchange",
"id": 39663,
"lm_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++, exception",
"url": null
} |
• To me, this axiom seems to be saying "Every non-empty set contains an element that it doesn't contain." But it doesn't say "an element that it does not contain" it says "an element that it does not intersect (meaning that it shares no elements with it.) Contain and intersect do not mean the same thing. The thing that is probably most confusing is the act of taking the intersection of a set with one of its elements (which is perfectly admissible, but a little disorienting compared to our everyday use of sets.) – rschwieb May 18 '17 at 13:53
• It's worth pointing out that the "it doesn't seem to make any sense" objection you're raising is the exact objection that Haskell's type system will raise if you try to do this the naive way (type Set x = [x], when you try to do intersect s1 s2 and s2 is an element of s1, it will complain that it can't unify the types Set x and Set (Set x) together). – CR Drost May 18 '17 at 15:11
• $\in\ne\subset$. – Martín-Blas Pérez Pinilla May 19 '17 at 9:03 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018376422666,
"lm_q1q2_score": 0.8364970375759402,
"lm_q2_score": 0.8577681104440171,
"openwebmath_perplexity": 327.32582745078724,
"openwebmath_score": 0.8436334133148193,
"tags": null,
"url": "https://math.stackexchange.com/questions/2286456/how-does-the-axiom-of-regularity-make-sense"
} |
quantum-mechanics, hilbert-space, linear-algebra, eigenvalue, observables
First of all I don't understand what is the connection between those $\lambda$s parameters and the $\langle \lambda |$s eigenbras. Then I'm not sure about what does $\langle \lambda_1 \lambda_2 \lambda_3 \cdots \lambda_u | a \rangle$ mean: is it a compact notation for $\langle \lambda_1 | a \rangle, \langle \lambda_2 | a \rangle, \langle \lambda_3 | a \rangle, \cdots, \langle \lambda_u | a \rangle$ ? And if this is right, is $\langle \lambda_1 \lambda_2 \lambda_3 \cdots \lambda_u |$ a shorthand for $\langle \lambda_1 |, \langle \lambda_2 |, \langle \lambda_3 |, \cdots, \langle \lambda_u |$? And last, how can Dirac's talk about domain, when the $\lambda$s as I understood aren't functions? I will try to translate the following passage by Dirac that you quote in a more familiar language, with minimal changes and few explanatory injections.
Broke | {
"domain": "physics.stackexchange",
"id": 76987,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, hilbert-space, linear-algebra, eigenvalue, observables",
"url": null
} |
electromagnetism, magnetic-fields
I think the 1st thing to do is forget about magnetic field lines, especially "field lines of force". That's not really a thing. I think the intuitive upside of field lines is that it is a graphical way to show an irrotational magnetic field (in free space). Likewise, for the electric field, one can show that the divergence is proportional to the charge density. Regarding forces on charges, they don't add much intuition.
For the Lorentz force law:
$$ \vec F = q(\vec E + \vec v \times \vec B )$$
all that matters is $\vec E$ and $\vec B$ at the (point) location of $q$, in the reference frame where its velocity is $\vec v$.
So all that matters is what $q$ sees locally. Of course, $q$ always sees itself at rest, so only its definition of $\vec E$ matters regarding the $\vec F$ it experiences.
Now that is strange, since it completely discounts $\vec B$. It's not a paradox, but it is an "oddity", and the resolution of the oddity requires understanding Special Relativity. | {
"domain": "physics.stackexchange",
"id": 56190,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, magnetic-fields",
"url": null
} |
c#, exception-handling
Title: Is This a Sufficient Demonstration of the Effects of Exception Handling We have some developers in house that believe it is best practice to use exception handing as flow control, as well as, thinking that catching and re-throwing exceptions is effective error handling.
In an effort to educated, I attempted to come up with a simple sample to demonstrate to them the negative effects of doing so. The code sample below is what I came up with. It consistently demonstrates that there is a penalty for gratuitous usage of try/catch blocks; but the effect is much greater than I had anticipated. I can't help but think I've done something very wrong in this sample. I would appreciate any suggestions of improvement.
In this sample, I am comparing the cost of catching and re-throwing an exception with just allowing the exception to bubble up. I needed to execute the methods in parallel to avoid waiting days for the code to execute on high values.
static void Main(string[] args) | {
"domain": "codereview.stackexchange",
"id": 586,
"lm_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#, exception-handling",
"url": null
} |
word-embeddings, word2vec, nlp
This works because the way that the neural network ended up learning about related frequencies of terms ended up getting encoded into the W2V matrix. Analogous relationships like the differences in relative occurrences of Man and Woman end up matching the relative occurrences of King and Queen in certain ways that the W2V captures.
This seems like a broad, vague kind of an explanation. Is there any online resource or paper that explains (or better yet, proves) why this property of embedding vectors should hold? TL;DR: A theoretical/mathematical explanation for why word2vec/GloVe embeddings of analogies appear to form parallelograms, and so can be "solved" by adding/subtracting embeddings, is given here, as summarised in this blog.
More explanation of w2v is given here. | {
"domain": "datascience.stackexchange",
"id": 9794,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "word-embeddings, word2vec, nlp",
"url": null
} |
frequency-modulation
Now consider the phase being given by $\phi(t) = K_p m(t)$ , where $m(t)$ is the message signal and $K_p$ is a simple constant for phase modulation. As clearly evident, here the Instantaneous Phase, $\phi(t)$, is directly proportional to the amplitude of the message signal $m(t)$ and hence this type of angle modulation is called as Phase Modulation (PM)
On the other hand, consider a message signal $m(t)$ such that $\phi(t) = K_f \int {m(\tau)d\tau}$, where $K_f$ is the constant for frequency modulation, then the instantaneous frequency is: $$ \omega_i = \frac {d\theta(t)}{dt} = \omega_c + K_f m(t) $$
As can bee seen, now instead, the instantaneous frequency in radians is directly proportional to the amplitude of the message signal $m(t)$ and this type of modulation is, therefore, called as Frequency Modulation (FM) | {
"domain": "dsp.stackexchange",
"id": 4096,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "frequency-modulation",
"url": null
} |
python, keras, tensorflow
Looking around, I suspect it has something to do with the custom_objects tag for the load_model function, but I am not 100% sure of how to implement it. After looking around some more and digging through some Github issues, I believe I've figured out away around the issue. For my specific situation, I didn't need to save the entire model, rather than just the weights. For my configuration I'm using Tensorflow 2.3.0 and Keras 2.4.3.
SHORT ANSWER:
Fit your model for at least one epoch, then load in the weights.
LONG ANSWER:
To save the weights, I use the following function appended with my model file path above it.
# Create a path for the saving location of the model
model_dir = dir_path + '/model.h5'
# Save the model
model.save_weights(model_dir)
I first build my model from my question above and store it in a model object
model = build_model(arguments) | {
"domain": "datascience.stackexchange",
"id": 8211,
"lm_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, keras, tensorflow",
"url": null
} |
You can take them however your own text presents them; but be aware that they are all really equivalent facts, and which you take as postulates doesn't affect how you use them, which is what really matters. In other words, in answer to your question as to whether "theorem" or "postulate" really matters: it matters in presenting a specific systematic treatment of geometry, but not in USING the facts you learn, which are true one way or another regardless.
This is the key idea that any student should come away with, and is why I am covering this answer first: Whatever starting point an author chooses, once the theorems have been proved it doesn’t matter whether a given fact was stated as a postulate or as a theorem, it is still equally true. | {
"domain": "themathdoctors.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126438601956,
"lm_q1q2_score": 0.8176982994955964,
"lm_q2_score": 0.8354835350552604,
"openwebmath_perplexity": 490.923540117864,
"openwebmath_score": 0.6749465465545654,
"tags": null,
"url": "https://www.themathdoctors.org/who-moved-my-postulate/"
} |
any number less than 5. any value less than 5 Look at the venn diagram on the left. Basic set operations. If you want to get in on their secrets, you'll want to become familiar with these Venn diagram symbols. MS Word Tricks: Typing Math Symbols 2015-05-14 Category: MS Office. Symbol Symbol Name Meaning / definition Example { } set: a collection of elements: A = {3,7,9,14}, Click the arrow next to the name of the symbol set, and then select the symbol set that you want to display. That is OK, it is just the "Empty Set". Sometimes the set is written with a bar instead of a colon: {x¦ x > 5}. Set theory starter. Set notation. take the previous set S ∩ V ; then subtract T: This is the Intersection of Sets S and V minus Set T (S ∩ V) − T = {} Hey, there is nothing there! Which is why the bulk of this follow-up piece covers the very basics of set theory notation, operations & visual representations extensively. If you … ALT Codes for Math Symbols: Set Membership & Empty Sets Read More » | {
"domain": "ljudarkivet.se",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9489172688214138,
"lm_q1q2_score": 0.8175284829918309,
"lm_q2_score": 0.8615382076534743,
"openwebmath_perplexity": 1254.4422453103816,
"openwebmath_score": 0.6526771783828735,
"tags": null,
"url": "http://ljudarkivet.se/brown-stem-nam/f12549-set-notation-symbols"
} |
python, performance, file, numpy, serialization
Title: Reading a binary file containing periodic samples I have the following code for reading HTK feature files. The code below is working completely correct (verified it with unit tests and the output of the original HTK toolkit).
from HTK_model import FLOAT_TYPE
from numpy import array
from struct import unpack
def feature_reader(file_name):
with open(file_name, 'rb') as in_f:
#There are four standard headers. Sample period is not used
num_samples = unpack('>i', in_f.read(4))[0]
sample_period = unpack('>i', in_f.read(4))[0]
sample_size = unpack('>h', in_f.read(2))[0]
param_kind = unpack('>h', in_f.read(2))[0]
compressed = bool(param_kind & 02000) | {
"domain": "codereview.stackexchange",
"id": 190,
"lm_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, file, numpy, serialization",
"url": null
} |
ros-kinetic
Originally posted by alessiadele on ROS Answers with karma: 3 on 2018-12-18
Post score: 0
Original comments
Comment by PeteBlackerThe3rd on 2018-12-18:
Are you trying to encode a color video format? I suspect you'll need to specify the video as greyscale to get this to work.
Comment by alessiadele on 2018-12-18:
I used all the three different parameters for "--encode" (rgb8, bgr8, mono8), but the program always gives me the same error.
I don't know how to specify the video as greyscale!
I've just had a quick look at the source code for this and it seems the encoding option is not implemented. It's actually hard coded to use bgr8 and ignores whatever you specify as the encoding!
Since It's a python file you could dig in and change the hard coded encoding format yourself or get it to use the encoding value correctly.
Hope this helps.
Update:
You'll need to change line 53 which is currently:
img = np.asarray(bridge.imgmsg_to_cv2(msg, 'bgr8')) | {
"domain": "robotics.stackexchange",
"id": 32183,
"lm_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-kinetic",
"url": null
} |
neuroscience, neurophysiology, neuroanatomy, neurology
See it like this: | {
"domain": "biology.stackexchange",
"id": 6801,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience, neurophysiology, neuroanatomy, neurology",
"url": null
} |
cell-membrane
(3) I find the starting conditions somewhat confusing. "K+" goes out means that there needs to be a potential difference. Is the question assuming we have, as starting conditions, the same concentration of K+ at both sides? Otherwise it is not clear why K+ should stop leaving the cell at any moment (even when it is at the state of equilibrium).
(4) Can we conclude, as a general rule, that if MRP is the membrane resting potential and EP is the X+ equilibrium potential, then X+ leaves the cell if EPMRP. Would the roles be reversed for X–? The other answer is a bit misleading. | {
"domain": "biology.stackexchange",
"id": 7270,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cell-membrane",
"url": null
} |
java, ascii-art
Example
One example of the text to ascii-art-conversion is the "Hello World!"-message at the beginning of this question.
To demonstrate the conversion of pictures, I used the well known poison-symbol, which you can find here: | {
"domain": "codereview.stackexchange",
"id": 38063,
"lm_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, ascii-art",
"url": null
} |
homework-and-exercises, special-relativity, velocity
The source of the error comes about from the fact that there is time dilation between the reference frames. This is why you can never get above the speed of light. To work out the solution it is better to think about the world line that the ejected particle has, in the rest frame we get $\vec{x}(t) = (ct,0,u_{y} t)$. Here I'm giving time in units of length because that feels nicer to me and the transformation becomes nice and symmetric and I'll give that below, for a change in velocity $v$ the transformations are:
$y^{'} = y$
$x^{'} = \gamma \left(x-\frac{v}{c}(ct)\right)$
$(ct^{'}) = \gamma \left((ct)-\frac{v}{c}x\right)$
which means in the lab coordinates (where $v = -u_{x}$) this is $\vec{x}^{'}(t) = (\gamma ct,\gamma u_{x}t,u_{y} t)$. | {
"domain": "physics.stackexchange",
"id": 44806,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, special-relativity, velocity",
"url": null
} |
general-relativity, energy, black-holes
Title: How can you tell if a critical energy density is actually a black hole? Here's a question inspired by Edward's answer to this question.
It's my understanding that the average energy density of a black hole in its rest frame is $\rho_\text{BH}(A)$, a function of surface area. I calculated $3c^2/2GA$ for a Schwarzschild black hole, but that's presumably not applicable here since I'm talking about an extended energy distribution. Anyway, suppose you are in a space filled with some sort of energy, matter, or whatever, which produces a potentially time-dependent stress-energy tensor. And further suppose that there is some finite, spherical region of surface area $A$ in this space, over which you measure the average energy density to be $\rho_\text{BH}(A)$, the net charge to be zero, and the total angular momentum of the matter within the region to be zero. (I'm assuming there is a measurement procedure available which can be carried out without entering the region, if it matters.) | {
"domain": "physics.stackexchange",
"id": 765,
"lm_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, energy, black-holes",
"url": null
} |
ros, gazebo, gazebo-ros, gazebo-ros-control, ros-indigo
My robot's urdf is just a single box "torso" with a single box "leg", and all the joints and interfaces and transmissions are defined:
<?xml version="1.0"?>
<robot name="myrobot"
xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="box_inertia" params="mass x y z">
<inertia
ixx="${mass*(y*y+z*z)/12}" ixy="0" ixz="0"
iyy="${mass*(x*x+z*z)/12}" iyz="0" izz="${mass*(x*x+z*z)/12}" />
</xacro:macro>
<xacro:include filename="$(find myrobot_description)/urdf/materials.urdf.xacro" />
<!-- width in meters -->
<property name="torso_x_size" value="0.1" />
<!-- length in meters -->
<property name="torso_y_size" value="0.205" />
<!-- height in meters -->
<property name="torso_z_size" value="0.03" />
<!-- torso mass (not including legs) in kg -->
<property name="torso_mass" value="0.920" /> | {
"domain": "robotics.stackexchange",
"id": 21596,
"lm_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, gazebo, gazebo-ros, gazebo-ros-control, ros-indigo",
"url": null
} |
optimization, coffeescript
# $("<span rel='tooltip' title='Started Ranking' class='today'> <b>new</b> </span>").addClass("sortboxnew").css(css).appendTo(row1)
if a > b && b > 0
$("<span rel='tooltip' title='Decreased' class='yesterday'> <b>#{a - b}</b> </span>").addClass(sortboxarrowdown).css(css).appendTo(changes)
else if a > b && b is 0
$("<span rel='tooltip' title='Started Ranking' class='yesterday'> <b>new</b> </span>").addClass("sortboxnew").css(css).appendTo(changes)
else if a < b && a is 0 && b > 0
$("<span class='yesterday' rel='tooltip' title='Dropped'> <b>Dropped</b> </span>").addClass("sortboxdrop").css(css).appendTo(changes)
else if a < b
$("<span rel='tooltip' title='Increased' class='yesterday'> <b>#{b - a}</b> </span>").addClass(sortboxarrowup).css(css).appendTo(changes)
else if a is b | {
"domain": "codereview.stackexchange",
"id": 7653,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optimization, coffeescript",
"url": null
} |
heat-transfer, hvac
Answer:
Comparing System 1 and System 2:
System 1: Direct heat exchange using water coils.
System 2: Cascaded heat exchange involving a plate heat exchanger and water coils.
Key Considerations:
Efficiency of Direct vs. Cascaded Heat Transfer: System 1's direct approach typically offers higher efficiency due to fewer stages of heat transfer, thus less thermal resistance. System 2, with its additional stage (plate heat exchanger), introduces more potential points for heat loss.
Impact at Residential Scale: The efficiency difference between these systems is less pronounced in residential applications compared to larger, industrial ones.
Complexity of System 2: The added components in System 2 (extra pipes, pump, tank) mean more opportunities for heat loss, but also offer the benefit of isolation.
Rough Estimation of Heat Exchange Capability: | {
"domain": "engineering.stackexchange",
"id": 5352,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "heat-transfer, hvac",
"url": null
} |
ros, joint, moveit, ros-industrial
to this:
<!-- run the robot simulator and action interface nodes -->
<group if="$(arg sim)" ns="arm1" >
<include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>
<group if="$(arg sim)" ns="track2" >
<include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>
<group if="$(arg sim)" ns="track3" >
<include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
</group>
and added the following to aggregate the joint_states topics of each controller into the general /joint_states topic.
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<param name="/use_gui" value="false" />
<rosparam param="/source_list">[/arm1/joint_states, /track2/joint_states, /track3/joint_states]</rosparam>
</node> | {
"domain": "robotics.stackexchange",
"id": 29701,
"lm_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, joint, moveit, ros-industrial",
"url": null
} |
vision, eyes, human-eye
Also magenta itself is not actually part of the spectrum, it can be produced in two ways, the first I discussed above, hitting the far end of that little blip perfectly. The second and most common requires light from two disparate and different parts of the spectrum in other words not a single wavelength. It is blue light and red light without green light, it is not a real color but an artifact of how our eyes see light. Your cones can't tell how they are activated just that they are. Yellow and cyan (and every other common human color)on the other hand can be produced by a single wavelength, which may or may not activate multiple types of cones.
You can find more information here | {
"domain": "biology.stackexchange",
"id": 9836,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vision, eyes, human-eye",
"url": null
} |
java, interview-questions, json, csv
manager.addEmployee(1, employee1);
manager.addEmployee(2, employee2);
team.addManager(1, manager);
division.addTeam(1, team);
surveyData.addDivision(1, division);
return surveyData;
}
private SurveyCSVParser.SurveyCSVData buildEmptySampleData() {
SurveyCSVParser.SurveyCSVData surveyData = new SurveyCSVParser.SurveyCSVData(SurveyCSVParser.SurveyCSVData.Employee.SortOrder.ORIGINAL);
SurveyCSVParser.SurveyCSVData.Division division = new SurveyCSVParser.SurveyCSVData.Division(1, SurveyCSVParser.SurveyCSVData.Employee.SortOrder.ORIGINAL);
SurveyCSVParser.SurveyCSVData.Team team = division.createTeam(1);
SurveyCSVParser.SurveyCSVData.Manager manager = team.createManager(1, CSVData.SortDirection.ASCENDING);
team.addManager(1, manager);
division.addTeam(1, team);
surveyData.addDivision(1, division);
return surveyData;
}
} | {
"domain": "codereview.stackexchange",
"id": 32296,
"lm_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, interview-questions, json, csv",
"url": null
} |
biochemistry, enzymes, synthetic-biology, enzyme-kinetics
at least 2 parallel cultures in a representative experiment
I would expect some more repetitions (at least three independent experiments), which would make the data more reliable. Then (and this point is much more important) they can not measure the activity of Glk and Gdh in the same culture due to restrictions in the detection system. Glk activity measurements use a coupled system which in the end measure the concentration change in NADH, while Gdh uses NADPH as a co-factor. Both versions can not be differentiated by measuring a spectrum, so activity measurements of Glk can only take place in untransfected cells. Since the expression changes conditions in the cell (and we don't know how), I would expect at least some discussion about it, but it is missing. | {
"domain": "biology.stackexchange",
"id": 1964,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, enzymes, synthetic-biology, enzyme-kinetics",
"url": null
} |
quantum-mechanics, hilbert-space, operators, angular-momentum, commutator
1 & 0
\end{array}\right] \\
J_{y}=\frac{\hbar}{2}\left[\begin{array}{cc}
0 & -i \\
i & 0
\end{array}\right] \\
J_{x}=\frac{\hbar}{2}\left[\begin{array}{cc}
1 & 0 \\
0 & -1
\end{array}\right].$$
If you calculated the total angular momentum squared ${\bf J}^{2}=J_{x}^{2}+J_{y}^{2}+J_{z}^{2}$, you will find that ${\bf J}^{2}$ has the explicit form
$${\bf J}^{2}=\frac{3\hbar^{2}}{4}\left[\begin{array}{cc}
1 & 0 \\
0 & 1
\end{array}\right].$$
Note that since ${\bf J}^{2}$ is proportional to the identity matrix, any two-component state will be an eigenstate: ${\bf J}^{2}|\psi\rangle=(3\hbar^{2}/4)|\psi\rangle$.
However, only certain vectors will be eigenstates of the individual angular momentum components. For instance, the eigenstates of $J_{z}$ are
$$|z+\rangle=\left[\begin{array}{c}
1 \\
0
\end{array}\right], \quad
|z-\rangle=\left[\begin{array}{c}
0 \\
1
\end{array}\right].$$ | {
"domain": "physics.stackexchange",
"id": 82993,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, hilbert-space, operators, angular-momentum, commutator",
"url": null
} |
5. Treat $n2^m$ as $b$
• It implies that both $a$ and $b$ are both positive integer
• From $a^2-b^2=(a+b)(a-b)$ and the result of $n^4 + 2^4$, it implies that $a$ is greater than $b$
• Hence both $(a+b)$ and $(a-b)$ are positive integer, that causes the result of $n^4 + 2^4$ is combination of $(a+b)$ and $(a-b)$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795102691454,
"lm_q1q2_score": 0.8741001063907176,
"lm_q2_score": 0.8856314617436728,
"openwebmath_perplexity": 272.7748211115131,
"openwebmath_score": 0.8389080762863159,
"tags": null,
"url": "https://math.stackexchange.com/questions/853615/proving-an-expression-is-composite"
} |
convection, waves
Now consider a moving channel, throw a stone, then see the waves now. Do the disturbances reach upstream of the channel? Nope. The disturbances created by the stone are carried downstream by the moving stream. This is in the 2D sense. Imagine same thing for 1D also. The created disturbances are carried by the material elasticity (noted by the wave/sound speed). when and where (the disturbed region) is decided by the wave speed. These inrteresting problems are governed by hyperbolic equations. So disturb only certain location to get disturbed somewhere. | {
"domain": "engineering.stackexchange",
"id": 2605,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "convection, waves",
"url": null
} |
logic, circuits
The carry has to ripple through the first sequence of consecutive bits set to 1.
Now suppose you are figuring out the output for, say, the 5th bit. What function of the first 4 bits tells you whether the 5th bit should ripple? That's the function you need to make a parallel-prefix circuit for. | {
"domain": "cs.stackexchange",
"id": 2775,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "logic, circuits",
"url": null
} |
vba, excel
For k = 9 To n
wsLot.Cells(k, "H").value = WorksheetFunction.CountIf(wsReg.Range("AD:AD"), wsLot.Cells(k, "G").value)
Next k
wsLot.Range("H8").Formula = "=MAX(H9:H3000)"
Calculate
If wsLot.Range("H8").value > 3200 Then MsgBox "Warning, at least one of the lots has more than 32000 elements"
'Export errors and Registers to Project Folder
ExportErrorsAndRegistersToProjectFolder 'no longer a need for the above comment (#3)
Errors = wsLot.Range("B5").value
wsCon.Range("O3").value = 1
wsCon.Activate
MsgBox ("Ex DataBase Import Completed" & vbNewLine & vbNewLine _
& "TOTAL EQUIPMENT IN Ex DATABASE : " & RegisterNumb & vbNewLine _
& "EQUIPMENT EXCLUDED DUE TO ERROR : " & Errors & vbNewLine _
& "TOTAL EQUIPMENT IMPORTED : " & RegisterNoError & vbNewLine & vbNewLine _
& "The Equipment with errors have been recorded on the ERRROR_LOG. You can continue discarting those elements or correct them in the originalfile and do the Import again." & vbNewLine) | {
"domain": "codereview.stackexchange",
"id": 38982,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vba, excel",
"url": null
} |
quantum-field-theory, hilbert-space, ground-state
If you naively set the two momenta equal to each other, you would get
$$\langle \mathbf{p} | \mathbf{p} \rangle \sim \delta(0).$$
Then you might complain this is not mathematically correct, because $\delta(0)$ is not a valid function or even a functional; it's not even defined at all. But the general overlap is perfectly well-defined as a functional of two variables, i.e. $\delta(\mathbf{p} - \mathbf{q})$. Your mistake was simply to set those variables equal, when you should have kept them explicit to integrate over later.
Similarly, for two-particle states the normalization is
$$\langle \mathbf{p}_1 \mathbf{p}_2 | \mathbf{q}_1 \mathbf{q}_2 \rangle \sim \delta(\mathbf{p}_1 - \mathbf{q}_1) \delta(\mathbf{p}_2 - \mathbf{q}_2) \pm \delta(\mathbf{p}_1 - \mathbf{q}_2) \delta(\mathbf{p}_2 - \mathbf{q}_1)$$ | {
"domain": "physics.stackexchange",
"id": 50708,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, hilbert-space, ground-state",
"url": null
} |
coordination-compounds, transition-metals
The increase in $\Delta_o$ leads to the absorption of a lower wavelength (or higher frequency) of light, as evident from:
$$E=h\nu= \frac {hc}\lambda $$
Note that a higher frequency would mean a shift towards the blue end.
Quantitatively speaking, the light blue colour of the initial hexaaqua complex was due to the absorption of the orange spectrum range of light.
Back to the color wheel, a shift towards the blue side (in the green direction, please) gives us a lighter shade of orange.
Why does the solution turn deep blue?
Observe the complement(the colour diametrically opposite) of orange-yellow is definitely a deeper shade of blue. | {
"domain": "chemistry.stackexchange",
"id": 11638,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "coordination-compounds, transition-metals",
"url": null
} |
cell-biology, reproduction
Therefore, my question is: Is someone aware of a similar program to CellTrak, which includes batch processing option, or even better, which works through command line and can be looped? Are there open source options or extensions to widely used open source programs (ImageJ, Bioconductor, etc.)? Please give a short tutorial/personal experience to the usage of the suggested program (if any). ImageJ has several tracking plugins, a good one being TrackMate. Most of it's functions can be scripted in various languages and the Fiji distribution can also run in headless mode. It's open source and won't cost you any mony for a much lager feture set.
I personally have used ImageJ in headless mode scripted with its own macro language because it is relatively easy to learn. | {
"domain": "biology.stackexchange",
"id": 6853,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cell-biology, reproduction",
"url": null
} |
c, array
Example:
input:
100
9.5
5
20 7.5 90 1.2 10.6 4.25 80 1.7 50 7.3
output:
10.53
8.33 6.85 10.67 21.04 11.76
3
I wrote the code and it works fine, although I can't eliminate the last space from the scond line of the output. (in the example above, the line ends 11.76 )
The code:
#include <stdio.h>
int main()
{
int length,size,cnt1=0,i;
float speed1,speed2[7],distance[7],time1,time2[7],small[7],big[7];
scanf("%d",&length);
scanf("%f",&speed1);
scanf("%d",&size);
time1=(float)length/speed1;
for(i=0;i<size;i++){
scanf("%f%f",&distance[i],&speed2[i]);
}
for(i=0;i<size;i++){
time2[i]=((length-distance[i])/speed2[i]);
}
if(distance[i]>=length)
time2[i]=0;
printf("%.2f",time1);
printf("\n");
for(i=0;i<size;i++){
if(time2[i]<time1){
small[i]=time2[i];
printf("%.2f ",small[i]);
cnt1++;
}
}
for(i=0;i<size;i++){
if(time2[i]>=time1){
big[i]=time2[i]; | {
"domain": "codereview.stackexchange",
"id": 34673,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, array",
"url": null
} |
organic-chemistry, nitro-compounds
Title: Diazonium ion positive charge I am confused about the nature of the positive charge on the nitrogen atom in the diazonium ion. Where does it come from? That nitrogen atom has 4 bonds, but I cannot deduce whether one of them is dative, because the other nitrogen forms 3 normal bonds, and the carbon in the aromatic ring has no empty orbitals or lone pair of electrons. So how does that nitrogen form 4 bonds and how does it have a positive charge? Thanks In a diazonium, or rather any compound where nitrogen forms four bonds, the nitrogen has a positive formal charge.
The reason is simple, nitrogen used it's lone pair of electrons to make the fourth bond. This gives nitrogen a positive charge.
A more simple example is the ammonium ion. While ammonia has 3 bonds and 1 lone pair, the ammonium ion has 4 bonds, the lone pair from ammonia was shared with a proton to make the ammonium ion. | {
"domain": "chemistry.stackexchange",
"id": 8820,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nitro-compounds",
"url": null
} |
phylogenetics, phylogeny, bacteria, 16rrna
Species delineation has always been problematic in bacteria and the rule of thumb was 5% divergence defined a species boundary.
Advice
I would use a multi-locus appproach under a full phylogenetics analysis, where a species boundary is defined by >5% divergence and bootstraps >80% with Bayes P values > 0.95.
Recombination is essentially ignored in taxonomy providing there isn't over reliance on a single gene tree, but using BLAST, ANI, GGDC as a method data-mining would justify a select sample size. The classification is then nailed with a phylogenetics analysis.
One of your methods (probably ANI) might be based machine learning/deep learning (its not GGDC) and the accuracy of misassigning a species under this method is high. Historically it was really high (80% accuracy), this might have improved to 90%. Its not like image recognition where the error rate is beyond human perception. | {
"domain": "bioinformatics.stackexchange",
"id": 2092,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "phylogenetics, phylogeny, bacteria, 16rrna",
"url": null
} |
Based on what I have just gone through, there are two facts that seem to be in contradiction of each other:
1. The vector $$\vec n$$ is normal to both $$(\vec v_1 - \vec v_2)$$ and $$(\vec v_3 - \vec v_2)$$, $$\vec n$$ is therefore normal to the plane (as $$(\vec v_1 - \vec v_2)$$ and $$(\vec v_3 - \vec v_2)$$, are parallel to the plane).
2. $$Ax + By + Cz \neq 0$$
The value of $$D$$ in the plane equation cannot be equal to $$0$$, since the plane does not pass through the origin. Conversely, either of the vectors $$(\vec v_1 - \vec v_2)$$ or $$(\vec v_3 - \vec v_2)$$ dotted with the normal vector $$(Ax + By + Cz)$$ should be equal to $$0$$ since both vectors are orthogonal to the normal vector (or at least it appears this way to me). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517514031506,
"lm_q1q2_score": 0.8171461307228477,
"lm_q2_score": 0.8354835309589074,
"openwebmath_perplexity": 96.61615142172646,
"openwebmath_score": 0.8116798996925354,
"tags": null,
"url": "https://math.stackexchange.com/questions/3336283/plane-equation-where-d-not-equal-to-zero-part-ii"
} |
algorithms, complexity-theory, graphs, algorithm-analysis
Store array into confirmed cycle set
Get j’s order of traversal of from map as o
Output length of cycle by deducting o from array length
Output part of the array that is the solution
Store array from index array.size() - o to the end into solution set
Endif
Endif
Endfor Unfortunately, your algorithm is not correct.
Let us call a directed graph where each vertex has exactly one outgoing edge a unique-outgoing graph.
What does a unique-outgoing graph look like?
It consists of some directed tree and some directed cycles, all of which are disjoint except that every root of the trees is also a vertex of some cycle. Or, it looks like a collection of directed cycles with some directed trees attached to them. | {
"domain": "cs.stackexchange",
"id": 15419,
"lm_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, complexity-theory, graphs, algorithm-analysis",
"url": null
} |
electrochemistry, redox, reduction-potential
$$\ce{Mg + Zn^2+ + Zn + Cu^2+ -> Mg^2+ + Zn + Zn^2+ + Cu}$$
$$\ce{Mg + Cu^2+ -> Mg^2+ + Cu}$$
You notice that the zinc is little more than a spectator ion.
Now how does this differ from the ethanol case? Well, permanganate can (and will) react with ethanol to form ethanal, and it can (and will) react with ethanal to form ethanoic acid — more rapidly. However, if permanganate (and therefore: electrons) is the limiting reagent, we end up with a mixture of ethanol, maybe ethanal and ethanoic acid. By a reaction analogous to the reverse Cannizarro reaction, these can comproportionate:
$$\ce{CH3CH2OH + CH3COOH <=>> 2 CH3CHO}$$
Therefore, the overall reaction seems to be one where ethanol only reacted with permanganate to only form ethanal, while in fact ethanoic acid was formed, but in the end the equilibrium favoured ethanal. | {
"domain": "chemistry.stackexchange",
"id": 4952,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry, redox, reduction-potential",
"url": null
} |
python, python-3.x
class IncorrectDirectionException(BaseBoatPlacerException, ValueError):
pass
class UnplaceableBoatException(BaseBoatPlacerException):
pass
And use the last two exceptions instead of ValueErrors and RuntimeErrors.
You can also simplify your exception handling by using contextlib.suppress rather than empty except blocks:
def place_boats(self, sizes, patience=10):
matrix_backup = [column.copy() for column in self.__matrix]
available_backup = self.__available.copy()
for _ in range(patience):
if all(self.place_selected_boat(size, patience) for size in sizes):
return
else:
self.__matrix = [column.copy() for column in matrix_backup]
self.__available = available_backup.copy()
raise UnplaceableBoatException('could not place the requested boats') | {
"domain": "codereview.stackexchange",
"id": 28317,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x",
"url": null
} |
thermodynamics
Title: Accelerating expansion of a gas The his thermodynamics book, Zemansky refers to an example in which a gas in a piston is expanding for which the piston is accelerating.
It is obvious that no equation of state exists for the states traversed by a system that is not in mechanical and thermal equilibrium, since such states cannot be described in terms of thermodynamic coordinates referring to the system as a whole. For example, if a gas cylinder were to expand and to impart to a piston an accelerated motion, the gas might have, at any moment, a definite volume and temperature, but the corresponding pressure, calculated from an equation of state, would not apply to the system as a whole. The pressure would not be a thermodynamic coordinate, because it would depend not only on the velocity and acceleration of the piston but would also vary from point to point. | {
"domain": "physics.stackexchange",
"id": 49042,
"lm_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
} |
homework-and-exercises, surface-tension, approximations
$$E=aT^{\frac {1}{2}}4\pi R^2+bT\frac {4}{3}\pi R^3=bT\frac {4}{3}\pi R^3(1+\frac {3a}{bR\sqrt {T}})$$
The second term in brackets will be small compared to 1 if $R\sqrt {T}>>1$. This is best done when $R>>1$ and $T>>1$. | {
"domain": "physics.stackexchange",
"id": 57868,
"lm_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, surface-tension, approximations",
"url": null
} |
rust, pointers
For example, consider the same program from above:
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6
If you change the first instruction from nop +0 to jmp +0, it would create a single-instruction infinite loop, never leaving that instruction. If you change almost any of the jmp instructions, the program will still eventually find another jmp instruction and loop forever.
However, if you change the second-to-last instruction (from jmp -4 to nop -4), the program terminates! The instructions are visited in this order:
nop +0 | 1
acc +1 | 2
jmp +4 | 3
acc +3 |
jmp -3 |
acc -99 |
acc +1 | 4
nop -4 | 5
acc +6 | 6
After the last instruction (acc +6), the program terminates by attempting to run the instruction below the last instruction in the file. With this change, after the program terminates, the accumulator contains the value 8 (acc +1, acc +1, acc +6). | {
"domain": "codereview.stackexchange",
"id": 40134,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rust, pointers",
"url": null
} |
we need to draw a diagram. In this configuration, when. Express the. Using the general definition for moment of inertia Show development of thin shell integral. Practice Problem 9 – 7: Using the parallel-axis theorem, show that when comparing the moments of inertia of an object about two parallel axes, the moment of inertia is less about the axis that is. The moment of inertia of a rectangular section having width b and depth d as shown in Fig. The moment of inertia of is given by: Where we have: m: mass R: radius ( from the axis O to the object ) The following is a list of moment of inertia for some common homogeneous objects, where M stands for mass and the red line is the axis the objects rotating about. In the following animations. If I c is the moment of inertia of a body of mass m with respect to a line through its centroid and I s is the moment of inertia with respect to a line S parallel to. Ans: (4ml^2)/3, (5ml^2)/3. PHYS 211 Lecture 21 - Moments of inertia 21 - 1 Thin rod We | {
"domain": "opera11bbparma.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771786365549,
"lm_q1q2_score": 0.8157803295921193,
"lm_q2_score": 0.8267117919359419,
"openwebmath_perplexity": 208.34489284734323,
"openwebmath_score": 0.6377691030502319,
"tags": null,
"url": "http://lcou.opera11bbparma.it/use-the-parallel-axis-theorem-to-show-that-the-moment-of-inertia-of-a-thin-rod.html"
} |
Now plugging in initial values
$$\displaystyle \frac{1^3}{3} + 1 +2 - \frac{1^2}{2} -1 = C$$
Question 4: a little embarrassing but does the exponent apply to the whole fraction or just the numerator? For example is $$\displaystyle \frac{1^3}{3}=\frac{1}{3}$$ or $$\displaystyle \frac{1^3}{3} = \frac{1}{3} \cdot \frac{1}{3} \cdot \frac{1}{3}$$? Obviously in LaTex I'm writing it as the 3 only applies to the 1 but given the context that the derivative of $$\displaystyle x^n=(n-1)x^{n-1}$$ which is it?
Question 5: in an example my textbook takes the equation an multiplies away the denominators. Doesn't this mess up the initial values and finding C? For example
$$\displaystyle \frac{1^3}{3} + 1 +2 - \frac{1^2}{2} -1 = C$$
multiply both sides of the equation by 6
$$\displaystyle 2 \cdot 1^3 +6+12-3\cdot 1^2-6=6C_1=C$$
Last edited:
#### Prove It
##### Well-known member
MHB Math Helper
Where did you get \displaystyle \begin{align*} \tan{(x)} - \sin{(x)}\sin{(y)} \end{align*} from? | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9504109742068042,
"lm_q1q2_score": 0.8323575771735248,
"lm_q2_score": 0.875787001374006,
"openwebmath_perplexity": 922.3422425045244,
"openwebmath_score": 0.935920000076294,
"tags": null,
"url": "https://mathhelpboards.com/threads/initial-value-problem-for-exact-equations.7293/"
} |
visible-light, electric-fields, polarization
Likewise if instead of two perpendicular filters creating a checkerboard pattern of squares, let's say you had a single combined filter with a grid of squares. Would this grid of squares block out light in the same fashion as the two 90 degree perpendicular filters, or is there something about using two filters that blocks out the light, and a single filter that has both vertical and horitzontal slits would behave differently? As an explanation of the physics of polarizers, the photographer's is screwed up. He's presenting a model or metaphor to give photographers something to have in their head as a way to understand the phenomenon. We do this in physics all the time. For example, in some applications it's useful to think of an electron as a tiny shiny sphere. Of course, it is not. | {
"domain": "physics.stackexchange",
"id": 83446,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "visible-light, electric-fields, polarization",
"url": null
} |
java, object-oriented, role-playing-game
if(command.equals("1")) {
castFireball(enemy);
} else if (command.equals("2")) {
castHealing();
} else if (command.equals("3")) {
castKnockOut(enemy);
} else if (command.equals("4")) {
castPoisoning(enemy);
} else if (command.equals("5")) {
lifeActual = 0;
}
This would look much clearer as a switch statement. Note that this did not work with strings before Java 7, but you should be over that.
switch (command) {
case "1":
castFireball(enemy);
break;
case "2":
castHealing();
break:
// and so on
}
isPoisoned = new int[2]; | {
"domain": "codereview.stackexchange",
"id": 29235,
"lm_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, object-oriented, role-playing-game",
"url": null
} |
quantum-mechanics, quantum-interpretations
A theory is ad hoc if it was invented to solve a particular problem and has no implications beyond that problem. Suppose that I feel uncomfortable about curved spacetime. I might say that spacetime is flat but that invisible, undetectable pixies push bodies around as if general relativity was true. Nobody would take such a theory seriously for very long, although it is not experimentally distinguishable from general relativity. There would not be extensive debates about the existence of the pixies. The theory would have been invented solely to dodge the straightforward implications of general relativity. The pixy theory is a bad explanation, it proposes that the pixies will push bodies around according to the equations of general relativity without explaining why or how they would do that. | {
"domain": "physics.stackexchange",
"id": 32241,
"lm_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-interpretations",
"url": null
} |
orbit, black-hole, photons
$$ \frac{r}{r_\mathrm s} = 1.5 $$
where $r_\mathrm s$ is the Schwarzschild radius. This radius gives the position of the notorious photon sphere.
But for light $V_\mathrm{eff}$ has a maximum not a minimum. That means if we displace the light by even the tiniest distance from this maximum it will lower its potential energy by moving either inwards or outwards. The orbit at $1.5r_\mathrm s$ is unstable and the tiniest perturbation will cause the light to spiral into the black hole or away from it. This means we cannot accumulate light in the photon sphere as the question asks. Any attempt to put light into this orbit is doomed to failure as even the tiniest perturbation (e.g. from other objects orbiting the black hole, or even from passing gravitational waves) will destabilise the orbit and the light will be lost. | {
"domain": "astronomy.stackexchange",
"id": 3513,
"lm_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, black-hole, photons",
"url": null
} |
special-relativity, speed-of-light, faster-than-light, aether, escape-velocity
Title: A vertical variation of modern versions of Michelson-Morley For almost a year now, I have been in the uncomfortable position of having an idea.
However, there is one nice thing about this idea. It makes a concrete, exact and relatively easy to test physical prediction.
The idea predicts that there is a 11,187 m/s (Earth’s escape velocity) aethereal wind directly into the surface of the Earth at its surface.
I believe it would be possible to test this by performing a vertical variation of modern versions of the Michelson-Morley experiment (MMX) with one arm pointed in the vertical direction. (Modern MMX)
In 2003, Müller et al. performed a normal (2 horizontal orthogonal arms) modern MMX using cryogenic optical resonators that found a “possible anisotropy of the speed of light c, (of) 2.6 +/- 1.7 parts in 10^15” ( arXiv ) | {
"domain": "physics.stackexchange",
"id": 17216,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, speed-of-light, faster-than-light, aether, escape-velocity",
"url": null
} |
programming-challenge, time-limit-exceeded, swift
Title: Minimum Window Substring in Swift exceeds LeetCode runtime check This is a popular question on LeetCode:
76. Minimum Window Substring
Given two strings s and t of lengths m and n respectively, return the
minimum window substring of s such that every character in t
(including duplicates) is included in the window. If there is no such
substring, return the empty string "".
The testcases will be generated such that the answer is unique.
A substring is a contiguous sequence of characters within the string.
Example:
Input: s = "ADOBECODEBANC", t = "ABC"
Output: "BANC"
Explanation: The minimum window substring "BANC" includes 'A', 'B', and 'C' from string t. | {
"domain": "codereview.stackexchange",
"id": 42476,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming-challenge, time-limit-exceeded, swift",
"url": null
} |
organic-chemistry, nomenclature, biochemistry, history-of-chemistry
Nottle, M.C. and Pope, G.S. Two Constituents of 'CloverStone', a Type of Urinary Calculus Found in Sheep in Proceedings of The Biochemical Society. Biochem J (1963) 89 (1): 1P–67P.
The Nottle and Pope report is on p. 67P. In that report, however, the structures of the urolithins were not described, as they had not yet been determined. In a subsequent paper, Pope reported the structures of the urolithins, noting that they were actually previously known compounds (specifically urolithin A is identical to pigment I of castoreum, isolated from beaver scent glands), but despite the compounds already being known, Pope and others continued to use the new name, which seems to have stuck. That report is also freely available from the Biochemical Journal here. The full reference is
Pope, G.S. (1964) Isolation of Two Benzocoumarins from 'Clover Stone', a Type of Renal Calculus Found in Sheep. Biochem J 93:474. | {
"domain": "chemistry.stackexchange",
"id": 14149,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature, biochemistry, history-of-chemistry",
"url": null
} |
quantum-entanglement, decoherence, quantum-teleportation
It's important to note, however, that even here the statement that both ions are entangled looks a lot stronger than it actually is. In particular, you cannot use entanglement to communicate, either faster or slower than light. The only 'weird' thing that entanglement allows you to do is to perform simultaneous measurements whose outputs will exhibit bizarre sorts of nonlocal correlations (i.e. the correlations are stronger than would be possible using hidden local variables, but not strong enough to signal). If you do that, though, in the end you are only making a complicated statement about the correlations between measurements of the two ions and the photons they emitted, which is much more mundane than what you started with. | {
"domain": "physics.stackexchange",
"id": 20267,
"lm_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-entanglement, decoherence, quantum-teleportation",
"url": null
} |
newtonian-mechanics, power
Once the tires stick, we need to switch over to the static friction regime. In this regime, the force of friction is whatever is needed to satisfy the $F=ma$ equation for the car, so long as it doesn't exceed the maximum (which we've already seen because force only goes down in your scenario, never up). The fact that this force does not need to be 0 (as initially stated in the question) is how our car can keep going fast and faster with no limit (although its acceleration gets smaller and smaller) | {
"domain": "physics.stackexchange",
"id": 99030,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, power",
"url": null
} |
ros, calibration, camera-info, camera-info-manager, camera-calibration
As you can see, I don't have a /set_camera_info service, which I think is the main problem I am having with trying to run the camera_calibration package. If anyone can please provide me with a simple sample code for using the camera_info_manager, it would be much appreciated.
EDIT: For now, I wish to simply initialize a camera_info_manager object so that I can use its functions to run the set_camera_info service, but I am not well-versed with C++ so I am having some problems understanding the tutorial for camera_info_manager.
EDIT2: I added these two lines in, based on @joq's comments:
boost::shared_ptr<camera_info_manager::CameraInfoManager> cinfo;
cinfo(new camera_info_manager::CameraInfoManager(nh));
but I only get this error:
no match for call to ‘(boost::shared_ptr<camera_info_manager::CameraInfoManager>) (camera_info_manager::CameraInfoManager*)’
cinfo(new camera_info_manager::CameraInfoManager(nh)); | {
"domain": "robotics.stackexchange",
"id": 29646,
"lm_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, calibration, camera-info, camera-info-manager, camera-calibration",
"url": null
} |
sequence-alignment, ngs, clustering
ACTCTAAAGCCTGCAGTTCCTGAAGAGATTGTACTGATCCTGTGGCTGAAAACTTTGATCCAACGGCTAGAAGTGACGATGGAACCTGTGTCTACAACTgtaagtgagggagtctcggactcaattagaggctcttctttcacaTTGTCTCTTTTGGTTTATTTTCTCCTTTGTGTAATTGTGGATTGGATCTTGTCCTCTTTTGTTTTCCTTTTTTTTTTTTATGATGTACAACACATTGGTAATTTAAAATTGCCTTGTCATGCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACTGTAGGCACCATCAATGAAGATAGAGCGACAGGCAAGTCACAAAAACACCGACAACTTTCTTGTCACGGTAGGCGATAGCAATACGTAACTG | {
"domain": "bioinformatics.stackexchange",
"id": 2656,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sequence-alignment, ngs, clustering",
"url": null
} |
-
I hoped you would answer. Your approach is, in fact, very similar to the approach taken by Roman Maeder in his implementation of lazy lists and streams in his "Mathematica programmer" book, except that he overloaded built-ins like Map etc with UpValues, while you created new heads. Very nice discussion and code - +1. – Leonid Shifrin Jan 28 '12 at 23:37
@Leonid Thanks for the +1. I was surprised that I got through writing this one without you getting there first :) When I started out, I had Common Lisp series in mind. But it ended up more like a toy Haskell :) – WReach Jan 29 '12 at 0:30
+1 ! Did you have this on the shelf or did you write it for this question? – Mr.Wizard Jan 29 '12 at 5:14
Color me impressed. I tried to implement something like that years ago and failed. I might have been able to do it now but not that quickly or cleanly. – Mr.Wizard Jan 29 '12 at 5:24 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9609517050371972,
"lm_q1q2_score": 0.8089537948838149,
"lm_q2_score": 0.8418256512199033,
"openwebmath_perplexity": 4589.382845517509,
"openwebmath_score": 0.27052566409111023,
"tags": null,
"url": "http://mathematica.stackexchange.com/questions/838/functional-style-using-lazy-lists/840"
} |
c#, algorithm
Title: Find all possible sumation numbers to a specified sum This is a problem that I had in mind for a loong time and today I decided to give it a go, the basic idea is you enter a number/sum and the program outputs all the possible ways this sum can be formed let's say we have 3 as input the output will be (1, 1, 1),(1, 2) I don't think that the code is really efficient so any tips are appreciated.
static void Main(string[] args)
{
int sum = int.Parse(Console.ReadLine());
List<List<int>> subsets = GetSubsets(sum);
for (int i = 0; i < subsets.Count; i++)
{
Console.WriteLine(string.Join(",", subsets[i]));
}
Console.ReadKey();
} | {
"domain": "codereview.stackexchange",
"id": 26610,
"lm_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",
"url": null
} |
general-relativity, spacetime
and was no longer present on our spacetime manifold. But the scare quotes around "now," "moment in time," and "point in time" remind us that we can't fundamentally define these times in the sense of universal simultaneity. Relativity doesn't have simultaneity. When matter falls into a black hole, it's valid for a distant observer to say that the matter never makes it past the horizon. | {
"domain": "physics.stackexchange",
"id": 9221,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, spacetime",
"url": null
} |
quantum-field-theory
This allows us to talk about one abstract space of states $\mathcal{E}$ and be sure that the $Q_i$ representation do exist, and this is what is usually done in QM.
This isn't the case in QFT. The commutation relations above do not give rise to a unique construction of a Hilbert space. In Mathematical terms: there are infinitely many unitarily inequivalent representations of the Canonical Commutation Relations (CCR).
Now, the fact is that you must build a representation: a Hilbert space on which the relations hold. It turns out that one way to do it is exactly the Fock Space route.
Essentialy you identify a single particle space of states $\mathfrak{h}$. This one is required to satisfy a simple requirement: it must carry a unitary representation of the Poincare group. In this way we implement the symmetries of Minkowski spacetime and furthermore, we get the existence of, for example, the momentum operator in $\mathfrak{h}$. | {
"domain": "physics.stackexchange",
"id": 43465,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory",
"url": null
} |
ros, navigation, costmap, turtlebot3
using std::string;
using std::vector;
using std::priority_queue;
using std::abs;
struct Node{
double f_cost, g_cost;
int idx;
};
namespace astar_planner {
class AstarPlanner : public nav_core::BaseGlobalPlanner {
public:
bool initialized = false;
costmap_2d::Costmap2DROS *m_costmap_ros;
costmap_2d::Costmap2D *m_costmap;
int cellsY;
int cellsX;
int area;
vector<bool> OccupancyGridMap;
vector<int> open;
vector<bool> closed;
vector<int> parentNode;
string m_frame_id;
ros::Publisher pub;
AstarPlanner(); // default constructor
AstarPlanner(std::string name, costmap_2d::Costmap2DROS* costmap_ros); | {
"domain": "robotics.stackexchange",
"id": 38872,
"lm_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, costmap, turtlebot3",
"url": null
} |
L = (1/4)(16+3) = 4.75; Q1 = 71 + 0.75(72 – 71) = 71.75
U = (1/4)(3*16+1) = 12.25; Q3 = 75 + 0.25(77 – 75) = 75.5
70 71 71 71|72 73 74 74|74 74 75 75|77 77 77 82
Langford’s method, for n even, is the same as Tukey and M&M. Note that, in Doctor Twe’s explanation, this method agrees with Tukey in case B, with M&M in case D, and with both in cases A and C.
Tom, using his book’s unspecified method, got 71 and 77, which is the same as M&S, so that may be what he was taught.
Note that almost all methods yield quartiles that are in the gaps where we would expect them to be (where I put bars); only M&S, which always uses numbers in the data set, gave quartiles that don’t lie in the gaps. None of them can really be called wrong. And for large data sets, the differences are insignificant.
But, then, what is right?
Definitions vs. methods | {
"domain": "themathdoctors.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846647163009,
"lm_q1q2_score": 0.819514532934338,
"lm_q2_score": 0.8376199694135332,
"openwebmath_perplexity": 933.2572023505967,
"openwebmath_score": 0.6025962233543396,
"tags": null,
"url": "https://www.themathdoctors.org/the-many-meanings-of-quartile/"
} |
= - $$\frac{2}{3}$$ Plug this in for x to find the value of the y-coordinate. A parabola can have 2 x-intercepts, 1 x-intercept or zero real x intercepts. $0=a(x+2)^2-4$ but i do not know where to put … Find the maximum number of turning points of each … In … Hence the equation of the parabola in vertex form may be written as $$y = a(x - 2)^2 + 3$$ We now use the y intercept at $$(0,- 1)$$ to find coefficient $$a$$. The Parabola. This is a mathematical educational video on how to find extra points for a parabola. Solution to Example 2 The graph has a vertex at $$(2,3)$$. The coordinate of the turning point is (-s, t). The vertex is at point (x,y) First find x by using the formula -b/2a <--- a = 2, b= -5 and c= 1 (because it is quadratic) So -(-5)/2(2) = 5/4 <--- your x value at the vertex or turning point is 5/4. There are two methods to find the turning point, Through factorising and completing the square.. Make sure you are happy … If the function is smooth, then the turning point | {
"domain": "kidadvocacy.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429134068499,
"lm_q1q2_score": 0.8271739880763094,
"lm_q2_score": 0.8397339616560072,
"openwebmath_perplexity": 372.93399516802384,
"openwebmath_score": 0.5448158979415894,
"tags": null,
"url": "https://www.kidadvocacy.com/t27bd/how-to-find-turning-point-of-parabola-c648fb"
} |
lattices, data-flow-analysis
We can construct a Control-Flow Graph (CFG) where each node is a program statement such as var x = 10. From that we can construct a Data-Flow Graph (DFG) where we are keeping track of how a variable is used. This creates an def-use ordering, along the lines of:
x, y, i at the same time
z comes after i
... | {
"domain": "cs.stackexchange",
"id": 11306,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lattices, data-flow-analysis",
"url": null
} |
• Mama Rudin has no 4th edition, I guess you cite Royden & Fitzpatrick. Dec 18, 2015 at 7:33
• Also related: en.m.wikibooks.org/wiki/Measure_Theory/…. This follows the proof in Mama Rudin. Dec 18, 2015 at 7:43
• This is not "the standard definition of outer measure". You don't even need a topology to define outer measure. You have a collection of sets where the measure is defined and you want to extend it. Open sets have the nice property that whenever they cover a compact set, you do have a finite sub-cover. Nov 8, 2021 at 23:01
• I see no problem in allowing empty and unbounded intervals. Nov 8, 2021 at 23:02 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464481549872,
"lm_q1q2_score": 0.8132801809748703,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 164.1874655074895,
"openwebmath_score": 0.9304102063179016,
"tags": null,
"url": "https://math.stackexchange.com/questions/1580748/why-do-we-use-open-sets-for-outer-measure"
} |
definition, frequency, resonance, linear-systems
Exemples of linear systems are:
the response of a spring to stress.
the oscillations of a pendulum.
vibrations in an elastic medium (propagation of waves)
Historically, it is the realization of the fact that the oscillations of a pendulum depend solely on the length of said pendulum and not on its weight that allowed clockmakers to build reliable clocks with a rather simple technology. The same applied to oscillations of springs: this lead to the conception of the first watches or chronometers, which in turn allowed for a whole new era of sea travel, relying on the use a sextant and a chronometer, to become possible.
Another reason why linear systems play an important role in physics is Taylor’s theorem which states that in first approximation the response of most systems to a sufficiently small change in its parameters is linear is a first approximation (whether it is the vibrations of a guitar string or the response of the stock market to a small perturbation). | {
"domain": "physics.stackexchange",
"id": 79850,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "definition, frequency, resonance, linear-systems",
"url": null
} |
atmosphere, climate-change, ionosphere
Title: Do HAARP-like programs have effects on climate? Military powers like USA, Rusia and China have programs to heat through electromagnetic waves the Ionosphere. HAARP supposedly is a research program, but run by part of the military of US (Air Force and Navy) . Rusia has SURA and China IIRC has CSES. Supposedly one of the tests made by these programs affected the city of Vasilsursk where they had electrical alterations. A physicist from China called Gong Shuhong said he followed the tests done by Russia and China in cooperation and that he believes it wont have important consequences in a global scale but that it could have consequences in a regional scale. My question is, is it known if HAARP-like programs have effects on climate? The programs manager said they dont but several articles online mention researchs which says they could. Not in any significant way. | {
"domain": "earthscience.stackexchange",
"id": 1666,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "atmosphere, climate-change, ionosphere",
"url": null
} |
pl.programming-languages, ct.category-theory, semantics, denotational-semantics, program-verification
Once again, this has nothing to do with compilers. Compilers are rarely ever adequate or fully abstract. And, they don't need to be! All that a compiler needs to do is to preserve the execution behavior of complete programs. The target language of a compiler is generally huge, which means that it has lots of contexts that can mess up equivalence. So, equivalent programs in the source language are almost never contextually equivalent when compiled. | {
"domain": "cstheory.stackexchange",
"id": 2366,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pl.programming-languages, ct.category-theory, semantics, denotational-semantics, program-verification",
"url": null
} |
fourier-transform, audio
It is often important to window the data (again Google: hamming window fft). One critical reason to do this that gets to the heart of your question: the fft assumes the chunk you fed it continues infinitely forward and backward in time. Obviously an audio file does not have this property.
For your example you might want to chunk your audio file into groups of powers of 2 like, 1024,2048, or 4096. | {
"domain": "dsp.stackexchange",
"id": 5698,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, audio",
"url": null
} |
## Mechanics of \foreach
Compile
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\noindent
\foreach \x in {1,1.1,...,2}{\x\\ } \ \foreach \x in {1,1.2,...,2}{\x\\ }
\end{document}
and you get
To make sense of this output, you need to know a bit about how \foreach's dots notation works. When \foreach encounters a ... element in its list argument, as in \foreach \i in {x,y,...,z}, it computes the difference d=y-x to fill in the "missing values". According to the TikZ/PGF manual (p.505),
the part of the list reading x,y,...,z is replaced by x, x + d, x + 2d, x + 3d, ..., x + md, where the last dots are semantic dots, not syntactic dots. The value m is the largest number such that x + md <= z if d is positive or such that x + md >= z if d is negative. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9353465170505205,
"lm_q1q2_score": 0.8298437196705836,
"lm_q2_score": 0.8872045862611166,
"openwebmath_perplexity": 1183.5997319897654,
"openwebmath_score": 0.9514173269271851,
"tags": null,
"url": "http://tex.stackexchange.com/questions/116980/why-doesnt-tikzs-foreach-iterate-over-the-last-element-of-the-list"
} |
python, python-3.x, console, ssh, curses
Don't ever ignore exceptions like that. You're letting every possible error just pass unnoticed. I can't tell what the right way here is since I don't even know what exception you're expecting.
try:
self.des_num = int(float(os.path.getsize(self.full_qual_dest_path)))
self.des_size = human_readable_size(self.des_num)
except:
time.sleep(.05)
self.des_num = int(float(os.path.getsize(self.full_qual_dest_path)))
self.des_size = human_readable_size(self.des_num)
If it failed the first time why do you think it won't fail after you wait for .05? What is the cause of the problem?
elif KEY_PRESS == 10 and self.position == 1:
self.status = 0
self.action = 1
What do any of those numbers mean? Use constants or enums instead of plain numbers to convey such information.
There is much more to cover but I think fixing problems I pointed out will be a good starting point. To sum it up: | {
"domain": "codereview.stackexchange",
"id": 43913,
"lm_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, console, ssh, curses",
"url": null
} |
matlab, cross-correlation
Note that when the SNR is low; that the noise portions have large amplitudes compared to the test signal embedded in the target signal, then the above paragraph becomes invalidated and the expected peak is burried within random peaks produced as the result of the irrelevant computations between the test signals and noise contained in the target signal. | {
"domain": "dsp.stackexchange",
"id": 5468,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, cross-correlation",
"url": null
} |
which turns out to be $18$. So \begin{align*} & 19y \equiv 2 \pmod {31} \\ \iff & y \equiv 2 \times 18 \pmod {31} \\ \iff & y \equiv 5 \pmod {31}. \end{align*} Hence $$x \equiv 12y \equiv 29 \pmod {31}.$$ Thus we have the solution $(x,y)=(29,5)$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534398277178,
"lm_q1q2_score": 0.8676434000094446,
"lm_q2_score": 0.8840392878563336,
"openwebmath_perplexity": 220.93903215255224,
"openwebmath_score": 1.0000098943710327,
"tags": null,
"url": "https://math.stackexchange.com/questions/501755/approaching-modular-arithmetic-problems"
} |
inorganic-chemistry, synthesis, alkali-metals
Method 2
Convert sodium chloride to sodium bicarbonate using Solvay process:
$$\ce{NaCl(aq, conc) + H2O(l) + NH3(g) + CO2(g) -> NaHCO3(s) + NH4Cl(aq)}$$
Thermal decomposition of bicarbonate first yields in sodium carbonate:
$$\ce{2 NaHCO3(s) ->[\pu{250 - 300 °C}] Na2CO3(s) + CO2(g) + H2O(g)}$$
which is subsequently calcined to form an oxide:
$$\ce{Na2CO3(l) ->[>\pu{1000 °C}] Na2O(s) + CO2(g)}$$
This appears to be a preferred method as it is less energy- and resources-consuming and allows to obtain $\ce{Na2O}$ selectively. | {
"domain": "chemistry.stackexchange",
"id": 12808,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, synthesis, alkali-metals",
"url": null
} |
• This may seem trivial, but you can teach skills. Laziness is much harder to knock out of someone. Sloppy formatting is a bigger red flag to me than a suboptimal algorithm from a junior developer. – David Harkness May 30 '14 at 3:26
• @DavidHarkness: Interesting. Is this suggesting that my answer may not be too helpful if the OP doesn't bother to adopt them, or quite the opposite? – Jamal May 30 '14 at 3:39
• Your answer is supremely helpful whether or not the OP follows your advice. If they don't, hopefully others reading it will and I can waste less time every day cleaning up poorly-formatted code. – David Harkness May 30 '14 at 4:11
• @DavidHarkness: Thanks for the clarification. This was actually inspired by Winston Ewert's top answer, which heavily criticized the OP's interview code along the same lines. I suppose this is something more expected from, say, an applicant fresh out of college who should at least be able to pay attention to detail. – Jamal May 30 '14 at 4:14 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9390248225478307,
"lm_q1q2_score": 0.8141680875858258,
"lm_q2_score": 0.8670357460591569,
"openwebmath_perplexity": 1297.1675396423818,
"openwebmath_score": 0.6181367039680481,
"tags": null,
"url": "https://codereview.stackexchange.com/questions/52028/solution-for-kth-row-of-pascals-triangle-for-a-job-interview/52039"
} |
thermodynamics, classical-mechanics, friction, angular-velocity
Title: Heat loss in wheels Is there a simple model for heat loss in car wheels that simply takes into account the width of the wheel and its angular speed? My guess is that if there is such a simple model, it would be a non-linear function of angular speed and vary linearly with the wheel width.
I'm assuming that the heat loss is mainly due to friction. Just a small correction.
Heat loss on wheels is not due to friction because when the fictional force acts on the wheels the point of contact do not move and when that point has moved there is no force acting in direction of is motion and hence no work is done. The heat loss is due to cyclic contraction and expansion of the rubber of the wheels. | {
"domain": "physics.stackexchange",
"id": 33669,
"lm_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, classical-mechanics, friction, angular-velocity",
"url": null
} |
beginner, file, go
The second one is perhaps less bad, but again, the error situation is just hidden, not actually dealt with.
The third one can be done, however it's usually reserved for programming errors, since not catching a panic call will simply abort the program (which is rarely what you want).
If in doubt, return an error in addition to any values: func getContent(string) (string, error) and writeContent/appendContent(string, string) error would be fine. Maybe also see this blog post and this newer one for 1.13. | {
"domain": "codereview.stackexchange",
"id": 36316,
"lm_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, file, go",
"url": null
} |
• Here is a simple 3 point formula. $L_1'(x)=\frac{(x-x_0)+(x-x_2)}{(x_1-x_0)(x_1-x_2)} = \frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}(\frac{1}{x-x_0}+\frac{1}{x-x_2})$. If you evaluate it at $x_2$, you will see you cannot just say it is zero using the second formula. – KittyL Jan 15 '15 at 11:47
• Okay, but then I can't use the formula in my implementation, since I end up computing $0/0$ since $(x-x_2)=0$ if $x=x_2$ and $1/(x-x2)=1/0$ if $x=x_2$? – k1next Jan 15 '15 at 12:16 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812345563902,
"lm_q1q2_score": 0.8430700657109627,
"lm_q2_score": 0.8705972768020108,
"openwebmath_perplexity": 405.1597659985782,
"openwebmath_score": 0.9459869265556335,
"tags": null,
"url": "https://math.stackexchange.com/questions/1105160/evaluate-derivative-of-lagrange-polynomials-at-construction-points"
} |
electromagnetism, soft-question, maxwell-equations
Title: "And God said......and there was light." What does these equations mean? Today while I was on the Internet I came across an interesting picture, that caught my eye. It's : | {
"domain": "physics.stackexchange",
"id": 18542,
"lm_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, soft-question, maxwell-equations",
"url": null
} |
the... So, with vectors you must also specify the direction, not only the magnitude and. 2, √ 2 2 these angles are called direction coseines of the vector direction coseines the! 29-33 Find the direction cosines and direction ratios of a vector with coordinate! 0 12.1 direction angles of the vector 37. c, c, c where. And direction ratios of a vector with the direction angles and direction cosines and direction angles the! 3,4,5\Rangle the Study-to-Win Winning Ticket number has been announced thing is to say 23 km/h, a better way to. Has been announced -4, -2›I Know How to Find the direction cosines ‹2, -4, -2›I Know to. Step 2: direction angles correct to the nearest degree. direction of. To Find the direction cosines of the vector a are the cosines of the vector finding cosines! 0 12.1 direction angles correct to the nearest degree. 37. c, c!, − 1 2, − 1 2, √ 2 2 angles correct to the nearest degree ). ( Give the direction angles of the Vectos vector - Examples angles that the vector | {
"domain": "capestance.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407175907054,
"lm_q1q2_score": 0.8473006971677932,
"lm_q2_score": 0.8705972549785201,
"openwebmath_perplexity": 853.3505657946914,
"openwebmath_score": 0.736409068107605,
"tags": null,
"url": "https://www.capestance.com/i-love-mgxp/find-the-direction-cosines-and-direction-angles-of-the-vector-ed5c42"
} |
$$E_i = (A_{11}E_1 + \ldots + A_{n1}E_n)B_{1i} + (A_{12}E_1 + \ldots + A_{n2}E_n)B_{2i} +\ldots + (A_{1n}E_1 + \ldots + A_{nn}E_n) B_{ni}$$
$$E_i = (A_{11}B_{1i} +\ldots + A_{1n}B_{ni})E_1 +\ldots +(A_{i1}B_{1i} +\ldots+ A_{in}B_{ni})E_i +\ldots +(A_{n1}B_{1i} +\ldots + A_{nn}B_{ni}) E_n \tag{C}$$
Comparing LHS and RHS its evident that
$$(A_{i1}B_{1i} +\ldots + A_{in}B_{ni})=1 \text{ for } i = 1, \ldots, n. \tag{D}$$
whereas
$$(A_{j1}B_{1i} +\ldots + A_{jn}B_{ni})=0 \text{ for } j \ne i \tag{E}$$
If $$B=(B_{ij})$$ is a matrix then from $$(B),(D),(E)$$ we have $$AB=I$$ and hence $$B$$ is the inverse of $$A$$.
(note: this proof uses no assumptions of row or column transformations or determinants as well but uses the only one simple fact of linear independence between the basis vectors and standard basis vectors. )
• Please use MathJax – Aqua Jul 8 '19 at 13:23 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9572778036723353,
"lm_q1q2_score": 0.8192873062392672,
"lm_q2_score": 0.8558511469672594,
"openwebmath_perplexity": 156.33206124480162,
"openwebmath_score": 0.971529483795166,
"tags": null,
"url": "https://math.stackexchange.com/questions/1925062/proof-that-columns-of-an-invertible-matrix-are-linearly-independent/1925178"
} |
$$C^T=\operatorname{adj}(A)=\begin{pmatrix} 1 & 0 & 0 & 0&\ldots &0\\ -1 & 1& 0 & 0 &\ldots &0\\ 0&-1&1&0&\ldots &0\\ 0& 0 &-1 &1 &\ldots&0\\ \vdots &\vdots &\vdots &\vdots &\ddots&\vdots\\ 0&0&0&0&\ldots &1\end{pmatrix}=A^{-1}$$
Is this correct? Also, can I leave it like that or should I somehow write it more formally?
• try using elementary row operations. – vidyarthi Jan 24 '17 at 10:11
• Looks all right. – StubbornAtom Jan 24 '17 at 10:25
• Try multiplying your proposed $A^{-1}$ by $A$ to see whether you get the identity matrix. – Gerry Myerson Jan 24 '17 at 11:38
Yes, your inverse is correct. Let me show you an alternative approach of finding this inverse without the use of the adjugate matrix. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180627184411,
"lm_q1q2_score": 0.8598885641853226,
"lm_q2_score": 0.8723473746782093,
"openwebmath_perplexity": 117.00378915905104,
"openwebmath_score": 0.953346312046051,
"tags": null,
"url": "https://math.stackexchange.com/questions/2111562/find-the-inverse-of-a-lower-triangular-matrix-of-ones"
} |
frequency-response, time-domain
f = 444; % carrier frequency
x = 0.7 * sin(2*pi*f*t + pi/3); %carrier
noise = 0.5 * randn(1, length(x)); % noise
x = x + noise;
probe1 = exp(-1j*2*pi*f*t); % correct probe signal
probe2 = exp(-1j*2*pi*446*t); % incorrect probe signal
% correlation with both probes
corr1 = abs(x*probe1');
corr2 = abs(x*probe2');
For one run, I get corr1 = 2844 and corr2 = 12, showing the effectiveness of the method. | {
"domain": "dsp.stackexchange",
"id": 11664,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "frequency-response, time-domain",
"url": null
} |
c#, algorithm, pathfinding
public bool Equals(Vector2Int other)
=> X == other.X && Y == other.Y;
public override bool Equals(object obj)
{
if (!(obj is Vector2Int))
return false;
var other = (Vector2Int) obj;
return X == other.X && Y == other.Y;
}
public override int GetHashCode()
=> HashCode.Combine(X, Y);
public override string ToString()
=> $"({X}, {Y})";
}
}
IEquatable interface is implemented for future optimizations. Sqr value is cached because there is no need to calculate it more than once.
DistanceEstimate() used for heuristic cost calculation. It is more accurate than Math.Abs(X) + Math.Abs(Y) version, which overestimates diagonal cost. | {
"domain": "codereview.stackexchange",
"id": 38851,
"lm_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, pathfinding",
"url": null
} |
java, object-oriented, csv
public static String partNumberMatches(Part part, String... partNumbers) {
for (String partNumber : partNumbers) {
if (part.hasPartNumberContains(partNumber)) {
return partNumber;
}
}
return "";
}
}
Finally, the main class. I have commented out the parts that read in user input (see the use of the Scanner class) and hard-coded two test values. The bulk of the work is done in getPartLists.
Map<String, PartList> result = new HashMap<String, PartList>();
RecordSupplier supplier = new RecordSupplier();
Iterator<Part> iterator = supplier.iterator();
PartList partList = null;
Create our result object and the RecordSupplier.
while (iterator.hasNext()) {
Part part = iterator.next();
Get a Part object representing the current row.
if (part.isTopLevelPart()) {
String match = partNumberMatches(part, partNumbers); | {
"domain": "codereview.stackexchange",
"id": 4248,
"lm_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, object-oriented, csv",
"url": null
} |
ros, parameter
Originally posted by archer0517 on ROS Answers with karma: 1 on 2014-03-02
Post score: 0
Original comments
Comment by archer0517 on 2014-03-02:
the tutorial's link: http://wiki.ros.org/tf/Tutorials/Writing%20a%20tf%20listener%20%28Python%29
the problem is about line 19 of "nodes/turtle_tf_listener.py"
Comment by brice rebsamen on 2014-03-03:
those tutorials are a bit outdated. You could file an issue: https://github.com/ros/geometry/issues?state=open
It looks like the command message type in turtlesim has changed from turtlesim/Velocity to geometry_msgs/Twist.
I've updated the tutorial: http://wiki.ros.org/tf/Tutorials/Writing%20a%20tf%20listener%20%28Python%29
Originally posted by ahendrix with karma: 47576 on 2014-03-04
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 17133,
"lm_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, parameter",
"url": null
} |
homework-and-exercises, newtonian-mechanics, acceleration, differentiation
Title: a problem on finding acceleration by differentiation The displacement of particle along the $x$ and $y$ axis is
\begin{cases}
x(t)=\omega t-\sin\omega t\\
y(u)=1-\cos\omega t
\end{cases}
Upon differentiation, the velocity is
\begin{cases}
v_x(t)=\omega\left(1-\cos\omega t\right)\\
v_y(t)=\omega\sin\omega t
\end{cases}
so
$$v =\sqrt{v_x^2+ v_y^2} = 2w \sin (wt /2)$$
My problem is if I find the magnitude of acceleration by differentiation of components $v_x$ and $v_y$ followed by their sum, I get a constant acceleration $w^2$ but if I directly differentiate $v$ I got variable acceleration $w^2 \cos (wt/2)$.
I don't understand why. How are the two methods different? When I square $v_x$ and $v_y$, I get
\begin{align}
v(t)&=\sqrt{\left(\omega-\omega\cos\omega t\right)^2+\omega\sin^2\omega t}\\
&=\left[\omega^2+\omega^2\cos^2\omega t-2\omega^2\cos\omega t +\omega\sin^2\omega t\right]^{1/2}\\
&=\omega\sqrt{2-2\cos\omega t}
\end{align} | {
"domain": "physics.stackexchange",
"id": 18273,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, acceleration, differentiation",
"url": null
} |
array, regex, console, reflection, phpunit
/**
* This should analyze each variable passed indicate the value and description of it.
* note: the description is a rich text.
*
* @param mixed $var
*
* @return array
*/
protected function evaluateVariable($var): array
{
if (null === $var || 'null' === $var || 'NULL' === $var) {
return is_string($var) ? ['val' => "'null'", 'desc' => 'null value string.'] :
['val' => 'null', 'desc' => 'null value.'];
}
if (is_array($var)) {
return ['val' => "", 'desc' => 'array node.'];
}
if (in_array($var, ["true", "false", true, false], true)) {
return is_string($var) ? ['val' => "'" . $var . "'", 'desc' => 'string value boolean ' . $var . '.'] :
['val' => ($var ? 'true' : 'false'), 'desc' => 'boolean value ' . ($var ? 'true' : 'false') . '.'];
} | {
"domain": "codereview.stackexchange",
"id": 40733,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "array, regex, console, reflection, phpunit",
"url": null
} |
# Proof by contradiction: $r - \frac{1}{r} =5\Longrightarrow r$ is irrational?
Prove that any positive real number $r$ satisfying:
$r - \frac{1}{r} = 5$ must be irrational.
Using the contradiction that the equation must be rational, we set $r= a/b$, where a,b are positive integers and substitute:
\begin{align*} &\frac{a}{b} - \frac{1}{a/b}\\ &\frac{a}{b} - \frac{b}{a}\\ &\frac{a^2}{ab} - \frac{b^2}{ab}\\ &\frac{a^2-b^2}{ab} \end{align*}
I am unsure what to do next?
-
The main point is that you have only transformed the left hand side, so far. Now use the right hand side and proceed as either of the two answerers suggest. kneidell uses $a^2 - b^2 = (a-b)(a+b)$. – t.b. Feb 17 '11 at 0:29
Thanks you guys, I have to go to work right now, but will look over your answers as soon as I get back. – Mr_CryptoPrime Feb 17 '11 at 0:34
What irrationality proofs have you seen? Do any of them look like they might adapt to this case? – Qiaochu Yuan Feb 17 '11 at 0:43 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9669140235181257,
"lm_q1q2_score": 0.8036438644796027,
"lm_q2_score": 0.8311430436757313,
"openwebmath_perplexity": 442.3606955648712,
"openwebmath_score": 0.891287088394165,
"tags": null,
"url": "http://math.stackexchange.com/questions/22423/proof-by-contradiction-r-frac1r-5-longrightarrow-r-is-irrational"
} |
formal-languages, reductions
This is only possible if $A \le_m B$ exists and $B=\overline{B}$
But that condition simplifies to "false" since it can never the case that $B=\overline{B}$.
Anyway the answer to both cases is "yes".
If $A \le_T B$ then there is a Turing machine $T$ with oracle $B$ that decides $A$.
By complementing $T$'s output we obtain a Turing machine with oracle $B$ that decides $\overline{A}$ showing that $\overline{A} \le_T B$.
Moreover, consider a Turing machine $T'$ with oracle $\overline{B}$ that simulates $T$ except for the following: whenever $T$ invokes its oracle for $B$ on some input $w$, $T'$ invokes its oracle for $\overline{B}$ on $w$ and then complements the result. Clearly $T'$ still decides $A$, thus showing that $A \le_T \overline{B}$. | {
"domain": "cs.stackexchange",
"id": 17553,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, reductions",
"url": null
} |
# Decimal Numerators & Denominators
#### Explain this!
##### New member
Why are decimals not used as numerators and denominators?
For example, 0.4% can be expressed as (4/10)/100 as complex fraction, but 0.4/100 with a decimal numerator is not common.
The same with 100/(4/10) but not 100/0.4.
#### tkhunny
##### Moderator
Staff member
Why are decimals not used as numerators and denominators?
For example, 0.4% can be expressed as (4/10)/100 as complex fraction, but 0.4/100 with a decimal numerator is not common.
The same with 100/(4/10) but not 100/0.4.
Why not?
Convention, more than anything.
#### JeffM
##### Elite Member
Why are decimals not used as numerators and denominators? | {
"domain": "freemathhelp.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9566341962906709,
"lm_q1q2_score": 0.8345173296615656,
"lm_q2_score": 0.8723473746782093,
"openwebmath_perplexity": 2937.009416765426,
"openwebmath_score": 0.8081411719322205,
"tags": null,
"url": "https://www.freemathhelp.com/forum/threads/decimal-numerators-denominators.114417/"
} |
c++, io, c++14, user-interface
If you don't publish your software at all, you're also fine. So you can always experiment around freely for your personal learning and private usage.
There might be other libraries providing similar line-editing support but I don't know any of them.
Williham Totland commented that there is another free software library for line-editing, Linenoise. While checking its website, I also found the Editline Library (libedit) (also free software). I've never used either of them.
Style
Besides the fact that you shouldn't declare stuff in namespace std, you have put the DocString alongside with the implementation. If you decide to separate declaration and definition, the DocString should go with the declaration because that's what is important for your users.
I assume you wanted to write a DocString that can be processed by Doxygen. If so, note that you should use @tparam to document template arguments. | {
"domain": "codereview.stackexchange",
"id": 16096,
"lm_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++, io, c++14, user-interface",
"url": null
} |
javascript, google-maps, browser-storage
function addMarkerToLocalStorage(lat, lng) {
var markers = getMarkersFromLocalStorage();
markers.push({lat, lng});
localStorage.markers = JSON.stringify(markers);
};
function removeMarkerFromLocalStorage(lat, lng) {
var markers = getMarkersFromLocalStorage(),
newMarkers = [];
markers.forEach(function(marker) {
if(marker.lat != lat && marker.lng != lng) {
newMarkers.push({
lat: marker.lat,
lng: marker.lng
});
}
});
localStorage.markers = JSON.stringify(newMarkers);
};
function clearMarkers() {
markersAll.forEach((marker) => {
marker.setMap(null);
});
};
function renderMarkers() {
var markers = getMarkersFromLocalStorage();
markers.forEach(function(marker) {
//console.log(marker.lat, marker.lng);
generateMarker(marker.lat, marker.lng);
});
}; | {
"domain": "codereview.stackexchange",
"id": 28078,
"lm_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, google-maps, browser-storage",
"url": null
} |
algorithm-analysis, asymptotics, recurrence-relation, master-theorem
Title: Master theorem: $T(n)=10T(n/9)+n\lg(n)$ I am told to solve the recurrence
$$T(n)=10T(n/9)+n\lg(n)$$
using the Master theorem. I then try to use case 3. However, I am unable to show that for $f(n)=n\lg(n)$ then $10f(n/9) \leq cn\lg(n)$ for $c < 1$ and all sufficiently large $n$. Is it wrong to use case 3? Or does the Master theorem even apply? Case 3 does not apply. Indeed:
$$
f(n) = n \log n \not\in \Omega(n^{\log_9 10}) = \Omega(n^{\log_b a}).
$$
However case $1$ applies since, for $0<c \le 0.01$
$$
f(n) = n \log n \in O(n^{1.04 - 0.01}) \subset O(n^{\log_9 10 - 0.01} ) \subseteq O(n^{\log_b a - c} ).
$$
This shows that $T(n) \in \Theta(n^{\log_9 10})$. | {
"domain": "cs.stackexchange",
"id": 17757,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm-analysis, asymptotics, recurrence-relation, master-theorem",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.