text stringlengths 1 1.11k | source dict |
|---|---|
energy, renewable-energy, meteorology, solar-cells
An eclipse of the sun next month could disrupt Europe’s power supplies because so many countries now use solar energy, electricity system operators have warned.
“The risk of incident cannot be completely ruled out,” the European Network Transmission System Operators for Electricity said on Monday, adding the eclipse on March 20 would be “an unprecedented test for Europe’s electricity system”.
[...]
ENTSO-E said the eclipse could play a bigger role in places such as Germany, Europe’s largest economy, which now gets more than a quarter of its electricity from renewable generators and like other EU nations is connected with neighbouring countries’ grid systems.
The organisation also said it had been planning co-ordinated “countermeasures” for several months to help protect the continent’s power system from the eclipse [...] | {
"domain": "physics.stackexchange",
"id": 19949,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "energy, renewable-energy, meteorology, solar-cells",
"url": null
} |
cardiology, sleep, health
Title: Does physical exercise following lack of sleep increase the risk of sudden cardiac death (SCD)? Is there any scientific evidence supporting the hypothesis that physical exercise following lack of sleep increases the risk of sudden cardiac death (SCD)?
The only relevant research I could find is: Reddy PR, Reinier K, Singh T, et al. Physical activity as a trigger of sudden cardiac arrest: The Oregon Sudden Unexpected Death Study. International journal of cardiology 2009;131(3):345-349. doi:10.1016/j.ijcard.2007.10.024. However, it only points out that 5% of the SCD cases in the sample took place during vigorous physical activity, which does not directly answer my question. | {
"domain": "biology.stackexchange",
"id": 3171,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cardiology, sleep, health",
"url": null
} |
machine-learning, natural-language-processing
Now remember how Naive bayes works. We have a boolean random variable $Y$ that indicates the class of an item, and $n$ boolean random variables $X_1,\dots,X_n$ that indicate which features it has. In particular, $X_i=+$ means that the $i$th feature is positive, i.e., that the $i$th subtree $S_i$ is a subtree of the current item. We want to calculate
$$\Pr[Y=+ | X_1=x_1,\dots,X_n=x_n].$$
We do this using Bayes theorem. In particular, we use our training set to calculate
$$\Pr[X_i=x_i | Y=y],$$
for each of the 4 possibilities of $x_i,y$. Then, we use Bayes theorem to compute $\Pr[Y=+ | X_1=x_1,\dots,X_n=x_n]$. | {
"domain": "cs.stackexchange",
"id": 5678,
"lm_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, natural-language-processing",
"url": null
} |
• But how can it have 3 real roots? Because every root will be irrational or integer and I can understand it can not have any integer root. Then how it can have three irrational root when we know that irrational roots will be there in conjugates.?@Robert Z – cmi Jul 20 '18 at 12:47
• @cmi complex roots come in conjugate pairs not real roots (irrationals or rationals) – Robert Z Jul 20 '18 at 13:41
• No if $a + {b^(1/2)}$is a root of the equation with rational coefficients then $a - {b^(1/2)}$ will be it's root as well. – cmi Jul 20 '18 at 15:26
• If $t$ is an irrational real root of such polynomial then it does not follow that $t$ has the form $a+\sqrt{b}$ – Robert Z Jul 20 '18 at 15:35
• Now I am clear. Thank you. – cmi Jul 20 '18 at 15:38
Hint:
If you take the derivative twice, you get $x\mapsto20x^3$, which is negative for $x<0$ and positive for $x>0$. This tells you that $f'$ is decreasing on $\Bbb R_-$ and increasing on $\Bbb R_+$. Therefore $f'$ can vanish at most twice. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9728307700397332,
"lm_q1q2_score": 0.8189538945851992,
"lm_q2_score": 0.8418256492357358,
"openwebmath_perplexity": 158.20965420564832,
"openwebmath_score": 0.8742473721504211,
"tags": null,
"url": "https://math.stackexchange.com/questions/2857562/the-number-of-real-roots-of-x5-5x-2-0"
} |
formal-languages, reference-request, check-my-proof
Title: Quasigroups, congruences and recognizable subsets My question refers to the draft of Mathematical Foundations of Automata Theory, IV.2.1 (pages 89ff in the pdf). I will repeat everything necessary nevertheless:
Let $M,N$ be monoids and $\varphi: M \rightarrow N $ a monoid morphism. We say that a subset $L$ of $M$ is recognizable by $\varphi$ if there is a subset $P$ of $N$ such that $L = \varphi^{-1}(P)$. As is known, the rational languages are precisely the recognizable subsets of $\Sigma^\ast$.
Furthermore, we define an equivalence relation $R_\varphi$ by $u R_\varphi v :\Leftrightarrow \varphi(u)=\varphi(v)$.
This relation is a congruence relation, that is $\forall s,t,u,v \in M:s R_\varphi t \Rightarrow usv~R_\varphi~utv$.
We say that a congruence relation $R$ saturates $L$ if for all $u \in L$, $uRv$ implies $v \in L$.
Then in the above document, the following proposition (IV.2.2, page 90) is stated:
Let $\varphi : M \rightarrow N$ be a monoid morphism and let | {
"domain": "cs.stackexchange",
"id": 1473,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, reference-request, check-my-proof",
"url": null
} |
5) $\neg q$.................................................. .....................................from (1) and (4) and using M.Ponens
6) $p\wedge\neg q$.................................................. ...........................from (1) and (5) and using Conjunction Introduction
7) $\neg(p\wedge q)\Longrightarrow(p\wedge\neg q)$.................................................. .......................from (2) to(6) and using the rule of conditional proof
8) $(p\wedge q)\vee (p\wedge\neg q)$.................................................. ........................from (7) and using material implication $(A\Longrightarrow B)\Longleftrightarrow (\neg A\vee B)$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.988491852291787,
"lm_q1q2_score": 0.8800485829094331,
"lm_q2_score": 0.8902942203004186,
"openwebmath_perplexity": 1357.516068242157,
"openwebmath_score": 0.8503162860870361,
"tags": null,
"url": "http://mathhelpforum.com/discrete-math/125642-how-prove-logical-equivalence-using-theorems-substitution.html"
} |
are only defined up to a multiplicative constant. This will be orthogonal to our other vectors, no matter what value of , … The expression A=UDU T of a symmetric matrix in terms of its eigenvalues and eigenvectors is referred to as the spectral decomposition of A.. And just check that AT = (QT)TΛTQT. The eigendecomposition of a symmetric positive semidefinite (PSD) matrix yields an orthogonal basis of eigenvectors, each of which has a nonnegative eigenvalue. @A.G. proved this just fine already. Theorem 2.2.2. MATH 340: EIGENVECTORS, SYMMETRIC MATRICES, AND ORTHOGONALIZATION Let A be an n n real matrix. they are eigenvectors for $A$. If v is an eigenvector forATand if w is an eigenvector forA, and if the corresponding eigenvalues are dierent, then v and w must be orthogonal. I must remember to take the complex conjugate. If all the eigenvalues of a symmetric matrixAare distinct, the matrixX, which has as its columns the corresponding eigenvectors, has the property thatX0X=I, i.e.,Xis an | {
"domain": "reliableairtulsa.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357561234474,
"lm_q1q2_score": 0.843476714039851,
"lm_q2_score": 0.861538211208597,
"openwebmath_perplexity": 381.93015762875825,
"openwebmath_score": 0.7964757680892944,
"tags": null,
"url": "https://reliableairtulsa.com/0t3u0l/19f33c-eigenvectors-of-symmetric-matrix-are-orthogonal-proof"
} |
-1 an condition number is, so orthogonal matrices are important because have. Matrix are symmetric with respect to the main diagonal explanation of the orthogonal matrix, its Inverse is by... Are unit vectors and P is orthogonal quadratic form with no cross-product term covered... | {
"domain": "atomiclaboratories.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9572778061099869,
"lm_q1q2_score": 0.8038586845301104,
"lm_q2_score": 0.8397339616560072,
"openwebmath_perplexity": 1368.4600311612091,
"openwebmath_score": 0.7969015836715698,
"tags": null,
"url": "http://atomiclaboratories.com/asmodee-gem-dok/837835-orthogonal-symmetric-matrix"
} |
c#, design-patterns, asynchronous, web-scraping
public WebCrawler()
{
client = new HttpClient();
crawlList = new CrawlList();
}
public void Start()
{
crawlList = new CrawlList();
crawlList.AddUrl(SiteUrl);
do
{
if (workers >= MaxWorkers) continue;
if (!crawlList.HasNext()) continue;
Interlocked.Increment(ref workers);
Debug.Write("Workers " + workers);
ProcessUrl(crawlList.GetNext());
} while (crawlList.HasNext() || workers > 0);
}
private async void ProcessUrl(string url)
{
Debug.Print("Processing " + url);
await client.GetAsync(url).ContinueWith(ProcessResponse);
} | {
"domain": "codereview.stackexchange",
"id": 9877,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, design-patterns, asynchronous, web-scraping",
"url": null
} |
quantum-mechanics
1 - i \\
1 - i
\end{pmatrix}$
\end{align}
Hopefully the question is understood clearly. So, is this above calculation correct? Or is there something wrong with it. Here's a slightly different take, if only in formalism. Several Translation Operators can be created as the complex exponential of the conjugate observable operator. For example, the complex exponential of the Hamiltonian divided by $i\hbar$ is the unitary time translation operator. In the case of rotations, construct the angular momentum operator with respect to the desired axis of rotation: Rotations in Quantum Mechanics
As I recall they go into this in some detail in Bransden and Joachain. Griffiths leaves it as an exercise.
$$\hat{D}(\hat{n},\phi)=\exp\left(-i\left(\phi\frac{\hat{n}\cdot\vec{J}}{\hbar}\right)\right)$$ | {
"domain": "physics.stackexchange",
"id": 63069,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics",
"url": null
} |
machine-learning, deep-learning, dataset, data, api
However, a different issue would be to prove that the model was indeed trained on your data.
Yet a further issue would be if such a fact is legal or not for a specific country/legal system; see these questions on the matter to better understand the problems posed by this kind of situations (I am not a lawyer, you should seek professional legal advice for this kind of matter): | {
"domain": "datascience.stackexchange",
"id": 8643,
"lm_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, deep-learning, dataset, data, api",
"url": null
} |
php, pagination
UPDATE
I created this class to add support for db or array/ArrayObject
class Pagination
{
public function __construct($options = [], $mode = 'Default')
{
eval('$this = Pagination::factory($options, $mode);');
}
public static function &factory($options, $mode)
{
$classname = ($mode == 'Default') ? 'Pagination\\Paginator' : 'Pagination\\DbPage' ;
// If the class exists, return a new instance of it.
if (class_exists($classname)) {
$pagination = new $classname($options);
return $pagination;
}
$null = null;
return $null;
}
} | {
"domain": "codereview.stackexchange",
"id": 36431,
"lm_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, pagination",
"url": null
} |
fluid-dynamics, pressure, water, fluid-statics, equilibrium
Title: 2 connected tubes filled with water, placing a stopper in one and raising the other, how can I determine pressure exerted onto the stopper? If I have two 20ml test tubes connected at the base via a thinner flexible U-shape tube and I pour a set amount of water (40ml) into one test tube whilst both are at level height, the water equilibrates so that it is at the same level in each tube. If I then introduce a stopper to meet the surface of the water in one tube and raise the other open tube to a higher level of lets say 2cm, how can I determine the pressure exerted onto the stopper by the water as the system once again tries to reach equilibrium? I'm not sure what equations I need in order to work out everything that is going on in the system. I'm trying to mimic a certain pressure against the stopper but first need to understand what the current pressure is and what factors I am working with in order to change the height of the other tube to gain the pressure I am after. Below is | {
"domain": "physics.stackexchange",
"id": 74788,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, pressure, water, fluid-statics, equilibrium",
"url": null
} |
special-relativity, mass-energy, units, dimensional-analysis, metrology
There's a subtlety that I swept under the rug, which doesn't apply to $E = mc^2$ but does to other equations. When we talk about a "unit system", we don't just mean a set of base units. We often also include an entire set of conventions about how to define physical quantities in the first place. Different conventions can lead to differences in the appearances of the equations themselves.
For example, consider Faraday's law,
$$\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}.$$
I could define an alternative quantity $\tilde{\mathbf{B}} = c \mathbf{B}$. The advantage of this new definition is that $\tilde{\mathbf{B}}$ has the same dimensions as $\mathbf{E}$, which leads to a pleasing symmetry between Faraday's law and Ampere's law in vacuum,
$$\nabla \times \mathbf{E} = - \frac{1}{c} \frac{\partial \tilde{\mathbf{B}}}{\partial t}, \quad \nabla \times \tilde{\mathbf{B}} = \frac{1}{c} \frac{\partial \mathbf{E}}{\partial t}.$$ | {
"domain": "physics.stackexchange",
"id": 76834,
"lm_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, mass-energy, units, dimensional-analysis, metrology",
"url": null
} |
integers. Khan Academy is a 501(c)(3) nonprofit organization. matrix for my answer. The identity matrix for is because . 2. 4. It’s the identity matrix! Top | 1 is the result of multiplying the third row of A Representing a linear system as a matrix. The Identity Matrix. Or should I say square zero. "Matrix Multiplication / The Identity Matrix." (fourdigityear(now.getYear())); Matrix(1I, 3, 3) #Identity matrix of Int type Matrix(1.0I, 3, 3) #Identity matrix of Float64 type Matrix(I, 3, 3) #Identity matrix of Bool type Bogumil has also pointed out in the comments that if you are uncomfortable with implying the type of the output in the first argument of the constructors above, you can also use the (slightly more verbose): Notice, that A and Bare of same order. matrix I (that's the capital letter "eye") In particular, the identity matrix serves as the unit of the ring of all n×n matrices, and as the identity element of the general linear group GL(n) (a group consisting of all | {
"domain": "stampdealersassociationofgeorgia.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731169394882,
"lm_q1q2_score": 0.8257502969922134,
"lm_q2_score": 0.8577681068080749,
"openwebmath_perplexity": 528.1671848794363,
"openwebmath_score": 0.8320501446723938,
"tags": null,
"url": "http://stampdealersassociationofgeorgia.com/gnhbekh/5392c3-identity-matrix-multiplication"
} |
beginner, clojure, lisp
Code:
(defn run-with-reporting [sequence-function-maps stop-time]
(let [beginning-time (java.util.Date.) ;; 1.
seq-counts (map #(count (:sequence %)) sequence-function-maps)
total-sequence-counts (reduce + seq-counts)
prog-rpt-ref (ref {:todo total-sequence-counts, :done 0, :total-time-taken 0})]
(println (str "total counts = " total-sequence-counts))
(doseq [sequence-function-map sequence-function-maps]
(let [sequence (:sequence sequence-function-map),
function (:function sequence-function-map)]
(loop [loop-seq sequence]
(if (and stop-time (clj-time/after? (clj-time/now) stop-time))
(println "stopped at " (clj-time/now) ". Requested stop at " stop-time)
(when loop-seq ;; 2.
(let [item (first loop-seq)
start-time (java.util.Date.)]
(function item)
(let [end-time (java.util.Date.) | {
"domain": "codereview.stackexchange",
"id": 1161,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, clojure, lisp",
"url": null
} |
organic-chemistry, nomenclature, nitriles
Title: Naming a nitrile in the middle of an aliphatic chain What class of compounds does this belong to, if it exists; $$\ce{CH3-CH2-C\equiv N^{+}- CH3}$$
I honestly don't know if it exists; it popped up in my head while I was reading up on nitrile compounds, and I haven't heard of this type of molecule, thus the question.
If it doesn't exist, why not? Compounds like this are named based on the nitrile from which they are derived. So, in your case, the nitrile is propanenitrile:
$$\ce{CH3-CH2-C#N}$$
A protonated nitrile would be called a nitrilium cation, following the general form:
amine --> ammonium
imine --> iminium
nitrile --> nitrilium
Thus, the following cation is named propanenitrilium:
$$\ce{CH3-CH2-C#N^+-H}$$
If we swap that proton with an alkyl group, we can call it an N-alkyl substituent. Thus, your cation is the N-methylpropanenitrilium cation.
$$\ce{CH3-CH2-C#N^+-CH3}$$ | {
"domain": "chemistry.stackexchange",
"id": 15425,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature, nitriles",
"url": null
} |
csv, swift, networking
Please note that running this will actually grab the pages from the website, so please be respectful and don't hammer them! I'll cover just one aspect of your program: How a series of
network requests is handled.
This “polling”
// Busy wait until we get a result
while (!done){
}
is bad because it wastes CPU cycles. In my test it caused almost 100% usage for
one CPU core while a network request is active.
Network requests are asynchronous in nature, and there are better (and less
resource intensive) ways to handle that.
First change the getPage() function to take a callback instead of returning the
result. It is also sufficient to create the URLSession once:
let ephemeralConfiguration = URLSessionConfiguration.ephemeral
let ephemeralSession = URLSession(configuration: ephemeralConfiguration,
delegate: nil, delegateQueue: nil)
func getPage(address: URL, callback: @escaping (_ page: String) -> Void) { | {
"domain": "codereview.stackexchange",
"id": 29412,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "csv, swift, networking",
"url": null
} |
java, array, serialization
Title: Three methods to serialize 7-, 6-, and 3-dimensional int arrays Here's some code I wrote which sends multi-dimensional arrays to a file, is there any way I can make a generic method?
public void sendSevenToFile(int[][][][][][][] seven, String filename) throws IOException {
ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(filename));
outputStream.writeObject(seven);
}
public void sendSixToFile(int[][][][][][] six, String filename) throws IOException {
ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(filename));
outputStream.writeObject(six);
} | {
"domain": "codereview.stackexchange",
"id": 24890,
"lm_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, array, serialization",
"url": null
} |
Question
# Let $$A = \left[ {\matrix{ 1 & 0 \cr 1 & 1 \cr } } \right],$$ and $$I = \left[ {\matrix{ 1 & 0 \cr 0 & 1 \cr } } \right]$$ then prove that $${A^n} = nA - (n - 1)I,n \ge 1.$$
Solution | {
"domain": "byjus.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9875683495127004,
"lm_q1q2_score": 0.8313603591551889,
"lm_q2_score": 0.8418256412990657,
"openwebmath_perplexity": 5305.104612741378,
"openwebmath_score": 0.9564034342765808,
"tags": null,
"url": "https://byjus.com/question-answer/let-a-left-matrix-1-0-cr-1-1-cr-right-and-i-left-matrix/"
} |
search-algorithms, search-trees, balanced-search-trees, binary-search, binary-search-trees
Gilbert–Moore algorithm: Partition the unit interval $[0,1]$ into intervals of length $p_i$, and let $x_i$ be the midpoint of the $i$th interval. We locate $n^*$ by doing binary search on $[0,1]$. For an interval $I \subseteq [0,1]$, denote by $X(I)$ the midpoints $x_i$ which are found in $I$. We first ask whether $n^* \in X([0,1/2])$. Depending on the answer, we ask whether $n^* \in X([0,1/4])$ or whether $n^* \in X([1/2,3/4])$; and so on. Eventually we reach an interval $I$ such that $X(I)$ is a singleton, and we have found $n^*$.
Horibe's algorithm: Find $x$ that minimizes $|\Pr[n^* \leq x] - 1/2|$, and ask whether $n^* \leq x$. Denote by $I$ the values of $n^*$ conforming to the answer. Find $x$ that minimizes $|\Pr[n^* \leq x \mid n^* \in I] - 1/2|$, and ask whether $n^* \leq x$. Update $I$, and repeat until $I$ becomes a singleton. | {
"domain": "cs.stackexchange",
"id": 9019,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "search-algorithms, search-trees, balanced-search-trees, binary-search, binary-search-trees",
"url": null
} |
catkin-make, ros-kinetic
-- Using CATKIN_TEST_RESULTS_DIR: /home/dayo/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.8
-- BUILD_SHARED_LIBS is on
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dayo/catkin_ws/build
####
#### Running command: "make -j2 -l2" in "/home/dayo/catkin_ws/build"
#### | {
"domain": "robotics.stackexchange",
"id": 29988,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "catkin-make, ros-kinetic",
"url": null
} |
cc.complexity-theory, circuit-complexity, upper-bounds
$x \in A$ if and only if $f(x) = 2^{|x|^k}$.
Note that $\sharp AC^0$ is a special form of constant depth arithmetic circuit over $Z$ (only constants 0 and 1 are allowed, and variable inputs can be $x_i$ or $1-x_i$).
Given that, as Boaz points out in his answer, there is a non-trivial depth reduction for arithmetic circuits, this might be something to look into. | {
"domain": "cstheory.stackexchange",
"id": 321,
"lm_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, circuit-complexity, upper-bounds",
"url": null
} |
ros-kinetic
Title: Rviz and Namespaces with explore_lite
Hello! I am attempting to run multiple turtlebot3s on my Ubuntu16.02 using the package explore_lite. My current strategy is to use namespaces to launch individual robots,
after roscore, starting on my ssh turtlebot with ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_1" set_lidar_frame_id:="tb3_1/base_scan" ,
followed by ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping multi_robot_name:=tb3_1.
Problems arise after the following move_base launch command : ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_navigation move_base.launch multi_robot_name:=tb3_1 which throws the error Costmap2DROS transform timeout [...] Could not get robot pose, cancelling reconfiguration | {
"domain": "robotics.stackexchange",
"id": 31288,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-kinetic",
"url": null
} |
From the numerical simulation we can find the closest value in the simulation when $\mathit{h}\left({\mathit{t}}_{\mathit{i}}\right)\approx 0$
i = ceil(double(tHit/dt));
t([i-1 i i+1])
ans = 1×3
3.5500 3.6000 3.6500
plot(t,h,'o')
hold on
fplot(eqn,[0 10])
plot(t([i-1 i i+1 ]),h([i-1 i i+1 ]),'*R')
title('Height over time')
xlim([0 5])
ylim([0 25])
hold off | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668684574637,
"lm_q1q2_score": 0.8154900215073366,
"lm_q2_score": 0.8311430478583168,
"openwebmath_perplexity": 3754.123192397763,
"openwebmath_score": 0.8457438349723816,
"tags": null,
"url": "https://se.mathworks.com/help/symbolic/validate-simulink-model-using-symbolic-math-toolbox.html"
} |
java, optional
There are often, IMO, two big reasons to make a new abstraction.
1) to decrease the mental load on the maintainers of this code or
2) to increase the ability to add new features in the future.
Both of these are, of course, related. My question is, and feel free to comment below, does your if abstraction decrease maintainer mental load through simplicity or brevity and/or does your if abstraction improve the ability to add new features in the future? If not then you need to consider why you are doing it in the first place. | {
"domain": "codereview.stackexchange",
"id": 35082,
"lm_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, optional",
"url": null
} |
mysql, bash, configuration
declare -A mysql=() # mysql script read values from env
have_command() {
type -p "$1" >/dev/null
}
try() {
have_command "$1" && "$@"
}
if_match() {
[[ "$1" =~ $2 ]]
}
validate() {
[[ -z $1 && -z "${config[subdomain]}" ]] && die "--subdomain required"
[[ "${config[webmaster]}" == "root" ]] && die "--webmaster should not be root"
id "${config[webmaster]}" >& /dev/null || die "--webmaster user '${config[webmaster]}' not found"
getent group "${config[webgroup]}" >& /dev/null
[[ $? -ne 0 ]] && die "Group ${config[webgroup]} not exists"
have_command apache2 || die "apache2 not found"
[[ -d ${config[apachesites]} ]] || die "apache2 config folder not found" | {
"domain": "codereview.stackexchange",
"id": 34133,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mysql, bash, configuration",
"url": null
} |
orbit
sun, mercury, venus, earth, moon, mars, jupiter , saturn, uranus = bodies
days_inner = np.arange(2000)
times_inner = ts.utc(2019, 1, days_inner)
months_outer = np.arange(2000)
times_outer = ts.utc(2019, months_outer, 1)
for body in bodies:
body.posn_barycentric_inner = body.obj.at(times_inner).position.km
body.posn_barycentric_outer = body.obj.at(times_outer).position.km
for body in bodies:
body.posn_geocentric_inner = body.posn_barycentric_inner - earth.posn_barycentric_inner
body.posn_geocentric_outer = body.posn_barycentric_outer - earth.posn_barycentric_outer
body.posn_heliocentric_inner = body.posn_barycentric_inner - sun.posn_barycentric_inner
body.posn_heliocentric_outer = body.posn_barycentric_outer - sun.posn_barycentric_outer
print (jupiter.posn_geocentric_inner.shape)
if True:
plt.figure()
lw, fs = 0.7, 12 | {
"domain": "astronomy.stackexchange",
"id": 3597,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbit",
"url": null
} |
ros
Interestingly enough, the roll and pitch drift when the boat is sitting on the table. If I understand correctly, without 'mag updates' and process variance for rate gyros set to 0, the pitch and roll should be only estimated from accelerometers (gravity) - thus I am perplexed why the roll and pitch drift? All other kalman filters I've used converge on the correct value rather than accumulate some bias - as appears to be happening?
Resetting the extended kalman filter produces the correct value for ~10-20 s, until it drifts. Thus, I have programmed by boat to continuously reset the EKF every 10 seconds . . a regretfully hacky solution . . this is likely not how the system was designed to function and produces step changes upon each EKF reset. | {
"domain": "robotics.stackexchange",
"id": 29567,
"lm_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
} |
electronic-configuration, oxidation-state
This same effect explains why the metals in the first row of transition metals do not display as many stable compounds with high oxidation states compared to the second and third rows, as the $3d$ orbitals are much smaller than $4d$ or $5d$ orbitals. | {
"domain": "chemistry.stackexchange",
"id": 813,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electronic-configuration, oxidation-state",
"url": null
} |
investigated and compared with the classic multi-step differential transform method (MsDTM). Consider the complex differential equation,. If there is very large damping, the system does not even oscillate—it slowly moves toward equilibrium. The set up is a damped oscillator governed by a differental equation of the form ay'' + by' +cy =0, where a,b,c are arbitrary constants ( for the case of a mechanical oscillator then a=mass, b= the damping constant and c is the magnitude of the spring constant). Akibat adanya gaya gesek, kecepatan system akan menurun secara proporsional terhadap aksi gaya gesek. Of course, you may not heard anything about 'Differential Equation' in the high school physics. This expansive textbook survival guide covers the following chapters and their solutions. Equation 2. Second Order Linear Differential Equations. To illustrate the applicability and accuracy of the new method, six case studies of the free undamped and forced damped conditions are considered. | {
"domain": "filipdippel.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303440461105,
"lm_q1q2_score": 0.8183044195519519,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 632.6663727050176,
"openwebmath_score": 0.7542253136634827,
"tags": null,
"url": "http://filipdippel.de/damped-harmonic-oscillator-differential-equation.html"
} |
cc.complexity-theory, ds.algorithms, graph-algorithms
These conditions are very easy to check, being simple inequalities among the input parameters, so the existence question can be answered effortlessly. Furthermore, the proof of the theorem is constructive, resolving the construction issue, as well. On the other hand, this result does not appear standard enough, so that you can expect everybody to know about it.
Can you provide further examples in this spirit, where knowing a (not so standard) theorem greatly simplifies a task? Deciding isomorphism of simple groups, given by their multiplication tables. The fact that this can be done in polynomial time follows directly from the fact that all finite simple groups can be generated by at most 2 elements, and currently the only known proof of that fact uses the Classification of Finite Simple Groups (perhaps the largest theorem - in terms of authors, papers, and pages - ever proven). | {
"domain": "cstheory.stackexchange",
"id": 3438,
"lm_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, ds.algorithms, graph-algorithms",
"url": null
} |
quantum-algorithms, complexity-theory
development on the dependency on $\kappa$, bear in mind that it is probably more informative to consider the logarithm of the condition number as the more natural feature of the input. (It is easy to efficiently express matrices with exponentially large condition number.) If we write $\lambda = \log(\kappa)$, suddenly that $\mathrm{poly}(\kappa) = 2^{O(\lambda)}$ dependency seems more important. And there are other ways in which $\lambda$ seems the relevant thing to consider from a complexity-theoretic standpoint fixed-parameter complexity — for instance, if a quantum algorithm could be found with only $\mathrm{poly}(\lambda)$ dependency, it would imply that $\mathsf{BQP = PSPACE}$. If we consider this to be unlikely in the same way that we consider $\mathsf{P = NP}$ to be unlikely, it seems that fixed-parameter tractability in terms of $\lambda$ fits in the same spirit as fixed-parameter tractability of $\mathsf{NP}$-complete problems. | {
"domain": "quantumcomputing.stackexchange",
"id": 76,
"lm_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-algorithms, complexity-theory",
"url": null
} |
simulations, diffusion
Re-calibrate your coefficients for 1D. You would basically start with what you have and tweak $k$ and $d_i$ until your results matched the 3D. This can be an acceptable choice under some limited circumstances, but to be valid you would need to show that your new values of $k$ and $d_i$ reproduced the same physics as the original set. So for instance, change equivalence ratio and you should still match the 3D results without having to tweak your numbers again. This may only work for a narrow range of $\phi$ but if that range is what you are studying then maybe it's fine. On the other hand, if you have to tweak the numbers for every case then that will never be acceptable as a rigorous scientific approach. So proceed with caution in that direction. | {
"domain": "physics.stackexchange",
"id": 18845,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "simulations, diffusion",
"url": null
} |
neural-network, tensorflow, predictive-modeling, preprocessing
test_ds = df_to_dataset(test, shuffle=False, batch_size=batch_size)
Then you can get the predictions like this:
model.predict_proba(x=test_ds)
Take into account that the test-input format should be the same as training-input format, so if you have done any preprocessing (on_hot_encode, standardize, bucketize, etc) to the training dataset, you should do it also to the test dataset
Another way, if your dataset is ready for prediction, you can just transform it to a numpy array:
model.predict_proba(x=test[feature_names].values) | {
"domain": "datascience.stackexchange",
"id": 7589,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, tensorflow, predictive-modeling, preprocessing",
"url": null
} |
estimation, least-squares, parameter-estimation
Binghamton University - Thomas J. Watson College - EECE 522 Estimation Theory.
Steven Kay - Fundamentals of Statistical Signal Processing, Volume I: Estimation Theory. | {
"domain": "dsp.stackexchange",
"id": 11451,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "estimation, least-squares, parameter-estimation",
"url": null
} |
javascript, array, functional-programming
pickRandomItemFrom is not picking an item so don't call it that; it's picking an index of this array; I think "From" is implicit and does not need to be written; if you omit it there would be no other way to interpret what the function does. For whatever reason I stuck with "element" (as in array element) instead of "item" (as in list item) but I think that's more of a personal preference.
If you have a function called pickRandomItem then that it should be made/constructed/returned by something I would call makeRandomItemPicker; it actually does what it says in the name.
Other observations: | {
"domain": "codereview.stackexchange",
"id": 41069,
"lm_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, array, functional-programming",
"url": null
} |
performance, file-system, vba, excel
strCompanyName = arrFilteredAddresses(K, 1)
strPostcode = arrFilteredAddresses(K, 10)
strDay = Left(Right(strFileName, 7), 2)
strMonth = Left(Right(strFileName, 9), 2)
strYear = Left(Right(strFileName, 13), 4)
strFileDate = strDay & "." & strMonth & "." & strYear
'/wsFilteredAddresses.Activate '/ originally introduced to save time by deleting companies from the list as they were found
'/wsFilteredAddresses.Rows(K).Delete '/ taken out as not huge time saving, and means only most recent filing is found | {
"domain": "codereview.stackexchange",
"id": 16717,
"lm_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, file-system, vba, excel",
"url": null
} |
algorithms, computational-geometry, efficiency, numerical-algorithms
All of the interesting bit is in how we determine the next largest value of $x$ where "something interesting" happens. Fortunately, this is easy. For each pair of adjacent active pieces (adjacent in their sorted order), we can find whether they intersect and where, and if it corresponds to a larger value of $x$, add it to a priority queue. Also, for each active piece, we can add its right endpoint (the largest value of $x$ in its domain) to the priority queue. Then finding the next "interesting" value of $x$ amounts to an ExtractMin operation on the priority queue. Also, when you move to the next largest interesting value of $x$, it's easy to update the set of active pieces and maintain them in sorted order. | {
"domain": "cs.stackexchange",
"id": 5802,
"lm_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, computational-geometry, efficiency, numerical-algorithms",
"url": null
} |
cc.complexity-theory, derandomization, average-case-complexity
Title: Fine-grained average-case derandomization Many believe derandomization with polynomial overhead, $\mathsf{P} = \mathsf{BPP}$,
because it follows from $2^{\Omega(n)}$ circuit lower bounds for $\mathsf{E}$ (IW97).
Do we have any evidence for or against even stronger (mildly average-case) derandomization?
In particular, I'm interested in the question $\mathsf{BPTIME}(t) \subseteq \mathsf{ioHeur}_{\mathsf{o}(1)}\mathsf{DTIME}(t \cdot \log(t)^{\Theta(1)})/\log(t)$ for say a quasipolynomial time bound $t$ but any pointers would be helpful.
The question [https://cstheory.stackexchange.com/questions/39227/fine-grained-complexity-of-bpp] is related but unfortunately unanswered.
The closest connection there would be Dmytro's guess that $\mathrm{BPTime}(O(n^a))⊄\mathrm{Time}(O(n^{a+1-ε}))$. There are some recent works on this topic, for example [DMOZ20], [CT21a], and [CT21b]. | {
"domain": "cstheory.stackexchange",
"id": 5628,
"lm_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, derandomization, average-case-complexity",
"url": null
} |
ros, ros2, rclcpp, build
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp)
find_package(autodrive_msgs)
find_package(rosidl_default_generators REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/AccelCommand.msg"
)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# uncomment the line when a copyright and license is not present in all source files
#set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# uncomment the line when this package is not in a git repo
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package() | {
"domain": "robotics.stackexchange",
"id": 36279,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros2, rclcpp, build",
"url": null
} |
and sendable. Favorite Answer. Whether you want to calculate the Area (A), Arc (s), or one of the other properties of a sector including Radius (r) and the Angle formed, then provide two values of input. Learn Science with Notes and NCERT Solutions, Area of combination of figures - two circles, circle and square, Finding Area of rectangle with path outside/inside, Finding Area of rectangle with cross roads. Yes, though it can be expressed more simply. One radian is equal to the angle formed when the arc opposite the angle is equal to the radius of the circle. Terms of Service. We’re looking for the perimeter of this sector. Just replace 360˚ in the formula by 2π radians (note that this is exactly converting degrees to radians). Login to view more pages. The radius of a circle is seven centimeters and the central angle of a sector is 40 degrees. 1. = 44 + 2 (21) Area of a circle is given as π times the square of its radius length. First, we want to just sketch our circle and then label | {
"domain": "ac.id",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.982287698703999,
"lm_q1q2_score": 0.8498989865928189,
"lm_q2_score": 0.8652240964782011,
"openwebmath_perplexity": 498.07981130006914,
"openwebmath_score": 0.9099538922309875,
"tags": null,
"url": "https://ijm.telkomuniversity.ac.id/3vpsk1b/article.php?963f9b=perimeter-of-sector-formula-radians"
} |
as 506 but I am calculating it 600... Or you want to share more information about the same size as Peter 's way from to... Use the Handshaking theorem: let be an undirected graph with e how to find number of edges in a graph Noel Jun '17! ) in an undirected graph or digraph to create an undirected graph, edit close, link code. Theory- Problem-01: a simple graph G ’ if an undirected graph consists of two sets: set of,... Is not in the undirected graph implementation of above idea, edit close, link brightness_4.! An arbitrary graph with e edges, this condition means that there is no way. '14 at 7:50. orezvani write comments if you won n vertices and 20 edges, all! V, to ) and all vertices of given vertex, and can one make from first. Edges do I need in a spanning tree, the number of vertices in the graph is the of. Edges from a complete graph = total number of node pairs in the undirected graph what. Is not in the given graph can contain − TE = number pairs! Jun 25 '17 at 16:53 ( v, to | {
"domain": "beerlak.hu",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9621075733703927,
"lm_q1q2_score": 0.8252651917556326,
"lm_q2_score": 0.8577681068080748,
"openwebmath_perplexity": 432.9119990276175,
"openwebmath_score": 0.4630250632762909,
"tags": null,
"url": "http://beerlak.hu/daddy-community-wxxm/how-to-find-number-of-edges-in-a-graph-fdde7d"
} |
What is a parallel line?
We are learning vectors in class and I have a question about parallel lines and coincident lines. According to wikipedia a parallel line is:
Two lines in a plane that do not intersect or touch at a point are called parallel lines.
But another reference says
Side by side and having the same distance continuously between them.
According to the above definition, you can have two parallel lines with a distance of zero but this contradicts the first definition. So which is it?
EDIT:
If it is the second definition then you can have two lines that are coincident and parallel right?
-
I think one can combine both definitions – SMath Jun 5 '13 at 6:06
I think it is an interesting question what "constant distance" between two lines actually means - it requires some definition of distance, which may not be a primitive concept, while incidence tends to be primitive (properties defined in axioms). – Mark Bennet Aug 16 '13 at 19:55 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9473810511092411,
"lm_q1q2_score": 0.8033485862387316,
"lm_q2_score": 0.8479677583778258,
"openwebmath_perplexity": 810.0564547412071,
"openwebmath_score": 0.7885639071464539,
"tags": null,
"url": "http://math.stackexchange.com/questions/411249/what-is-a-parallel-line"
} |
performance, matlab
the efficient price is given by the price at the previous instant plus a random schocks ( stocks follows a martingale process) . The midquote of the bid-ask prices at time t is equal to mid_quotes(t,:) = mid_quotes(t-1,:)+... delta*(eff_prices(t,:)-mid_quotes(t-1,:)) + ... (1-delta)*sigma_m*shocksWm(t,:); where delta is speed of learning of the market maker. the observed price is equal to the following function
function logp = flatten_eff_prices(p_start,n_min,ndays,mid_quotes,trader_type,buy_trade,sell_trade,zero_trade,nois_trade) | {
"domain": "codereview.stackexchange",
"id": 45071,
"lm_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, matlab",
"url": null
} |
general-relativity, black-holes, singularities
The next step is to calculate the time measured by you and me sitting outside the black hole. This is a bit more involved, but we end up with an expression:
$$ dt = \frac {-(\epsilon + 2M)^{3/2}d\epsilon} {(2M)^{1/2}\epsilon} $$
where $\epsilon$ is the distance from the event horizon i.e. $\epsilon = r - 2M$. Integrating this to find the time to reach the event horizon is a bit messy, but if restrict ourselves to distances very near the event horizon we find:
$$\Delta t \propto ln(\epsilon)$$
but $\epsilon$ is the distance from the event horizon, so it's zero at the event horizon and $ln(0)$ is infinity. That means that the time you and I measure for our astronaut to reach the event horizon, $\Delta t$, is infinity.
And this is why you get the apparently paradoxical result about falling into black holes. The time measured by the person falling in, $\Delta\tau$, is finite but the time measured by people outside the black hole, $\Delta t$, is infinite. | {
"domain": "physics.stackexchange",
"id": 3457,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, black-holes, singularities",
"url": null
} |
concentration
Title: One mole of solute (NaCl) is dissolved in 1 litre water. The molarity of solution is
One mole of solute ($\ce{NaCl}$) is dissolved in $\pu{1 L}$ of water. The molarity of the solution is:
A) $\pu{<1M}$
B) $\pu{>1M}$
C) $\pu{=1M}$
D) $\pu{=2M}$
My answer: It’s a fairly simple question so, I did what anybody would do.
$\mathrm{Molarity}=\frac{\text{No. of moles}}{\text{volume of solution}}$
$\mathrm{Molarity}=1$
That is the obvious answer, and it’s probably right, but the answer given is $\pu{<1M}$. I just wanted to confirm that the answer given is right or wrong. If it is right, why? The answer $<\pu{1M}$ is correct.
Suppose you have $\pu{1L}$ ($\pu{1dm^3}$) of water and then you add your salt. When you add your salt the volume of the solution increases so now you have $\pu{1 mol}$ of $\ce{NaCl}$ in more than $\pu{1L}$ of solution. That means that you can't have a $\pu{1M}$ solution anymore.
If you want a $\pu{1M}$ solution then: | {
"domain": "chemistry.stackexchange",
"id": 12393,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "concentration",
"url": null
} |
nuclear-physics, neutrons
Is there any way for me to easily figure this out for myself?
Many thanks. Fission reaction tend to produce a range of potential daughter nuclei, so the decay path is not just one single pair.
There is a broad literature on fission yields, much of it from the 1950's and 60's (not surprisingly). For example, the 1965 IAEA symposium on Physics and Chemistry of Fission is available on-line at the IAEA. A search on Cs137 finds papers about the fission yields from Pu239 and Th232 presented at that conference. Interestingly, the paper on Ac227 fission does not report measurements of Cs137, but there is no reason to believe that it is not produced (with reasonable yields) given the curves of relative fission yield vs mass number. | {
"domain": "physics.stackexchange",
"id": 24238,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nuclear-physics, neutrons",
"url": null
} |
general-relativity, gravity, experimental-physics, solar-system
Title: Do metric theories with torsion contradict solar system observations? Obviously, the answer to this question can be "maybe, if you make the torsion tensor small enough", but my question is, given some "typical" size to the torsion tensor, do the spin-orbit couplings that cause non-geodesic motion become large enough that they contradict known solar system and high-precision tests of general relativity?
I don't remember seeing this type of thing investigated in the Clifford Will articles on the matter. To quote from Will's book (Theory and Experiment in Gravitational Physics, Rev. Ed., Cambridge, 1993), "[...] in almost all experiments discussed in this book, the observable effects of torsion are negligible".
Will then mentions a counterexample (Ni, Phys. Rev. D 19, 2260 (1979)), but that example is a specific theory in which torsion propagates and couples to the electromagnetic field. | {
"domain": "physics.stackexchange",
"id": 23436,
"lm_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, gravity, experimental-physics, solar-system",
"url": null
} |
beginner, c, homework, playing-cards
typedef enum suit
{
hearts,
diamonds,
spades,
clubs
} suit;
typedef struct playing_card
{
suit suit;
short pip;
} card; | {
"domain": "codereview.stackexchange",
"id": 42390,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, c, homework, playing-cards",
"url": null
} |
neural-networks, game-ai, single-layer-perceptron
A "move" means something you can do in the game, like moving a piece from a2 to a3. You could represent it in your program as {"from": (0,1), "to": (0,2)}. all_valid_moves_for_computer is a function that returns a list of all the moves the computer is allowed to make according to the rules of the game. | {
"domain": "ai.stackexchange",
"id": 3020,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks, game-ai, single-layer-perceptron",
"url": null
} |
react.js, jsx
Would love to hear any feedback. Things I'm not sure about. How far up should I lift the state? Pretty much all my state lives at the highest component which kind of doesn't make sense to me. Imagine if this was a super large app then literally all my state would just sit in the Game Component. I guess that might be where redux comes in? FloodFill memory hog
Using a library should reduce your source code size and create a higher performance app. If this is not the case then you should not be using the library.
Using react to hold the pixel state is beyond ludicrous. Just for a 50 by 50 square you create 2500 elements, and the same number of Javascript objects, and more under the hood, plus all the supporting code to hold and render pixels.
A typical image that you would want to fill is in the 1024 by 1024+ size. Most devices would have a hard time creating 1 million unique elements, and thats a low res image.
The fill algorithm | {
"domain": "codereview.stackexchange",
"id": 32422,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "react.js, jsx",
"url": null
} |
The 2D PE in cylindrical coordinates with imposed rotational symmetry about the z axis maybe obtained by introducing a restricted spatial dependence into the PE in Eq. Finite Volume model in 2D Poisson Equation This page has links to MATLAB code and documentation for the finite volume solution to the two-dimensional Poisson equation where is the scalar field variable, is a volumetric source term, and and are the Cartesian coordinates. the full, 2D vorticity equation, not just the linear approximation. The equation system consists of four points from which two are boundary points with homogeneous Dirichlet boundary conditions. In the case of one-dimensional equations this steady state equation is a second order ordinary differential equation. c -lm -o poisson_2d. on Poisson's equation, with more details and elaboration. LaPlace's and Poisson's Equations. In mathematics, the discrete Poisson equation is the finite difference analog of the Poisson equation. Poisson’s equation can be | {
"domain": "laquintacolonna.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9918120917924487,
"lm_q1q2_score": 0.8085574450136944,
"lm_q2_score": 0.8152324938410783,
"openwebmath_perplexity": 572.7196407654142,
"openwebmath_score": 0.8367288708686829,
"tags": null,
"url": "http://zgea.laquintacolonna.it/2d-poisson-equation.html"
} |
ros, ros-melodic, velodyne
CMake Error at velodyne/velodyne_driver/src/driver/CMakeLists.txt:13 (target_link_libraries):
Attempt to add link library
"/usr/lib/x86_64-linux-gnu/libboost_date_time.so" to target
"driver_nodelet" which is not built in this directory.
CMake Error at velodyne/velodyne_driver/src/driver/CMakeLists.txt:13 (target_link_libraries):
Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_atomic.so"
to target "driver_nodelet" which is not built in this directory.
CMake Error at velodyne/velodyne_driver/src/driver/CMakeLists.txt:13 (target_link_libraries):
Attempt to add link library "/usr/lib/x86_64-linux-gnu/libpthread.so" to
target "driver_nodelet" which is not built in this directory.
CMake Error at velodyne/velodyne_driver/src/driver/CMakeLists.txt:13 (target_link_libraries):
Attempt to add link library
"/usr/lib/x86_64-linux-gnu/libconsole_bridge.so.0.4" to target
"driver_nodelet" which is not built in this directory. | {
"domain": "robotics.stackexchange",
"id": 36564,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, velodyne",
"url": null
} |
javascript, ecmascript-6
const string1 = 'AYUKB17053UI903TBC';
const string2 = 'ABKUY01357IU039BCT';
function sortPieces(str) {
const result = [];
let lastPiece = [];
let lastType;
for (const char of str) {
const nextType = (char >= "0" && char <= "9") ? "number" : "letter";
if (nextType === lastType || !lastType) {
// either same type as previous char or first char in string
lastPiece.push(char);
} else {
// different type of char than previous char, start a new piece
result.push(...lastPiece.sort());
lastPiece = [char];
}
lastType = nextType;
}
result.push(...lastPiece.sort());
return result.join("");
}
let result = sortPieces(string1)
console.log(result === string2, result); | {
"domain": "codereview.stackexchange",
"id": 37524,
"lm_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, ecmascript-6",
"url": null
} |
all trigonometric ratios, trigonometric identities, trigonometric sign rule, quadrant rule and some of the value of the. Find h for the given triangle. The notation may vary…. Solving trigonometric equations requires the same techniques as solving algebraic equations. Muslim scholars studied the ancient civilizations from Greece and Rome to China and India. Today, the use has expanded to involve rotations, orbits, waves, vibrations, etc. Use our trigonometry worksheets to help your students quickly master mathematical modeling, circular and periodic functions, higher-degree polynomials, and more!. Determine how fast the volume of the conical sand is changing when the radius of the base is 3 feet, if the rate of change of the radius is 3 inches per minute. 99 a) Compute the reliability of the system assuming independent failure events for the components. Very helpful tutorials for students to solve mathematical problems under the category of heights and distances…try out now… | {
"domain": "officinariusomarghera.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9883127447581986,
"lm_q1q2_score": 0.8400373512134626,
"lm_q2_score": 0.849971181358171,
"openwebmath_perplexity": 789.9586885075794,
"openwebmath_score": 0.7282557487487793,
"tags": null,
"url": "http://officinariusomarghera.it/trigonometry-quadrant-system.html"
} |
python, hash-map, iteration
This function is called a lot of times in my program.
And this function is slow and it accounts for a large percentage of the overall execution time.
How could I make this faster? I would prefer an implementation that is simple, built-in, type-safe, and explicit (the original implementation is arguably explicit, but not simple or type-safe; and whereas it does use built-ins it doesn't necessarily take advantage of the right ones).
This is faster, but if it isn't fast enough, you'd be in diminishing returns and need to re-evaluate your choice of using Python. Justin Chang's brute-force cache method does technically work and is quite fast, but is also higher-complexity, has less structure, and takes up 32 kB of memory; it's up to you to choose which trade-offs are more important. | {
"domain": "codereview.stackexchange",
"id": 44948,
"lm_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, hash-map, iteration",
"url": null
} |
rnn
The number of timesteps taken depend on the data - not the network. You can use the same network on sequence of length 512, 2 and 2 million. That's why they're commonly used to solve problems with varying length like speech recognition. LSTMs have weights just like a normal neural network does. You can think of these 512 hidden nodes as the size of a hidden layer in the cell. Using two layers of LSTM means using two LSTMs with 512 nodes, and using output of the first as the input of the second one. The output of the second LSTM is the output of 2-layer LSTM. | {
"domain": "datascience.stackexchange",
"id": 8334,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rnn",
"url": null
} |
-
Dear @Bongers : I don't disagree with the observation in the first line, but in almost all sources, prime numbers are defined to be nonzero, and I think that kind of trumps anything you might say about divisors. I'm not suggesting you need to change anything: I just wanted to bring this to future readers' attention. Regards! – rschwieb Oct 25 '13 at 12:46
@rschwieb I find the definition of prime numbers to be non-zero an exceptionally boring reason as to why zero is not a prime number. It implies that "zero is not a prime number because someone defined it that way", which isn't true. Zero is not a prime number because it has more than two divisors, and this allows people define it out. – user1729 Oct 28 '13 at 20:19 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9399133464597458,
"lm_q1q2_score": 0.8278729379372719,
"lm_q2_score": 0.8807970873650401,
"openwebmath_perplexity": 488.4553305508332,
"openwebmath_score": 0.8583123087882996,
"tags": null,
"url": "http://math.stackexchange.com/questions/539174/is-zero-a-prime-number/539536"
} |
machine-learning, python, classification, scikit-learn, churn
Each row represents a single contract, and each contract is only represented once in the data. There are 350k "Not Cancelled" and 50k "Cancelled" cases.
Features are all extracted as at a specific date for each contract. This date is referred to as the "Effective Date". For "Cancelled" contracts, the "Effective Date" is the date of cancellation. For "Not Cancelled" contracts, the "Effective Date" is a date say 6 months ago. This will be explained in a moment.
2) "Live Dataset"
Contains 300k contracts (rows) with the same list of 300 features. All these contracts are "Not Cancelled" of course, as we want to predict which of them will cancel. These contracts were followed for a period of 2 months, and I then added a Label to this data to indicate whether it actually ended up cancelling in those two months: 0 = "Not Cancelled", 1 = "Cancelled"
The problem: | {
"domain": "datascience.stackexchange",
"id": 4708,
"lm_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, classification, scikit-learn, churn",
"url": null
} |
rosdep
i try to ignore that and go next step catkin_make and it is successful
i run this step:rosdep install --from-paths src -i -y in ~/kobuki,it failed again
ERROR: the following rosdeps failed to install
apt: command [sudo -H apt-get install -y ros-indigo-ar-track-alvar] failed
apt: Failed to detect successful installation of [ros-indigo-ar-track-alvar] | {
"domain": "robotics.stackexchange",
"id": 23088,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosdep",
"url": null
} |
quantum-mechanics, renormalization, history
In 1951 quantum electrodynamics was well established, and I think renormalisation was understood by then, but quantum chromodynamics would not be formulated for another decade. The world of the hadrons seemed a bewildering zoo of particles with little obvious structure. That meant there was no theory to describe what happened at energies above a GeV or so.
Exactly what Bohm meant by saying that an entirely new theory may be required only he knew and the secret died with him. However it is possible that he meant S matrix theory. In the 1960s various apparently intractable problems with applying quantum field theory to hadrons resulted in S matrix theory becoming a popular competitor to quantum field theory. With the later discovery of quarks, and in particular asymptotic freedom, QFT regained a lead that it has held ever since. However there was a period when many physicists believed that QFT would fail and S matrix theory would take over. | {
"domain": "physics.stackexchange",
"id": 87359,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, renormalization, history",
"url": null
} |
c++, c++11, image, opengl, fractals
void make_current() {
glfwMakeContextCurrent(screen);
}
virtual void flush() override;
};
#endif //MANDELBROT_FRACTAL_DRAWER_DRAW_BUFFER_H
Draw_Buffer.cpp
#include "Draw_Buffer.h"
#include "Buffer_Base.h"
#include <memory>
#include <algorithm>
#include <stdexcept>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <iostream>
// Util function to compile a shader from source
void Draw_Buffer::compile_shader(GLuint &shader, const std::string &src) {
std::ifstream is(src);
std::string code;
std::string temp_str;
while (std::getline(is, temp_str)) {
code += temp_str + '\n';
}
const char *c_code = code.c_str();
glShaderSource(shader, 1, &c_code, NULL);
glCompileShader(shader);
} | {
"domain": "codereview.stackexchange",
"id": 25152,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, image, opengl, fractals",
"url": null
} |
c#, winforms
// C# 8 syntax; for earlier versions use 'if (found != null) {
if (found is {}) {
found.BringToFront();
if (found.WindowState == FormWindowState.Minimized) {
found.WindowState = FormWindowState.Normal;
}
}
return found;
}
Then, for example in addNewDocument_Click, you could write:
var found = findForm("New Document");
if (found is null) {
var newDoc = new AddNewDocument(this);
newDoc.Show();
}
Consider putting the SQL statement in a separate const. This makes it easier to see what's going on at the start of your using block.
Since you're not using the inner dataSet variable, you can remove the innermost using.
I would also suggest making use of the new using statement in C# 8 if you can:
using var conn = new MySqlConnection(ConnectionString.ConnString);
using var mySqlDataAdapter = new MySqlDataAdapter(sql, conn);
DataSet DS = new DataSet();
mySqlDataAdapter.Fill(DS);
... | {
"domain": "codereview.stackexchange",
"id": 38495,
"lm_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",
"url": null
} |
quantum-mechanics, quantum-field-theory, weak-interaction, electroweak
Title: Can't the weak force be explained purely by electrostatics? Again, super naive, but my basic question is: isn't the force of attraction between electrons and protons sufficient to explain their confinement to atomic orbitals. I know the W and Z particles have been discovered and I know about the electroweak interaction, but what exactly do the W and Z bosons do? I mean, there must be a significant amount of positive vs negative charge between electrons and protons anyway and, as far as I'm aware atoms with one neutron are unstable. So the question is, why the W and Z bosons, what's their purpose? Weak force is not required to keep electrons confined in atomic orbitals. For that, electromagnetism is sufficient. | {
"domain": "physics.stackexchange",
"id": 39521,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, weak-interaction, electroweak",
"url": null
} |
inorganic-chemistry, coordination-compounds
Using Ligand Field theory and MO diagrams is probably a better way to understand how the orbitals overlap and where electrons are in the final structure. This diagram is for $\ce{[Ni(H2O)6]^2+}$, but the diagram will look very similar for the $\ce{V}$ complex, just with fewer electrons. (Image source: dx.doi.org/10.1021/jp4100813 | J. Phys. Chem. B 2013, 117, 16512−16521) | {
"domain": "chemistry.stackexchange",
"id": 7764,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, coordination-compounds",
"url": null
} |
Last edited:
#### Fantini
MHB Math Helper
Okay. Thank you!
Edit: Why does it not prove that $\sigma (\alpha) = \alpha$? Since $\sigma$ is surjective we have that there is some $k \in K$ such that $\sigma (k) = \alpha$. Suppose $k \in \mathbb{Q}$. We already showed that $\sigma (k) = k$ for that case, but $\alpha \notin \mathbb{Q}$, therefore it can't be rational. If it can't be rational, the only possibility, since $\sigma$ is injective, is that $\sigma (\alpha) = \alpha$.
In other words, I don't mind being wrong. Mistakes is where I learn most. But I need know WHERE exactly I am going wrong. What is the problem with my reasoning? Am I using faulty assumptions? Is doing $(a+b \alpha + c \alpha^2)^3$ the only way? Thanks.
Last edited:
#### Deveno
##### Well-known member
MHB Math Scholar
all we are given to go on for $\alpha$ is that:
$\alpha^3 = 2$ and $\alpha \in \Bbb R$
since $\sigma$ fixes $\Bbb Q$ taking $\sigma$ of both sides gives:
$(\sigma(\alpha))^3 = 2$ | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9433475715065793,
"lm_q1q2_score": 0.8127299843343267,
"lm_q2_score": 0.8615382165412808,
"openwebmath_perplexity": 178.1052126639129,
"openwebmath_score": 0.9436347484588623,
"tags": null,
"url": "https://mathhelpboards.com/threads/field-isomorphism.2690/"
} |
python, python-2.x, api, tkinter, cryptocurrency
self.client = Client(api_key, api_secret)
status = self.client.get_system_status()
self.populate_portfolio()
self.start_websockets()
def start_websockets(self):
""" Start websockets to get price updates for all coins in the portfolio, trade execution reports, and user account balance updates. Start the message queue processor. """
self.bm = BinanceSocketManager(self.client)
self.bm.start()
trade_currency = self.trade_currency
symbols = self.coins['symbol'].tolist()
symbols.remove(trade_currency+trade_currency)
self.sockets = {}
for symbol in symbols:
self.sockets[symbol] = self.bm.start_symbol_ticker_socket(symbol, self.queue_msg)
self.sockets['user'] = self.bm.start_user_socket(self.queue_msg)
self.parent.after(10, self.process_queue) | {
"domain": "codereview.stackexchange",
"id": 30849,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-2.x, api, tkinter, cryptocurrency",
"url": null
} |
Now there is also a related theorem in the book: Compactness is equivalent to the finite intersection property.
Sounds to me countable compactness and compactness are pretty much the same.
I am not asking for a solution to the exercise. My question is this:
What is the difference between Compactness and Countable Compactness in terms of closed Collections? Both things sound to me like this: Given a collection of closed sets, when a finite number of them has a nonempty intersection, all of them have a nonempty intersection.
BTW: the definitions, the theorems and the exercise are from Topology by Hocking/Young.
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540707672648,
"lm_q1q2_score": 0.8074401437895155,
"lm_q2_score": 0.8244619263765707,
"openwebmath_perplexity": 104.05261785208384,
"openwebmath_score": 0.8457050323486328,
"tags": null,
"url": "http://math.stackexchange.com/questions/160876/countably-compact-vs-compact-vs-finite-intersection-property"
} |
image-processing, ifft
The important information in images tends to edges -- edges contain most detail in the image. This information is carried in the phase information -- when decomposed into sinusoidal signals, a square wave can have arbitrary location only if the waves contain phase information.
Additionally, real world images tend to look roughly the same in the frequency spectrum when only plotting magnitude. These images tend to have a large (in magnitude) low frequency components with (much) smaller high frequency components. It's reasonable to say that a significant portion of the entropy (or information) is carried in the phase information.
With a naïve inverse Fourier transform on the values obtained from the image, it is not possible (at least by experiment) to recover the original signal. However, the phase only inverse Fourier transform (where we divide by the magnitude to only preserve the phase). | {
"domain": "dsp.stackexchange",
"id": 4087,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, ifft",
"url": null
} |
moveit
Originally posted by lehem_d on ROS Answers with karma: 3 on 2021-06-08
Post score: 0
Hello,
Just try to install this package and check everything is working or not.
sudo apt-get install ros-noetic-robot-state-publisher
Originally posted by Ranjit Kathiriya with karma: 1622 on 2021-06-09
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 36503,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "moveit",
"url": null
} |
quantum-mechanics, wavefunction, schroedinger-equation, potential, parity
EDIT
Hi, all. So I've figured out my original question. With the hints given, I was able to to make some significant progress. Now I'm faced with solving the discontinuous derivative at $\pm a$.
I've found that:
$$ \psi (x) = \begin{cases} Be^{kx} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (x<-a) \\ C(e^{-kx} + e^{kx}) \ \ (-a<x<a) \\ Be^{-kx} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (x>a) \end{cases} $$
When applying the continuity conditions, I found that
$$ \psi_{-}(a) = \psi_{+}(a) = Be^{-ka}=C(e^{-ka} +e^{ka}) \\ \Rightarrow B=C[1+e^{2ka}] $$
I've been trying to figure out the derivative, but I'm unsure of how to approach this. If I could ask for the following hint, I think I can work the rest out.
Why does the discontinuity of $d\psi/dx$ at $x=a$ imply the following?
$$ -kBe^{-ka} - C(ke^{ka}-ke^{-ka}) = -\frac{2m\alpha}{\hbar ^2}Be^{-ka} $$ Your approach is correct, and you can use the parity argument once you have all the pieces of your wavefunctions, as you do. | {
"domain": "physics.stackexchange",
"id": 43397,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, wavefunction, schroedinger-equation, potential, parity",
"url": null
} |
the-sun
2460159.500000000, A.D. 2023-Aug-03 00:00:00.0000, 7.340284302854846E-02, 3.572496770205199E+05, 5.016123674133671E+00, 2.788500405977741E+01, 2.869024014201097E+02, 2.460158658978031E+06, 1.520284336503910E-04, 1.104703942319290E+01, 1.281728923915146E+01, 3.855501544901964E+05, 4.138506319598729E+05, 2.367978090387134E+06,
2460160.500000000, A.D. 2023-Aug-04 00:00:00.0000, 7.162883937549905E-02, 3.569891829431704E+05, 5.024686604357866E+00, 2.775623512602453E+01, 2.850820375305457E+02, 2.460158530548510E+06, 1.526321490973527E-04, 2.597197940124664E+01, 2.987693813420488E+01, 3.845328227376530E+05, 4.120764625321357E+05, 2.358611879142072E+06, | {
"domain": "astronomy.stackexchange",
"id": 6993,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "the-sun",
"url": null
} |
ros
Title: how to use so file in ros
Hello, I want to use a .so file in the ros. And I add the .h and .so file in the /usr/include/
What else should I do? Thanks very much! | {
"domain": "robotics.stackexchange",
"id": 19026,
"lm_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
} |
ros
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/Num.msg"
"srv/AddThreeInts.srv"
)
ament_package()
find_package(rosidl_default_generators REQUIRED)
I have this package.xml:
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>tutorial_interfaces</name>
<version>0.0.0</version>
<description>Description</description>
<maintainer email="email@gmail.com">My Name</maintainer>
<license>Apache License 2.0</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<build_depend>rosidl_default_generators</build_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Other information: | {
"domain": "robotics.stackexchange",
"id": 37759,
"lm_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
} |
soft-question, advice-request
The idea is that, instead of having an algorithm along with a proof of correctness, you start with a type that describes the properties of a solution. Then you simply write a program of that type, and you are guaranteed that it is correct.
Does this mean that you get correctness for free? Certainly not. But now the "why" at each stage is clear. The presentation of the algorithm and the explanation are one and the same. The notion of of correctness is formalized, and baked into the language itself.
For intros on this, see: | {
"domain": "cstheory.stackexchange",
"id": 5018,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "soft-question, advice-request",
"url": null
} |
electromagnetic-radiation, material-science, frequency, absorption
$$A_x = A_0 e^{jkx}$$
where $k$ is a complex number, $k = k_0(1+\alpha j)$. Now you can expand that, and you get
$$A_x = A_0 e^{jk_0 x}e^{-k_0\alpha x}$$
You can see there is now a decay term that depends on both the thickness of the sample, and the wave number ($k=\frac{2\pi}{\lambda}$). From which it follows that EM radiation with a longer wavelength (lower wavenunber) will be less absorbed in material of a given thickness, even when the loss tangent is the same. | {
"domain": "physics.stackexchange",
"id": 32181,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-radiation, material-science, frequency, absorption",
"url": null
} |
python, matrix, numpy
range_inc = lambda start, end: range(start, end+1)
# Find the zero crossing in the l_o_g image
# Done in the most naive way possible
def z_c_test(l_o_g_image):
print(l_o_g_image)
z_c_image = np.zeros(l_o_g_image.shape)
for i in range(1, l_o_g_image.shape[0] - 1):
for j in range(1, l_o_g_image.shape[1] - 1):
neg_count = 0
pos_count = 0
for a in range_inc(-1, 1):
for b in range_inc(-1, 1):
if a != 0 and b != 0:
print("a ", a, " b ", b)
if l_o_g_image[i + a, j + b] < 0:
neg_count += 1
print("neg")
elif l_o_g_image[i + a, j + b] > 0:
pos_count += 1
print("pos")
else:
print("zero") | {
"domain": "codereview.stackexchange",
"id": 10212,
"lm_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, matrix, numpy",
"url": null
} |
Now, we wish to write this series of numbers each being the sum of a series. We can rearrange the double sum because the components are non-negative (a fact from elementary calculus).
$$\sum_{n=1}^{\infty}\sum_{k=1}^{\infty}l(I_k^n) < \sum_{n=1}^{\infty}\frac{\epsilon}{2^n} = \epsilon$$
which completes the proof.
Thus any countable set is null, and null sets appear to be closely related to countable sets - this is no surprise as any proper interval is uncountable, so any countable subset is quite sparse when compared with an interval, hence makes no real contribution to its length. (You may have also noticed the similarity between step 2 in the above proof and the diagonal argument which is used to show that $\mathbf{Q}$ is a countable set).
However, uncountable sets can be null, provided their points are sufficiently sparsely distributed as the following famous example, due to Cantor, shows: | {
"domain": "github.io",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9928785720971596,
"lm_q1q2_score": 0.8047071370103323,
"lm_q2_score": 0.8104789040926008,
"openwebmath_perplexity": 178.13072689772082,
"openwebmath_score": 0.9929477572441101,
"tags": null,
"url": "https://quantophile.github.io/mathsummaries/posts/null_sets/"
} |
•,,
y
,
,, ,, ,, ,, ,
(-3,:2)
._--------- ------.--,
_r -4y! +6x+16y -23 - 0
------------ -. .r'
--------,c----+'--~,,---------- .
FIGURE 8.26
Since A is a symmetric matrix. we know from Section 7.3 that it can be diagonalized by an orthogonal matrix P. Thus
where Al and A2 are the eigenvalues of A and the columns of P are Xl and X2, orthononnal eigenvectors of A associated with Al and A2, respectively. Letting X = Py .
where
y=
[>l
we can rewrite Equation (5) as ( py )T A ( Py) + B(Py) T yT(p AP)y + B (P y)
[ X'
[A' A20] [X'] )" +
y' ] o
+f +J
~0
= 0
B (P y)
+f
= 0
(6)
(7) | {
"domain": "silo.pub",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.97737080326267,
"lm_q1q2_score": 0.8080039639783043,
"lm_q2_score": 0.8267117876664789,
"openwebmath_perplexity": 4465.94787859596,
"openwebmath_score": 0.8407867550849915,
"tags": null,
"url": "https://silo.pub/elementary-linear-algebra-with-applications-9th-edition.html"
} |
Calculating “percentage” of overlap between two rectangles
I have a program that, among many other things, checks to see if a Rectangle is at all overlapping with another rectangle - meaning, if any of the points of one rectangle is inside another given rectangle, they are overlapping. A rectangle is defined by its top-left point and its bottom-right point - I think this is more commonly known as a "bounding box". Here is the code I have for checking this:
def overlaps(self, other):
"""
Return true if a box overlaps with this box.
A Box class has 8:
self.left left side
self.top "top" side
self.right right side
self.bottom bottom side
self.lt left-top point
self.rb right-bottom point
self.rt = right-top point
self.lb left-bottom point | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.977022627413796,
"lm_q1q2_score": 0.8162863125773124,
"lm_q2_score": 0.8354835289107309,
"openwebmath_perplexity": 568.4522202051955,
"openwebmath_score": 0.7552639245986938,
"tags": null,
"url": "https://math.stackexchange.com/questions/2449221/calculating-percentage-of-overlap-between-two-rectangles/2449249"
} |
r, visualization
For each sample I am checking, is there any way to show that with all the samples together, any suggestion or help would be highly appreciated. Assuming da is a data-frame with the cluster as factor you can do the following:
ggplot(da) +
geom_boxplot(aes(cluster, H4)) +
xlab("Cluster") +
ylab("Genes") +
ggtitle("Genes by Cluster") | {
"domain": "bioinformatics.stackexchange",
"id": 709,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "r, visualization",
"url": null
} |
python, optimization, beginner, game
Title: Help with refactoring my Tic Tac Toe game I'm very new to coding and have been diving into the skill with Python as my first language. One of the first programs I wrote for a class was this Tic Tac Toe game. I re-wrote this game using classes and have just recently refactored it looking for different smells. The person who's been teaching the class suggested that I post it here for additional help optimizing it. Any help or suggestions for improvement is much appreciated! Is there anything that smells funky to you?
#Written in Python 3.3.0, adapted for Python 2.7.3
#Tic Tac Toe Part 2
class Board(object):
"""Represents tic tac toe board"""
def __init__(self):
self.move_names = '012345678'
self.Free_move = ' '
self.Player_X = 'x'
self.Player_O = 'o'
self.moves = [self.Free_move]*9 | {
"domain": "codereview.stackexchange",
"id": 3579,
"lm_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, optimization, beginner, game",
"url": null
} |
organic-chemistry, nomenclature
Title: Nomenclature for 5-Methylhepta-1,3,6-triene I was practicing writing nomenclatures for several organic compounds with the help of Blue Book Essentials and I have some queries regarding the following structure:
According to the blue book, the numbering of parent chain is as follows:
Lowest locants for heteroatoms
Lowest locant(s) for indicated hydrogen
Lowest locant(s) for principal characteristic group(s)
Lowest locants for ‘ene’, ‘yne’, and hydro prefixes
Lowest locants as a set for all substituents cited by prefixes
Lowest locants for substituents in the order of citation. | {
"domain": "chemistry.stackexchange",
"id": 17985,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature",
"url": null
} |
quantum-mechanics, hilbert-space
Title: Do the energy eigenstates still form a basis in Hilbert spaces where different states do not correspond to differing energies? I'm new to quantum so apologies if this question doesn't make any sense:
Consider a Hilbert space of states corresponding to different positions along the x axis. If there is no associated potential function with position, the energy states will not span the Hilbert space as there is nothing to distinguish the energy of a particle for different positions. Given that the Schrodinger equation is derived under the assumption that the energy eigenstates form a basis, does that mean that it will not be applicable in this scenario? The energy eigenstates always form a basis, even when the potential is $V(x)=0$ everywhere. In this case, if the object of interest is a point particle, the Hamiltonian will be of the form
\begin{equation}
\hat{H} = \frac{1}{2m}\hat{P}^2 + V(\hat{x}) = \frac{1}{2m}\hat{P}^2.
\end{equation} | {
"domain": "physics.stackexchange",
"id": 95027,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, hilbert-space",
"url": null
} |
The Summer Reading Challenge website helps you keep track of your reading all year round: find new books to read, take part in competitions and mini challenges, and play games. 6 "Example 1" and Note 3. Write your answer in the space provided or on a separate sheet of paper. siewlehkoh 3 months ago report. A score of 9 or more? 2 3 5 7 11 1 2 4 3 Alex is playing a game. asked • 07/03/19 Two dice are rolled one after another. What is Sample Space? The Sample Space of an statistical experiment is the set of all possible outcomes and is generally represented by an alphabet S. We have illustrated three representations of the sample space of possible rolls of two dice. CSS1 is a simple style sheet mechanism that allows authors and readers to attach style (e. Provide other examples of an experiment, and ask students to list the possible outcomes in the sample space: Flipping a coin The possible outcomes are heads and tails. Event E: A subset of the sample space. Browse by topic: probability | {
"domain": "arcivasto.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137889851291,
"lm_q1q2_score": 0.818336245329326,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 457.6458790605359,
"openwebmath_score": 0.5200204253196716,
"tags": null,
"url": "http://arcivasto.it/vhml/sample-space-of-3-dice.html"
} |
irrational number: Assume that √2 is a rational number, meaning that there exists a pair of integers whose ratio is √2. 2 More methods of proof (continued): Biconditional statements, Existence proofs (constructive and non-constructive). p= -mln, where -m and n are both integers and n ± 0 4. The correct proof is this: Let assume that the product of two odd numbers, m and n, is an even number N: N = m*n. Since n is odd, n = 2k + 1 for some integer k. Assume $$n$$ is a multiple of 3. Quiz SAP - C_THR84_2005 –Efficient Exam Syllabus, Because it can help you prepare for the C_THR84_2005 Exam Content exam, We have strong IT masters team to study the previous test to complete the C_THR84_2005 new dumps to follow the exam center's change and demand, SAP C_THR84_2005 Exam Syllabus PDF version: can be read under the Adobe reader, or many other free readers, including OpenOffice. The negative of an integer is. Typo: The hypothesis that r is not equal to 0 in the Example is not necessary (I was | {
"domain": "chicweek.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713887451681,
"lm_q1q2_score": 0.8506750575164101,
"lm_q2_score": 0.863391617003942,
"openwebmath_perplexity": 395.13846022461126,
"openwebmath_score": 0.7791018486022949,
"tags": null,
"url": "http://bgvl.chicweek.it/proof-by-contradiction-examples-and-solutions.html"
} |
of opposite angles are congruent. This makes two pairs of adjacent, congruent sides. It looks like the kites you see flying up in the sky. A line of symmetry for any polygon can be found by reflecting the polygon over a line so that the polygon or figure is divided into two halves that are mirror-images. The properties of the kite are as follows: Two disjoint pairs of consecutive sides are congruent by … none are parallel. wich quadrilateral does not have two pairs of parallel sides a- trapezoid b- rectengle c- rhombus d- square my geomotry problem i need an answere asap From the above discussion we come to know about the following properties of a kite: 1. long bisects short. The trapezium is also known as a trapezoid. WIN #9$100,000.00; WIN #7 $100,000.00; EIN #5$750,000.00 GWY. Kite . Copyright © 2020 Multiply Media, LLC. In an isosceles parallelogram, we have. But they have different properties. diamond- shaped ones do. https://www.answers.com/Q/Does_a_kite_have_any_parallel_sides | {
"domain": "xixonspanishrestaurant.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806540875628,
"lm_q1q2_score": 0.8171419686203154,
"lm_q2_score": 0.8333245870332531,
"openwebmath_perplexity": 920.5362119043538,
"openwebmath_score": 0.45532315969467163,
"tags": null,
"url": "http://www.xixonspanishrestaurant.com/kenny-everett-nbxie/9aa7c4-does-a-kite-have-parallel-sides"
} |
r, text-mining
The ni are the counts in a 2^K contingency table whose dimensions are defined by the ci. I will try to illustrate the lambda collocation metric, first we have to define a function c(x, z) that receives two K-word expressions where x is the K-word expression you want to score and z corresponds to all possible values of a K-word expression in the corpus. c(x, z) returns a binary vector (j1, ..., jk) such that ji = 1 if xi == zi, 0 otherwise. Now a binary vector can represent a decimal number up to 2^K = M, so c(x, z) = ci means that the binary vector returned was equal to the binary representation of the decimal number i. Now as it says on the documentation ni corresponds to the number of times the c(x, z) function was equal to ci through the corpus. Now an example, consider the following sentence:
this sentence is an example for this sentence | {
"domain": "datascience.stackexchange",
"id": 2300,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "r, text-mining",
"url": null
} |
ros, opencv, ros-melodic, rosrun
cv::namedWindow("A_good_name", CV_WINDOW_AUTOSIZE);
if(!cap.isOpened() )
{
std::cout << "\nCannot open the video file.\n";
return EXIT_FAILURE;
}
double fps = cap.get(CV_CAP_PROP_FPS); //get the fps
int waitKeyValue = 10;
while(true)
{
cv::Mat frame;
if(!cap.read(frame) )
{
std::cout <<"\n Cannot read the video file.\n";
return EXIT_FAILURE;
}
cv::imshow("A_good_name", frame);
int key = cv::waitKey(waitKeyValue);
if(key != -1)
std::cout << key << std::endl;
if(key == 32) //space button for pause
{
if(waitKeyValue)
waitKeyValue = 0;
else
waitKeyValue = 10;
}
if(key == 27) //escape button for exit
break;
}
cap.release();
return EXIT_SUCCESS;
} | {
"domain": "robotics.stackexchange",
"id": 33793,
"lm_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, opencv, ros-melodic, rosrun",
"url": null
} |
is defined as follows: Therefore, This could be further condensed using sigma notation. binomial coefficient Latex. LaTeX forum ⇒ Math & Science ⇒ Expression like binomial Coefficient with Angle Delimiters Topic is solved Information and discussion about LaTeX's math and science related features (e.g. Asking for help, clarification, or responding to other answers. }{k ! therefore gives the number of k -subsets possible out of a set of distinct items. It is especially useful for reasoning about recursive methods in programming. All combinations of v, returned as a matrix of the same type as v. Binomial coefficient denoted as c(n,k) or n c r is defined as coefficient of x k in the binomial expansion of (1+X) n.. The following are the common definitions of Binomial Coefficients.. A binomial coefficient C(n, k) can be defined as the coefficient of x^k in the expansion of (1 + x)^n.. A binomial coefficient C(n, k) also gives the number of ways, disregarding order, that k objects can be | {
"domain": "mohammadshariatmadari.ir",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426450627306,
"lm_q1q2_score": 0.8513885117143548,
"lm_q2_score": 0.8740772450055545,
"openwebmath_perplexity": 980.351373441915,
"openwebmath_score": 0.9148372411727905,
"tags": null,
"url": "https://mohammadshariatmadari.ir/d9ueu4v/binomial-coefficient-latex-88290e"
} |
[cont'd] ... So, yes, your solution involves more advanced mathematical concepts, but I wonder if a student who cannot solve this problem can understand your solution at all. You seem to say that I strip down your proof to please the readers. No. The motive behind this rewrite is not to make them happy, but to make sure that we have a solution that at least a novice can understand. Moron's solution is easy, but a bit tedious to my taste. Yours, frankly, is too advanced for someone who, say, takes a freshman Calculus course. I only try to strike the middle ground. – user1551 Sep 3 '10 at 8:31 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226307590189,
"lm_q1q2_score": 0.8284836863353431,
"lm_q2_score": 0.8479677545357568,
"openwebmath_perplexity": 736.7895650276631,
"openwebmath_score": 0.9206456542015076,
"tags": null,
"url": "http://math.stackexchange.com/questions/3888/find-polynomials-such-that-x-16p2x-16x-1px/3889"
} |
cc.complexity-theory, complexity-classes, time-complexity, gt.game-theory
Some of the squares in this grid are "deadly." If you step on it, you must restart and try to go over again. We will assume that the placement of these deadly squares is random.
However, if you pick a "friendly" grid you will be allowed to "mark" it. In logical terms this means that we know that the square is safe. If you need to start over again, you have knowledge that the square is not deadly.
You may only start from one of the 4 sides of the large 6x6 square and only go horizontal, vertical, or diagonal. No skipping squares.
I have 2 questions: | {
"domain": "cstheory.stackexchange",
"id": 5476,
"lm_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, gt.game-theory",
"url": null
} |
c#, linq
Is it worth it, or over-engineered? This is subjective and a matter of taste. Some find verbosity more readable, others prefer terseness/expressiveness.
I would let both solutions slide in a peer review, although creating a single-use extension method (If) looks like a minor code smell.
Another way to avoid repetitive overwriting of values, which you're uncomfortable with, would be to introduce temporary variables:
var blanksHandled = includeBlanks ? values : values.Where(v => v != String.Empty);
var duplicatesHandled = excludeDuplicates ? blanksHandled.Distinct() : blanksHandled;
var withAffixes = duplicatesHandled.Select(v => begin + v + end); | {
"domain": "codereview.stackexchange",
"id": 19667,
"lm_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#, linq",
"url": null
} |
javascript, programming-challenge
newHealth = this.processOutputLink(node.outputLink, newHealth, first, last); // FINITO
return newHealth;
}
getHealth(word, first, last) {
let health = 0;
let index = 0;
for (const c of word) {
const character = c.charCodeAt(0) - 97;
const parentNode = this.trie[index];
const nextIndex = this.trie[index].next[character];
if (nextIndex !== -1) {
health = this.processNode(nextIndex, health, first, last);
index = nextIndex;
} else {
const indexSuffix = this.processLink(parentNode.link, character);
const indexNextNode =
indexSuffix !== ROOT_TREE
? indexSuffix
: this.trie[indexSuffix].next[character];
if (indexNextNode !== -1) {
health = this.processNode(indexNextNode, health, first, last);
index = indexNextNode;
} else {
index = ROOT_TREE;
}
}
}
return health;
}
} | {
"domain": "codereview.stackexchange",
"id": 44103,
"lm_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, programming-challenge",
"url": null
} |
• The explicit methods should also be $u_i$ on the very right hand side of the bottom equation. then you can solve for $u_{i+1}$ explicitly. – tch Jan 3 at 16:02
• I think your reasoning is right. All the methods require you to store a current iterate and the matrix. It is possible that solving a linear system will require some additional memory, but that wouldn't mean the implicit memory uses less. Also, everything you do in the implicit method you need to do in the Crank-Nicholson method anyway, so there is no reason the implicit method would use less memory that Crank-Nicholson. – tch Jan 3 at 16:06
• Thanks for the comments @tch. I corrected the question according to your first comment. Regarding the second one, that's indeed the point which is not clear for me, but it seems we have the same intuition – ecjb Jan 3 at 16:11
• this question might be better suited for scicomp.stackexchange.com – piyush_sao Jan 3 at 16:21 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850897067341,
"lm_q1q2_score": 0.8355939819972371,
"lm_q2_score": 0.84997116805678,
"openwebmath_perplexity": 438.13219679213586,
"openwebmath_score": 0.5016211271286011,
"tags": null,
"url": "https://math.stackexchange.com/questions/3060678/finite-difference-explicit-implicit-crank-nicolson-does-the-implicit-met/3060728"
} |
javascript, jquery
Let me explain what the setDataAttributes function does:
it takes two arguments: element and dataAttributes (an object)
it checks to see if the element has a dataAnalytics tag (some links have a data-analytics tag that we can get some values from)
if the element does have the data-analyticstag, then we parse it and return an object (see parseDataAnalyticsTag) and merge it with the original dataAttributes object.
Next, we take the dataAttributes object and pass it into another function prefixAndTrimProperties where we prefix each key with 'data-' and trim each value, this function returns an object.
we take the returned object and pass it into element.attr(dataAttributes) where it then sets the data attributes for that specific element.
Questions
I'm currently reading Clean Code by Robert C. Martin, and I'm attempting to apply some of his practices around naming and functions - haven't made it to the rest of the book yet. | {
"domain": "codereview.stackexchange",
"id": 12348,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery",
"url": null
} |
python, beginner, python-3.x, object-oriented, tetris
This function only handles one piece and it takes the coordinates in directly, it doesn't "care" what those coordinates represents (a piece, but could now be used for anything else too).
I think using x and y is natural since the rows and columns function as coordinates in a tetris game. This is more specific than i and j which are often used as iterators for any inner loop, which doesn't necessarily or naturally relate to coordinates.
Also, I'm looking at each case one at a time, no need to use all and "remember" the pieces simultaneously. This is the most important change to make it readable and piece-by-piece easy to understand.
When calling the function from the outside, it now makes sense to use all.
if all([in_bounds(x,y) for (y,x) in pieces]):
2
def translate_active_piece(self, direction):
if direction == 'right':
x, y = 0, 1
elif direction == 'left':
x, y = 0, -1
elif direction == 'down':
x, y = 1, 0 | {
"domain": "codereview.stackexchange",
"id": 39344,
"lm_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, object-oriented, tetris",
"url": null
} |
java, beginner, array
Title: Party Invitation - Trimming the Invitation List I am learning Java right now and am coding some simple programs to practice. Right now, one of my for loops has an inelegant way of ending the loop. I was wondering if there was another way to express what I want the program to do.
Problem: Party Invitation
Problem Description
Number your friends 1,2,....,K and place them in a list in this order. Then perform m rounds. In each round, use a number to determine which friends to remove from the ordered list.
The numbers will use numbers r1, r2,....,rm. In round 'i' remove all the remaining people in positions that are multiples of ri (that is, ri, 2ri, 3ri,...) The beginning of the list is position 1.
Output the numbers of the friends that remain after this removal process.
Input Specification | {
"domain": "codereview.stackexchange",
"id": 12044,
"lm_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, array",
"url": null
} |
classical-computing, experimental-realization, scalability
Yes. A universal quantum computer with only 100 qubits (12.5 quantum bytes) can find the ground state of a matrix with $2^{200} = 10^{60}$ elements. Assuming Moore's Law could continue forever (which is not true due to physical limitations), it would take longer than the age of the universe (13.5 billion years) for the "doubling of transistors every 18 months" to bring classical computers to what a quantum computer with one quantum gigabyte can do, for certain problems.
More interesting question is, is there even a way to improve the power of
quantum computers? | {
"domain": "quantumcomputing.stackexchange",
"id": 213,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-computing, experimental-realization, scalability",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.