text stringlengths 1 1.11k | source dict |
|---|---|
$$\Bbb{Q}(\sqrt[4]{6},e^{2\pi i/3}) \cong \Bbb{Q}(\sqrt[4]{6}, \sqrt{3}i)$$
that has degree 8 over $\Bbb{Q}$. It is a good exercise which you should do to show why this is the splitting field.
In some polynomial rings over certain fields, adjoining one root to the field does give you all the roots. Consider the polynomial
$$f(x) = x^p - x - a$$
in $\big(\Bbb{Z}/p\Bbb{Z}\big)[x]$ with $a \neq 0$. Then in $\Bbb{Z}/p\Bbb{Z}$, no matter what value we substitute in for $x$ by Fermat's Little Theorem $f(b) = a$ for all $b \in \big(\Bbb{Z}/p\Bbb{Z}\big)$. Now create a root for this polynomial in the field extension
$$\big(\Bbb{Z}/p\Bbb{Z}[x]\big)/(x^p - x - a).$$
Call that root $\gamma$. Now we know that this field must contain $\big(\Bbb{Z}/p\Bbb{Z}\big)$ because
$$\big(\Bbb{Z}/p\Bbb{Z}\big) \subset \big(\Bbb{Z}/p\Bbb{Z}[\gamma]\big) \cong \big(\Bbb{Z}/p\Bbb{Z}[x]\big)/(x^p - x - a).$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.968381236381426,
"lm_q1q2_score": 0.8230961434922069,
"lm_q2_score": 0.849971181358171,
"openwebmath_perplexity": 59.737526201329665,
"openwebmath_score": 0.9003086090087891,
"tags": null,
"url": "http://math.stackexchange.com/questions/134521/splitting-field-of-an-irreducible-polynomial-over-mathbbq?answertab=active"
} |
cc.complexity-theory, complexity-classes, time-complexity, lower-bounds
Edit: More generally I'm also trying to avoid problems which can be shown to be equivalent to simulations of TM. Unless the lowerbound does not use this fact.
One example of a problem i'd be interested in could be something like "is this graph planar ?". Unfortunately this problem is known to be solvable in linear time. Many answers to this post, are also answer to this one, although the original question is different. All of the answers to this post are only conjectures though, it even seems there are standalone conjectures, i.e. they don't seem to rely on the usual bigger conjectures ($P \neq NP$)
Here is a list of problems taken from this post : | {
"domain": "cstheory.stackexchange",
"id": 4862,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, complexity-classes, time-complexity, lower-bounds",
"url": null
} |
I have never come across this definition of the exponential. Where did you find this? Apart from that, let me help you:
Note that we can take $x=y=0$ in i) to find $\mbox{exp}(0)=1$ (it cannot be zero because of ii) as you can see). Also, if we have (4) then we also have (1) by using (i) again. In fact, $\mbox{exp}$ is then strictly increasing. So it remains to prove (4).
If there is an $x>0$ such that $\mbox{exp}(x)=1$, then by (3), which we already proved, we obtain a set of arbitrarily large real numbers $nx$ for which $\mbox{exp}(nx)=1$. This must contradict ii). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290955604489,
"lm_q1q2_score": 0.8488418236862948,
"lm_q2_score": 0.8740772236840656,
"openwebmath_perplexity": 143.41840791695756,
"openwebmath_score": 0.9500347375869751,
"tags": null,
"url": "https://math.stackexchange.com/questions/2740468/deriving-properties-of-the-exp-function-from-definition"
} |
inorganic-chemistry, aqueous-solution, solubility, analytical-chemistry
addition of sulphate precipitates practically all barium ions
addition of sulphate precipitates a large part of calcium ions
but: a non-neglegible amount of $\ce{CaSO4}$ remains dissolved
addition of oxalate precipitates practically all the remaining calcium.
In fact, the solubilities of $\ce{BaSO4, SrSO4}$ and $\ce{CaSO4}$ are such that a saturated solution of $\ce{SrSO4}$ will always give precipitate when barium is added but never with calcium or strontium; while a saturated solution of $\ce{CaSO4}$ will give a precipitate if either strontium or barium is added but never with calcium. This can be used to identify the heaviest alkaline earth metal in an unknown sample. | {
"domain": "chemistry.stackexchange",
"id": 12643,
"lm_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, aqueous-solution, solubility, analytical-chemistry",
"url": null
} |
statistical-mechanics, conformal-field-theory, research-level, probability
Title: SLE applied to theoretical physics (eg. CFT), too untractable? not informative enough? It is has been 15 years since the SLE area took off, and it helped rigourize known predictions from RG and the conformal invariance of the interface (eg. percolation and Ising) and other applications.
But besides the numerous surveys of relating CFT and SLEs, I haven't found any solid paper using SLE techniques to obtain new results in physics (in the last few years), let alone being a common place tool such as RG.
So as a person knowledgeable in the SLE area, I would like to know what the criticisms are from the physics point of view.
1)Were the physicists looking for a more tractable limiting object (eg. Gaussian free field)? Are SLEs not explicit enough, as a theoretical tool?
2)Is it that known tools can do anything that SLEs do and far more? So why bother learning about them. | {
"domain": "physics.stackexchange",
"id": 40103,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, conformal-field-theory, research-level, probability",
"url": null
} |
error-correction, surface-code
Assuming there is no problem, what happens after this $X$ measurements? Do I stop including the pink qubits in any stabilizer measurement?
Why [doesn't the data measurement change the boundary stabilizers]? If I measure the pink data qubit belonging to the black plaquette with a Pauli X measurement, the black plaquette will have its value changed.
The basis of the data measurement has to match the type of the boundary you are introducing. The boundary type is important because it results in all the opposite-type stabilizers that the data measurements touch not being used anymore in the configuration after the data measurements. Yes, you anticommute with them. You destroy them. But you don't need them anymore.
Assuming there is no problem, what happens after this X measurements? Do I stop including the pink qubits in any stabilizer measurement?
That's right. You start doing the surface code cycle for two separated qubits, completely ignoring that they used to be one patch. | {
"domain": "quantumcomputing.stackexchange",
"id": 3453,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "error-correction, surface-code",
"url": null
} |
between individuals is large, the diversity is high; if the average distance is small, the diversity is low. This is an unbiased estimator of the variance of the population from which X is drawn, as long as X consists of independent, identically distributed samples. This simulation package is intended as a tool for experimenting with different models of social contact and social distancing as a virus spreads through a population. Individual algorithms were developed in MATLAB using the Embedded MATLAB™ subset and then integrated into a Simulink model of the system as function blocks. AUTOMOTIVE CONFERENCE 2020 NORTH AMERICA. Modeling in courses that incorporate computation can help students better understand physical systems. m) listed in Appendix 1, we used the same values for b as for the nonlinear discrete model (equation 1. 5 series of 100 elements each, randomly between 0 and 1 – each series of random numbers will display a degree of correlation to the others, e. The total | {
"domain": "collezionericordi.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9728307739782682,
"lm_q1q2_score": 0.8085615365691371,
"lm_q2_score": 0.8311430499496095,
"openwebmath_perplexity": 1495.8913086396221,
"openwebmath_score": 0.5351118445396423,
"tags": null,
"url": "http://jmnd.collezionericordi.it/matlab-population-model.html"
} |
optics, visible-light, waves, refraction, interference
Title: Some doubts related to interference of light by air wedge
We were taught "Interference by an Air Wedge" today in class. I have attached the image of diagram we were taught and the related formulae. However, I have still some lingering doubts about this topic.
In the air wedge, why don't we consider the rays reflected from the upper part of top plate and bottom part of lower plate ?
When I asked this question in class my teacher said something along the lines of "Due to thin plates for the two waves from upper and lower part phase difference will be π due to which destructive interference take place and hence it is better to ignore these..." | {
"domain": "physics.stackexchange",
"id": 36313,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, visible-light, waves, refraction, interference",
"url": null
} |
python, performance, mysql, postgresql
Title: Database migration script I'm working on a database migration script written in python, which will take data from a MySQL database and insert them into a PostgreSQL database with a different Schema (different table structures, different datatypes and so on).
Performances does matter, since I will have to handle with sizable databases.
I use mysql.connector and psycopg2 adapters in order to make python talks with the two databases.
My problem is that I need performance, but also the power of modifying/converting mysql data before inserting rows in the new fresh database. I will give you an example in order to show why there actually is a conflict of interest.
Following is a snippet of code without performance optimization, but at least, where transformation/conversion of data was possible:
cur_msql.execute("SELECT customer_id, customer_name, contact_name, address, city, postal_code, country FROM mysqlcustomers")
for row in cur_msql: | {
"domain": "codereview.stackexchange",
"id": 16251,
"lm_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, mysql, postgresql",
"url": null
} |
gazebo, gazebo-1.2
Originally posted by Erik Stoltenborg on Gazebo Answers with karma: 86 on 2012-11-07
Post score: 1
Hello,
Gazebo 1.2 throttles itself to about 1.0 real-time. You can change this using the update_rate SDF parameter. When the update_rate = 1/dt, which is the default, then Gazebo runs at realtime. Set the update_rate = 0 and Gazebo will run as fast as it can.
The next major release of Gazebo has better sleep behavior, and will not use 100% of your CPU.
The model database format is not necessary, and you don't have to name everything model.sdf. Gazebo does use URIs for everything, as described here. So you can use file://path_to_my_model.sdf.
Originally posted by nkoenig with karma: 7676 on 2012-11-07
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 2795,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, gazebo-1.2",
"url": null
} |
machine-learning, python, dataset, data-cleaning, randomized-algorithms
Thanks,
Greg In Auriel Geron's book, there is a short description of the approach:
you could compute a hash of each instance’s identifier, keep only the last byte of the hash, and put
the instance in the test set if this value is lower or equal to 51 (~20% of 256). This ensures
that the test set will remain consistent across multiple runs, even if you refresh the dataset.
The new test set will contain 20% of the new instances, but it will not contain any instance
that was previously in the training set. | {
"domain": "datascience.stackexchange",
"id": 9501,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, python, dataset, data-cleaning, randomized-algorithms",
"url": null
} |
For some small $$d$$, the bounds look like this:
$$d$$ Bounds
2 $$\frac{1}{2} \leq 1 \leq 1$$
3 $$8 \leq 11 \leq 16$$
4 $$216 \leq 261 \leq 432$$
5 $$8533\frac{1}{3} \leq 9694 \leq 17066\frac{2}{3}$$
The table makes it look like the lower bound is probably closer to the truth. Looking at the ratios $$N_d/F(d)$$ for the numbers you've computed, Brendan says they appear to be going to 1. I'm a little less sure, since it looks like the rate at which they decrease is going down as $$d$$ increases, but with such a small dataset it's hard to tell. I'd guess that $$N_d/F(d)$$ approaches a constant near $$1.08$$. If it turns out I'm wrong, at least I'll have Legendre to keep me company. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924793940119,
"lm_q1q2_score": 0.8162150973706227,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 284.2131111390387,
"openwebmath_score": 0.8397153615951538,
"tags": null,
"url": "https://mathoverflow.net/questions/300713/number-of-hypercube-unfoldings"
} |
vba, excel
I see this particular With block:
For Each ws In ThisWorkbook.Worksheets
If ws.Range("A5") = "Project # :" Then
Dim Z As Integer
Z = 19
Do While Not ws.Range("A" & Z) = "" And Not IsNull(ws.Range("A" & Z))
x = .Range("A" & Rows.Count).End(xlUp).Offset(1).Row
.Cells(x, "A").Value = ws.Name 'classifying number
.Cells(x, "B").Formula = "='" & ws.Name & "'!$A$" & Z 'Non-stores material
.Cells(x, "D").Formula = "='" & ws.Name & "'!$C$" & Z 'Lead Time
.Cells(x, "F").Formula = "='" & ws.Name & "'!$E$" & Z 'Order By Date
.Cells(x, "G").Formula = "='" & ws.Name & "'!$F$" & Z 'Date Ordered
.Cells(x, "H").Formula = "='" & ws.Name & "'!$G$" & Z 'Goals Met
Z = Z + 1
Loop
End If
Next | {
"domain": "codereview.stackexchange",
"id": 21547,
"lm_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
} |
machine-learning, visualization, matplotlib
ax.scatter(X[:100, 0], X[:100, 1], X[:100, 2], c=y_train, cmap=plt.cm.Set1, edgecolor='k', s=40)
ax.plot_surface(xx, yy, z, alpha = 0.5)
plt.show()
I guess d in plane equation (ax+by+c*z = d) shouldn't be equal to 0. So I'm completely confused about this. This answer is borrowed from-
https://stackoverflow.com/questions/36232334/plotting-3d-decision-boundary-from-linear-svm
from sklearn.svm import SVC
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
from mpl_toolkits.mplot3d import Axes3D
iris = datasets.load_iris()
X = iris.data[:, :3] # we only take the first three features.
Y = iris.target
#make it binary classification problem
X = X[np.logical_or(Y==0,Y==1)]
Y = Y[np.logical_or(Y==0,Y==1)]
model = svm.SVC(kernel='linear')
clf = model.fit(X, Y) | {
"domain": "datascience.stackexchange",
"id": 7540,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, visualization, matplotlib",
"url": null
} |
homework-and-exercises, astrophysics, planets, thermal-radiation, estimation
However, these calculations are for the modest situation of planets close to a fairly dim K-type star. My gut feeling is that in the scenario you propose the wind would not cool sufficiently to form dust and the evaporation timescale would still be extremely short, and/or the wind from the star would blast the evaporating material away, preventing obscuration.
If the evaporating material reached 10,000 K, even vaporised iron could escape the Earth's gravity. A spherically symmetric wind would have
$$\dot{M} = 4\pi R^2 \rho_w v$$
If the expansion velocity were of order 10 km/s, then for the mass-loss rate discussed above wind density would be
$$ \rho_w \simeq 0.08 \left(\frac{R}{R_E}\right)^{-2} \left(\frac{v}{10\ km/s}\right)^{-1}\ kg/m^3.$$
The (ram) pressure (for $v=10$ km/s would only be $8\times10^{6}$ Pa. | {
"domain": "physics.stackexchange",
"id": 25104,
"lm_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, astrophysics, planets, thermal-radiation, estimation",
"url": null
} |
statistical-mechanics, phase-transition, ising-model, percolation
Title: When $h>0$ and $0<T<\infty$, do up domains percolate in the Ising model? I'm considering the Ising model in a field on a square lattice in $d$ dimensions:
$$H = -\sum_{\langle i j \rangle} \sigma_i \sigma_j - h \sum_{i} \sigma_i$$
As usual, $\langle i j\rangle$ refers to nearest neighbor couplings.
When $h>0$ and $0< T < \infty$, it follows that there is a finite magnetization density of $\mathbb{E}[\sigma_i] = m(h, T)>0$ in the thermodynamic limit.
One can imagine this might occur because there are more or larger finite domains of up spins than down spins, and that either of the following situations could arise: | {
"domain": "physics.stackexchange",
"id": 95974,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, phase-transition, ising-model, percolation",
"url": null
} |
java, android
protected void launchMissile() {
missiles[index] = 350; // missile distance from buggy
index++;
xbuggy2 = 0;
shoot = true;
}
// event listener for when the user touches the screen
@Override
public boolean onTouchEvent(MotionEvent event) {
int action = MotionEventCompat.getActionMasked(event);
int coordX = (int) event.getX();
int coordY = (int) event.getY();
//Log.d("coordY", "coordY " + coordY);
if (coordX < 220 && moonRover.getJumpHeight() == 0 && action == MotionEvent.ACTION_MOVE) {
jump = true;
shoot = false;
lastTurn3 = System.currentTimeMillis();
return true; // do nothing
}
if (coordX > 219 && action == MotionEvent.ACTION_DOWN) {
numberOfshots++;
performClick();
return true;
}
return true;
}
} | {
"domain": "codereview.stackexchange",
"id": 31261,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, android",
"url": null
} |
ros
changing mode of /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/roslocate to 755
changing mode of /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/rosws to 755
Found existing installation: vcstools 0.1.18
Uninstalling vcstools:
Successfully uninstalled vcstools
Running setup.py install for vcstools
Found existing installation: PyYAML 3.10
Uninstalling PyYAML:
Successfully uninstalled PyYAML
Running setup.py install for pyyaml
checking if libyaml is compilable
/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c build/temp.macosx-10.6-x86_64-2.6/check_libyaml.c -o build/temp.macosx-10.6-x86_64-2.6/check_libyaml.o
build/temp.macosx-10.6-x86_64-2.6/check_libyaml.c:2:18: error: yaml.h: No such file or directory | {
"domain": "robotics.stackexchange",
"id": 10432,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
CoCalc Public Filesweek 5 / assignment / FindRoots.ipynb
Authors: Boyuan Qi, Rajvir Sidhu
Views : 31
Compute Environment: Ubuntu 20.04 (Default)
# Assignment 2: Polynomial Root Finding
## Markdown
Give the address (url) for a website that has documentation for markdown, including tables (i.e. a webpage, not a pdf or other document, that describes how you use markdown to create a table). Enter your answer as a variable named website='http://url.goes.here'
Marks: 1
In [ ]:
# YOUR CODE HERE
markdownWebsite='https://www.markdownguide.org/cheat-sheet'
Test your code from above here(1 point), ID: validate_website
In [ ]:
#test that it's a suitable website link you've given | {
"domain": "cocalc.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769049752757,
"lm_q1q2_score": 0.8925562454264588,
"lm_q2_score": 0.9149009584734676,
"openwebmath_perplexity": 4157.842828911409,
"openwebmath_score": 0.4697786271572113,
"tags": null,
"url": "https://share.cocalc.com/share/b67337a608fb9911d3a0a3330eaadd1ab39e446b/week%205/assignment/FindRoots.ipynb?viewer=share"
} |
ros
or using rosws:
rosws set hector_gazebo --git https://github.com/tu-darmstadt-ros-pkg/hector_gazebo.git --version=fuerte-devel
Unfortunately the name of the development branch to use for each distro is currently not displayed in the ROS wiki. I opened a feature request issue here.
Originally posted by Johannes Meyer with karma: 1266 on 2013-05-25
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Martin Günther on 2013-05-26:
Good answer! Just a minor typo: it should be --version=fuerte-devel, like this:
rosws set hector_gazebo --git https://github.com/tu-darmstadt-ros-pkg/hector_gazebo.git --version=fuerte-devel
Comment by Johannes Meyer on 2013-05-26:
Thanks, updated.
Comment by jacobsolid on 2013-05-27:
Thank you very much it works! | {
"domain": "robotics.stackexchange",
"id": 14278,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
## 1 Answer
All "Difference of Squares" really is is the use of the equation $(a-b)(a+b)=a^2-b^2$. In the case shown, $a=1$ and $b=\sqrt2\sin\theta$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357237856481,
"lm_q1q2_score": 0.8137988368126741,
"lm_q2_score": 0.8289388040954683,
"openwebmath_perplexity": 530.0127177502795,
"openwebmath_score": 0.7067885398864746,
"tags": null,
"url": "https://math.stackexchange.com/questions/2474391/differences-of-squares-on-1-2-sin2x"
} |
c++, beginner, queue
m_ReallocAnyway() is ONLY ever called from m_Realloc().
m_Realloc() is ONLY ever called from m_CheckOrAlloc().
m_CheckOrAlloc() is called from multiple places (good!)… but… it’s really just reserve().
I think AT MOST all you need is reserve(), and then maybe an internal, unconditional reallocation function. Keep it simple.
void resize(size_type sz) {
m_Size = sz;
m_CheckOrAlloc(sz);
}
This is just completely wrong. You allocate enough capacity, but you never actually construct or destruct any objects. You just set the size. You’re either going to truncate your queue with a bunch of inaccessible objects past the end, or the last few elements in your queue are going to be empty garbage.
void erase(iterator val)
void erase(iterator first, iterator last)
erase() is perhaps the trickiest function in std::vector to properly implement, and your queue is basically std::vector. In the std::vector version of erase() there are basically 2 paths: | {
"domain": "codereview.stackexchange",
"id": 40871,
"lm_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++, beginner, queue",
"url": null
} |
# Algebra
The time, t, required to drive a certain distance varies inversely with the speed, r. If it takes 7 hours to drive the distance at 55 miles per hour, how long will it take to drive the same distance at 65 miles per hour?
• about 6.25 hours
• about 385.00 hours
• about 5.92 hours
• about 3.21 hours
Show how to get answer...
1. 👍
2. 👎
3. 👁
1. since ts = k is constant,
and 65 = 13/11 * 55,
(7)(55) = (11/13 * 7)(13/11 * 55)
11/13 * 7 = 5.92
1. 👍
2. 👎
2. It always help to see how it is done. Thanks.
1. 👍
2. 👎
3. you can also see that since st is constant,
65t = 55*7
1. 👍
2. 👎
## Similar Questions
1. ### variation
Can you please check my answers? Thanxs! Write an equation that expresses the relationship. Use k as the constant of variation. 20. f varies jointly as b and the square of c. -I got: f=kbc^2 22. r varies jointly as the square of s
2. ### Math | {
"domain": "jiskha.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.977022625406662,
"lm_q1q2_score": 0.8010543353079324,
"lm_q2_score": 0.8198933315126791,
"openwebmath_perplexity": 705.6832839987069,
"openwebmath_score": 0.8124702572822571,
"tags": null,
"url": "https://www.jiskha.com/questions/1054147/the-time-t-required-to-drive-a-certain-distance-varies-inversely-with-the-speed-r-if"
} |
python, object-oriented, simulation
self.second_door = self.first_door
else:
self.switch_doors(doors)
else:
self.second_door = random.choice(doors) | {
"domain": "codereview.stackexchange",
"id": 41473,
"lm_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, object-oriented, simulation",
"url": null
} |
$$b=\sqrt{ \sqrt[3]{ \frac{a}{18} }-\sqrt[3]{ \frac{2}{3a} } }$$
$$a=9+\sqrt{93}$$
And solving the quintic equation:
$$c^5-c-\frac{1}{5}=0$$
We get the upper bound for the limit with four correct digits:
$$L<1.272282$$
Taking into account the corresponding lower boundary:
$$L>\sqrt{\frac{1}{2}+\sqrt[3]{\frac{1}{3}+\sqrt[4]{\frac{1}{4}+\sqrt[5]{\frac{1}{5}+\sqrt[6]{\frac{1}{6}}}}}}=1.271035$$
We see that truncating the limit gives less accurate solutions than the method in this answer.
However, truncating at $\frac{1}{7}$ we can finally get very good boundaries:
$$1.27207<L<1.27228$$
This is a partial result:
The underlying sequence is increasing and upper bounded by $\sqrt{1+\sqrt{1+\sqrt{1+\cdots}}}=\dfrac{1+\sqrt{5}}{2}=\phi$. Thus the limit exists and it is less than $\phi$.
Actually, there is another way which gives better upper boundary. I'm posting it as a separate answer because of the size.
First we notice that: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765569561562,
"lm_q1q2_score": 0.8582507222906963,
"lm_q2_score": 0.8757869932689565,
"openwebmath_perplexity": 425.9537510141508,
"openwebmath_score": 0.9270058870315552,
"tags": null,
"url": "https://math.stackexchange.com/questions/582196/find-the-limit-l-lim-n-to-infty-sqrt-frac12-sqrt3-frac13-cdo"
} |
php, mysql, console, pdo
Suggestions
Constants
While it appears you intend to have users of this script modify them, $useroutfile and $grantoutfile could be declared as constants, since the value is never re-assigned. The same would also apply to the values stored in variables for the database connection info (e.g. $dbuser, $dbpassword).
Another thing to consider for those values is to get them from command line arguments or else user input.
Database Server name hard-coded
The value for $dsn contains localhost for the host name: | {
"domain": "codereview.stackexchange",
"id": 37564,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, mysql, console, pdo",
"url": null
} |
general-relativity, curvature, stress-energy-momentum-tensor
No. Ben's answer has one essential component that ny answer above forgot to put in: although it may look like the matter-energy and curvature are tightly coupled through $G_{\mu\,\nu}\propto T_{\mu\,\nu}$, $G_{\mu\,\nu}$ is not quite the curvature - its something derived from the curvature with its "trace" subtracted away, such the curvature can propagate as waves that become sundered from their matter-energy sources, just as electromagnetic waves can become sundered from the current and charge sources that generate them. It's not only waves either: a "static" curvature field can reach into "empty" space where $T_{\mu\,\nu} = 0$. This is what Ben is driving at when he gave the example of Gravity Probe B in empty space. The relationship between the "curvature field" and matter-energy is very like that between the electromagnetic field and current/charge. One needs the other to get going, but you can see that they are quite separate. Also, I'd like Ben to confirm this, but there is the | {
"domain": "physics.stackexchange",
"id": 9610,
"lm_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, curvature, stress-energy-momentum-tensor",
"url": null
} |
angular-momentum, representation-theory, mathematics, lie-algebra
My confusion with tensor product representations
If I took the tensor product of two different representations $R_\Lambda$ and $R_{\Lambda '}$ of the Lie algebra with highest weights $\Lambda$ and $\Lambda'$ respectively, I will get a represnetation space $V_\Lambda \otimes V_{\Lambda'}$ which is spanned by $ \{ v_\lambda \otimes v'_{\lambda'} \} $. The representatives of $L(SU(2))$ are given by
$$ R_{\Lambda \otimes \Lambda'}(X) = R_{\Lambda}(X) \otimes I_{\Lambda'}+ I_\Lambda \otimes R_{\Lambda '}(X).$$ | {
"domain": "physics.stackexchange",
"id": 45484,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "angular-momentum, representation-theory, mathematics, lie-algebra",
"url": null
} |
# Math Help - If gcd(aa,b)=1, then gcd(a-b,a+b)=1 or 2 for all integers a,b
1. ## If gcd(aa,b)=1, then gcd(a-b,a+b)=1 or 2 for all integers a,b
Show that if $gcd(a,b) = 1$ then $gcd(a-b,a+b) = 1$ or $2$ for all integers $a,b$.
I don't know how to start.
2. ## Re: If gcd(aa,b)=1, then gcd(a-b,a+b)=1 or 2 for all integers a,b
Originally Posted by math2011
Show that if $gcd(a,b) = 1$ then $gcd(a-b,a+b) = 1$ or $2$ for all integers $a,b$.
I don't know how to start.
suppose $~\gcd(a-b,a+b)=k~$ where $~k>2~$ then :
$a-b=k\cdot m ~\text {and}~ a+b=k \cdot n$ , hence :
$2a=k\cdot m+k\cdot n \Rightarrow a = \frac{k}{2} \cdot(m+n)$
$2b=k\cdot n-k\cdot m \Rightarrow b = \frac{k}{2} \cdot(n-m)$
If $k$ is an even number then
$\gcd(a,b) \geq 2 ~$, contradiction.....
If $k$ is an odd number then
$(m+n) ~\text {and}~ (n-m) ~$ are even numbers , hence :
$\gcd(a,b) \geq 3 ~$, contradiction.....
3. ## Re: If gcd(aa,b)=1, then gcd(a-b,a+b)=1 or 2 for all integers a,b
Hello. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517488441415,
"lm_q1q2_score": 0.8041435191182871,
"lm_q2_score": 0.8221891327004133,
"openwebmath_perplexity": 614.2549045497504,
"openwebmath_score": 0.9636815190315247,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/195773-if-gcd-aa-b-1-then-gcd-b-b-1-2-all-integers-b.html"
} |
reference-request, graph-theory, treewidth
Title: Generalization of locally bounded treewidth graphs Is the following graph class known in the literature?
The class of graphs is parameterized by positive integers $d$ and $t$ and contains each graph $G=(V,E)$ such that for each vertex $v\in V$, the subgraph of $G$ induced on all vertices at distance at most $d$ from $v$ in $G$ has treewidth at most $t$.
It generalizes the concept of locally bounded treewidth, and it seems useful when searching for local structures in graphs. The concept of exploiting properties that a graph possesses locally can be taken even further. Dawar, Grohe and Kreutzer in Locally Excluding a Minor considered classes of graphs that locally exclude a minor and Dvorak, Kral and Thomas in Deciding first-order properties for sparse graphs considered classes of graphs that have (locally) bounded expansion.
Both of those classes are subsumed by classes of nowhere dense graphs, introduced by Nesetril and Ossona de Mendez. | {
"domain": "cstheory.stackexchange",
"id": 2247,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, graph-theory, treewidth",
"url": null
} |
javascript, css, html
/* Footer */
.footerBox
{
color: white;
font-size: 13px;
margin: 0 auto;
width: 700px;
margin-top:5px;
}
.footerItem{
float: left;
width: 33%;
}
.footerItem a{
font-size:13px;
color:white;
}
.footerItem a:hover{
color: #ffaa00;
}
.copyright
{
color: white;
text-align:center;
background-color: #000000;
font-size: 12px;
padding: 3px;
}
.footIco{
height: 40px;
width: 32px;
float: left;
margin-top: 7px;
position:relative;
left: -4px;
display:block;
} | {
"domain": "codereview.stackexchange",
"id": 6050,
"lm_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, css, html",
"url": null
} |
c#, beginner
[STAThread]
static void Main()
{
Thread connection = new Thread(WebFile.Download);
connection.Start();
// ...
}
public class WebFile
{
public static void Download()
{
System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
customCulture.NumberFormat.NumberDecimalSeparator = ".";
System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
while (true)
{
try
{
WebRequest request = WebRequest.Create(INFO_HOST + INFO_PATH + "?v=" + APP_VERSION);
WebResponse response = request.GetResponse();
string responseStr = streamResponse(response);
parseResponse(responseStr);
}
catch
{
Thread.Sleep(60000);
continue;
}
}
} | {
"domain": "codereview.stackexchange",
"id": 40949,
"lm_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#, beginner",
"url": null
} |
algorithms, data-structures, computational-geometry, trees, intervals
intervals that begin before i
intervals that end after j
intervals that begin after i and end before j (i.e., that are contained within [i,j]). | {
"domain": "cs.stackexchange",
"id": 8118,
"lm_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, data-structures, computational-geometry, trees, intervals",
"url": null
} |
javascript, jquery, mvc, backbone.js, mvvm
};
this.take_turn = function (row, column, new_direction) {
var removed = [];
var added = [];
var current_row = row;
var current_column = column;
var old_direction = this.board.get_cell_direction(current_row, current_column);
var current_next_cell_location = this.board.calculate_next_cell_location(row, column, old_direction);
var new_next_cell_location = this.board.calculate_next_cell_location(row, column, new_direction);
var current_next_cell_direction = null;
this.board.set_cell_direction(row, column, new_direction);
removed.push([current_row, current_column]);
added.push({'row': current_row, 'column': current_column, 'direction': new_direction});
if(current_next_cell_location){
current_next_cell_direction = this.board.get_cell_direction(current_next_cell_location['row'], current_next_cell_location['column']);
}
var next_step = new_next_cell_location; | {
"domain": "codereview.stackexchange",
"id": 7746,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, mvc, backbone.js, mvvm",
"url": null
} |
star, observational-astronomy, magnitude
A colour index is therefore something like
$$ B-V = -2.5\log_{10} f_B + 2.5\log_{10}f_V + Z_B - Z_V = -2.5\log_{10} \frac{f_B}{f_V} + Z_{BV}$$
Now, let's think about what you are asking.
$$BV = (-2.5\log_{10} f_B + Z_B)(-2.5\log_{10} f_V + Z_V)$$
$$BV= -2.5Z_v\log_{10} f_B -2.5Z_B\log_{10} f_V +Z_{B}Z_V -2.5 \log_{10} f_B^{-2.5\log_{10}f_V}$$
This numerology has no physical significance at all and, because the fluxes themselves are distance-dependent, then like $B$ and $V$ individually, $BV$ and $B/V$ would be distance-dependent and therefore have no relationship to anything physical that is intrinsic to the star. | {
"domain": "astronomy.stackexchange",
"id": 3112,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "star, observational-astronomy, magnitude",
"url": null
} |
navigation, robot-localization
The only problem for you is that the error is going to be a function of your steering angle. When the robot is driving straight, the unicycle and Ackermann models will both produce the same prediction. When the robot is turning, the models will clearly differ during prediction. You could compute the upper bound on this error and use it to dictate the process node covariance values for the affected variables.
If you can, I'd fuse the pose data from your odometry, rather than the velocity. | {
"domain": "robotics.stackexchange",
"id": 28256,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, robot-localization",
"url": null
} |
java, matrix, mathematics
double[][] doubMatrix1 = new double[d1][d2];
double[][] doubMatrix2 = new double[d1][d2];
double[][] doubMatrix3 = new double[d1][d2];
doubMatrix1 = getdoubMatrix(d1,d2);
doubMatrix2 = getdoubMatrix(d1,d2);
doubMatrix3 = addMatrices(doubMatrix1, doubMatrix2);
}
public static double[][] getdoubMatrix(int d1, int d2){
double[][] tempArray = new double[d1][d2];
for(int i =0; i <tempArray.length;i++ )
for(int j =0;j < tempArray[i].length;j++)
tempArray[i][j] = Math.random()*(10.0);
return tempArray;
}
public static double[][] addMatrices(double doubMatrix1[][], double doubMatrix2[][]){ | {
"domain": "codereview.stackexchange",
"id": 17351,
"lm_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, matrix, mathematics",
"url": null
} |
planetary-science, storms
is the reason that Hurricanes/Typhoons can last rather long). However, at the latest at landfall this mechanism stops and the storm will decay. On gas-planets, however, there is no surface, therefore friction is much less (only the friction between different layers of the atmosphere, which is much less). Once a storm develops, with a low pressure centre, there is no (or hardly) any friction which counteracts geostrophic balance. This allows the storms to exist much longer. | {
"domain": "earthscience.stackexchange",
"id": 1151,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planetary-science, storms",
"url": null
} |
homework-and-exercises, special-relativity, photons, doppler-effect
$$a \propto \sqrt{ \frac{1-\beta}{1+\beta} } \, \sqrt{ \frac{1-\beta}{1+\beta} }
= \frac{1-\beta}{1+\beta}$$
If you don't want to go via the wavelength, then just consider the pulse itself as it catches up with the moving rocket, all observed in the launch pad frame. From this you will get the time the launch pad observer's clock registers for the photons to hit the rocket. The closing speed of pulse and rocket is $c-v$ so it takes $L/(c-v)$ for a pulse of length $L$ to be absorbed by the rocket (and the emitter took $\delta t_0 = L/c$ to emit it). The rocket observer finds a shorter time than this by $\gamma$,
$$ \delta t = \frac{L}{c-v} \frac{1}{\gamma} = \frac{L}{c} \frac{\sqrt{1-\beta^2}}{1-\beta} = \delta t_0 \sqrt{ \frac{1+\beta}{1-\beta}}$$
After allowing also for the transformed energy-momentum of the radiation in the pulse
you thus end up with the same answer again. | {
"domain": "physics.stackexchange",
"id": 54721,
"lm_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, photons, doppler-effect",
"url": null
} |
unless the domains are limited. Chapter Five – Trigonometric Functions What to Expect: A new formula designed for sin and cos graphs, details about frequencies, new vocabulary, explaining periodic trends, and the like. 2]Solve right and oblique triangles including application problems. Outcome 6: Set up and solve exponential and logarithmic equations; then identify and sketch graphs of the functions. Precalculus students are required to understand how sine and cosine functions model the real world. A lot of waves actually follow a sine graph, so we can prove that sinusoidal motion is a real thing in nature. We completed three cosine graphs together on the 13-5 vocab support page. f(x)= Calculus: Early Transcendental Functions Use Exercise 25 to find the moment of inertia of a circular disk of radius a with constant density about a. 0333 170 -170 t e 0. Have them graph these points and note whether or not they are on the same graph. Use a horizontal scale where one unit represents 0. | {
"domain": "rafbis.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9926541732082084,
"lm_q1q2_score": 0.8624445117417647,
"lm_q2_score": 0.8688267626522814,
"openwebmath_perplexity": 518.5260431003412,
"openwebmath_score": 0.7441229820251465,
"tags": null,
"url": "http://rafbis.it/qowu/graph-of-sine-and-cosine-functions-real-world-applications.html"
} |
earthquakes, seismic
Secondly, and more importantly, the P-wave radiation pattern (and S-wave as well) for an explosion is fundamentally different to that of an earthquake. This can be investigated by plotting the polarities of the first arriving waves of a seismic event on a stereonet, with the position on the net being determined by the azimuth of the source from the receiving station and the outgoing angle of the wave from the source.
Earthquakes radiate P-waves in four lobes, with alternating polarities. This is called a double couple source and it produces a fault plane solution with two positive and two negative quadrants.
An explosion, radiates P-waves equally in all directions and so produces an isotropic pattern.
You may have seen reports of a second seismic event after the nuclear test which has been interpreted as a tunnel collapse. This also has a distinctive focal mechanism, called a compensated linear vector dipole (CLVD). | {
"domain": "earthscience.stackexchange",
"id": 1192,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "earthquakes, seismic",
"url": null
} |
is a covariance matrix is fully. To replace it by the Left almost opaque semi-positive definite then you could get variances that were negative are examples! Certain elements of remain fixed euclidean space receive notifications of new posts by email see our tips on great... That were negative privacy policy and cookie policy for example in Monte-Carlo simulations in finance equate to a semi-definite... Details below or click an icon to Log in: you have some eigenvalues your! Numbers and occur due to noise in the first equality in the equation. Sum and there is general ( matrix-level ) mismatch between$ h $.... 'Randcorr ' ) under cc by-sa in statistics, we usually apply these terms to a positive semi-definite property correlation... Non-Gramian ( non-psd ) matrix if ( 1 ) it is a possible correlation matrix, like... Matrix: it has eigenvalues,, so we solve the problem want... A given matrix is not positive definite has eigenvalues,, so solve! That certain elements of remain fixed | {
"domain": "magentomobileshop.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9572778048911613,
"lm_q1q2_score": 0.8192873055225837,
"lm_q2_score": 0.8558511451289037,
"openwebmath_perplexity": 696.6299272588651,
"openwebmath_score": 0.6574012041091919,
"tags": null,
"url": "https://shopping.magentomobileshop.com/2z9m5h/correlation-matrix-positive-semidefinite-proof-507ddb"
} |
choose one of these options and start planting! Area in Square Feet: Plant Spacing in Inches: Number of Trees in Bed: Calculate *Only enter one bed at a time, do not combine bed square footages and enter as one. Length Member Width ... Decimal Inch or Metric mm. Fill in any two fields and this tool will calculate the third field. The plant quantity calculator works out the area of the garden based on the measurements you provide (in metric or imperial units) using the formula: $$Area\,of\,garden = Length \times Width$$ Our calculator allows you to use both square and triangular patterns for the plants with equal coverage. This calculator figures seed spacing and population. Spacings Calculator Metric Never use a chart again! Our calculator allows you to use both square and triangular patterns for the plants with equal coverage. A Tree Spacing Calculator that will calculate the number of trees per acre and spacing between trees and tree rows. ... Calc # of plants needed in a rectangular | {
"domain": "co.uk",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9615338079816756,
"lm_q1q2_score": 0.8053999188316894,
"lm_q2_score": 0.8376199694135333,
"openwebmath_perplexity": 2628.0538647379285,
"openwebmath_score": 0.6550539135932922,
"tags": null,
"url": "https://sarahphoebe.co.uk/tags/cca926-plant-spacing-calculator-metric"
} |
c++, integer, c++17
constexpr uint128_t& operator^=(const uint128_t& rhs) noexcept {
array[0] ^= rhs.array[0];
array[1] ^= rhs.array[1];
return *this;
}
template<typename T, typename = std::enable_if_t<std::is_integral_v<std::decay_t<T>>>>
constexpr uint128_t& operator^=(T&& rhs) noexcept {
array[0] ^= rhs;
return *this;
}
friend constexpr uint128_t operator~(uint128_t value) noexcept {
value.array = { ~value.array[0], ~value.array[1] };
return value;
}
template<typename T>
friend constexpr uint128_t operator<<(uint128_t lhs, T&& rhs) noexcept {
return lhs <<= rhs;
}
constexpr uint128_t& operator<<=(const uint128_t& rhs) noexcept {
if (rhs.array[1] > 0)
return array = {}, *this;
return *this <<= rhs.array[0];
} | {
"domain": "codereview.stackexchange",
"id": 25843,
"lm_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++, integer, c++17",
"url": null
} |
finite-automata, regular-expressions
Note, that the professor might wanted you to work in methodological way, where there are fixed "gadgets", i.e., converting x|y to some certain states, and converting xy to other (fixed) states. Then, their comment makes sense - they wanted you to interpret a|b|c as (a|b)|c, first use the gadget on a|b to obtain the upper half of the machine, and then use the gadget again on x|c where $x$ is the already-constructed machine.
If this (or any fixed other) methodology was required, then the outcome NFA would be unique. | {
"domain": "cs.stackexchange",
"id": 19342,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "finite-automata, regular-expressions",
"url": null
} |
# Multivariable limit $\lim_{(x,y) \rightarrow (0,0)} \frac { x \sin(y/\sqrt{x}) } {\sqrt{ x^2 + y^2 }}$
In trying to find this limit, all the (x,y) paths I check approaching (0,0) produce the same result, namely, the function approaches 0. consequently, I came up with the simplest proof I could that the limit indeed exists and is zero. However wolframalpha tells me that the limit doesnt exist. Assuming I'm wrong, can anyone shed light on where my proof is flawed, and possibly provide a path on which the function doesn't approach 0.
$$\lim_{(x,y) \rightarrow (0,0)} \frac { x \cdot \sin(\frac{y}{\sqrt{x}}) } {\sqrt{ x^2 + y^2 }}$$
provided $x>0$
my proof:
let's take $\varepsilon > 0$ and prove the existence of some $\delta > 0$ such that
$\forall (x,y) \in B(0, \delta ) : |f(x,y)| < \varepsilon$
(where f is our function above, and as stated $x>0$)
taking the x to the denominator, we get:
$$\frac { \sin(\frac{y}{\sqrt{x}}) } {\sqrt{ 1 + (\frac{y}{x})^2 }}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731126558705,
"lm_q1q2_score": 0.8293796663225192,
"lm_q2_score": 0.8615382058759129,
"openwebmath_perplexity": 135.50718147420633,
"openwebmath_score": 0.9620891809463501,
"tags": null,
"url": "http://math.stackexchange.com/questions/10322/multivariable-limit-lim-x-y-rightarrow-0-0-frac-x-siny-sqrtx"
} |
python, pandas, excel
Table2=list(zip(name,amount))
df1=pd.DataFrame(Table2,columns=columns)
df1 is your real dataframe.
We define a aggregated function to retrieve a list of indexes of duplicates rows for each name according your criteria:
def get_duplicates_idxs(self):
idxs=[]
if len(self)==3:
amount=self.Amount
indexes=amount.index
idx1=indexes[0]
idx2=indexes[1]
idx3=indexes[2]
a1=amount[idx1]
a2=amount[idx2]
a3=amount[idx3]
if a1+a2==a3:
idxs=[idx1,idx2]
if a1+a3==a2:
idxs=[idx1,idx3]
if a2+a3==a1:
idxs=[idx2,idx3]
return idxs
There are two assumptions:
Duplicates implies 3 rows for that name.
The order of the 3 rows are irrelevant.
a1, a2 and a3 are the amounts of the posible duplicates rows in that order.
Then we apply this function in df1 grouped by name:
idxs_series=df1.groupby("Name").apply(lambda x: get_duplicates_idxs(x))
idxs_duplicates=(list(itertools.chain.from_iterable(idxs_series))) | {
"domain": "datascience.stackexchange",
"id": 10610,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, pandas, excel",
"url": null
} |
optics, lenses
Title: Calculating lens parameters I have a very bright LED light and I'd like to make this light focus so it forms around 5mm thick strong line (height can be arbitrary) on on an object about 150 mm away.
I used a cylindrical lens for this purpose which has a focal length of 150mm and it seemed to achieve what I want, but it had to be held away from the light at about a distance of about 150 mm, which does not work for my experiment.
I'm trying to understand how I can calculate the lens parameters needed so that I can get a front focal length of about 150mm but a back focal length of around 20mm or less. I'm not sure whether I'm using the terminology right, but I want the lens to be 20mm (or less) from the light and the focus distance to be 150mm away from the light. Suppose the object (the LED) is distance o from the lens and we want the image to be distance i from the lens: | {
"domain": "physics.stackexchange",
"id": 26260,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, lenses",
"url": null
} |
c#, winforms, chess
/// <summary> Method to load and draw all the figures using several other methods </summary>
private void LoadAllFigures()
{
if (Properties.Settings.Default.EnabledTurnTracking)
{
flpBlackPlayerWinnings.Height /= 2;
flpWhitePlayerWinnings.Height /= 2;
flpWhitePlayerWinnings.Location = new Point(flpWhitePlayerWinnings.Location.X, flpBlackPlayerWinnings.Location.Y + flpBlackPlayerWinnings.Height + 10);
EnableTurnTracking();
}
if (Figures.Count > 0)
{
Restart();
}
else
{
AddKings();
AddQueens();
AddRooks();
AddBishops();
AddKnights();
AddPawns();
DrawFigures();
}
} | {
"domain": "codereview.stackexchange",
"id": 19923,
"lm_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#, winforms, chess",
"url": null
} |
lidar, rviz, ros-groovy
Title: RViz crashes upon first /scan
I'm having a serious problem getting RViz to operate on a FitPC2 (dreaded GMA500 embedded system) with a SICK TiM310 scanner.
The FitPC2 is currently running Ubuntu 12.04, ROS-Groovy and RViz 1.9.34 as our primary research platforms are designed around a PandaBoard, but this specific research problem requires some of the x86 packages that are not yet ARMHF compiled for Hydro. We will upgrade along that path at some point.
Currently I am able to run RViz fine, but as soon as the first /scan data is published by the SICK_TiM3xx package, RViz crashes with the following terminal information: http://pastebin.com/euHWXPBD
I have confirmed that the output of the LiDAR is correct by other means, but it would be extremely valuable to us to be able to visualise the scan data in real-time on the platform.
Any help that someone could provide would be greatly appreciated. | {
"domain": "robotics.stackexchange",
"id": 17807,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lidar, rviz, ros-groovy",
"url": null
} |
ruby, html, ruby-on-rails
I don't like that I have to define an i variable, is there a better way? Rails has a built in method, cycle, which will cycle between two more more options for you, so you don't have to manage the "Even"/"Odd" selection.
<% @patients.each do |patient| %>
<%= content_tag :tr, :class => cycle('Even', 'Odd') do %>
<%= content_tag :td, link_to(patient.id, patient) %>
<% [:username, :first_name, :last_name, :email, :active, :disabled].each do |property| %>
<%= content_tag :td, patient.user.send(property) %>
<% end %>
<td>
<ul class="Horizlist">
<%= content_tag :li, link_to('Detail', patient) %>
</ul>
</td>
<% end %>
<% end %> | {
"domain": "codereview.stackexchange",
"id": 100,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ruby, html, ruby-on-rails",
"url": null
} |
python, image, file-system
if not os.path.dirname(root) == '.':
notice(msg = "layer {layer} on main group {m_group} on group {group}",
verbosity = args_dict['verbosity'],
layer = filename,
m_group = os.path.dirname(root).replace('.\\', ''),
group = root_dir_basename)
create_layer_from_file(
doc = new_doc,
layer_name = filename,
layer_set = new_doc.LayerSets(scrubbed_dirname(root)).LayerSets(root_dir_basename),
path = os.path.realpath(filename),
psApp = psApp)
else:
create_layer_from_file(
doc = new_doc,
layer_name = filename,
layer_set = new_doc.LayerSets[root_dir_basename],
path = os.path.realpath(filename),
psApp = psApp)
os.chdir(args_dict['base_dir']) | {
"domain": "codereview.stackexchange",
"id": 34313,
"lm_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, image, file-system",
"url": null
} |
algorithms, time-complexity, loops
Title: How many times is a for loop executed? Consider the following code snippet:
for(int i=0;i<n;i++)
The question I have is: whether this loop is executed $n$ times or $(n+1)$ times?
According to what I understand: when $i=n$, the for loop would increment $i$ to $n+1$ and check if $i<n$ which would evaluate to false and the loop will be exited.
So the increment would be performed a total of $(n+1)$ times. Is this correct? Should we count $(n+1)$ as the number of increment operations performed during algorithm analysis?
I know this would not make any difference to the complexity since $O(n+1) = O(n)$, linear time. But I was just curious to know if my understanding is correct or not.
Consider the following code snippet:
for(int i=0;i<n;i++)
The question I have is: whether this loop is executed $n$ times or $(n+1)$ times? | {
"domain": "cs.stackexchange",
"id": 15550,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, time-complexity, loops",
"url": null
} |
a fair coin, which has a (1/2) 10 chance of flipping 10 heads in a row. You flip it again, having a 1/2 chance of it landing on heads. With an honest coin, the chances of winning or losing are 50% and consequently, coin flipping is used to decide such momentous events like who kicks off in a football game. You will be registered and sent instructions. Toss a single coin 10 times. Write the probability of NOT rolling doubles as a fraction in lowest terms, as a decimal and as a percent. But we need a few more rules to get very far. In particular, the activity addresses the grade 7 Common Core State Standards for Mathematics (CCSSM) in probability and statistics (CCSSI 2010). A coin, having probability p of landing heads, is flipped until head apears for the rth time. We sought to provide evidence that the toss of a coin can be. An ideal unbiased coin might not correctly model a real coin, which could be biased slightly one way or another. Predicting a coin toss. khanacademy. I have a | {
"domain": "gruppokamengepavia.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513873424044,
"lm_q1q2_score": 0.8039426459541658,
"lm_q2_score": 0.8152324848629215,
"openwebmath_perplexity": 305.28230835746405,
"openwebmath_score": 0.7786978483200073,
"tags": null,
"url": "http://yqxs.gruppokamengepavia.it/coin-flip-probability.html"
} |
filters, lowpass-filter, averaging
But how averaging work like a normal function in time domain?
Is there any intuition in it? First intuition: If you symmetrize the top plot across the $y$-axis, you will see a bell-shaped function. For real filters, one usually only plots the right-most part, since the Fourier magnitude is symmetric. The most notable example of a bell-shaped function is the Gaussian, and the Fourier transform of a Gaussian is a Gaussian too. So half a Gaussian on the left of the Fourier domain is like full Gaussian in time.
Second intuition: perform a moving average of two-sample width on a signal. Do that again, and again, again (like in a forest). Those combined averages tend to a Gaussian.
Finally, a caveat: the curvature of your top plot is only one possibility for a low-pass filter. Moving average filters (with $M$ length) are brick-like, and their Fourier domain counterparts do not look like Gaussians. | {
"domain": "dsp.stackexchange",
"id": 7101,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, lowpass-filter, averaging",
"url": null
} |
$Q_2$ is the point such that the area under the bars each side of $Q_2$ is equal. A histogram is a very specific type of graph. The median $Q_2$is the point such that the area under the bars each side of $Q_2$is equal. What is 7? Accidentally ran chmod +x /* - How bad did I just mess up? What is a range? Histogram vs. Each bin has a bar that represents the count or percentage of observations that fall within that bin.Download the CSV data file to make most of the histograms in this blog post: Histograms.In the fie… The line in the middle shows the median of the distribution. Has a state official ever been impeached twice? That is, half the monarchs started ruling before this age, and half after this age. It only takes a minute to sign up. Quartile 1 is the 25th percentile: it is the score that separates the lowest 25% from the highest 75% of scores. My Tweets. Answer. The histogram is still preferable for a more detailed look at the shape of the distribution. Please be sure to answer | {
"domain": "pipburner.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9559813501370537,
"lm_q1q2_score": 0.8710708070888212,
"lm_q2_score": 0.9111797075998823,
"openwebmath_perplexity": 691.1884279624694,
"openwebmath_score": 0.4373709261417389,
"tags": null,
"url": "https://pipburner.com/rajgir-mla-unngu/2ca157-j-b-weld-plastic-putty"
} |
c++, catkin, rqt
[ 4%] Built target stereo_driver
[ 7%] Built target camera_publisher
[ 10%] Built target stereo_publisher
[ 12%] Built target camera_subscriber
[ 12%] Built target std_msgs_generate_messages_py
[ 12%] Built target stereo_msgs_generate_messages_eus
[ 12%] Built target std_msgs_generate_messages_cpp
[ 12%] Built target std_msgs_generate_messages_eus
[ 12%] Built target std_msgs_generate_messages_nodejs
[ 12%] Built target std_msgs_generate_messages_lisp
[ 12%] Built target stereo_msgs_generate_messages_py
[ 12%] Built target rosgraph_msgs_generate_messages_cpp
[ 12%] Built target roscpp_generate_messages_py
[ 12%] Built target rosgraph_msgs_generate_messages_eus
[ 12%] Built target rosgraph_msgs_generate_messages_nodejs
[ 12%] Built target roscpp_generate_messages_cpp
[ 12%] Built target rosgraph_msgs_generate_messages_lisp
[ 12%] Built target rosgraph_msgs_generate_messages_py
[ 12%] Built target roscpp_generate_messages_nodejs
[ 12%] Built target stereo_msgs_generate_messages_cpp | {
"domain": "robotics.stackexchange",
"id": 24763,
"lm_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++, catkin, rqt",
"url": null
} |
ros
Title: seesaw macros not working with chrome
With Chrome Version 30.0.1599.66 (the current), the seesaw macros at http://wiki.ros.org/seesawexample don't seem to work. Specifically, if I click on "Bash" then on "Compiled" nothing is shown. Confused me for a while before I tried Firefox, where this works logically.
Actually, I noticed this while trying to follow http://wiki.ros.org/turtlebot_bringup/Tutorials/TurtleBot%20Bringup, where I couldn't see/find the Deb Installiation Instructions, but the example also doesn't work for me.
ps. sorry for the broken links, answers.ros.org says I need more karma to publish links :(
Originally posted by KevinNickels on ROS Answers with karma: 23 on 2013-10-10
Post score: 1
Original comments
Comment by tfoote on 2013-10-10:
I fixed the links for you.
I've ticketed it here: https://github.com/ros-infrastructure/roswiki/issues/75 | {
"domain": "robotics.stackexchange",
"id": 15821,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
performance, html, mysql, ruby-on-rails
Title: Allowing users to subscribe to categories I am working on a Rails 3 application, and am having some trouble with my user/edit view. In this application, Users can subscribe to Categories. Users and Categories have a has_and_belongs_to_many relationship through a join table (categories_users).
In my user/edit view, I need to display a list of checkboxes for the various categories so the user can edit his subscriptions. I am using the following code to achieve this:
<div id="category-checklist">
<% Category.roots.order('name ASC').each do |category| %>
<ul>
<li class="parent <%= category.name %>">
<%= check_box_tag "user[category_ids][]", category.id, @user.categories.include?(category) %> <span><%= category.name %></span>
</li> | {
"domain": "codereview.stackexchange",
"id": 2154,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, html, mysql, ruby-on-rails",
"url": null
} |
everyday-chemistry, analytical-chemistry
Title: Determining ppm concentrations from food label information for ICP-OES analysis? Overview: I am looking to determine what ppm values of trace metals are present in a particular formula while considering digestion, dilution, and detection limits for ICP-OES. For example, one serving is 15 g of powdered formula which is then dissolved in 150 mL of solution, according to the label. The label reads 15 micrograms of Mn.
Goal: Find concentration of a metal from analysis of 1 g of formula digested and then diluted to 100 mL.
Attempt: 15 micrograms of Mn per 15 g of powdered formula. As that microgram/g is equivalent to ppm (15ug/15g = 1.0 ppm), there should be 1 ppm of Mn per 15 g of dry formula.
Taking 1 g of the formula, digesting it, and diluting to 100 mL: 100mL/1g x (X read) = 1 ug/g (ppm)
The AAS or ICP-OES read value should then be 0.01 ppm. | {
"domain": "chemistry.stackexchange",
"id": 15944,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "everyday-chemistry, analytical-chemistry",
"url": null
} |
thermodynamics, simulations, boundary-conditions, models, randomness
$$ p(v)=(2\pi mk_BT)^{-3/2}\exp\left(-\frac{mv^2}{2k_BT}\right) $$
Note that you can generate Gaussian-distributed random numbers using the Box-Muller transform.
How to initialise the positions?
If the box boundaries are periodic or reflective then they have no effect on the probability distribution, so a uniform distribution would be fine.
Although if your particles interact then you must be careful to avoid overlaps (and you should equilibrate before any ensemble sampling). | {
"domain": "physics.stackexchange",
"id": 38431,
"lm_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, simulations, boundary-conditions, models, randomness",
"url": null
} |
particle-physics
Thanks for any help. The flavor eigenstates for the quarks are defined to be the same as the mass eigenstates. What you're talking about is a basis that diagonalizes the weak interaction matrix. There are many bases you could choose in principle, but the standard one is $u, c, t, d', s', b'$ where the primed particles are related to $d, s, b$ by the CKM matrix. $W\to\bar ub'$ (note the bar) can't happen because the amplitude is proportional to an off-diagonal entry of the diagonal interaction matrix.
Your Feynman diagram is allowed, but it would be disallowed if you replaced either or both of the $b$s by $b'$s. | {
"domain": "physics.stackexchange",
"id": 72176,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics",
"url": null
} |
ros-kinetic, ros-indigo, velodyne
Original comments
Comment by Augusto Luis Ballardini on 2017-04-15:
Hi, I have a VLP-16 in my university lab and I'm currently using the lidar with the standard velodyne_driver ros package (and the calibration yaml file). Since the only difference should be the weight, I suppose it's going to work with the lite version too..
Comment by graziegrazie on 2017-04-24:
I think so, but I want the evidence. VLP-16 and VLP-16-LITE is very expensive. And I want to skip to develop driver for the LITE on ROS. That is why I want to confirm if there is a drive for the LITE or not.
Comment by amburkoff on 2018-07-20:
Have you checked it? Does VLP-16 work in ROS kinetic?
Comment by graziegrazie on 2018-07-20:
Yes, I checked. VLP-16 works well in ROS Kinetic.
Comment by amburkoff on 2018-07-20:
Does VLP-16-LITE work in ROS kinetic? Or does the driver come from the regular version?
Comment by graziegrazie on 2018-07-25:
I have not tried VLP-16 LITE on any distribution. | {
"domain": "robotics.stackexchange",
"id": 27606,
"lm_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, ros-indigo, velodyne",
"url": null
} |
special-relativity, dirac-equation, representation-theory, dirac-matrices
My guess is that these are the smallest possible representation and give spin half fermions as the physical particles, which are common in nature. Would higher dimensional representations give higher spin particles? You have no other choice than to use $4\times 4$ matrices. All these "representations" are different realizations (related by similarity transformations) of the only possible irreducible representation of the Clifford algebra that is spanned by the abstract $\gamma^\mu$. This representation, in a way, is the definition of what a "Dirac spinor" is, and it is usually a representation of the covering group of the rotation group, but only a projective representation of the rotation group itself. Also, it is not always irreducible as a representation of the rotation group (e.g. the 4D Diac spinor decomposes into the two Weyl spinors and also into two Majorana spinors). | {
"domain": "physics.stackexchange",
"id": 31231,
"lm_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, dirac-equation, representation-theory, dirac-matrices",
"url": null
} |
ros, navigation, ros-kinetic, tf2, ur10
Title: xyz position tracking of UR10
Hi all, I am currently working on a UR10 robot that has to do a certain contact operation on parts.
i have the trajectory execution working and it executes the operation almost flawlessly aside from the start and stop of the operation. Therefore i need to be able to get the realtime position of the TCP link of the robot. I have been looking at TF2 but i am not sure if i can use it this purpose as it seems it only publishes the transform matrix. I have also been looking at the ROS navigation stack but it says it is only in 2d and it looks like it is for robots that actually move their entire base in space. I probably need something that does use TF2 but then calculates the position. Thanks in advance
Originally posted by stefvanlierop on ROS Answers with karma: 37 on 2019-08-20
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 33649,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, navigation, ros-kinetic, tf2, ur10",
"url": null
} |
c++, performance, c++11, programming-challenge, combinatorics
We can check that a number is in a mask using bitwise operations(and we add a new number to a mask in the same way), so the total time complexity is O(2^n * n^2).
It is also possible to improve the constant factor by checking only even cur when last is odd (and vice versa) or by precomputing the list of all cur such that cur + last is a prime before running the dynamic programming. | {
"domain": "codereview.stackexchange",
"id": 13366,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, c++11, programming-challenge, combinatorics",
"url": null
} |
thermodynamics, entropy, reversibility
Let there be two bodies, A and B, which are so massive that a transfer of heat between the two does not change their temperatures. For example, the ocean (body A) and atmospheric air (body B). Let the temperature of body A (the ocean) be $T_H$ (higher temperature) and body B (the atmosphere) be $T_L$ (lower temperature). Let there be a transfer of heat $Q$ occur between body A and B. Then the entropy changes are:
Body A
$$\Delta S=\frac{-Q}{T_H}$$
Body B
$$\Delta S=\frac{+Q}{T_L}$$
The total entropy change is
$$\Delta S_{Tot}=\frac{-Q}{T_H}+\frac{+Q}{T_L}$$
You can see that for all $T_{H}>T_{L}$, $\Delta S_{Tot}>0$
The only way for the total entropy change to be zero is if the temperature difference between the two bodies is zero. But then, of course, there would be no heat transfer. Bottom line, all real processes are irreversible. A reversible process is an ideal but not attainable, process.
Hope this helps. | {
"domain": "physics.stackexchange",
"id": 53551,
"lm_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, entropy, reversibility",
"url": null
} |
with gaussian processes. Declare the first derivative of model.x with respect to model.t, Declare the second derivative of model.y with respect to model.t, Note that this DerivativeVar will be indexed by both model.s and model.t, Declare the partial derivative of model.z with respect to model.l, Note that this DerivativeVar will be indexed by both model.t and model.l, Declare the mixed second order partial derivative of model.z with respect, Declare other model components and apply a discretization transformation, Deactivate the differential equations at certain boundary points, Discretize model using Backward Difference method, Add another constraint to discretized model, Add objective function after model has been discretized, Applies the Forward Difference formula of order O(h) for first derivatives, Declaring a Pyomo Suffix to pass the time-varying inputs to the Simulator, Discretize the model using Orthogonal Collocation, Initialize the discretized model using the simulator | {
"domain": "ericlowitt.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9353465080392795,
"lm_q1q2_score": 0.8040834871274012,
"lm_q2_score": 0.8596637505099168,
"openwebmath_perplexity": 1195.4964350677812,
"openwebmath_score": 0.31521889567375183,
"tags": null,
"url": "http://www.ericlowitt.com/site/dynamic-optimization-python-7b0aea"
} |
terminology, elasticity
Think about stress in the same way as pressure. In mechanics of materials, stress or pressure expresses the internal forces between neighboring particles (atoms, molecules, etc.) of materials. The units of stress are the same as pressure.
The diagram below shows a vertically oriented cylinder of cross section area $A$ with a disc of mass $m$ placed on top. The downward force of the disc is $mg$. The axial or normal stress on the cross section area of the cylinder is the result of the disc force being distributed uniformly over the cross section area and equals $F/A=mg/A$.
For any given cross section area within the cylinder material, the stress will be the sum of the weight of the disc plus the weight of cylinder above the cross section, divided by cross sectional area.
Hope this helps. | {
"domain": "physics.stackexchange",
"id": 63908,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "terminology, elasticity",
"url": null
} |
cosmology, fermions
Looking backward in time, to reach an ever-smaller density, all that is required is an ever-larger initial energy. Evolving backward in time is essentially solving for the necessary initial conditions you must assume to posit such a Universe in the first place.
For relativistic particles, this is fine, since the Fermi temperature scales as $L^{-1}$ and the particle temperature will evolve similarly, since it will behave similarly to radiation (since it is relativistic).
Not too different from a radiation-dominated Universe, whose energy densities will also increase rapidly as you shrink the Universe.
Essentially, letting a spring go is different from compressing a spring. In this case, you are just letting a spring go and assuming it was already compressed by initial conditions.
No maximum density necessary. | {
"domain": "physics.stackexchange",
"id": 81971,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, fermions",
"url": null
} |
electromagnetism
along your path from infinity, and when you get to the sphere, the field will drop to zero, and there is no longer a contribution to the potential. Therefore, the potential inside the sphere is the same as the potential on the shell, and is constant everywhere inside. | {
"domain": "physics.stackexchange",
"id": 26807,
"lm_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",
"url": null
} |
general-relativity, cosmology, time
The time between events within a gravitational field in the Schwarzschild metric is
$$ \Delta \tau = \Delta t \left( 1 - \frac{r_s}{r}\right)^{1/2},$$
where $\Delta t$ is the time between events seen by an observer at infinity and $r_s$ is the Schwarzschild radius.
If $\Delta t$ was (for example) the timescale for the universe to double in size, then the proper time for this to occur according to an observer deep within the gravitational field would be smaller.
Such corrections (on a smaller scale) are routinely made between clocks on Earth and on GPS satellites in order for the timing to be accurate. | {
"domain": "physics.stackexchange",
"id": 25653,
"lm_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, cosmology, time",
"url": null
} |
ds.algorithms, graph-algorithms, clustering
We want to compute the similarity graph with significantly less operations.
Is this possible?
If not can we compute an approximation to the graph
which contains all edges in the similarity graph
plus possibly at most $O(1)$ other edges? There may be a way to shoe horn the Johnson-Lindenstrauss theorem into this problem. Essentially, J-L states that you can project high dimensional data into lower dimensional spaces in such a way that the pairwise distances are nearly preserved. More practically, Achlioptas has a paper called Database-friendly random projections: Johnson-Lindenstrauss with binary coins that does this projection in a random way, which works pretty well in practice.
Now, certainly, your similarity function is not exactly the same as something that would fit into the J-L theorem. However, it looks like a distance function and perhaps some of the theory above may help. | {
"domain": "cstheory.stackexchange",
"id": 2815,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ds.algorithms, graph-algorithms, clustering",
"url": null
} |
java, beginner
Simplify your for-loop
In general, a variable used as a counter in a for-loop should be initialized and incremented within that for-loop statement itself. To accomplish this, you would want to remove the int i and the lines that call i++;, and format your for-loop as follows:
for (int i = 0; i < word.length(); i++) {
...
}
However, there is an even better way to express our intent of "loop over all characters in a String". We can format our for-loop into a foreach-loop as follows:
for (char vowel : word) {
...
}
Now, we can remove the line vowel = word.charAt(i), since vowel will now automatically loop over every character in the given word. | {
"domain": "codereview.stackexchange",
"id": 31636,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner",
"url": null
} |
resonance, vibrations
Finally we have the forcing term, which I am writing as the complex oscillation $e^{ist}$ for variable $s$. There is nothing in theory wrong with using real numbers and $\cos(st)$ if you are not comfortable with these yet, but one does have to then do a lot of work with sines and cosines to get the same basic answers and as one becomes more and more of a physicist one gets more and more lazy.
Given this equation, it is clear that a particular solution $x(t) = A e^{is t}$ will work, but only if $A$ is a very particular complex number: $$
A (-s^2) e^{ist} + 2 i \lambda s e^{ist} + \Omega^2 e^{ist} = e^{ist}\\
A = \frac{1}{-s^2 + 2 i \lambda s + \Omega^2}.$$(This is only one solution out of many, but the general solution just adds some terms that exponentially decay to zero due to this loss term $\lambda$ so that this $A e^{is t}$ term is the only long-lived term. Search for “overdamping” to see the details of these decays worked out.) | {
"domain": "physics.stackexchange",
"id": 57284,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "resonance, vibrations",
"url": null
} |
ros, rclcpp
When using the command line tools like ros2 topic echo, the same is done behind the scenes. If I can just get a YAML representation and how to print that, I'd be happy, too.
Originally posted by fredBeauj on ROS Answers with karma: 131 on 2020-11-17
Post score: 5
I just found out that recently (Sep 2020), a to_yaml(msg, ostream) function was added to ROS2 in response to this issue. That means we will just have to wait a bit until that's available in a release. The core function is defined here and has this interface
void to_yaml(const @(message_typename) & msg, std::ostream & out, size_t indentation = 0)
Originally posted by fredBeauj with karma: 131 on 2020-11-17
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 35767,
"lm_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, rclcpp",
"url": null
} |
Many a times in O(n) complexity as there would be a single choice at every point. The greedy choice property should be the following: An optimal solution to a problem can be obtained by making local best choices at each step of the algorithm. It doesn't "reconsider" anything in how it picks vertices (the algorithm technically is selecting greedily the "nearest" vertex from the set of vertices tha. At each iteration the estimate of the signal is improved by updating its support. Example: Making Change (US Coinage). [PSEUDOCODE] [ALGORITHM] Improving Efficiency. In Section 3 the extension of this method to color images is described, followed by the results in Section 4. Greedy Motif Search Input: Integers k and t, followed by a collection of strings Dna. Greedy Algorithms Brute-force Algorithms Def’n: Solves a problem in the most simple, direct, or obvious way Not distinguished by structure or form Pros – Often simple to implement Cons – May do more work than necessary – May be efficient | {
"domain": "puntoopera.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347860767304,
"lm_q1q2_score": 0.8011696831464599,
"lm_q2_score": 0.822189123986562,
"openwebmath_perplexity": 806.7616996057025,
"openwebmath_score": 0.5701478719711304,
"tags": null,
"url": "http://puntoopera.it/rsls/greedy-algorithm-pseudocode.html"
} |
filters, filter-design, finite-impulse-response
Title: Notch filters: why is $H(e^{j0}) = H(e^{j\pi})$ required? I'm studying for the final exams and many example exercises require to design fir notch filters of length 5, given some passband and some stopband frequencies. You've got to find 3 coefficients α0, α1, α2. You need 3 equations.
R(passband ω) = 1
R(stopband ω) = 0 | {
"domain": "dsp.stackexchange",
"id": 7615,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, filter-design, finite-impulse-response",
"url": null
} |
python, programming-challenge, python-3.x, primes
Notice that the last five lines closely match your pseudocode (with the exception of updating the set circular).
[Below is a summary of edits suggested by enedil.]
You use int() unnecessarily here:
for i in range(2, int(ceil(sqrt(n)))):
Because ceil() already returns an integer, wrapping it in int() is redundant.
The following line can be improved to skip multiples of primes that have already been identified:
for j in range(i*2, n, i):
As you have it, j increments through multiples of all integers between i and 2, in addition to the integers we are interested in, those greater than i. As multiples of all integers below i have already been removed from the prime list, they can be skipped in subsequent rounds. So, j should be initiated at i**2, the first composite that has not been seen before. The improved loop looks like this:
for j in range(i**2, n, i): | {
"domain": "codereview.stackexchange",
"id": 24478,
"lm_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, programming-challenge, python-3.x, primes",
"url": null
} |
bash
Title: New svn repository script This is my very first Bash script that does something real. I'm here to learn, so please tell me if and how this can be done better.
#!/bin/sh
# Daniele Brugnara
# October - 2013
if [ -k $1 ]; then
echo "Error! You must pass a repository name!"
exit 1
fi
SVN_PATH="/var/lib/svn"
currPath=$(pwd)
cd $SVN_PATH
svnadmin create $1
chown -R www-data:www-data $1
cd $currPath
echo "Done! Remember to set valid user permission in authz file."
If the first argument to your script contains a space, then you get an error message:
$ ./cr32076.sh "my repository"
./cr32076.sh: line 6: [: my: binary operator expected
To avoid this, put quotes around the variable $1, like this:
if [ -k "$1" ]; then
The man page for [ says:
-k file True if file exists and its sticky bit is set.
is this really what you mean? It seems more likely that you want the -z option:
-z string True if the length of string is zero. | {
"domain": "codereview.stackexchange",
"id": 4636,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bash",
"url": null
} |
c++, optimization, matrix
Title: Templated Matrix class I created a Matrix class. I tested it and it seems to work.
Can someone tell me if this class is good?
Can I improve it?
Can I use more move semantics (where)? What do I have to modify?
Are there some logic/programming errors?
#ifndef MATRIX_H
#define MATRIX_H
#include <iostream>
#include <initializer_list>
#include <stdexcept>
#include <utility>
#include <type_traits>
template <typename T>
class Matrix
{
static_assert(std::is_arithmetic<T>::value,"");
public:
Matrix(size_t, size_t);
Matrix(size_t, size_t, const T&);
Matrix(const Matrix<T>&);
virtual ~Matrix();
void set(const T&);
size_t get_row() const;
size_t get_col() const;
void print(std::ostream&) const; | {
"domain": "codereview.stackexchange",
"id": 2231,
"lm_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++, optimization, matrix",
"url": null
} |
java
By using this code, the user will be able to make inputs until making a valid input. If you don't know about try-catch yet, i suggest reading this explanation.
Logic
I would create a seperate method for the "triangle-validation":
public static boolean isTriangle(int a, int b, int c) {
if (a + b > c && a + c > b && b + c > a) {
return true;
} else {
return false;
}
}
Style
Please consider using more than one space for indentation. My suggestion is two or even four spaces. This improves the legibility.
Final code
import java.util.Scanner;
import java.util.InputMismatchException;
public class Triangle {
public static void main(String[] args) {
int a, b, c;
Scanner in = new Scanner(System.in);
// Prompt for a
a = getUserInput("a");
// Prompt for b
b = getUserInput("b");
// Prompt for c
c = getUserInput("c"); | {
"domain": "codereview.stackexchange",
"id": 38807,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
filters, gabor
The 4 parameters in the param vector respectively controls the radial width, radial location, angular width, and angular location of the filter in the Fourier domain. In other words, the filter's response is a (separable) Gaussian function of the frequency modulus and orientation (that is, the polar coordinates). The parameters #2 and #4 gives the location of this Gaussian while parameters #1 and #3 gives its scale. However, I have no explanation regarding the "magic" values (maybe they were simply obtained by trial & error).
These filters are not Gabor filters since their Fourier transforms are not Gaussian functions of the 2D frequencies. On the figure you showed, Gabor filters would result in ellipsoid curves instead of these drop-shaped curves. I guess the authors made this choice to have a better coverage of the spectral plane. | {
"domain": "dsp.stackexchange",
"id": 3587,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, gabor",
"url": null
} |
ros, navigation, planner, navfn
Which makes me think that they are declared and initialised, but never used. Maybe it is just part of the API and the current global planner implementation does not use it, or may be it is just legacy code that will be removed at some point.
Might be a good idea to open an issue on github
Originally posted by Martin Peris with karma: 5625 on 2014-09-30
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 19566,
"lm_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, planner, navfn",
"url": null
} |
python, beginner, python-3.x, role-playing-game
else:
#Add new item
self._inven[item + nameEdit] = _item
break
else:
print('Item type(?) not available: ' + str(type(_item) ) )
rejects[str(items)] = items
break
else:
rejects[item] = items[item]
#Check if items is a list w/ Item instance that is not a Bag
elif type(items) == list and isinstance(items[1], Item) and not isinstance(items[1],Bag):
#Name editor
nameEdit =''
#Item variable
_item = items[1] | {
"domain": "codereview.stackexchange",
"id": 28639,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-3.x, role-playing-game",
"url": null
} |
python, performance, algorithm, tower-of-hanoi
While this works fine, I was wondering if there's a better solution (more optimal) than what I have so far. Currently with what I have, I can solve 16 disk in 765 moves. if you are just trying to find the minimum number of moves and not necessarily a solution you can use the Frame–Stewart algorithm that you linked to earlier
this builds up a solution to the number of moves to achieve a solution.
def FrameStewart(ndisks,npegs):
if ndisks ==0: #zero disks require zero moves
return 0
if ndisks == 1 and npegs > 1: #if there is only 1 disk it will only take one move
return 1
if npegs == 3:#3 pegs is well defined optimal solution of 2^n-1
return 2**ndisks - 1
if npegs >= 3 and ndisks > 0:
potential_solutions = (2*FrameStewart(kdisks,npegs) + FrameStewart(ndisks-kdisks,npegs-1) for kdisks in range(1,ndisks))
return min(potential_solutions) #the best solution | {
"domain": "codereview.stackexchange",
"id": 6233,
"lm_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, algorithm, tower-of-hanoi",
"url": null
} |
inorganic-chemistry, thermodynamics
344.7 should be $\varepsilon/k$ in K and 3.339 should be $\sigma$ in Angstroms.
! Species: HCL CAS Number: 7647-01-0
! Name: Hydrogen Chloride
! Source: SNLL fit to 1986 JANAF tables, 4/21/89
! H0(298K) = -22.0600 (Kcal/mole), S0(298K) = 44.6500 (cal/mole-K)
HCL 42189CL 1H 1 G 300.000 5000.000 1000.00 1
2.75533500e+00 1.47358100e-03-4.97125400e-07 8.10865800e-11-5.07206300e-15 2
-1.19180600e+04 6.51511600e+00 3.33853400e+00 1.26820700e-03-3.66691700e-06 3
4.70399200e-09-1.83601100e-12-1.21315100e+04 3.19355500e+00 4 | {
"domain": "chemistry.stackexchange",
"id": 268,
"lm_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, thermodynamics",
"url": null
} |
universe, laws-of-physics
Title: Is concept expressed in "Autodidactic Universe" article plausible? As I understood, the authors (Lee Smolin et al) of the "Autodidactic Universe" article suggest that the fundamental laws of nature as time progresses since the Big Bang event (which happened about 13.8 billion years ago) were/(perhaps still are) undergoing the “learning” self change adoptive process that is somewhat similar to the Charles Darwin's life evolution theory.
Is concept expressed in the"Autodidactic Universe" article plausible?
The state of the Universe is governed by a function.
Neural networks approximate functions -- it is what they are designed to do. Period.
Therefore, the Universe is an approximation of some ideal and unattainable function ... wait, what? Why? Why bother? Why do we need an approximation when the real thing will do? There is an acronym -- KISS -- keep it simple, stupid. | {
"domain": "physics.stackexchange",
"id": 79124,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "universe, laws-of-physics",
"url": null
} |
hamiltonian, dimensional-analysis, second-quantization
$$\hat n_\lambda= \hat a_\lambda^\dagger \hat a_\lambda$$
The resolution of the identity for the states $\left| \vec q\right>$ is (due to the $\mathcal{C}$):
$$ I=\int \frac{d^d\vec q}{\mathcal{C}} \left|\vec q\right>\left<\vec q \right|$$
Thus performing a change of basis on $\hat n_\lambda$ we get:
$$\hat n_\lambda=\int \frac{d\vec q d\vec q'}{\mathcal{C}^2}\left<\vec q|\lambda \right>\left<\lambda|\vec q' \right>\hat a_{\vec q}^\dagger \hat a_{\vec q'}$$
Subbing this into (A1) and using that:
$$\sum_{\lambda=0}^\infty \left<\lambda \right| \hat A_{1p} \left|\lambda\right> \; \left| \lambda\right>\left<\lambda\right|=\hat A_{1p}$$
we get:
$$\hat A=\int \frac{d\vec q d\vec q'}{\mathcal{C}^2} \left<\vec q \right| \hat A_{1p} \left| \vec q' \right>\hat a^\dagger (\vec q)\; a(\vec q') $$
which is the generalized form of the equation in the question. | {
"domain": "physics.stackexchange",
"id": 48118,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "hamiltonian, dimensional-analysis, second-quantization",
"url": null
} |
The characterization of perfectly normal spaces in Theorem 5 is hereditary. This means that any subspace of a perfectly normal space is also perfectly normal. In particular, perfectly normal implies hereditarily normal. Thus we have the following theorem.
Theorem 6
Condition 2 in Theorem 5 is hereditary, i.e., if a space satisfies Condition 2, every subspace satisfies Condition 2. Therefore if the space $Y$ is a perfectly normal space, then every subspace of $Y$ is also perfectly normal. In particular, if $Y$ is perfectly normal, then $Y$ is hereditarily normal (i.e. every subspace of $Y$ is normal).
____________________________________________________________________
Normality is hereditary with respect to $F_\sigma$ subsets
Normality is not a hereditary notion. Lemma 1 can used to show that normality is hereditary with respect to $F_\sigma$ subspaces.
Theorem 7
Let $Y$ be a normal space. Then every $F_\sigma$ subspace of $Y$ is normal. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9911526443943918,
"lm_q1q2_score": 0.8033083158230812,
"lm_q2_score": 0.8104789109591831,
"openwebmath_perplexity": 104.48403738152078,
"openwebmath_score": 0.9783799052238464,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/perfectly-normal-space/"
} |
c++, graph, generics
// The class for Graph
template<typename T>
class Graph
{
//Undirected Graph
std::map<T, std::list<T>> adj_list;
public:
Graph(const std::vector<std::pair<T, T>>&);
void add_edge(std::pair<T, T>);
size_t size();
void print_adj_list();
void bfs(T, T);
void dfs(T, T, std::set<T>&, int&);
};
// The graph constructor. Takes in a vector of edges and builds graph.
template<typename T>
Graph<T>::Graph(const std::vector<std::pair<T, T>>& edges)
{
for(size_t i = 0; i < edges.size(); i++)
{
this -> add_edge(edges[i]);
}
}
// Undirected Graph
// Add additional edges specified by pair
template<typename T>
void Graph<T>::add_edge(std::pair<T, T> edge)
{
adj_list[edge.first].push_back(edge.second);
adj_list[edge.second].push_back(edge.first);
} | {
"domain": "codereview.stackexchange",
"id": 31656,
"lm_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++, graph, generics",
"url": null
} |
as to how. Suppose that y= f(x) is a continuous function with a continuous derivative on [a;b]:The arc length Lof f(x) for a x bcan be obtained by integrating the length element. Sign in Remember. Level 2 Arc Length. The length of a curve or line. And the curve is smooth (the derivative is continuous). If you get half the pizza then the arc length is half the circumference of the pizza. EasyCalculation. Calculus analyses things that change, and physics is much concerned with changes. 5 and after integration sin^-1 (x) from -1 to 1. Secant-tangent angles Tangents Using equations of circles Writing equations of circles Arc length and sector area Congruent Triangles Classifying triangles Exterior Angle Theorem Isosceles and equilateral triangles Proving triangles congruent Triangle angle sum Triangles and Congruence Constructions Angle bisector constructions Angle constructions. Hence, we can take, arc M'X = MX = height of the man = 5½ feet = 11/2 feet. Thus, the length of the path is the | {
"domain": "cogoo-epaper.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9907319874400309,
"lm_q1q2_score": 0.8360738701999422,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 366.12298574545065,
"openwebmath_score": 0.8626194000244141,
"tags": null,
"url": "http://jldy.cogoo-epaper.de/arc-length-formula-calculus.html"
} |
means that the right hand statement is true whenever the left hand statement is, which means that an implication is true if either the right statement is true or the left statement is false (or both). This means that if the left statement is false then the implication holds. One also consider any statement on the form$\phi\land\neg\phi$to be false. So with that interpretation we always would have$(\phi\land\neg\phi)\rightarrow\psi$, so if we can from$\neg\psi$prove both$\phi$and$\neg\phi$and thereby$\phi\land\neg\phi$we would have$\neg\phi\rightarrow(\psi\land\neg\psi)\rightarrow\psi$. And of course you have$\psi\rightarrow\psi$. From this follows that$(\psi\lor\neg\psi)\rightarrow\psi$, and we consider$\psi\lor\neg\psi\$ to be true. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534365728416,
"lm_q1q2_score": 0.8135648379880788,
"lm_q2_score": 0.8289388040954683,
"openwebmath_perplexity": 567.1055099581736,
"openwebmath_score": 0.6970574259757996,
"tags": null,
"url": "https://math.stackexchange.com/questions/1667884/are-proofs-by-contradiction-really-logical/1667939"
} |
python, game, python-2.x, rock-paper-scissors
Also, are you aware of __str__? It's a magic method, if you were to change the name of stats to __str__ and returned the values instead of printing them then you could make this table be the string representation of your object. This is how it would need to look:
def __str__(self):
"""Table of all stats"""
return ('\n\n+++++++++++++++++++++-=Stats=-+++++++++++++++++++\n'
'=================================================\n'
'|--{:^11}--|--{:^12}--|--{:^12}--|\n'.format("", "Rounds", "Games")
'|--{:^11}--|--{:^12}--|--{:^12}--|\n'.format("Wins", self.round_wins, self.game_wins)
'|--{:^11}--|--{:^12}--|--{:^12}--|\n'.format("Losses", self.round_losses, self.game_losses)
'|--{:^11}--|--{:^12}--|--{:^12}--|\n'.format("Draws", self.round_draws, "N/A")
'|--{:^11}--|--{:^12}--|--{:^12}--|\n'.format("Played", self.total_rounds, self.total_games)
'\n\n') | {
"domain": "codereview.stackexchange",
"id": 16589,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, game, python-2.x, rock-paper-scissors",
"url": null
} |
quantum-field-theory, renormalization, quantum-interpretations, feynman-diagrams, bohmian-mechanics
I know that Lubos blogged on another occasion that Bohmian mechanics absolutely couldn't deal with fermion fields, because they are based on Grassmann variables and you can't have "Grassmann beables". I don't know if that argument is valid; if it is, maybe you could still get by just with beables for the bosonic fields; but for the sake of completeness, I mention this further claim of his. | {
"domain": "physics.stackexchange",
"id": 30795,
"lm_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, renormalization, quantum-interpretations, feynman-diagrams, bohmian-mechanics",
"url": null
} |
c#
public static IEnumerable<PartitonedIndexRange> GetPartitionsByPartitionCount(int fromInclusive, int toExclusive, int partitionCount)
{
return InternalCreatePartitions(fromInclusive, toExclusive, partitionCount, 0);
}
public static IEnumerable<PartitonedIndexRange> GetPartitionsByRangeSize(int itemCount, int rangeSize)
{
return GetPartitionsByRangeSize(0, itemCount, rangeSize);
}
public static IEnumerable<PartitonedIndexRange> GetPartitionsByRangeSize(int fromInclusive, int toExclusive, int rangeSize)
{
return InternalCreatePartitions(fromInclusive, toExclusive, 0, rangeSize);
}
private static IEnumerable<PartitonedIndexRange> InternalCreatePartitions(int fromInclusive, int toExclusive, int partitionCount, int rangeSize)
{
// here we will put the combined logic of the GetPartitionsByRangeSize && GetPartitionsByPartitionCount
} | {
"domain": "codereview.stackexchange",
"id": 42667,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#",
"url": null
} |
algorithm-analysis, combinatorics, search-algorithms, branch-and-bound
Why do we have to divide by 9(possible locations of the blank space) to get the average branching factor.I'm confused with how the blank space affects the branching factor? The average branching factor is defined as :
On average, how many moves can you do, from a given position.
For some positions (corners 4x), you have 2 moves. For other positions (sides 4x), you have 3 moves. Lastly, for some position (centers 1x), you have 4 moves.
So, a weighted average gives you $$4 \cdot 2 + 4 \cdot 3 + 1 \cdot 4 \over 4 + 4 + 1$$
The blank space affects the branching factor of a given position by limiting the number of moves you can make. | {
"domain": "cs.stackexchange",
"id": 4172,
"lm_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, combinatorics, search-algorithms, branch-and-bound",
"url": null
} |
$$\displaystyle \frac{d}{dx}\left(\sec(x)y \right)=\sec^2(x)$$
Integrating with respect to $x$, we find:
$$\displaystyle \sec(x)y=\tan(x)+C$$
Multiply through by $\cos(x)$ (observing that $$\displaystyle \tan(x)\cos(x)=\frac{\sin(x)}{\cos(x)}\cos(x)=\sin(x)$$):
$$\displaystyle y(x)=\sin(x)+C\cos(x)$$
And this is our general solution.
find_the_fun
Active member
Re: first order linear equation
How do you integrate $$\displaystyle \sec^2(x)$$ to get $$\displaystyle \tan(x)+C$$?
MarkFL
Staff member
Re: first order linear equation
How do you integrate $$\displaystyle \sec^2(x)$$ to get $$\displaystyle \tan(x)+C$$?
This comes from:
$$\displaystyle \frac{d}{dx}\left(\tan(x)+C \right)=\sec^2(x)$$
Ackbach
Indicium Physicus
Staff member
Re: first order linear equation
Find the gernal solution of $$\displaystyle cosx\frac{dy}{dx}+(sinx)y=1$$ | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631647185702,
"lm_q1q2_score": 0.8479406557736063,
"lm_q2_score": 0.8596637487122112,
"openwebmath_perplexity": 288.1536374601115,
"openwebmath_score": 0.9647024869918823,
"tags": null,
"url": "https://mathhelpboards.com/threads/first-order-linear-equation.7188/"
} |
can be arranged in themselves in 4! ways = 24 ways Required number of ways = 720*24 = 17280. Sound Trees - The teacher says a word and the students listen and count the number of phonemes in the word, placing the corresponding number of leaves on the tree. If the letters of the word 'CYCLINDER' are arranged alphabetically, then which letter would be farthest from the first letter of word? 1. Major League Baseball has a seven-year media arrangement worth over $5 billion. 2% more than the actual collections in January 2019, and$35 million or 1. So I rewrote my simulation for this new standard, trying to find keyboards with this few total word matches of colliding type-bar pairs. The Postal Service wants to. Infosys Previous Year Placement Papers for 2021 graduates can be found out on this page. 4 billion in taxes in its most recent fiscal year, and said Microsoft's tax rate was in the middle third of companies in the S&P 500. 29 December, 2007 Countercurrents. For example, for a deck of | {
"domain": "xrayworks.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787857334057,
"lm_q1q2_score": 0.8350964261454992,
"lm_q2_score": 0.8459424353665381,
"openwebmath_perplexity": 1211.2152926140193,
"openwebmath_score": 0.31705012917518616,
"tags": null,
"url": "http://xrayworks.de/find-the-number-of-distinguishable-arrangements-of-the-letters-of-the-word-billion.html"
} |
everyday-chemistry, alcohols, combustion, materials, fuel
of the intermediates. A dehydration reaction to produce ethylene is also possible in very high acid-to-water concentrations of sulfuric acid (possible when filling up in the winter, when it's dry and the gas has more sulfur). Ethylene will form a number of intermediate products with just about anything in that gas tank, some better for your engine than others (ethylbenzene is an antiknock compound; methyl ethyl ketone is a solvent and a pollutant byproduct of combustion engines). | {
"domain": "chemistry.stackexchange",
"id": 8284,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "everyday-chemistry, alcohols, combustion, materials, fuel",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.