text
stringlengths
49
10.4k
source
dict
convolution, continuous-signals, linear-systems Title: Under what conditions is the convolution of an input signal with the system's impulse response periodic? I'm currently solving the following convolution problem from Oppenheimer's book: In the solution, it was stated that "$x(t)$ periodic implies $y(t)$ is periodic" So I wondered if it's always the case that if $x(t)$ is periodic then so is the output from the convolution, I tried doing research about this in hope of finding any supporting evidence to this but I couldn't, and "circular convolution" is all around the place. So I wondered if it's always the case that if x(t) is periodic then so is the output from the convolution Yes, it's always the case. Convolution is a linear operation and linear operations preserve periodicity. Roughly speaking: any periodic signal consists of a sum of discrete sine waves. The output of an LTI system to a sine wave is also a sine wave at the same frequency. Hence the LTI system preserves the "discreteness" of the original input.
{ "domain": "dsp.stackexchange", "id": 10065, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "convolution, continuous-signals, linear-systems", "url": null }
ros, homebrew, ros-fuerte Title: mountain lion install broken? I've been following the instructions on (http://www.ros.org/wiki/fuerte/Installation/OSX/Homebrew/Source) to install ros/fuerte on a macbook...(OSX 10.8). I get to the line: brew install ros/fuerte/swig-wx which generates the following error: bash-3.2$ brew install ros/fuerte/swig-wx ==> Cloning git://github.com/wg-debs/swig-wx.git Cloning into '/Library/Caches/Homebrew/swig-wx--git'... fatal: remote error: Repository not found. Error: Failure while executing: git clone --no-checkout --depth 1 --branch upstream/1.3.29 git://github.com/wg-debs/swig-wx.git /Library/Caches/Homebrew/swig-wx--git In the troubleshooting part of the page, it says that the git repository has been removed, and provides some code. require 'formula' class SwigWx < Formula url 'git://github.com/ros/swig-wx.git', {:using => :git, :tag => '1.3.29_fuerte'} homepage 'http://www.swig.org' version '1.3.29' def install ENV.universal_binary system "./configure --prefix=#{prefix}" system "make" system "make install" end end Can anybody tell me what am I supposed do with this code? Or maybe this is a red herring? Thank You!!! Originally posted by ebeowulf on ROS Answers with karma: 100 on 2013-02-12 Post score: 0 Ok ... still don't know the answer about what to do with the "Troubleshooting Tip", but the workaround is to run the commands in the file separately:
{ "domain": "robotics.stackexchange", "id": 12858, "lm_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, homebrew, ros-fuerte", "url": null }
newtonian-mechanics, newtonian-gravity, differential-equations Also, is there a simpler way to derive this diffeq given that it is right in the first place? (perhaps, using other formulations of classical mechanics?) Thanks! $\def \b {\mathbf}$ start with the position vector to the mass m $$\b R=\left[ \begin {array}{c} d\\ d\tan \left( \varphi \right) \end {array} \right] $$ from here the velocity vector $$\b v=\left[ \begin {array}{c} 0\\ {\frac {d\dot\varphi }{ \left( \cos \left( \varphi \right) \right) ^{2}}}\end {array} \right] $$ the kinetic energy T $$T=m\,\b v\cdot \b v$$ the potential energy U $$U=2\,\frac{m\,M\,G}{\left(\b R\cdot\b R\right)^{1/2}}$$ and with Euler Langrage method you obtain this differential equation $$\ddot\varphi+{\frac {\sin \left( \varphi \right) \left( -2\,{\dot\varphi }^{2}{d}^{3 }+M\,G \left( \cos \left( \varphi \right) \right) ^{5} \right) }{\cos \left( \varphi \right) {d}^{3}}} =0$$ but where is the "pendulum " in this equation ? Phase diagram initial condition $~\varphi(0)=1~,\dot\varphi(0)=0$
{ "domain": "physics.stackexchange", "id": 93012, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, newtonian-gravity, differential-equations", "url": null }
filters, discrete-signals, signal-analysis The Hilbert transform must be well-defined There must be a center frequency for the passband signal There must be a frequency higher than half the bandwidth of the baseband signal. 2 and 3 are equivalent, as far as I can see – you can only use baseband if your signal has been a passband signal before¹. About the 1. requirement: Tough one, I've been trying to generally state a domain of definition for the Hilbert transform, but that's nothing for a lazy Sunday noon. Concretely, and function $f(t)$ that fulfills $$\left\lvert\int\limits_{-\infty}^{\infty} \frac{f(t)}{t-\tau}\right\rvert < \infty$$ is Hilbert-transformable, and you need to account for the fact that you can use all your Lebesgue intergral magic here (you'll really have to, that thing usually has a singularity, and that is an example often used to motivate Cauchy's principal value theorem for electrical engineers). Now, if $f\in L^p,\, p>1$, then that's a given; but periodic (and hence, not-energy-)signals do work too; tempered distributions do, and a few other things. Considering the fact that Parseval's theorem already tells us that, inherently, a signal that's limited in energy in frequency domain (and every band-limited signal has to be) needs to be in $L^2$, we can infer that there is none band-limited passband signal that you cannot equivalently observe in baseband. Systems This is the tricky part. We're looking for passband systems that we can't map back and forth from passband to baseband.
{ "domain": "dsp.stackexchange", "id": 8802, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "filters, discrete-signals, signal-analysis", "url": null }
javascript, html, websocket formatString = formatString.replace(/MM/, MM); formatString = formatString.replace(/M/, M); formatString = formatString.replace(/dd/, dd); formatString = formatString.replace(/d/, d); formatString = formatString.replace(/hh/, hh); formatString = formatString.replace(/h/, h); formatString = formatString.replace(/mm/, mm); formatString = formatString.replace(/m/, m); formatString = formatString.replace(/ss/, ss); formatString = formatString.replace(/s/, s); return formatString; } else { return ""; } };
{ "domain": "codereview.stackexchange", "id": 29903, "lm_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, html, websocket", "url": null }
python, api, flask if self.progress_check(progress_hash): return json_response({ "success": False, 'result': "This report is already being generated", }) file = open(f'/root/progress_data/{progress_hash}', 'w+') file.close() try: report = self.generate_report(serialized_data) except: os.remove(f'/root/progress_data/{progress_hash}') return json_response({ "success": False, 'result': "Error while generating report", }) os.remove(f'/root/progress_data/{progress_hash}') return json_response({ "success": True, 'data': report, }) I think that this is not really production-ready solution, but I could not come up with something better. Also, there are some holes where the file is not being deleted in all cases. Could you show me potential holes and may be another way of checking the progress There is nothing I can test here, so I will only make a couple superficial remarks. You do not offer a lot of insight into your application. If you say you have a problem with overlapping queries, then you should address the root of the problem. I have the impression that you simply devised a workaround. It may do the job but at the expense of performance or reliability. It could also create more problems. Repetition What is immediately apparent is that you have a hardcoded path repeated multiple times across your code. At the top of your code you should define a variable for '/root/progress_data'. Then if you decide to change the file name or path you will have only one line to change. But Python has a library for temp files: https://docs.python.org/3/library/tempfile.html. This is what you should be using. The date format "%Y-%m-%d" could be made a variable too. Security Does your program really need to run as root ? Maximize your try/catch/finally blocks You repeat this twice: os.remove(f'/root/progress_data/{progress_hash}')
{ "domain": "codereview.stackexchange", "id": 38764, "lm_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, api, flask", "url": null }
np, nondeterminism, co-np Now consider the machine $!M$ which accepts when $M$ rejects and rejects when $M$ accepts. If $\langle G,s,t \rangle \in \mathsf{!HAMPATH}$ then $!M(\langle G,s,t \rangle,p)$ accepts for all values of $p$. If $\langle G,s,t \rangle \notin \mathsf{!HAMPATH}$ then there exists a witness $p$ such that $!M(\langle G,s,t \rangle,p)$ rejects. As you can see, $!M$ doesn't have the same promises regarding $\mathsf{!HAMPATH}$ that $M$ has regarding $\mathsf{HAMPATH}$.
{ "domain": "cs.stackexchange", "id": 12550, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "np, nondeterminism, co-np", "url": null }
${d}_{{\theta }_{0}}\left(C\right)={d}_{{\theta }_{0}+\pi /2}\left(C\right).$ # 3 Proof The proof is similar to that of "stabilising a wobbly table". The idea is to consider pairs of diameters for orthogonal angles. As we rotate the shape, these diameters vary continuously. After rotating the shape by a right-angle, the original diameters are swapped. This means that there must have been a rotation where the two diameters were the same. The key is to show that the diameter varies continuously. Lemma 3 Let $C$ be a simple, closed curve with a continuous parametrisation. Then the function $\theta ↦{d}_{\theta }\left(C\right)$ is continuous. Proof Let $r:\left[0,1\right]\to {ℝ}^{2}$ be a parametrisation of $C$. As the shape is closed, we have $r\left(0\right)=r\left(1\right)$. For $\theta \in {S}^{1}$, the projection map ${P}_{\theta }$ is defined by: ${P}_{\theta }\left(x,y\right)=x\mathrm{cos}\left(\theta \right)+y\mathrm{sin}\left(\theta \right)$ This is clearly continuous in $\theta$. Thus ${P}_{\theta }\left(C\right)$ is the image of the continuous function: $\left(\theta ,t\right)↦{P}_{\theta }r\left(t\right).$ The domain of this function is ${S}^{1}×\left[0,1\right]$. It therefore lives in the space of continuous functions $C\left({S}^{1}×\left[0,1\right],ℝ\right)$. The key property of this space that we want to use is that there is an isomorphism:
{ "domain": "mathforge.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9911526462237642, "lm_q1q2_score": 0.8126394429690494, "lm_q2_score": 0.8198933293122507, "openwebmath_perplexity": 136.2812695924954, "openwebmath_score": 0.9170705676078796, "tags": null, "url": "https://loopspace.mathforge.org/CountingOnMyFingers/IntermediateAxes/" }
c, array, c99 /// /// @brief Removes the element at the index `Index` from the Dynamic Array. /// @remarks If the Dynamic Array is empty, nothing will be done. /// @param [in,out] DynArray The Dynamic Array. /// @param [in] Index Index of the element to be removed. /// #define dynarray_remove(DynArray, Index) if (true) { \ if ((DynArray).count != 0) { \ memmove( \ (DynArray).data + (Index), \ (DynArray).data + (Index) + 1, \ (sizeof *(DynArray).data) * ((DynArray).count - (Index) - 1)); \ (DynArray).count -= 1; \ } \ } else (void)0 /// /// @brief Fills the Dynamic Array will `ElemVal` values. /// @warning The old contents of `DynArray` will be overwritten. /// @param [in,out] DynArray The Dynamic Array. /// @param [in] ElemVal New value for all elements. /// #define dynarray_fill(DynArray, ElemVal) if (true) { \ for (size_t i=0; i < (DynArray).count; ++i) { \ (DynArray).data[i] = (ElemVal); \ } \ } else (void)0
{ "domain": "codereview.stackexchange", "id": 22509, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, array, c99", "url": null }
photons, quantum-optics Appendix: Calculations for $\langle \tilde{2}|\tilde{2}\rangle = 2$ $$\langle \tilde{2}|\tilde{2}\rangle = \int\int \text{d}\omega_1 \text{d}\omega_2 \text{d}\omega_1^\prime \text{d}\omega_2^\prime \phi(\omega_1)\phi(\omega_2) \phi(\omega_1^\prime)\phi(\omega_2^\prime) \langle 0| a(\omega_1^\prime)a(\omega_2^\prime) a^\dagger(\omega_1)a^\dagger(\omega_2)|0\rangle\\ = \int\int \text{d}\omega_1 \text{d}\omega_2 \text{d}\omega_1^\prime \text{d}\omega_2^\prime \phi(\omega_1)\phi(\omega_2) \phi(\omega_1^\prime)\phi(\omega_2^\prime) \\\times \left(\langle 0| a(\omega_1^\prime) a^\dagger(\omega_1)a(\omega_2^\prime)a^\dagger(\omega_2)|0\rangle +\\ \langle 0| a(\omega_1^\prime) \delta(\omega_2^\prime-\omega_1)a^\dagger(\omega_2)|0\rangle \right), \\ = \int\int \text{d}\omega_1 \text{d}\omega_2 \text{d}\omega_1^\prime \text{d}\omega_2^\prime \phi(\omega_1)\phi(\omega_2) \phi(\omega_1^\prime)\phi(\omega_2^\prime) \\\times
{ "domain": "physics.stackexchange", "id": 14428, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "photons, quantum-optics", "url": null }
In computing, a hash table (hash map) is a data structure used to implement an associative array, a structure that can map keys to values. 78.2k 17 17 gold badges 123 123 silver badges 218 218 bronze badges. Dr. As we move the elements, keys must be rehashed for the new array of m ′ m' m ′ buckets. Rob Edwards from San Diego State University describes how to calculate the load factor for a hash Load factor; Performance: separate chaining and double hashing; Performance graphs; Hash functions; Strings to integers; Folding; Independent hash functions ; Motivation: Fast Table Lookup . A critical influence on performance of an open addressing hash table is the load factor; that is, the proportion of the slots in the array that are used. The hash code is used to find an index (hashCode % arrSize) and the entire linked list at that index (Separate chaining) is first searched for the presence of the K already. Load Factor is a measure which decides when exactly to increase the hashmap capacity or you can say bucket capacity, so that get and put operation can still have O(1) complexity. The load factor is the average number of key-value pairs per bucket. The solution is to resize table, when its load factor exceeds given threshold. It is an older .NET Framework type. The performance is determined by the Load Factor. The Load factor is a measure that decides when to increase the HashMap capacity to maintain the get () and put () operation complexity of O (1). Hashtable optimizes lookups. share | cite | improve this question | follow | edited Dec 5 '18 at 23:06. Jose Jose. The load factor limit is usually configurable and offers a tradeoff between time and space costs. write a constructor that takes a string as... What were your responsibilities in your previous job . α= average number of elements in a chain, or load factor αcan be less than or greater than 1 If mis proportional to n(that is, mis chosen as a linear function of n), All contents are copyright of their authors. Complexity and Load Factor a hash table that contain runs of length ... = / – load factor (Note: 1) Expected no. The GCC initially starts with 11 buckets, Windows starts with 8 buckets. I’m currently learning about Hash Tables and
{ "domain": "testzonen.se", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9304582516374121, "lm_q1q2_score": 0.8297929548244396, "lm_q2_score": 0.891811054783143, "openwebmath_perplexity": 1407.5131175387194, "openwebmath_score": 0.2969931662082672, "tags": null, "url": "http://testzonen.se/tim-hortons-qqqw/hash-table-load-factor-643470" }
black-holes, quantum-information, quantum-entanglement Title: Quantum entanglement (one particle destroyed) Two particles are experiencing "quantum entanglement". What happens to one particle if the other is destroyed (i.e. falls into a black hole and reaches singularity)? Would the remaining particle be destroyed? In what way would the remaining particle be affected? The delay time for a particle falling into a Schwarzschild black hole is $$ cT~=~r~-~2m~ln(r~-~2m),~m~=~GM/c^2, $$ which diverges for $r~\rightarrow~2m$. It takes an infinite time to observe a particle reach the event horizon. So for an eternal black hole, the mathematical solution corresponding to Einstein's field equations, you would observe your partner with the EPR pair never reach the black hole, and in principle your entanglement is conserved. There would be no loss of entanglement. This is for a perfect situation that ignores Hawking radiation and the influx of other quanta into the black hole. The physical situation is more messy. First off other quantum fields pile up near the horizon, and in fact the holographic screen or stretched horizon a Planck length or string length above the mathematical horizon at $r~=~2m$ is composed of all the quantum fields that make the black hole. The other EPR pair becomes also a component of the black hole. From the perspective of the distant external observer the other EPR pair interacts with lots of quantum fields and the entanglement phase is lost to the black hole. This is a form of decoherence. After a long period to time watching the EPR pair creep ever closer to the black hole the entanglement is lost to this large reservoir of states. You never witness the other particle reach the singularity. That state of affairs is only accessible to an observer that falls in with the particle.
{ "domain": "physics.stackexchange", "id": 34357, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "black-holes, quantum-information, quantum-entanglement", "url": null }
then, the integral can be written as follows, fullscreen. 4 Other improper integrals If the limits are nite, but the integrand becomes in nite at one of the endpoints then we also call the integral improper. For these integrals, we will have to use limits. In short, one class of functions whose improper integral diverges can be transformed to functions that tend to infinity and the class of functions whose integrals converge can be transformed into functions which are bounded over a bounded interval. Therefore, the integral is convergent. es 2 Technical University of Madrid, Spain When teaching how to compute improper integrals such as: Z ¥ 0 f(t)dt ; Z 0 ¥ f(t)dt and Z ¥ ¥ f(t)dt. Improper Integrals, Sequences and Series. The fundamental theorem of integral calculus is great, but it's not without its limitations. Consider the improper integral ∫ 1 1 1 xp dx: Integrate using the generic parameter p to prove the integral converges for p > 1 and diverges for p ≤ 1 (you will have to distinguish between the cases when p = 1 and p ̸= 1 when you integrate). Integral Calculus. f f a, b , c a, b b a f x dx lim c a b c f x dx. A definite integral for which the integrand has a discontinuity between the bounds of integration, or which has ∞ and/or –∞ as a bound. One very special type of Riemann integrals are called improper Riemann integrals. Some of the topics covered are: Indefinite Integrals, Definite Integrals, Trigonometric Integrals, Trigonometric Substitution, Partial Fractions, Double Integrals, Triple Integrals, Polar Coordinates, Spherical Coordinates, Line Integrals, Centroids/Centers of Mass, Improper Integrals, Volumes of. improper integral an integral over an infinite interval or an integral of a function containing an infinite discontinuity on the interval; an improper integral is defined in terms of a limit. And since this. (b) Decide if the integral is convergent or divergent. Theorem of Calculus. In this course, Calculus Instructor Patrick gives 60 video lectures on Integral Calculus. Improper integral convergence fails(?) Hi, i have this integral : ∫1/((x^4+1)^(1/3)) from 0 to +∞ and I have to determine it's convergence
{ "domain": "claudiaerografie.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682444653242, "lm_q1q2_score": 0.8151193339077226, "lm_q2_score": 0.8244619350028204, "openwebmath_perplexity": 525.4508902781389, "openwebmath_score": 0.9661898612976074, "tags": null, "url": "http://claudiaerografie.it/wxzr/improper-integral.html" }
infinite-impulse-response, bandpass, step-response Is there any other type of BPF which has a low step response? Please tell me how can I avoid it. Thank you! The step response of your BPF has a fast decay, so you may eliminate it by setting the filter states. Have a look at the difference equation of your biquad BPF: $$ y[n] = 0.0377 x[n] + 0 x[n-1] - 0.0377 x[n-2] + 1.9240 y[n-1] - 0.9246 y[n-2] $$ Since $b_0=-b_2$ and we have $x[n] = 0.65$ for all $n\geq 0$, if we set $x[n-1]=x[n-2] = 0.65$ and $y[n-1]=y[n-2]=0$, we get a zero step response $y[n]=0$ for all $n\geq 0$. So if you are implementing the biquad filter with direct form I, just initialize your filter states as [0.65, 0.65, 0, 0]. If you are using transposed direct form II, you may use a filter states [-b0*0.65, -b0*0.65]. x = ones(2*Fs, 1) * 0.65; z = [-b(1)*0.65, -b(1)*0.65]; [y, z] = filter(b, a, x, z); figure; stem(y)
{ "domain": "dsp.stackexchange", "id": 10682, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "infinite-impulse-response, bandpass, step-response", "url": null }
java, unit-testing, collections, null, junit /** * Returns the <em>n</em> entries with the highest count in descending * order of frequency. Entries with the same frequency are returned in an * arbitrary order. * * @return An array of length <em>n</em>. If <em>n</em> exceeds the number * of entries that exist, the result is padded with nulls. */ @SuppressWarnings("unchecked") public Map.Entry<T, Integer>[] mostCommon(int n) { Map.Entry[] top = new Map.Entry[n]; int i = 0; for (Map.Entry<T, Integer> e : this) { top[i++] = e; if (i == n) break; } return (Map.Entry<T, Integer>[])top; } } CounterTest.java import static org.junit.Assert.*; import static org.junit.Assume.*; import org.junit.BeforeClass; import org.junit.Test; import org.junit.Ignore; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import java.io.*; import java.net.MalformedURLException; import java.net.URL; import java.text.BreakIterator; import java.util.Arrays; import java.util.Map; import java.util.Scanner; // javac -cp .:junit.jar Counter.java CounterTest.java // java -cp .:junit.jar:hamcrest-core.jar org.junit.runner.JUnitCore CounterTest @RunWith(JUnit4.class) public class CounterTest { private static String SHAKESPEARE_CORPUS;
{ "domain": "codereview.stackexchange", "id": 6653, "lm_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, unit-testing, collections, null, junit", "url": null }
quantum-algorithms, deutsch-jozsa-algorithm If you start with $|x\rangle = |0\rangle$ and $|y\rangle = |0\rangle$: For a balanced function $ f (0) = f '(1)$ you'll get $$\frac{1}{2}(|0,f(0)\rangle+|0,f'(0)\rangle+|1,f(1)\rangle+|1,f'(1)\rangle)) = $$ $$= \frac{1}{2}(|0,f(0)\rangle+|0,f'(0)\rangle+|1,f'(0)\rangle+|1,f(0)\rangle)) = $$ $$= \frac{1}{2}((|0\rangle+|1\rangle)(|f(0)\rangle+|f'(0)\rangle))$$ Which is the same result as you'd get for a constant function. That's why you need to start with $|y\rangle = |1\rangle$ - you need to get a phase difference between the two scenarios somehow. If you start with $|x\rangle = |1\rangle$ and $|y\rangle = |0\rangle$, you get the same outcome: the state both for balanced and for constant scenarios is the same, and you can't distinguish them. (The math is very straightforward so I won't write it out here).
{ "domain": "quantumcomputing.stackexchange", "id": 551, "lm_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, deutsch-jozsa-algorithm", "url": null }
php, jquery, laravel These are all the methods that I found completely relevant. There are several more methods in this God class that generate the forms for the GUI. Eventually I'll get to code review on these. Security Try to follow current best practices. If you are very new to web security, take a quick look at the OWASP Top 10. SQL Injection You are open to SQL Injection via the $urlid parameter as well as $browseragent, $reqpath, and possibly $ip and $host. As well as do second order injection via $username and $projectName. And that's just in your first two functions, your other functions are vulnerable as well. It should also be said that casting to int or escaping input is not the best approach to SQL injections. Current best-practice is to use prepared statements. It's safer, it's more readable, it's easy to use. There is really no excuse to not use them. XSS You echo variables without encoding, which can lead to XSS. Examples are $toEmail, $user['USR_Username'], etc. Ideally, you should use a templating engine, which encodes variables by default. This is more secure, and also results in better code. Structure / Encapsulation / Readability Try to read up on MVC, and try to make more use of Laravel functionality. For example, Laravel has a query builder, templates, etc. Globals From a quick first look at your code, there is a lot of work being done on global variables, either via superglobals or via setenv. Duplication webbugExecutionWebsite and webbugExecutionEmail contain a lot of duplicate code (they are essentially the same function). Try to extract that duplication to functions which you then reuse. Your functions do too much Your functions do way too much, which is why you have so much duplication. And why your code is quite difficult to read, or change, or test. A good example is sendEmail which indeed sends mail, but also proccesses a request, does some work on projects and templates, logs stuff, selects users from the database, and updates users in the database, exists, and prints information to the user.
{ "domain": "codereview.stackexchange", "id": 20717, "lm_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, jquery, laravel", "url": null }
• Is there a way to write the design matrix $A$ as the result of matrix multiplications, instead of calculating each element independently? Then the calculation of the design matrix would be much more efficient in the respective computer systems like Matlab or numpy. – Make42 Mar 20 '19 at 19:47 • So $C = \begin{pmatrix}d&e\\e&f\end{pmatrix}$, $b^T = (b,c)$ (first my vector than your scalars) and my $a$ equals your $a$? – Make42 Mar 20 '19 at 19:55 • Could it be that you missed two $\sum$-symbols in your design matrix? – Make42 Mar 20 '19 at 23:00 • Could be... corrected now – Mark Fischler Mar 21 '19 at 2:25 • The calculation of the matrix is incredibly efficient in any sort of procedural language, where you simply accumulate, as each point is processed, the various components. I've seen Matlab code that tried to use the powerful matrix syntax by artificially creating a column matrix out of each point - it is both ugly and very inefficient. – Mark Fischler Mar 21 '19 at 2:28 Disclaimer: Approach 1 is from Mark Fischler, but I want to reference the approach in my second approach and I need the labels under the matrices for referencing, so I restate the approach. Apparently, adding the second approach to Mark's answer is not wanted by the moderators. # Approach 1 You can do multi-variate quadratic regression in the usual way. Let's label the row (and column) indices of the design matrix $$A$$, and the row index of the value vector $$b$$, by index $$s(\{p_1, p_2, p_3, \cdots\})$$ which pertains to the coefficient of $$x_i^{p_1}x_2^{p_2}\cdots$$. For example, the row labeled $$s(\{ 1, 0, 2\})$$ will be the row pertaining to the coefficient of $$x_1x_3^2$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754474655619, "lm_q1q2_score": 0.804963757922954, "lm_q2_score": 0.817574478416099, "openwebmath_perplexity": 383.4968465619186, "openwebmath_score": 0.9902435541152954, "tags": null, "url": "https://math.stackexchange.com/questions/3155866/multivariate-quadratic-regression/3155891" }
Here is yet another approach that uses Feynman's trick of differentiating under the integral sign. We begin by enforcing a substitution of $x \mapsto x^{1/n}$. This gives $$\int_0^\infty \tan^{-1} \left (\frac{1}{x^n} \right ) \, dx = \frac{1}{n} \int_0^\infty \frac{\tan^{-1} x}{x^{1 + \frac{1}{n}}} \, dx, \quad n > 1.$$ Now let $$I(a) = \frac{1}{n} \int_0^\infty \frac{\tan^{-1} (ax)}{x^{1 + \frac{1}{n}}} \, dx, \quad a > 0.$$ Note that $I(0) = 0$ and we are required to find the value of $I(1)$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9898303425461246, "lm_q1q2_score": 0.8160774224630345, "lm_q2_score": 0.8244619177503205, "openwebmath_perplexity": 613.4352023261916, "openwebmath_score": 1.0000100135803223, "tags": null, "url": "https://math.stackexchange.com/questions/2661664/computing-int-0-infty-arctan-left-frac1xn-right-mathrmdx" }
algorithms, graphs, search-algorithms, shortest-path Title: Modified Bellman Ford to find minmum cost cycle in O(E²V) time? I'm thinking about how you can modify Bellman Ford a bit to calculate the minimum weight cycle in an undirected graph with positive weights. Note that the constraint is that the algorithm must run in $O(VE^2)$ times, and Bellman Ford runs $O(VE)$ time so we are looking at a modification that runs $O(E)$ My approach is first make a directed graph by doubling the edges in both directions, then run Bellman Ford to come up with the shortest path, then compute the strongly connected components in this graph. After you have a tree of strongly connected components, calculate the weights around the perimeter of the SCC and then compare the weights. But I'm not sure how you could calculate SCC using Bellman Ford and this algorithm is going to take too long. Does anyone see an obvious solution? Some hints for you, so you can solve your own exercise: If the graph has a negative-weight cycle, what is the proper answer? Can you detect this situation? If the minimum-weight cycle has positive weight (strictly greater than zero), how could you find it? If you knew the distance between every pair of vertices, could you use that to help you find the minimum-weight cycle in this case? Does that suggest an algorithm that could handle this case? If the minimum-weight cycle has zero weight, can you detect this fact? What could you do in this situation?
{ "domain": "cs.stackexchange", "id": 3836, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, graphs, search-algorithms, shortest-path", "url": null }
newtonian-mechanics, forces, spring, stress-strain, viscosity Title: How can the equation of force for a spring and damper in series simplify to just the equation for a spring if the damper is set to "zero"? I have been working extensively on modeling physical objects using the stress/strain relationships of springs and dampers as described here: https://en.wikipedia.org/wiki/Viscoelasticity#Constitutive_models_of_linear_viscoelasticity Basic Equations The stress (σ) of a simple spring (where E is the elastic modulus) can be described in terms of strain (ε) as: $$σ = Eε$$ The stress of a dashpot/damper (where η is its viscosity) can be described as: $$σ = η\dot{ε}$$ One of the simplest combinations of spring and dashpots used in these models is putting both in series like so:
{ "domain": "physics.stackexchange", "id": 77850, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, forces, spring, stress-strain, viscosity", "url": null }
ros-melodic Title: Autoware 1.14.0 build error: ‘Index’ in namespace ‘Eigen’ does not name a type I follow autoware wiki to build autoware 1.14.0 step by step, when I begin to build (without CUDA), error occurs: error: ‘Index’ in namespace ‘Eigen’ does not name a type return state_(static_cast<Eigen::Index>(IDX::X)); my environment: ubuntu 18.04 ros Melodic ,Eigen 3.2.10 and here is my error log from terminal So how can I solve this error? Thanks in advance! Originally posted by LongruiDong on ROS Answers with karma: 26 on 2021-08-20 Post score: 0 Ok, It is because the version of Eigen is old, I downgrade autoware to 1.12.0 and update Eigen to 3.3.7, and then build successfully. Originally posted by LongruiDong with karma: 26 on 2021-08-21 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 36827, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-melodic", "url": null }
quantum-mechanics, hamiltonian, topology, time-reversal-symmetry, spin-models \end{equation} From the action of the time reversal operator on the wave function we see, that it leads to a complex conjugation of the wave function. Thus, we can simply construct it in the case of spin-less wave functions as $\mathcal{T} = K$, where $K$ is the operator for complex conjugation. More generally we can write $$\mathcal{T} = UK \tag{1} \quad ,$$ where $U$ is a unitary operator. The determination of $U$ in the case of spin-$\frac{1}{2}$ particles, leaves us with the explicit representation for the time-reversal operator. There are some basic properties, that every time-reversal operator needs to possess.
{ "domain": "physics.stackexchange", "id": 76449, "lm_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, hamiltonian, topology, time-reversal-symmetry, spin-models", "url": null }
the-moon, surface Title: Are these parallel lines I'm seeing in this image a real pattern on the Moon? In this question I mention the GIF in EarthSky.org's Moon Phases update Lengths of lunar months in 2017. After watching it a while, I've noticed a pattern of parallel nearly vertical lines on the Moon image that's used to generate this simulation. I've shown it below. However, if I look at the moon image in Wikipedia, which is much larger, higher resolution, and has perhaps higher contrast, I don't see it. It could be there, but less noticable due to the enhanced level of detail i the large image, but I am wondering - is it real, or not. If not, how did it get into this image? above: Animation used in EarthSky.org. above: Frame 29 from the GIF Animation used in EarthSky.org. above: A casual analysis of the cropped ROI. The traces are color: top, middle, and bottom third, column averages, black: entire column average. Short vertical lines are drawn by hand to try to point out the pattern that I'm seeing. above: "Full Moon photograph taken 10-22-2010 from Madison, Alabama, USA. Photographed with a Celestron 9.25 Schmidt-Cassegrain telescope..." from here. They are not real. The images used in the animation use a mosaic of photographs taken by an orbiting satellite, the Clementine orbiter. This satellite has a polar orbit, and so returns images in strips that run roughly north-south. Due to variations in lighting between orbits, when the strips are joined together, there are artefacts at the joins. The whole moon image from a ground-based telescope doesn't have such artefacts. The lunar orbiter view was used as it covers the whole moon, including the far-side. As the moon orbits Earth, it appears to wobble (an effect known as libration.) By starting with a whole moon map, and then projecting it to a sphere, this libration can be simulated. You couldn't do that with a single ground-based image.
{ "domain": "astronomy.stackexchange", "id": 2084, "lm_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-moon, surface", "url": null }
human-biology, food, lungs Title: What happens to the food you accidentally aspire? I'm well aware of the health effects of aspirating solid food and liquids, but I'm interested in the reaction of the body on the biological level to the strange body on our lungs. After I almost aspirated corn, I started to wander: what does the body do when food got on our lungs? Will it be eventually absorbed? Destroyed by our white cells? Or just lie there forever until it fully decomposes? The body has mechanisms to prevent food to get into the lungs, so the body is aware that eventually some food will get into the lungs. As a result, it makes sense to believe that our body would have a mechanism to deal with such issue if all other mechanisms fail ( coughing and etc.,) yet I couldn't find anything on Google. People can drown because of aspired food. If they don't then it can cause diseases, for example pneumonia. In extreme cases a tree can grow in the lungs. There are other aspiration/inhalation related diseases like silicosis or asbestos lung cancer. So it depends on the composition of the object (or liquid or powder) and other factors whether it causes a disease or not. I did not find anything about what exactly happens with these objects in the lungs. Probably the lung tries to get rid of them mechanically, if there is no success in that, then they cause a local inflammation, which can lead to diseases if it becomes chronic and/or the object contains pathogens. Common presenting symptoms (information available in 36 cases) included dyspnea (14), fever (9), and cough (6). A history of recurrent pneumonia was present in 9. 2007 - Pulmonary Disease due to Aspiration of Food and Other Particulate Matter: A Clinicopathologic Study of 59 Cases Diagnosed on Biopsy or Resection Specimens The annual overall inpatient cost associated with pediatric bronchial foreign-body aspiration is approximately $12.8 million. Combined, the rate of death or anoxic brain injury associated with pediatric foreign body is approximately 4%. 2014 - The national cost burden of bronchial foreign body aspiration in children
{ "domain": "biology.stackexchange", "id": 4630, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "human-biology, food, lungs", "url": null }
Your initial equation implies 0*x1 + 0*x2 = 1, i.e. 0 = 1. By manipulating the two sides of this "equation" we can then get any mathematical result we like. • This is by far the most important point on this question. Understanding that asserting a falsehood allows one to prove everything is fundamental. – The Great Duck Dec 24 '17 at 23:24 It is a general fact of life that when you try to solve an equation $F(X) = V$ and you transform the system by implication: $$F(X) = V\quad \Longrightarrow \quad G(X)= W$$ then the second equation may have more solutions than the first one. On the other hand, no solution is lost. Nevertheless, such implications remain a powerful tool to solve systems, especially non linear systems. Only remember that after solving $G(X) = W$, one needs to remove the extra "solutions".
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877675527114, "lm_q1q2_score": 0.8307642356381377, "lm_q2_score": 0.855851143290548, "openwebmath_perplexity": 211.01671293434515, "openwebmath_score": 0.9953089356422424, "tags": null, "url": "https://math.stackexchange.com/questions/2577065/using-the-left-inverse-to-solve-an-impossible-system-of-equations/2578219" }
tools, software-recommendation One of the key reasons to employ virtualization is to isolate applications from each other. Running everything on one machine would be great if it all worked, but many times it results in undesirable interactions or even outright conflicts. The cause often is software problems or business requirements, such as the need for isolated security. Virtual machines allow you to isolate each application (or group of applications) in its own sandbox environment. The virtual machines can run on the same physical machine (simplifying IT hardware management), yet appear as independent machines to the software you are running. For all intents and purposes—except performance, the virtual machines are independent machines. If one virtual machine goes down due to application or operating system error, the others continue running, providing services your business needs to function smoothly. Standardization Another key benefit virtual machines provide is standardization. The hardware that is presented to the guest operating system is uniform for the most part, usually with the CPU being the only component that is "pass-through" in the sense that the guest sees what is on the host. A standardized hardware platform reduces support costs and increases the share of IT resources that you can devote to accomplishing goals that give your business a competitive advantage. The host machines can be different (as indeed they often are when hardware is acquired at different times), but the virtual machines will appear to be the same across all of them. Ease of Testing Virtual machines let you test scenarios easily. Most virtual machine software today provides snapshot and rollback capabilities. This means you can stop a virtual machine, create a snapshot, perform more operations in the virtual machine, and then roll back again and again until you have finished your testing. This is very handy for software development, but it is also useful for system administration. Admins can snapshot a system and install some software or make some configuration changes that they suspect may destabilize the system. If the software installs or changes work, then the admin can commit the updates. If the updates damage or destroy the system, the admin can roll them back. Virtual machines also facilitate scenario testing by enabling virtual networks. In VMware Workstation, for example, you can set up multiple virtual machines on a virtual network with configurable parameters, such as packet loss from congestion and latency. You can thus test timing-sensitive or load-sensitive applications to see how they perform under the stress of a simulated heavy workload. Mobility
{ "domain": "datascience.stackexchange", "id": 57, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "tools, software-recommendation", "url": null }
electromagnetism, magnetostatics Title: Force on infinitesimal loop as stated in Griffiths' Electrodynamics I've found little to no success in finding a proof of result given by Griffiths at the start of the chapter on Magnetic fields in matter, namely the one for the force acting on an infinitesimal loop with dipole moment $\mathbf{m}$ in an external field $\mathbf{B}$: $$\mathbf{F} = \nabla(\mathbf{m} \cdot\mathbf{B}). \tag{1}$$ Is there a proof for this result? It does not seem to be an easily provable one, and I believe the proof does not rely much on intuition. Therefore, Griffiths' intuitive (and sometimes not rigorous) approach led him to omit the proof in the end. Anyways, If any of you managed to obtain it either with a more pragmatic or a more formal one, then I'd be grateful if you could post it. Again, whatever explanation is well-accepted. The formula is rigorously true for an ideal magnetic dipole and an arbitrary magnetic field (conversely, also for an arbitrary loop and linear magnetic field). If the loop is of finite size and the magnetic field has a varying derivative, you can decompose the big loop into an integral of ideal magnetic dipoles and integrate the force on every one of those dipoles (remarkably, it does not depend on the specific decomposition). This is why Griffiths' proofs (problems 6.4 and 6.22) involving Taylor expansions are valid. A rigorous way would be to prove it using distributions and the general equations of magnetostatics. The current density of the ideal dipole is: $$ j = \nabla\delta\times m $$ since the magnetisation is $M = m\delta$ and $j=\nabla\times M$. The magnetic force is given by: $$ F = \int j\times Bd^3x $$ Substituting the expression of current: $$ \begin{align} F &= \int (\nabla\delta\times m)\times Bd^3x \\ &= \int [(\nabla \delta\cdot B)m-(m\cdot B)\nabla\delta]d^3x \\
{ "domain": "physics.stackexchange", "id": 96570, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, magnetostatics", "url": null }
rviz Title: Rviz Crashes (OGRE) When running rviz I get the following error messages: [ WARN] [1414015276.298139367]: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/lib/x86_64-linux-gnu/OGRE-1.8.0/RenderSystem_GL. System Error: /usr/lib/x86_64-linux-gnu/OGRE-1.8.0/RenderSystem_GL.so: undefined symbol: _ZN4Ogre15StringInterface17msDictionaryMutexE in DynLib::load at /home/stefania/software/ogre/OgreMain/src/OgreDynLib.cpp (line 93) terminate called after throwing an instance of 'Ogre::InternalErrorException' what(): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/lib/x86_64-linux-gnu/OGRE-1.8.0/RenderSystem_GL. System Error: /usr/lib/x86_64-linux-gnu/OGRE-1.8.0/RenderSystem_GL.so: undefined symbol: _ZN4Ogre15StringInterface17msDictionaryMutexE in DynLib::load at /home/stefania/software/ogre/OgreMain/src/OgreDynLib.cpp (line 93) Aborted (core dumped) I'm running on Ubuntu 14.04 and ROS Indigo. My graphics card info: VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0102] (rev 09) (prog-if 00 [VGA controller]) UPDATE 1 Running rviz tries to compile against OGRE 1.8.1, and then gives the error messages above [ INFO] [1414078694.030851551]: compiled against OGRE version 1.8.1 (Byatis)
{ "domain": "robotics.stackexchange", "id": 19821, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz", "url": null }
ros, ros-melodic, package.xml, dependencies This is most likely the cause of you not being able to import the packages listed in the package manifest: rosdep will use your OS' package manager -- which in the case of Ubuntu (and Debian) would be apt -- to install the system dependencies that you've listed in your package's manifest. For python-pandas for instance, it would lookup the rosdep rule for that key (here) and resolve it to python-pandas (in this case the rosdep key resolves to the same Ubuntu/Debian package name, but that is a coincidence). It would then ask apt to install the python-pandas Debian package. On Ubuntu (and Debian), that would result in the Python 2 version of that package getting installed in the default system location: /usr/lib/python2.7/dist-packages/pandas. There is also a Python 3 version of the pandas rosdep key (here), but that wouldn't change what happens (it would just install the Python 3 version of Pandas in the system default location). apt does not take any virtual environments into account, it will just install in the system default location (or really: it installs files in whichever location is specified in the .deb package). This immediately means that the packages are installed, so rosdep will be happy (as apt reports it has installed whatever rosdep asked of it), but the packages will not be available in your virtual environment. However, whenever I try to do pip list [..] I don't see them in the list. this should be clear now: pip will look in your virtual environment, and as the packages have not been installed there, it will not list them as available. Edit: is there a way of installing the dependencies in the virtual environment with a ROS tool or I need to e.g. install the dependencies manually (from e.g. a requirements.txt file)?
{ "domain": "robotics.stackexchange", "id": 33802, "lm_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, package.xml, dependencies", "url": null }
neuroscience, neuroanatomy, neurotransmitter Activity at the axoaxonic synapse partially hypopolarizes the terminal so that, when an action potential comes down the [...] afferent fiber into that terminal, its amplitude is reduced. Because the amount of transmitter substance released by a bouton is proportional to the amplitude of the action potential in it, less transmitter substance is released, resulting in a smaller EPSP and less excitation of the postsynaptic cell [...] Links: http://en.wikipedia.org/wiki/Synapse http://www.getbodysmart.com/ap/nervoussystem/neurophysiology/synapses/introduction/synaptic_contacts/tutorial.html http://michaeldmann.net/mann13.html
{ "domain": "biology.stackexchange", "id": 2979, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience, neuroanatomy, neurotransmitter", "url": null }
python, excel, state-machine state_table[5] = [[1,2], [0,2], [5,2], [0,0], [0,2], [0,5], [2,2], [0,2], [0,2], [0,2], [0,2]] # found left-paren; only wrap and insert if not empty, like =row() state_table[6] = [[6,0], [6,0], [6,0], [6,0], [6,0], [6,0], [6,0], [6,0], [6,0], [0,0], [6,0]] # inside curly-braced array
{ "domain": "codereview.stackexchange", "id": 6648, "lm_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, excel, state-machine", "url": null }
graph-theory, co.combinatorics, topological-graph-theory Title: Does a pair of disjoint homotopic cycles in the dual separate the graph? Let $G$ be a graph embedded on an orientable compact surface of genus $g$ so that the embedding is cellular. Consider the dual of the graph $G^*$. Let $C_1$ and $C_2$ be disjoint cycles in $G^*$ that are homotopic to each other and let $E_1$ and $E_2$ be their corresponding edge sets in $G$ respectively. Is $G \setminus (E_1 \cup E_2)$ a disconnected graph? Yes. Let me write $\Sigma$ for the surface on which $G$ and $G^*$ are embedded. Because the cycles $C_1$ and $C_2$ are homotopic, they are also in the same $\mathbb{Z}_2$-homology class. So by definition, the symmetric difference $C_1\oplus C_2$ is the boundary of the union of some subset of faces of $G^*$; call this union of faces $U$. (In fact, either $U$ or its complement $\Sigma\setminus U$ must be an annulus, but this isn't important.) Because $C_1$ and $C_2$ are disjoint, the symmetric difference $C_1\oplus C_2$ is equal to the union $C_1\cup C_2$. In particular, we have $C_1\oplus C_2\ne \varnothing$, which implies that both $U$ and its complement $\Sigma\setminus U$ are non-empty. In other words, the subsurface $\Sigma \setminus (C_1\cup C_2)$ is disconnected.
{ "domain": "cstheory.stackexchange", "id": 1455, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graph-theory, co.combinatorics, topological-graph-theory", "url": null }
Personally, I prefer this method $$|A-\lambda I|=\left| \begin{array}{rrr} -\lambda & -1 & 1\\ -1 & -\lambda & 2 \\ 1 & 2 & -\lambda \\ \end{array}\right|$$ $$=-\lambda\left| \begin{array}{rr} -\lambda & 2\\ 2 & -\lambda \\ \end{array}\right| +\left| \begin{array}{rr} -1 & 2\\ 1 & -\lambda \\ \end{array}\right| +\left| \begin{array}{rr} -1 & -\lambda\\ 1 & 2 \\ \end{array}\right|$$ $$=-\lambda^3+6\lambda-4 =(2-\lambda)(\lambda^2+2\lambda-2)$$ $$=(2-\lambda)\left(\lambda-\sqrt3+1\right)\left(\lambda+\sqrt3+1\right)$$ You can also triangularize the matrix first. This makes the determinant trivial to compute $$|A-\lambda I|=\left| \begin{array}{rrr} -\lambda & -1 & 1\\ -1 & -\lambda & 2 \\ 1 & 2 & -\lambda \\ \end{array}\right|$$ $$=\left| \begin{array}{rrr} -\lambda & -1 & 1\\ 0 & 2-\lambda & 2-\lambda \\ 1 & 2 & -\lambda \\ \end{array}\right|$$ $$=\left| \begin{array}{rrr} -\lambda & -1 & 1\\ 0 & 2-\lambda & 2-\lambda \\ \lambda & 2\lambda & -\lambda^2 \\ \end{array}\right|$$ $$=\left| \begin{array}{rrr} -\lambda & -1 & 1\\ 0 & 2-\lambda & 2-\lambda \\ 0 & 2\lambda-1 & 1-\lambda^2
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850892111574, "lm_q1q2_score": 0.8149173823292495, "lm_q2_score": 0.8289388083214156, "openwebmath_perplexity": 266.9401421652402, "openwebmath_score": 0.8694229125976562, "tags": null, "url": "https://math.stackexchange.com/questions/1509107/making-a-determinant-easier-to-solve-to-find-characteristic-polynomial" }
python, numpy, pandas out = pd.DataFrame(values, dtype=np.float64).fillna(1) print(out) # John Mike Alan # 0 0.010539 0.013201 1.0 # 1 0.011800 0.014756 1.0 # 2 0.013201 0.016477 1.0 # 3 0.014756 1.000000 1.0 # 4 0.016477 1.000000 1.0 # .. ... ... ... # 96 1.000000 1.000000 1.0 # 97 1.000000 1.000000 1.0 # 98 1.000000 1.000000 1.0 # 99 1.000000 1.000000 1.0 # 100 1.000000 1.000000 1.0 # # [101 rows x 3 columns] Note that the hin edges need to be one larger than the labels, because technically, this is interpreted as (59, 60], (60, 61], ..., i.e. including the right edge.
{ "domain": "codereview.stackexchange", "id": 38790, "lm_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, numpy, pandas", "url": null }
optimization, randomized-algorithms Title: Maximization problem I work at a company and i got to a seminar we're they told us to solve this problem below in the picture Is there an algorithm that can help me solve this question. I thought about a randomized algorithm after that i get stuck? The case $k \ge n$ is trivial as you can give different value to every variable, which satisfy all inequalities and thus is optimal. So let's consider $k < n$. This problem can be considered as building a paritition of the $n$ variables in $k$ subsets. All inequalities involving two variables in the same subset are unsatisfied, any other is satisfied. I would first build an efficient structure to count the number of inequalities involving each pair of variables. Basically this is a $n^2$ array, built in $O(m)$. In case $m << n$, a graph may be more efficient than a sparse matrix. Then, let's take arbitrarily $k$ variables and distribute them into the $k$ subsets (give them the $k$ different values). Any inequalities involving these first variables is satisfied (then the arbitrarily may target greedily the largest values in the array). Then loop on the remaining variables. For each $x_i$, evaluate $A^i_k$, the number of unsatisfied inequalities (considering only the variables assigned so far), for each of the $k$ possible assignment. For this, one has to consider every assigned variable in the same subset, this step is $O(n)$. Let's call $S_i = \sum_k A^i_k$. By assigning $k_0$ to $x_i$, you unsatisfy $A^i_{k_0}$ inequalities but satisfy $S_i - A^i_{k_0}$ ones.
{ "domain": "cs.stackexchange", "id": 16936, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optimization, randomized-algorithms", "url": null }
# Write the functional derivative of the Dirichlet energy I have the following functional: $$J(u) = \int_{\Omega} \frac{|\nabla u|^p}{p}\,d\Omega$$ and I want to compute its functional derivative along the direction of an arbitrary test function $$v\in H_0^1$$. I tried applying the limit definition $$J'(u)v = \lim_{\varepsilon \to 0} \frac{J(u+\varepsilon v)-J(u)}{\varepsilon}$$ but I have some problems with the non linear part of the integral. I know that the expected result should be $$J'(u)v=\int_{\Omega}|\nabla u|^{p-2}\nabla u \cdot \nabla v \,d\Omega$$ since imposing $$J'(u)v=0$$ is equivalent to solve weakly the homogeneus p-Laplace equation, but I don't know how to proceed computing this derivative.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471656514752, "lm_q1q2_score": 0.8066497346750654, "lm_q2_score": 0.8198933359135361, "openwebmath_perplexity": 343.4352237267266, "openwebmath_score": 0.9999809265136719, "tags": null, "url": "https://math.stackexchange.com/questions/3274730/write-the-functional-derivative-of-the-dirichlet-energy/3274845" }
javascript, algorithm, array, binary-search console.log("searching big array"); console.log("300 ? : ", binarySearch(BIG, 300)); console.log("45 ? : ", binarySearch(BIG, 45)); console.log("959 ? : ", binarySearch(BIG, 959)); appendix : do I need a search at all ? As a side note, please keep in mind that a binary search will only work on a sorted list, so you'd need to check for that when parsing the input, OR sort it before calling binary search. So as an exercise, your code is fine, but in production code, I'd be pissed if you didn't just compare and return while parsing the input.
{ "domain": "codereview.stackexchange", "id": 26276, "lm_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, algorithm, array, binary-search", "url": null }
performance, c, embedded, natural-language-processing if (ret == NULL) { fprintf(stderr, "Out of memory\n"); exit(0); } return ret; } /** * Takes a part of the source string and appends it to the destination string. * * @param dst Destination string to append to. * @param dstLen Current length of the destination string. This will * be updated with the new length after appending. * @param src Source string. * @param srcBegin Starting index in the source string to copy from. * @param len Length of portion to copy. */ static void append(char *dst, int *dstLen, const char *src, int srcBegin, int len) { if (len > 0) { memcpy(&dst[*dstLen], &src[srcBegin], len); *dstLen += len; } dst[*dstLen] = 0; } int deletion(char *word, char **array, int start_idx) { int i = 0; size_t word_len = strlen(word); for (; i < word_len; i++) { int pos = 0; array[i+start_idx] = checked_malloc(word_len); append(array[i+start_idx], &pos, word, 0, i); append(array[i+start_idx], &pos, word, i+1, word_len-(i+1)); } return i; } int transposition(char *word, char **array, int start_idx) { int i = 0; size_t word_len = strlen(word);
{ "domain": "codereview.stackexchange", "id": 14061, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, c, embedded, natural-language-processing", "url": null }
# Category: Mathematics ## MCQs Mathematics 2 The GRE mathematical reasoning section tests your knowledge of arithmetic, basic algebra, applied mathematics, elementary geometry, and common graphs and charts. Let Starts with the GRE MCQs Mathematics quiz. 1. If $3x-5=x+11$, then $x=$? 2. ABC works two part-time jobs. One week ABC worked 8 hours at one job, earning $\$150$, and$4.5$hours at the other job, earning$\$90$. What were his average hourly earnings for the week? 3. For how many 3-digit whole numbers is the sum of the digits equal to 3? 4. In a cafeteria, the people are either faculty members or students. The number of faculty members is 15% of the total number of people in the cafeteria. After some of the students leave, the total number of persons remaining in the cafeteria is 50% of the original total. The number of students who left is what fractional part of the original number of students? 5. A car dealer who gives a customer a 20% discount on the list price of a car still realizes a net profit of 25% of the cost. If the dealer’s cost is $4800 what is the usual list price of the car? 6.$2000 amount is deposited into a savings account that earns interest at the rate of 10% per year, compounded semi-annually. How much money will there be in the account at the end of one year? 7. If $x+y=8$ and $2x-y=10$ then $x=$? 8. If $x=k+\frac{1}{2}=\frac{k+1}{2}$, then $x=$? 9. If $x=\frac{y}{7}$ and $7x=12$, then $y=?$ 10. A certain photo state machine produces 13 copies every 10 seconds. If the machine operates without interruption, how many copies will it produce in an hour? 11. If the value of a piece of the property decreases by 10% while the tax rate on the property increases by 10%, what is the effect on the taxes? 12. If $7-x=0$, then $10-x=$?
{ "domain": "gmstat.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9901401438236133, "lm_q1q2_score": 0.8314543035820139, "lm_q2_score": 0.8397339596505965, "openwebmath_perplexity": 6251.922139197874, "openwebmath_score": 0.48146066069602966, "tags": null, "url": "https://gmstat.com/category/gre/mathematics/" }
r, simulation # ---- discrete-event simulation # run_event_simulation <- function(t_ordered, machine, dt_recovery) { n_parts <- length(t_ordered) # results data-frame production_df <- data.frame( id = seq(n_parts), t_ordered = t_ordered, t_started = 0, t_completed = 0, no_failures = 0, stringsAsFactors = FALSE ) # Create initial list of tasks. Once produced, a part will be removed from the # queue. product_queue <- create_priority_queue( data.frame( id = production_df$id, t = production_df$t_ordered ), "t" ) t <- 0 while (!is_empty(product_queue)) { queued_part <- peek(product_queue) ind_production_df <- match( queued_part$id, production_df$id ) machine <- update_machine(machine, ind_production_df, production_df, t) if ( should_produce_part(machine, earliest_production_time = queued_part$t, current_time = t) ) { # A machine is available and a part needs to be produced # - pop the scheduled part from the queue; add it back if it's production # fails product_queue <- delete_min(product_queue) machine$is_occupied <- TRUE production_df$t_started[ind_production_df] <- t part <- create_part(machine) if (part$is_failure) { # bad part - add it back to the schedule queued_part$t <- queued_part$t + dt_recovery product_queue <- add(product_queue, queued_part) production_df <- increment_failures(production_df, ind_production_df)
{ "domain": "codereview.stackexchange", "id": 33471, "lm_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, simulation", "url": null }
c, file, comparative-review, windows Which one is better, and why? What is bad about the above examples? Can you show a better example or how you would do it? While there's nothing inherently wrong with either approach, your code does not follow usual Windows conventions for C APIs. Windows APIs will almost never allocate a buffer that the caller must free; those that do will almost always do so with a custom cleanup function. Secondly, by using ANSI characters and APIs instead of Wide characters and APIs, you limit the sets of files you can work with. Now there are certainly tradeoffs in the question of whether caller or callee allocates the buffer. When the callee allocates it, there's little chance of buffer overruns. However there's an increased chance of either a memory leak or attempting to free the memory with the wrong function, although static analysis can help with either of these concerns. This concerns are especially relevant at library interfaces. There's even technically a tradeoff on the ANSI vs Wide character question, but unless you're trying to support Windows 9x systems (now all firmly outdated), the fact that the Wide APIs do not work on those systems should no longer be relevant. If you don't know whether you need to support such cases, it's possible to use 'T' character typedefs and API macros that are dependent on the definition of UNICODE. Finally there's a small concern that you're excluding possible return values from GetFileSize. This is probably okay, because if a file exceeds 4GB, you are less likely to be able to allocate the buffer and read it into memory anyway. But it's worth commenting that this is intentional so that the function can document its limits. To sum up, I would suggest changing most of the above to improve your code. Add comments. Use the Unicode types and APIs. Especially if you are writing a library, have the caller allocate the buffer. Consider supporting static analysis (_In_, _Out_, etc.). And consider checking the high half of GetFileSize's result: BOOL ReadFile_3(_In_ LPCWSTR szFilename, _Out_ LPBYTE lpBuffer, _In_ cbBuffer) { : : :
{ "domain": "codereview.stackexchange", "id": 10473, "lm_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, file, comparative-review, windows", "url": null }
apache-spark, dataframe, scala, pipelines Title: How does "sameModel" mean in Spark ML Pipeline, (Section: Example: Pipeline), from the docs? I'm looking at the Spark ML docs in scala for Section: Example Pipeline https://spark.apache.org/docs/latest/ml-pipeline.html#example-pipeline. From the example, the model is fit using a pipeline (val model), then the pipeline is saved to a directory. The next line is val sameModel = PipelineModel.load("/tmp/spark-logistic-regression-model") I don't see how/where sameModel is being used. I see model being used again on test data. I would've expected the example to use sameModel to show how to invoke the loaded pipeline back into the process. Does sameModel automatically update model? Any insight would be appreciated as I am interested in saving a pipeline following a fit then load it at a later point, but am having issues with: Finding good examples saving & loading Spark ML pipelines, then invoking said loaded pipeline Not fully understanding the examples I see online Any assistance in clarifying what is going on and how to move forward would be greatly appreciated. Thanks! It appears that "sameModel" is just an example of loading the model back without any influence on "model" from the docs.
{ "domain": "datascience.stackexchange", "id": 4162, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "apache-spark, dataframe, scala, pipelines", "url": null }
gazebo, simulation, simulator-gazebo, dependencies, best-practices hector_sensors_gazebo (depends on needed plugins and hector_sensors_description) hector_sonar_gazebo (depends on needed plugins and hector_sonar_description) Originally posted by Stefan Kohlbrecher on ROS Answers with karma: 24361 on 2012-02-08 Post score: 7 Perhaps I'm not interpreting your question correctly, but if you wanted to be able to load your urdf in a real-robot situation, you could use the line: <param name="robot_description" command="$(find xacro)/xacro.py '$(find my_robot_description)/urdf/my_robot.urdf.xacro'" /> or something similar. What I've always seen done is that there are two main files: one urdf that describes only the solid bodies of the robot (named with the .urdf.xacro extension), and one with only the controller descriptions (named with the .gazebo.xacro extension). You then provide two separate wrapper urdf files to be included in your launch files. <param name="robot_description" command="$(find xacro)/xacro.py '$(find my_robot_description)/urdf/robot_real_world.urdf.xacro'" /> or <param name="robot_description" command="$(find xacro)/xacro.py '$(find my_robot_description)/urdf/robot_simulator.urdf.xacro'" /> The file "robot_real_world.urdf.xacro would look like this: <robot name="robot" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:xi="http://www.w3.org/2001/XInclude"> <include filename="$(find my_robot_description)/urdf/body.urdf.xacro" /> </robot>
{ "domain": "robotics.stackexchange", "id": 8146, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo, simulation, simulator-gazebo, dependencies, best-practices", "url": null }
c#, reflection, windows-runtime using System.Linq; using Chess_Club.Models; using Windows.Storage; using System.Diagnostics; namespace Chess_Club.DAL { class ChessClubContext { public List<IEnumerable<Model>> Models = new List<IEnumerable<Model>>(); public List<Game> Games = new List<Game>(); public List<Member> Members = new List<Member>(); private StorageFolder RootFolder; private StorageFolder RootDataFolder; public ChessClubContext() { RootFolder = Windows.Storage.ApplicationData.Current.RoamingFolder; Models.Add(Games); Models.Add(Members); } public async void LoadData() { RootDataFolder = await RootFolder.CreateFolderAsync("Data", CreationCollisionOption.OpenIfExists); foreach (IEnumerable<Model> models in Models) { string modelClassName = models.GetType().GenericTypeArguments.First().Name; StorageFolder modelFolder = await RootDataFolder.CreateFolderAsync(modelClassName, CreationCollisionOption.OpenIfExists); IReadOnlyList<StorageFile> files = await modelFolder.GetFilesAsync(); foreach (StorageFile file in files) { // Some quick reflection to access the property... Saves duplicating this code n times for n as number of lists Type modelType = models.GetType().GenericTypeArguments.First(); dynamic list = (this.GetType().GetRuntimeProperty(modelClassName + "s").GetValue(this)); dynamic loaded = Activator.CreateInstance(modelType); loaded.Deserialize(""); // Pretend I'm actually loading the text around here, for now an empty string is fine. list.Add(loaded); } } }
{ "domain": "codereview.stackexchange", "id": 9564, "lm_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#, reflection, windows-runtime", "url": null }
security, bash Title: Controller web interface security I'm designing a web interface to a controller for my school's bell. Are there any security flaws in this code? The source code is available here. Front End: bell-ringer.cgi: #!/bin/bash function unescape { local s="$1" while [ "a$s" != "a" ]; do if [ "a${s:0:1}" == "a%" -a "a`echo "${s:1:2}" | sed '{s/\([0-9a-fA-F]\)/\1/gp; s/.*//}'`" == "a${s:1:2}" ]; then printf "\x${s:1:2}" s="${s:3}" else printf "%s" "${s:0:1}" s="${s:1}" fi done } function escape { local s="$1" while [ "a$s" != "a" ]; do if [ "a`echo "${s:0:1}" | grep "[a-zA-Z0-9 ]"`" != "a" ]; then printf "%s" "${s:0:1}" else printf "%s" "${s:0:1}" | hexdump -e '/1 "&#%02X;"' fi s="${s:1}" done } function output_content { cat <<EOF Content-Type: text/html; charset=UTF-8
{ "domain": "codereview.stackexchange", "id": 9699, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "security, bash", "url": null }
ros, pi-tracker, skeleton Comment by fergs on 2011-09-12: Note: "process has died [pid 28770, exit code -11]. log files: /home/yuanwei/.ros/log/9cae2868-dddc-11e0-9c14-00256438dd8a/skeleton_tracker-7*.log" --> please check this file (and post it if you need more help). It's solved now. I just svn checkout http://pi-robot-ros-pkg.googlecode.com/svn/trunk/pi_tracker. And it just mysteriously worked!
{ "domain": "robotics.stackexchange", "id": 6669, "lm_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, pi-tracker, skeleton", "url": null }
Armed with this simple recursion it is easy to calculate several numerical cases, and build the cuonjecture that $$H(n,r)=r(n+1)/(r+1)$$. Proving this formula by induction on $$n$$ is then a banal calculation \begin{aligned} H(k+1,r)&=\frac{\binom{k}r H(k,r)+\binom{k}{r-1}(k+1)}{\binom {k+1} r}\\ &=\frac{(k+1-r)H(k,r)+r(k+1)}{k+1}\\ &=(k+1-r)\frac r{r+1}+r\\ &=\frac{(k+2)r}{r+1}, \end{aligned} where in the first step the common factorials of the binomial coefficients were cancelled, and the induction hypothesis was applied in the next step. Anyway, with the induction step thus completed we are done. Not much to it: • An advantage may be to get away without the hockey stick identity. But that identity is useful to know anyway. • A disadvantage may be the need to first build a conjecture as to what the answer is. But this is also a useful skill in problem solving. • Thank you sir for this insight. I have been trying to improve my recursion skills. This will help tons! Upvoted! – Sen47 Jul 26 at 9:53
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.976310532836284, "lm_q1q2_score": 0.8114537057924728, "lm_q2_score": 0.8311430415844384, "openwebmath_perplexity": 349.7637264254024, "openwebmath_score": 0.8971453905105591, "tags": null, "url": "https://math.stackexchange.com/questions/3303126/problem-to-find-arithmetic-mean-of-the-largest-elements-of-r-subsets-of-1-2" }
c++, programming-challenge, c++11, vectors, heap I solved this problem using heaps(since it was tagged under this category). I feel my solution is a bit verbose which includes building a vector from a map and so on. Can you think of any redundancies that can be removed from this solution or any better way of doing it. class CompareHeap { public: bool operator()(const std::pair< char, int> &A, const std::pair< char , int > &B ) { return (A.second < B.second); } }; class Solution { public: string frequencySort(string input) { std::string answer = ""; std::map<char, int> freq; for(auto it = input.begin(); it!= input.end(); ++it) { if(freq.find(*it) != freq.end()) { freq[*it] += 1; } else { freq[*it] = 1; } } std::vector<std::pair<char, int >> v; std::transform(freq.begin(), freq.end(), std::back_inserter(v), [](std::pair<char , int > kv) {return kv;}); std::make_heap(v.begin(), v.end(), CompareHeap()); while(v.size() > 0) { std::pop_heap(v.begin(), v.end(), CompareHeap()); answer += std::string(v.back().second,v.back().first); v.pop_back(); } return answer; } }; Shorter: There are possibilities to make the code shorted without making it less correct/clear. for(auto it = input.begin(); it!= input.end(); ++it)
{ "domain": "codereview.stackexchange", "id": 23772, "lm_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++, programming-challenge, c++11, vectors, heap", "url": null }
collision Title: Create other collision shapes Hello, How could I add more fancy shapes for collision, other than the simple provided primitives : box, sphere and cylinder. I know this would decrease performance, but I definitely have to do so. Thanks!!! Originally posted by mowahed on Gazebo Answers with karma: 3 on 2013-09-26 Post score: 0 Please see the tutorials Originally posted by nkoenig with karma: 7676 on 2013-09-26 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by mowahed on 2013-09-26: Thank you.
{ "domain": "robotics.stackexchange", "id": 3467, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "collision", "url": null }
fft, digital-communications, ofdm Title: Why should the number of subcarriers of OFDM system be a power of 2? I notice that almost all papers use the number of subcarriers of 64, 128,256.. so on, which is a number of $2^k$ and $k$ is an integer. Why is the number of subcarriers always like that? Can we use any number or it must be only using one of those numbers? Implementing an IFFT and FFT engine which is a power of $2$ is easier in hardware and hence if an OFDM system is talked about, it is talked about in $2^k$ length FFT. All practical Communication system based on OFDM use $2^k$ length FFT-IFFT engines. However, for OFDM in principle, it is not required to have FFT-IFFT in power of $2$. There are different factors which may affect the choice of number of sub-carriers based on multi-path channel response in the frequency range of operation and maximum doppler spread the channel expect to suffer.
{ "domain": "dsp.stackexchange", "id": 8838, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft, digital-communications, ofdm", "url": null }
machine-learning, classification, xgboost, cross-validation, generalization With all other techniques used, my cv log_loss decreased but my leaderboard loss increased. I used XGBoostClassifier model. I have removed all correlated features (corr > 0.8) also. Your choice to use a gradient boosting technique makes me think you are doing logistic regression and as such your choice to remove one of the highly correlated variables is, in general, a good idea; removing the extra influence of the variables, here is a good discussion. The fact that you are using cv to compare your approaches is good, this is what it is essentially for but note that as you do this you risk over fitting to the training data similar to doing this with just a training set. An important step I think you have missed is to split your data and create your own test set that you do not touch until hyperparameter tuning is complete to use as a blind test. This should give you equivalent results to the leaderboard test set if you have big enough sample size, your test/train split has equivalent distributions and lastly, if the test set from the leaderboard is, in fact, the same as the data you are using for training. And is it valid to judge my model performs better when my cv score decreases ?
{ "domain": "datascience.stackexchange", "id": 7564, "lm_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, classification, xgboost, cross-validation, generalization", "url": null }
one of each. What does left inverse mean? _\square Since it is both surjective and injective, it is bijective (by definition). The reasoning behind each step is explained as much as is necessary to make it clear. If f has a left inverse then that left inverse is unique Prove or disprove: Let f:X + Y be a function. A linear map having a left inverse which is not a right inverse. (f*g)(x) = f\big(g(x)\big).(f∗g)(x)=f(g(x)). Here r = n = m; the matrix A has full rank. _\square We are using the axiom of choice all over the place in the above proofs. Free functions inverse calculator - find functions inverse step-by-step This website uses cookies to ensure you get the best experience. Example 1 Show that the function $$f:\mathbb{Z} \to \mathbb{Z}$$ defined by $$f\left( x \right) = x + 5$$ is bijective and find its inverse. It is a good exercise to try to prove these on your own as well, and to compare your proofs with those given here. The same argument shows that any other left inverse b ′ b' b ′ must equal c, c, c, and hence b. b. b. {eq}\eqalign{ & {\text{We have the function }}\,f\left( x \right) = {\left( {x + 6} \right)^2} - 3,{\text{ for }}x \geqslant - 6. f(x) = \begin{cases} \tan(x) & \text{if } \sin(x) \ne 0 \\ To prove A has a left inverse C and that B = C. Homework Equations Matrix multiplication is asociative (AB)C=A(BC). Information and translations of left inverse in the most comprehensive dictionary definitions resource on the web. Since gʹ is a right inverse of f, we know that y = f(gʹ(y)). The transpose of the left inverse of is the right inverse . If only a right inverse
{ "domain": "ingenium-elearning.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9648551515780319, "lm_q1q2_score": 0.8312595779357588, "lm_q2_score": 0.8615382076534742, "openwebmath_perplexity": 596.7027181393795, "openwebmath_score": 0.9139620065689087, "tags": null, "url": "http://stereotypes.ingenium-elearning.com/qrbqo/jake-wood-mgfn/qg6ek.php?5e26de=left-inverse-is-right-inverse" }
ros, laserscanner, laserscan, pointcloud Originally posted by stevemacenski with karma: 8272 on 2017-12-20 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by Mekateng on 2017-12-21: I converted laserscan to pointcloud Mr. @smac . Using the pointcloud form , How do we organize this code? so I ask how do you do something in the code. Comment by stevemacenski on 2017-12-21: I trust that once you look at the ros_pcl documentation to convert, you'll understand how to do it. Comment by Mekateng on 2017-12-21: I looked it but ı couldn't do this unfortunately. @smac Comment by RayROS on 2019-12-30: Hello, I am having the same problem. I have a pointCloud2 message. How do I calculate the distance from the origin to a point cloud? Have you solve it? If you did, could you please share the solution? Thank you very much :) Comment by Delbina on 2022-08-05: @Mekateng gravatar would you please share the correct code?
{ "domain": "robotics.stackexchange", "id": 29584, "lm_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, laserscanner, laserscan, pointcloud", "url": null }
quantum-gate, circuit-construction Title: quantum gates hamiltonian How could we construct a circuit with quantum gates for desired time-dependent hamiltonian? For example suppose we wanna construct for below 3 types of hamiltonian : a simple hamiltonian and time_independent without dissipation :$ 2\sigma_x+ 3 \sigma_z$ a time dependent hamiltonian without dissipation : $2\sigma_x+ 3t \sigma_z$ time dependent hamiltonian with dissipation Is there a general solution for construct gates for these hamiltonians ? Given an initial state $\vert \psi_0 \rangle$ and a Hamiltonian $H$ for the system, the system evolves (in the non-relativistic limit) from time $t_0$ to $t_1$ by $$\vert \psi_1 \rangle = e^{-iH(t_1-t_0)}\vert \psi_0 \rangle = U_t \vert \psi_0 \rangle,$$ where $H$ is Hermitian resulting in $U_{t}$ being unitary. The time evolution described by this equation can be represented in a quantum circuit by preparing the state $\vert \psi_0 \rangle$ and then applying a $U_{t}$ gate. Setting $\vert \psi_0 \rangle = \vert 0 \rangle$ and $t = t_1-t_0$ a quantum circuit representing the equation above is nothing more than
{ "domain": "quantumcomputing.stackexchange", "id": 1621, "lm_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-gate, circuit-construction", "url": null }
The business about passing through the origin is not relevant. Your definition is perfectly fine. The issue is whether there exist constants $a$ and $b$, not both $0$, that (simultaneously) work for all $t$. For the purpose of finding such constants, or showing that they do not exist, $t=0$ is completely useless. But you could for example take the two values $t=1$ and $t=-1$ (or $-17$). You obtain the two linear equations $a+b=0$ and $-a+b=0$, which have only the solution $a=b=0$. @user6312 @FredrikMeyer Hi, thanks for all your replies. So my definition should include the statement "for all non-trivial $t$ in $I$", is that what all of you are saying? That's the bit that worries me, what happens when $t=0$. But I can't include it otherwise this would render my proof redundant, is that right? Thanks. –  user38268 Apr 2 '11 at 0:08 For linear dependence, you want to show that there exist $a$ and $b$, not both $0$, such that $af(t)+bg(t)=0$ for all $t$ (that is, identically). For linear independence, you want to show that there is no $a$ and $b$ (not both $0$) which works for all $t$. The point is that for any functions $f$ and $g$, and any $k$ such that $f(k)=g(k)=0$, the value of the functions at $t=k$ cannot help you to prove linear independence. –  André Nicolas Apr 2 '11 at 0:43 I think I can point to part of the source of confusion. You are using matrices, which is perhaps overly fancy. In terms of matrices, however, to prove linear independence it is enough to show that the determinant is non-zero for some choice of $x$ and $y$. That the determinant is $0$ for some other choices does not matter. –  André Nicolas Apr 2 '11 at 0:59
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822877023336244, "lm_q1q2_score": 0.8206851999751072, "lm_q2_score": 0.8354835330070839, "openwebmath_perplexity": 69.08001491016557, "openwebmath_score": 0.9048807621002197, "tags": null, "url": "http://math.stackexchange.com/questions/30418/linear-dependence-of-functions-that-pass-through-the-origin" }
cosmology, cosmological-inflation Title: Number of e-foldings in inflationary cosmology Is there a physical principle limiting the number of e-foldins during cosmological inflation? What is the upper bound on the possible number of e-foldings? Generally, there is not limit. But we are usually interested in the "observable" inflation which is limited to around $50-60$ e-folds, depending on the model. "Observable" means that we can observe the density fluctuations generated during those $50-60$ e-folds, as CMB fluctuations. The fluctuations generated earlier than $60$ e-folds before the end of inflation are (currently) unobservable.
{ "domain": "physics.stackexchange", "id": 86033, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology, cosmological-inflation", "url": null }
c#, object-oriented //Check for Fish nearby direction = fishNearBy(x, y, sharkScent); Debug.WriteLine("direction: " + direction); if (direction == 0) direction = rnd.Next(1, 5); { switch (direction) { case 1://East. If Index 0 move to TableEnde if (newY > 0) { newY = newY - 1; moved = true; } else { newY = TableY - 1; moved = true; } break; case 2://West. If TableEnde move to 0. if (newY < TableY - 1) { newY = newY + 1; moved = true; } else { newY = 0; moved = true; } break; case 3://North. If top reached try again if (newX > 0) { newX = newX - 1; moved = true; } break; case 4://South. If bottom reached try again if (newX < TableX - 1) { newX = newX + 1; moved = true; } break; default: break; }//switch }//if if (myArray[newX, newY].fishType == fishTypeEnum.fish) { Debug.WriteLine("Fisch gefangen"); eatFish(newX, newY); myArray[x, y].ageStarvation = 0; ; } if (moved) { Debug.WriteLine("Hai bewegen"); myArray[newX, newY].cellColor = myArray[x, y].cellColor; myArray[newX, newY].fishType = myArray[x, y].fishType; myArray[newX, newY].age = myArray[x, y].age + 1; myArray[newX, newY].ageStarvation = myArray[x, y].ageStarvation + 1; myArray[newX, newY].moved = true;
{ "domain": "codereview.stackexchange", "id": 18359, "lm_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#, object-oriented", "url": null }
telecommunication, signal-processing The tones have been carefully selected to minimize harmonic interference and the probability that a pair of high and low tones will be simulated by the human voice, thus protecting network control signaling. The nominal voiceband channel is defined as 4 kHz although the speech signal is essentially bandlimited to between 200 Hz and 3.5 kHz. The additional bandwidth allows for a guard band on either side of the speech signal to lessen interference between channels. DTMF Frequencies An abandoned patent from 2005 describes a triple tone modulation frequency (TTMF) tone system for Bi-directional continuous voice and video quality testing system with TTMF tones. They used: 650Hz[f1], 750, 850, 950, 1050, 1150[f6], 1250[f7], 1350, 1450, 1550 and 1650. In order to avoid harmonics, the three frequencies comprising a TTMF tone may be chosen according to the following rules: (a) no frequency is a multiplier of another frequency; (b) the difference between any two frequencies is not equal to any of the frequencies; and (c) the sum of any three frequencies is not equal to any of the frequencies. Thus a permitted TTMF tone is a tone signal comprising, e.g., three frequencies such as ƒ1, ƒ6, and ƒ7 (as shown in the second column of Table 1). Digits: 0: f1, f6, f7; 1: f2, f6, f8; 2: f3, f6, f9; 3: f4, f6, f10; 4: f4, f6, f11; 5: f1, f6, f8; 6: f2, f6, f9; 7: f3, f6, f9; 8: f4, f6, f11; and 9: f5, f6, f7. With other combinations for E-TTMF flag signals representing decimal digits from 10 - 99. Digits 10-99 had two functions: (a) indicating the end of the played voice/video sample testing file; and (b) representing the two digit decimal portion of the voice/video quality measurement result.
{ "domain": "engineering.stackexchange", "id": 3534, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "telecommunication, signal-processing", "url": null }
orbital-motion, rocket-science, celestial-mechanics Title: Hohmann Transfer and Lagrange Point I recently learned about Lagrange points and Hohmann transfer orbit concepts. I need to confirm some facts. I looked up several sites but found no answer. I wanted to find whether spaceships are targeted to a Lagrange point when sent through a Hohmann orbit. Ex - In Earth to mars travel, will the spaceship be sent to a Sun-Mars Lagrange point in order to enter the orbit. Are Lagrange points used to enter and exit orbits around planets when being slingshot? In the general case: when planning a Hohmann transfer the Lagrange points are irrelevant. The only connection, I think, is when the destination orbit of a spacecraft is to actually orbit near a particular Lagrange point. Then the engine burn to ascend to the intended altitude is timed such that when the spacecraft arrives at altitude it also arrives near the intended Lagrange point. That is the most fuel efficient way to get there. In the case of gravitational assist the spacecraft does a close fly-by. On the other hand, none of the Lagrange points associated with a planet are close to that planet. Hence the Lagrange points are irrelevant for planning gravitational assist trajectory.
{ "domain": "physics.stackexchange", "id": 80253, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "orbital-motion, rocket-science, celestial-mechanics", "url": null }
ros-melodic Set( LIB_ARCHITECTURE ${CMAKE_SYSTEM_NAME}) else() set(STATIC_LIB_PREFIX lib) set(DYNAMIC_LIB_SUFFIX so) if( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7at2hf-neon-angstrom" ) Set (CMAKE_CXX_LIBRARY_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR} ) endif() if( "${CMAKE_CXX_LIBRARY_ARCHITECTURE}" STREQUAL "" ) set(CMAKE_CXX_LIBRARY_ARCHITECTURE ${CMAKE_SYSTEM_NAME}) endif() Set( LIB_ARCHITECTURE ${CMAKE_CXX_LIBRARY_ARCHITECTURE}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") #set( SYSTEM_LIBRARIES "-lrt -lpthread") # Enable static linking for gcc and stdc++ set(CMAKE_SHARED_LINKER_FLAGS "-static-libstdc++ -static-libgcc ${CMAKE_SHARED_LINKER_FLAGS}") set( zLIBWARPPER_LIB ${CMAKE_CURRENT_SOURCE_DIR}/libs/zLibWrapper/${LIB_ARCHITECTURE}/${SDK_PLATFORM_NAME}/${CMAKE_BUILD_TYPE}/${STATIC_LIB_PREFIX}zLibWrapper.${DYNAMIC_LIB_SUFFIX} ) endif()
{ "domain": "robotics.stackexchange", "id": 35445, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-melodic", "url": null }
turing-machines, strings, string-metrics Title: Are two strings equal if all deciders for a language take the same amount of time for both? Let $X_*^L$ be the set of all deterministic Turing machines $M$ which decide the language $L$ and have the property: $\forall x,y \in \Sigma^*: t_M(xy) \ge t_M(x) + t_M(y)$ (**) where $t_M(w)$ is the time of $M$ on input $w$. Define for all $x,y\in \Sigma^*$: $d(x,y) := \max_{M \in X_*^L} \frac{|t_M(x) - t_M(y)|}{t_M(xy)+t_M(yx)}$ Then, because of (**) we have $t_M(yx) + t_M(xy) \ge 2(t_M(x)+t_M(y))$ from which it follows that: $\frac{|t_M(x) - t_M(y)|}{t_M(xy) + t_M(yx)} \le 1/2 \frac{|t_M(x)-t_M(y)|}{t_M(x) + t_M(y)} \le 1/2 \frac{ |t_M(x)| + |t_M(y)|}{t_M(x) + t_M(y)} = \frac{1}{2}$ Hence we get $d(x,y) \le 1/2$. My question is this: Does $d(x,y) = 0$ which is equivalent to $\forall M \in X_*^L: t_M(x) = t_M(y)$ imply that $x = y$? The reason for asking this question, is that I am trying to define a metric on strings which has "something to do with the time-complexity of Turing machines".
{ "domain": "cs.stackexchange", "id": 7140, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "turing-machines, strings, string-metrics", "url": null }
with impulse response$h[n]$, one can compute its response to any input$x[n]$by a convolution sum: $$y[n] = x[n] \star h[n] = \sum_{k=-\infty}^{\infty} {h[k]x[n-k]} \tag{1}$$ Without anything further stated, above definition is for the linear convolution (aperiodic convolution) between$h[n]$and$x[n]$, which are ... 9 The proof of associativity of discrete convolution relies on the assumption that multiple infinite sums can be evaluated in any order. This is not true if some of the involved sequences do not converge absolutely, which is the case for the given sequences$x_1[n]$and$x_2[n]$. Note that the convolution sum$x_1\star x_2$does not converge, i.e.,$x_3\star (...
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639686018701, "lm_q1q2_score": 0.8475412886269702, "lm_q2_score": 0.8723473862936942, "openwebmath_perplexity": 544.11270736401, "openwebmath_score": 0.7695232033729553, "tags": null, "url": "https://dsp.stackexchange.com/tags/convolution/hot?filter=all" }
electromagnetism, special-relativity On the other hand, if you choose the Lorenz gauge, then both the scalar and vector potentials satisfy the wave equation $$\left(\nabla^2 - \frac{1}{c^2}\frac{\partial^2}{\partial t^2}\right)\phi = -\rho/\epsilon_0$$ $$\left(\nabla^2 - \frac{1}{c^2}\frac{\partial^2}{\partial t^2}\right)\vec A = -\mu_0 \vec J $$ In this case, changes in both potentials propagate outward at the speed of light.
{ "domain": "physics.stackexchange", "id": 43121, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, special-relativity", "url": null }
# Optimal stacking of bricks I need an algorithm to optimally stack a set of bricks in a 2D plane so that the resulting wall is as vertically short as possible. Bricks are defined as a pair of integers $$(x_1, x_2)$$ corresponding to the horizontal span of $$\textit{width} = x_2 - x_1$$ and are of equal height. Bricks cannot be translated left or right, they are only allowed to "fall" in place vertically from their original horizontal position. This is conceptually similar to a game of Tetris where instead of moving bricks, the player decides the order in which they fall. For example, in the following figure, arrangement A is the worst possible while B and C are equally optimal. The numbers inside the bricks indicate a possible stacking order. Bricks can number in the thousands so exhaustive evaluation of all possible permutations is not conceivable. • @greybeard - The numbers inside the bricks are meant as a possible stacking order to achieve the corresponding result. I edited the figure description to make this more explicit. Oct 25 '21 at 19:01 • Do you need to worry about bricks toppling if unsupported? (If these were physical bricks, bricks 2, 3, and 4 in example A would fall to the right; and in example B brick 2 would fall to the left.) Oct 26 '21 at 23:11 • @gidds - I used brick stacking order merely as a metaphor to simplify the explanation of the actual problem I'm trying to solve so I'm not interested in the mechanical behaviour of bricks. Perhaps a better metaphor would have been "minimizing the number of classrooms necessary to accommodate a schedule of classes", but the brick-based one came to mind first. Oct 27 '21 at 1:46 Consider a graph whose vertices are the intervals, and whose edges correspond to intersecting intervals. This is an example of an interval graph. In a solution, all intervals on a given row of the solution are non-intersecting. Therefore, if we color each interval according to the line it is on, we get a valid coloring of the graph. Conversely, given a valid coloring of the graph, we get a solution to your problem whose height is the number of different colors: simply drop all intervals colored 1, then all intervals colored 2, and so on.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9843363492205764, "lm_q1q2_score": 0.8137624692331197, "lm_q2_score": 0.8267117940706734, "openwebmath_perplexity": 368.09300046242015, "openwebmath_score": 0.6356682777404785, "tags": null, "url": "https://cs.stackexchange.com/questions/145083/optimal-stacking-of-bricks/145084#145084" }
special-relativity, spacetime, coordinate-systems, inertial-frames Of course, I don't doubt that $\gamma = \frac{1}{\sqrt{1-\frac{v^2}{c^2}}}$, but I wonder where the mistake in my calculations is, or if that standard approach to calculating gamma by watching a moving train with a travelling photon in it, only works in the case the photon's motion is perpendicular to the train's motion. Let's look at the red side of the triangle in your diagram where $\alpha \neq 0$. In the frame where the clock is moving (the "lab frame"), this is the distance between the emitter and the receiver at the time the light is received—with all measurements made in the lab frame. By labeling it as "$ct$", you have made the implicit assumption that this red distance is equal to the distance between the emitter and the receiver as measured in a frame moving with the light-clock (the "clock frame"). The problem is that this is not necessarily the case. In the case where $\alpha = 0$, the distance between the emitter and the receiver is perpendicular to the relative motion, and it can be argued (via symmetry considerations) that distances measured perpendicular to the frames' relative motion must be the same in both frames.* But if $\alpha \neq 0$, there's a component of this distance that is parallel to the relative motion, and we are not guaranteed that the red distance in your diagram—which is measured in the lab frame—is in fact the same as the distance measured in the clock frame. *Any source that doesn't make an argument concerning the invariance of perpendicular displacements before introducing the light-clock argument is taking questionable shortcuts at best.
{ "domain": "physics.stackexchange", "id": 86093, "lm_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, spacetime, coordinate-systems, inertial-frames", "url": null }
python, numpy Title: Extracting an arbitrary element from each row of a np.array I have a large numpy array of shape (n,m). I need to extract one element from each row, and I have another array of shape (n,) that gives the column index of the element I need. The following code does this, but it requires an explicit loop (in the form of a list comprehension.): import numpy as np arr = np.array(range(12)) arr = arr.reshape((4,3)) keys = np.array([1,0,1,2]) #This is the line that I'd like to optimize answers = np.array([arr[i,keys[i]] for i in range(len(keys))]) print(answers) # [ 1 3 7 11] Is there a built-in numpy (or pandas?) function that could do this more efficiently? The best way to do this is how @GarethRees suggested in the comments: >>> arr[np.arange(4), keys] array([1, 3, 7, 11]) There is another (not as good) solution that is a better alternative to using arr[i, keys[i]] for i in range(len(keys)). Whenever you want both the index and the item from some iterable, you should generally use the enumerate function: >>> np.array([arr[i, item] for i, item in enumerate(keys)]) array([1, 3, 7, 11])
{ "domain": "codereview.stackexchange", "id": 16515, "lm_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, numpy", "url": null }
control-engineering, control-theory, matlab eqtn = @(t,x,y) [x(2)-interp1(tspan(:),y(:),t) ; -3*x(2)-2*x(1)+3*interp1(tspan,y(:),t)]; x = [0;0]; [~,phi_1] = ode45(@(t,x)eqtn(t,x,y),tspan, x); eqtn = @(t,x,y) [x(2) ; -3*x(2)-2*x(1)-interp1(tspan,y(:),t)]; x = [0;0]; [~,phi_2] = ode45(@(t,x)eqtn(t,x,y),tspan, x); eqtn = @(t,x,u) [x(2) ; -3*x(2)-2*x(1)+interp1(tspan,u(:),t)]; x = [0;0]; [~,phi_3] = ode45(@(t,x)eqtn(t,x,u),tspan, x); z = [phi_1(:,1) phi_2(:,1) phi_3(:,1)]; It is assumed that the vectors $\ y \ \& \ u $ are known and represent the output and the input of the original system correspondingly.
{ "domain": "engineering.stackexchange", "id": 3161, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "control-engineering, control-theory, matlab", "url": null }
c# if (piece != lastPiece) { connected = 1; lastPiece = piece; continue; } connected++; if (connected == 4) { return lastPiece; } } return Piece.None; } private void RevertPlayer() { PlayerTurn = PlayerTurn == Piece.Red ? Piece.Yellow : Piece.Red; } private Piece[] GetRow(byte rowIndex) { return Enumerable.Range(0, ColumnsCount).Select(m => GameBoard[rowIndex, m]).ToArray(); } private Piece[] GetColumn(byte columnIndex) { return Enumerable.Range(0, RowsCount).Select(m => GameBoard[m, columnIndex]).ToArray(); } } }
{ "domain": "codereview.stackexchange", "id": 37099, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#", "url": null }
# zbMATH — the first resource for mathematics ##### Examples Geometry Search for the term Geometry in any field. Queries are case-independent. Funct* Wildcard queries are specified by * (e.g. functions, functorial, etc.). Otherwise the search is exact. "Topological group" Phrases (multi-words) should be set in "straight quotation marks". au: Bourbaki & ti: Algebra Search for author and title. The and-operator & is default and can be omitted. Chebyshev | Tschebyscheff The or-operator | allows to search for Chebyshev or Tschebyscheff. "Quasi* map*" py: 1989 The resulting documents have publication year 1989. so: Eur* J* Mat* Soc* cc: 14 Search for publications in a particular source with a Mathematics Subject Classification code (cc) in 14. "Partial diff* eq*" ! elliptic The not-operator ! eliminates all results containing the word elliptic. dt: b & au: Hilbert The document type is set to books; alternatively: j for journal articles, a for book articles. py: 2000-2015 cc: (94A | 11T) Number ranges are accepted. Terms can be grouped within (parentheses). la: chinese Find documents in a given language. ISO 639-1 language codes can also be used. ##### Operators a & b logic and a | b logic or !ab logic not abc* right wildcard "ab c" phrase (ab c) parentheses ##### Fields any anywhere an internal document identifier au author, editor ai internal author identifier ti title la language so source ab review, abstract py publication year rv reviewer cc MSC code ut uncontrolled term dt document type (j: journal article; b: book; a: book article) Is Gauss quadrature better than Clenshaw-Curtis? (English) Zbl 1141.65018
{ "domain": "zbmath.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9843363545048391, "lm_q1q2_score": 0.8137624778042695, "lm_q2_score": 0.8267117983401363, "openwebmath_perplexity": 7885.542298839636, "openwebmath_score": 0.8054840564727783, "tags": null, "url": "http://zbmath.org/?q=an:1141.65018" }
fluid-dynamics, surface-tension, turbulence Title: Why don't we see turbulence on the surface of liquids By turbulence I mean a chaotic field full of eddies. As far as I'm aware this is the state of most fluids, like the airflow in an room, unless effort has been taken to make the flow laminar. Shouldn't these movements be visible everywhere on the surface of bodies of water, as distorting their ripples and waves? Sometimes vortices do appear, but just a few at a time under specific conditions and not in the same chaotic fashion as turbulence would suggest. A possible explanation I can think of is that momentum carried through turbulence is negligible compared to surface tension and forces creating waves. So disturbances don't deform the surface even though they exist a short distance below it. It takes a strong current to distort the surface visibly. A chaotic turbulent flow can be present where most of the flow is not strong. If you stir a cup of coffee, you only see a whirlpool distort the surface distort for a moment, even though the flow continues flow continues for a while.
{ "domain": "physics.stackexchange", "id": 76973, "lm_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, surface-tension, turbulence", "url": null }
java, algorithm, programming-challenge slow[x][y] == fast[x + y * width]; This also goes for your visited list. For the love of ${DEITY}, don't encode coordinates into strings Instead of String pos = x+"."+y; simply use Point pos = new Point(x,y). Much faster, especially since you don't have to parse out the x and y values when you use it. Use the correct data structure and algorithm for unvisited nodes You are storing your unvisited nodes in a list and doing a linear search through it for the next unvisited node. This is what is ruining your algorithm performance of Dijkstra, going from O(E + VlogV) to O(E + V^2) and why it takes 30 seconds for your machine. First off you only need to store the currently accessible, unvisited nodes. This alone would significantly speed up your search for the unvisited node with smallest cost. You can do this by adding the neighbours of the current node to the unvisited nodes set only if they don't already exist in the set. (You can keep an additional matrix with nodes that have been added or you can query the set if it contains the node provided you have O(logn) lookup). Next as you will be taking the smallest element as the next node, it makes sense to use an ordered data structure such as a heap or also known as a PriorityQueue in Java. Note that if you do use the priority queue you need to remove and re-add elements as you change their cost so that they get re-sorted in the queue. Use an Object Oriented Solution You have many matrixes (arrays) of the same size that represent different properties of each node. It makes sense to just consolidate these arrays into one array of nodes where each node has properties. Like this: class DijkstraNode{ double value; double bestCostThisFar = Double.PositiveInfinity(); boolean visited = false; boolean addedToUnvisited = false; int x; int y; } DijkstraNode graph[] = new DijkstraNode[mEdge*mEdge]; PriorityQueue<DijkstraNode> unvisited = new PriorityQueue<>(mEdge*mEdge, comparator);
{ "domain": "codereview.stackexchange", "id": 14064, "lm_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, algorithm, programming-challenge", "url": null }
evaluating the sums of the infinite geometric series, summation notation, finding the first term and common ratio and more. Geometric sequence is a list of numbers where each term is obtained by multiplying the previous term by a constant. There are examples, "You-Dos" (student practice problems), and word problems as wel. )The rst term is a,thenumberris called the ratio (note to get from one term to the next term you multiply by the ratio) and arn is the last term. A mathematician who works in the field of geometry is called a geometer. 8 ARITHMETIC AND GEOMETRIC SEQUENCE WORD PROBLEM EXAMPLES All final solutions MUST use the formula. Arithmetic Sequences and Geometric Sequences This algebra 1 and 2 video provides an overview of arithmetic sequence geometric series. 19) Write the following Geometric series in sigma notation: 6 + 12 + 24 + + 384 20) Determine how many seats are in an auditorium with 30 rows of seats if there are 20 seats in the first row, 24 seats in the second row, 28 seats in the third row, and so on. 19) An auditorium contains 10 seats in the first row, 12 seats in the second, 14 in the third, and so on. Tuesday April 4: Page 838 - Sigma Notation (College Algebra) Wednesday April 5: Page 851 (College Algebra) Problems: 35-52. and the three terms in the sequence after the last one given. 1, 2, 4, 8, 16, 32, 64, 128, 256, This sequence has a factor of 2 between each number. Write a rule for the nth term of the geometric sequence. This lesson covers finding the sum of a geometric series using the formula and the calculator. Percentage shortcuts. 5 From Algebra: Themes, Tools, Concepts, by Anita Wah and Henri Picciotto, Teacher's Guide Equations Even though the word is not mentioned, these problems give students another opportunity to think about the mean. Part 2: Geometric Sequences Consider the sequence$2, 4, 8, 16, 32, 64, \ldots\$. Say hello to a different functioning and operating style of handling sequence and sums of arithmetic problems and solutions as the installation of the arithmetic sequence and sums will make your mind easy. Is there an example where we don. Word problems included. We can write a formula for the n th term of a geometric sequence in the form a n = a r n ,
{ "domain": "amicidellacattolica.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517418068649, "lm_q1q2_score": 0.8213032658134325, "lm_q2_score": 0.839733963661418, "openwebmath_perplexity": 681.0068812401423, "openwebmath_score": 0.5177739858627319, "tags": null, "url": "http://dtzi.amicidellacattolica.it/geometric-series-word-problems-pdf.html" }
greedy-algorithms, gradient-descent Title: The preliminary of the Bandit Gradient Algorithm In the papers introducing The Bandit Gradient Algorithm as Stochastic Gradient Ascent, the following relationship: is always considered as a preliminary and lacks proof for it. Does anyone know how does this relationship come about? ($\pi_t(x)$ is the probability of choosing action $x$ at time $t$ and $q_*(x)$ is the mean reward for action $x$) This follows almost immediately from the definition of expectation, when we sample the actions with the distribution that $\pi_t$ (the bandit) defines, and the inherent randomness of the model. First, let us make sure we use the same terminology: $\pi_t(x)$ is the probability that the bandit chose action $x\in\text{Actions}$ $R(x,r)$ will be the probability we got reward $r\in [0,R_{max}]$, when we play action $x\in \text{Actions}$ $q_*(x)$ will be $\mathbb{E}_{~r\text{~} R(x,\cdot)}[r]$, which is exactly the average reward when you play action $x$.
{ "domain": "cs.stackexchange", "id": 19110, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "greedy-algorithms, gradient-descent", "url": null }
• If some leaf is black, color it red. This increments $$T(X)$$ by $$1$$. • If all leaves are red, pick any black internal node $$v \in G$$. Suppose its degree is $$a > 1$$. Since $$G$$ is a tree, $$G - \{v\}$$ is a new graph which is a collection of $$a$$ separate trees (including possibly singleton nodes). Each of these $$a$$ smaller trees has at least one leaf belonging to the original $$G$$. Thus the original $$G$$ has at least $$a$$ leaves (which are, by assumption, all red). Now, change $$v$$ from black to red, and change any $$a-1$$ leaves from red back to black. This increments $$T(X)$$ by $$1$$. We can keep doing this until all nodes are red, at which point $$T(X) = 2n-2$$. Thus $$T()$$ goes through $$\{0, 1, 2, ..., 2n-2\}$$, proving it is surjective. • That's a very nice write up the graph-theoretic approach! Do you see a nice way to extend it to a sum of $2n-1$? – Calvin Lin Apr 12 at 15:40 • @CalvinLin - sure. Just add one more $1$, i.e. an extra leaf, call it $L$, and make sure it never turns red. So Case 1 reads "if some non-$L$ leaf is black..." and, in Case 2, when you turn $v$ red, one of the subtrees must contain $L$, and the other $a-1$ subtrees provide the $a-1$ leaves you need to turn black, without having to touch $L$. So using only non-$L$ nodes (i.e. the original nodes) you can traverse $0, 1, ... 2n-1$. – antkam Apr 12 at 17:14
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9728307676766118, "lm_q1q2_score": 0.816919034561936, "lm_q2_score": 0.8397339616560072, "openwebmath_perplexity": 6931.303955703207, "openwebmath_score": 1.0000096559524536, "tags": null, "url": "https://math.stackexchange.com/questions/3178648/proving-surjectivity-of-some-map-from-a-power-set-to-a-subset-of-integers/3190641" }
homework-and-exercises, kinematics I said very little mathematics, actually I did a bit of a trick, one that is useful in more circumstances than this. What I've done is called asymptotic analysis (examining the limiting behavior of the system). Often this can simplify the math quite a bit, and since the math wasn't too complicated to begin with, it's almost gone here!
{ "domain": "physics.stackexchange", "id": 24768, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, kinematics", "url": null }
species-identification, mycology Title: What is these mushrooms in my indoor pot? I am living in Japan and in summer, it's very hot and humid even inside my room. Today, I've found two mushrooms in the pot of a plant. What is this species? It's very surprising than within one day they grew like this. They do look a lot like a common mushroom called "shaggy mane" mushroom (Coprinus comatus). This may not be a correct identification though, so do not eat them. They are widespread around the world, but usually grow outside. Yes it is amazing how rapidly the fruiting body of many fungi can grow. I am providing an interesting Wikipedia link with more information. You can also search to find other images using Google images online. https://en.wikipedia.org/wiki/Coprinus_comatus
{ "domain": "biology.stackexchange", "id": 8881, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "species-identification, mycology", "url": null }
Chelsey Cooley | Manhattan Prep Instructor | Seattle and Online Did you like this post? Check out my upcoming GMAT classes and private tutoring! Manhattan Prep GMAT Discount | Manhattan Prep GMAT Reviews Re: Factorial   [#permalink] 28 Feb 2016, 22:32 Similar topics Replies Last post Similar Topics: 1 Simplifying Factorials 1 13 Mar 2016, 03:13 6 Power of a Number in a Factorial Problems 1 09 Jul 2014, 08:34 2 To convert factorials in 2^k*3^m.... format 0 20 Apr 2010, 11:10 360 Everything about Factorials on the GMAT 72 05 Oct 2009, 05:02 PS - sum of factorials 9 28 Apr 2007, 05:08 Display posts from previous: Sort by
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9504109798251322, "lm_q1q2_score": 0.8695319218988772, "lm_q2_score": 0.9149009642742805, "openwebmath_perplexity": 3373.8421979203454, "openwebmath_score": 0.5322432518005371, "tags": null, "url": "http://gmatclub.com/forum/factorial-94770.html?fl=similar" }
soft-question Title: What CS blogs should everyone read? Many top notch computer science researchers and research groups) maintain active blogs that keep us updated on the latest research in the authors' fields of interest. In most cases, blog posts are easier to understand than formal papers, because they omit most of the gory technical details and emphasize intuition (which papers generally omit). Thus, it would be useful to have a list of recommended blogs, in the same spirit as other lists of recommended resources: What papers should everyone read? What books should everyone read? What are the recent TCS books whose drafts are available online? What videos should everybody watch? What lecture notes should everyone read? Of course one can follow the excellent Theory of Computing Blog Aggregator, but that list is rather overwhelming, especially for beginners. Please highlight why you recommend them. It might come as no surprise, but there is a substantial overlap between cstheory Q&A power-users and the blogosphere. We even had a dedicated blog for a while, with some great posts but it fell into disuse. However, I thought I would list some of the blogs run by our top 38 users that have had new posts since 2012:
{ "domain": "cstheory.stackexchange", "id": 2936, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "soft-question", "url": null }
pressure, vacuum, instrument Title: What affect does pipe diameter have on a manometer? I am building a DIY hoover and want to test different technical configurations of the device (hose diameter, hose length, motor RPM, motor voltage, cavity size, etc). My objective for testing these different configurations is to find the utility sweet spot of the device. For example I want a large diameter hose (lets say 3 in) that is somewhat long, lets say (10 ft). In order to achieve this I will have to have a smaller vacuum cavity or higher RPM motor. I am hoping to use the hoover's sucking ability as a prime metric in figuring out the perfect sweet spot. Based on this answer: https://woodworking.stackexchange.com/questions/768/what-advantages-does-a-dust-collector-have-over-a-shop-vac As of this writing, a ”6.5 peak horsepower” Shop-Vac® vacuum rated at 9.3A@120V produces 185 CFM (87 l/s) of airflow and 64 inches (160 mbar) of pressure.
{ "domain": "physics.stackexchange", "id": 25532, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pressure, vacuum, instrument", "url": null }
javascript, node.js Title: Sending periodic heartbeats, wondering if there are any timer bugs What? heartbeatjs is a small light weight library that helps you run periodic heartbeat functions and detects timeouts when they occur by launching events. It was mainly designed for tcp/ip connections, but you can use it with any protocol you want as it designed to be generic. Project The project page, with examples and documentation can be seen here: https://fl4m3ph03n1x.github.io/heartbeatjs/index.html Code This library is mostly a collection of getters and setters mixed with some timers. I would like a second opinion regarding the code and any possible bugs one may find, as I am about to release the next version next week. const isFunction = require("lodash.isfunction"); const DEFAULT_TIMEOUT = 5000; const DEFAULT_INTERVAL = 3000; const heartBeatFactory = () => { let interval = DEFAULT_INTERVAL, timeout = DEFAULT_TIMEOUT, ping, pong, timer, lastHeartbeatTime, timeoutTimer, hasStarted = false; const events = { timeout: () => {} }; const hasTimedOut = () => Date.now() - lastHeartbeatTime > timeout; const getBeatInterval = () => interval; const setBeatInterval = newInterval => { if(isNaN(newInterval)) throw new TypeError(`${newInterval} must be a Number.`); interval = newInterval; }; const getBeatTimeout = () => timeout; const setBeatTimeout = newTimeout => { if(isNaN(newTimeout)) throw new TypeError(`${newTimeout} must be a Number.`); timeout = newTimeout; clearTimeout(timeoutTimer); timeoutTimer = setTimeout(events.timeout, getBeatTimeout()); }; const getPing = () => ping; const setPing = newPing => { ping = newPing; }; const getPong = () => pong;
{ "domain": "codereview.stackexchange", "id": 29949, "lm_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, node.js", "url": null }
python, programming-challenge, hash-map Title: ZigZag Conversion Coding Challenge This is my solution for ZigZag Conversion, a coding challenge from LeetCode. The challenge: Write a program that takes two parameters, a string and a number of rows, that interprets the string as if it were displayed in a zigzag pattern and returns a line by line conversion of this interpretation in a final answer string. Example: Given the string 'PAYPALISHIRING', and 3 rows: P A H N A P L S I I G Y I R The program should output: "PAHNAPLSIIGYIR" My approach was to use a list of dictionaries, with the dictionaries as columns and their position in the list representing row positions. At the end of the control flow the list of dictionaries is unpacked and returned in the final output string. My solution: class Solution(object): def convert(self, s, numRows): row = numRows if row <= 1: return(s) else: a_lst = [] a_dict = {} outer_count = 0 loop_count = 0 my_count = 0 inner_count = row if row == 2: minus = 0 else: minus = 2 for i in s: loop_count+=1 if outer_count < row: outer_count+=1 a_dict[outer_count] = i if outer_count == row: my_count = 0 inner_count = row dict_copy = a_dict.copy() a_lst.append(dict_copy) a_dict.clear() elif loop_count == len(s): dict_copy = a_dict.copy() a_lst.append(dict_copy) a_dict.clear()
{ "domain": "codereview.stackexchange", "id": 42139, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, programming-challenge, hash-map", "url": null }
python, performance, homework, numpy, neural-network p = softmax(s) if not p.shape == (10, h.shape[1]): raise ValueError("Got wrong shape of p: {}".format(p.shape)) return p def evaluate_classifier(X, W1, W2, b1, b2): if not X.shape[0] == n_input: ValueError("Wrong shape of X: {}".format(X.shape)) if not len(X.shape) == 2: ValueError("Wrong shape of X: {}".format(X.shape)) if not W1.shape == (n_hidden, n_input): raise ValueError("Wrong shape of W1: {}".format(W1.shape)) if not b1.shape == (n_hidden, 1): raise ValueError("Wrong shape of b1: {}".format(b1.shape)) if not W2.shape == (10, n_hidden): raise ValueError("Wrong shape of W2: {}".format(W2.shape)) if not b2.shape == (10, 1): raise ValueError("Wrong shape of b2: {}".format(b2.shape)) s1, h = layer_1(X, W1, b1) p = layer_2(h, W2, b2) return s1, h, p def compute_cost(X, Y, W1, W2, b1, b2, lamb = 0): # WARNING! Y must be one hot! # X must have shape (3072, -1) # Y and P must have shape (-1, 10)
{ "domain": "codereview.stackexchange", "id": 30225, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, homework, numpy, neural-network", "url": null }
noise, snr, derivative Title: Why level of noise can be magnified twice through each numerical differentiation? I was reading a paper and saw this is mentioned there, but I cannot figure out how this can analytically be proven? Simply put: take an independent identically distributed Gaussian noise (one observation in blue, left) and its gradient (in green, right). The amplitude is roughly multiplied by the norm of the gradient filter (here $h=[1\,-1]$), which is $\sqrt{2}$, which you can see from the picture. Their average energy $E$ thus differ by a factor of $|h\|^2=\sqrt{2}^2 = 2$. As said by Olli, a similar question was answered in 2nd order edge detectors more susceptible to noise?. The part "can be magnified twice" is important, since this does not happen for all noises or all difference filters. More generally, a random signal $x(t)$ passing through a time-invariant filter with frequency response $H(f)$ produces a signal $y(t)$ with PSD: $$ S_y(f) = S_x(f) |H(f)|^2\,. $$ Since the Fourier domain is energy-preserving, you get that $$\|H\|^2\ =|h\|^2=2\,.$$ This is a reason why people have developed noise-robust differentiation, often combined with smoothing (eg Savitzky-Golay filters). See examples at Differentiation. Note that in the continuous case, you should take care of non integrable processes, see for instance Variance of white Gaussian noise.
{ "domain": "dsp.stackexchange", "id": 4434, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "noise, snr, derivative", "url": null }
quantum-field-theory, integration, complex-numbers, analyticity Title: Contour Integration in Schwartz In Matthew Schwartz's QFT text, on page 39, he has the following contour integral: $$\int_{-\infty}^{\infty}dk\frac{e^{ikr}-e^{-ikr}}{k+i\delta }.\tag{3.63}$$ This can be split into two terms, one for the positive exponent and one for the negative exponent. What I am confused on is why does he choose to close the contour up for the first term, and down for the second term. The contour is a semicircle. Specifically, he says "for $e^{ikr}$ we must close the contour integral up to get exponential decay at large k". How do you get "exponential decay" when $e^{i*something*x}$ is usually a cyclical function of x? I will consider only one of the integrals and leave the other for you as an exercise. We wish to evaluate the integral $$ I = \int_{-\infty}^{\infty}dk\frac{e^{-ikr}}{k+i\delta }. $$ To do this we consider first a different integral $$I'= \oint_\gamma dz\frac{e^{-izr}}{z+i\delta }$$ where $z$ is complex-- you may think of $z = k + iy$, if you like. The goal is to find a closed contour $\gamma$ we can integrate over that is along the real axis (returning our original integral) and goes to zero at every other point along the contour. Here's how we do it.
{ "domain": "physics.stackexchange", "id": 55855, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, integration, complex-numbers, analyticity", "url": null }
php, sql //run the query on cabin_content for the specific info we need in this situation break; case 'b': //run the query on cabin_content for the specific info we need in this situation break; case 'c': //run the query on cabin_content for the specific info we need in this situation //run an additional query on cabin_small_images break; } } //populate content to view Okay so obviously what I don't like about this is we are running as many as three queries per page load. I tried using inner joins, but I just could never access what I needed from the query properly: SELECT cabin_name, peak_week, max_occupancy, image FROM cabin_content INNER JOIN cabin_images ON cabin_content.cabin_id = cabin_images.cabin_id WHERE cabin_content.cabin_id = '$cabin'"; The issue here is that we can end up with multiple images from $row['images'] which we then need to iterate through in the view. Now, we complicate the situation even more when for case 'c' we also need to query cabin_small_images: SELECT cabin_name, peak_week, max_occupancy, image, image_small FROM cabin_content INNER JOIN cabin_images ON cabin_content.cabin_id = cabin_images.cabin_id INNER JOIN cabin_small_images ON cabin_images.cabin_id = cabin_small_images.cabin_id WHERE cabin_content.cabin_id = '$cabin'";
{ "domain": "codereview.stackexchange", "id": 956, "lm_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, sql", "url": null }
=$\sqrt{14^{2}+18^{2}+21^{2}}$=31 The largest possible distance=sum of the two radii+distance between the centers=19+87+31=137. Categories ## Arithmetic Mean | AIME I, 2015 | Question 12 Try this beautiful problem from the American Invitational Mathematics Examination, AIME, 2015 based on Arithmetic Mean. ## Arithmetic Mean of Number Theory – AIME 2015 Consider all 1000-element subsets of the set {1, 2, 3, … , 2015}. From each such subset choose the least element. The arithmetic mean of all of these least elements is $\frac{p}{q}$, where $p$ and $q$ are relatively prime positive integers. Find $p + q$. • is 107 • is 431 • is 840 • cannot be determined from the given information ### Key Concepts Inequalities Algebra Number Theory AIME, 2015, Question 12 Elementary Number Theory by David Burton ## Try with Hints Each 1000-element subset ${ a_1, a_2,a_3,…,a_{1000}}$ of ${1,2,3,…,2015}$ with $a_1<a_2<a_3<…<a_{1000}$ contributes $a_1$ to sum of least element of each subset and set ${a_1+1,a_2+1,a_3+1,…,a_{1000}+1}$. $a_1$ ways to choose a positive integer $k$ such that $k<a_1+1<a_2+1,a_3+1<…<a_{1000}+1$ ($k$ can be anything from $1$ to $a_1$ inclusive
{ "domain": "cheenta.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9597620596782467, "lm_q1q2_score": 0.8421689365613222, "lm_q2_score": 0.8774767954920548, "openwebmath_perplexity": 1717.9663031514228, "openwebmath_score": 0.6250997185707092, "tags": null, "url": "https://usa.cheenta.com/tag/algebra/" }
dataset, visualization, data-cleaning, data-science-model Title: What to do when the target variable does not correlate with any of the independent variable in a dataset? I am quite new to data science. I am trying to use Logistic Regression to predict my target (either 1 or 0). But the problem is when I use a heatmap to find the correlation between the columns and the target variable, the highest value I get is around 0.17 (out of 1). So it appears to me that my target variable doesn't correlate with any of the columns in the dataset. My question is, is it normal to have a such target variable? And what can I do to increase correlation between the target variable and other columns? If your predictors have nothing to do with the outcome, you should not be able to build a model that works out-of-sample. This is a feature, not a bug, of machine learning. For instance, do you consider what time I set my alarm in the morning to be predictive whether or not you have cereal for breakfast? Features can, however, have just a small relationship with the outcome and combine to be quite predictive. Perhaps my alarm does not influence your breakfast choice, but there are a number of factors that do, each of which might be poor at predicting the outcome, but the combination of $3$ or $10$ might be very predictive. At an extreme, consider individual pixels of the MNIST digits. Does the middle pixel, on its own, have much ability to distinguish between the digits? What about some other pixel? Every individual pixel is a poor predictor of the digit, yet all $784$ combined result in strong performance.
{ "domain": "datascience.stackexchange", "id": 9842, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dataset, visualization, data-cleaning, data-science-model", "url": null }
angular-momentum, rotational-kinematics, rotation, rocket-science, angular-velocity Euler angles are almost never actually used for equations of motion or interpolation. They're terrible at it because they behave borderline non-physical. For instance, if you try to rotate smoothly from one orientation to another just by linearly interpolating the yaw pitch and roll channels, you find the object takes a rather exotic looking path to get to its final orientation. They're convenient for a quick way to describe an orientation in a physically meaningful way, but they act squirely when you start to vary them over time. If you want to have things like a rate of change of orientation, use a orientation format which supports that better. Direction Cosine Matrixes and Quaternions have far superior properties. From my experience, quaternions are by far the most popular way to handle rotations, although it takes a while to wrap your head around them. Both of them have straightforward ways of dealing with the conservation of angular momentum. If you want a sense of how wonky euler angles can be, look at gimbal lock. This is a quirky situation where two of the axes generate the same rotation. It happens when the second rotation rotates the third rotation into the same axis as the first rotation. This is a major issue with gimbals because, when it occurs, you end up with one rotational dimension that you simply cannot observe. This means that once gimbal lock occurs, you no longer know what your orientation is. We nearly failed to go to the moon because of this. Apollo 11 had a standard 3 ring gyro, so was susceptible to gimbal lock. To combat this, they had a clever little "kicker" device which would rotate one of the axes at a critical moment to sidestep this horrid alignment from occuring. As it so happened, the code to handle this had a bug, and caused the subsystem to cease operating. They flew onward knowing the risk that a gimbal lock would cause them to lose track of their attitude. (Contingency plans included re-acquiring alignment by observing stars, which would be slow and error prone, but would get astronauts home safely).
{ "domain": "physics.stackexchange", "id": 73133, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "angular-momentum, rotational-kinematics, rotation, rocket-science, angular-velocity", "url": null }
beginner, c, game, tic-tac-toe for(i = 0; i < 3; i++){ for(j = 0, condition = 0; j < 3; j++){ /*checks rows*/ if(marks[i][j] == 'X' || marks[i][j] == 'O'){ condition += marks[i][j]; } if((condition / 'X') == 3.0){ winner = 1; } else if((condition / 'O') == 3.0){ winner = 2; } } } for(j = 0; j < 3; j++){ for(i = 0, condition = 0; i < 3; i++){ /*checks columns*/ if(marks[i][j] == 'X' || marks[i][j] == 'O'){ condition += marks[i][j]; } if((condition / 'X') == 3.0){ winner = 1; } else if((condition / 'O') == 3.0){ winner = 2; } } } for(i = 0, j = 0, condition = 0; i < 3; i++, j++){ /*checks diagonally*/ if(marks[i][j] == 'X' || marks[i][j] == 'O'){ condition += marks[i][j]; } if((condition / 'X') == 3.0){ winner = 1; } else if((condition / 'O') == 3.0){ winner = 2; } } for(i = 2, j = 0, condition = 0; j < 3; i--, j++){ /*checks diagonally*/ if(marks[i][j] == 'X' || marks[i][j] == 'O'){ condition += marks[i][j]; } if((condition / 'X') == 3.0){ winner = 1; } else if((condition / 'O') == 3.0){ winner = 2; } }
{ "domain": "codereview.stackexchange", "id": 38660, "lm_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, game, tic-tac-toe", "url": null }
complexity-theory, computability, turing-machines, np, nondeterminism To prove that the other definition $\text{NP}$ in terms of NTM implies the one above, you should construct such a polynomial verifier $V$ with the desired property. That is, for every $x \in L$, you need to find a certificate $u$ (you are not given a certificate $u$) such that $V(x,u) = 1$. Note that for every $x \in L$, there is a sequence of nondeterministic choices that makes the NTM $M$ accept $x$. This sequence is the certificate we need. What the polynomial verifier $V$ need to do is just to simulate the action of $M$ using these nondeterministic choices.
{ "domain": "cs.stackexchange", "id": 8847, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, computability, turing-machines, np, nondeterminism", "url": null }
This suggests: $$\sum_{0 \le k \le n} (\alpha + k)^{\underline{h}} = \frac{(\alpha + n + 1)^{\underline{h + 1}}}{h + 1} - \frac{\alpha^{\underline{h + 1}}}{h + 1}$$ This we prove by induction. Base: $n = 0$ gives: \begin{align} \sum_{0 \le k \le 0} (\alpha + k)^{\underline{h}} &= \alpha^{\underline{h}} \\ \frac{(\alpha + 1)^{\underline{h + 1}}}{h + 1} - \frac{\alpha^{\underline{h + 1}}}{h + 1} &= \frac{1}{h + 1} \Delta \alpha^{\underline{h + 1}} \\ &= \alpha^{\underline{h}} \end{align} This checks out. Induction: Assume it is true for $n$, look at $n + 1$:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347838494568, "lm_q1q2_score": 0.8466150352159195, "lm_q2_score": 0.8688267796346599, "openwebmath_perplexity": 1318.5737046956292, "openwebmath_score": 1.0000098943710327, "tags": null, "url": "https://math.stackexchange.com/questions/1304792/partial-sums-of-falling-factorials" }
python, game, python-3.x, pyqt Title: Example of PyQt5 simple turn-based game code I've made my first turn-based game in PyQt5. I suppose that its idea can also be used by other novice GUI programmers. There is a 5 by 5 squared unpainted field and 4 players. Each player starts at corner square and has his own colour. Player can move to adjacent square and fill it with his colour if it isn’t occupied by other player or isn’t filled in player's colour. If player has nowhere to move he is randomly teleported to non-filled square. Game ends when all squares are filled. Player who has most squares filled with his colour wins. Also I would like to hear any suggestions about code improvement. The problem parts are probably self.turn() and self.turn_loop() in MyApp class since they have a bit complicated "if/elif/else" logic. Main module (PainterField.py): #!/usr/bin/env python ''' Game name: PainterFiled Author: Igor Vasylchenko As this module and its sub-modules use PyQt5 they are distributed and may be used under the terms of the GNU General Public License version 3.0. See http://www.gnu.org/copyleft/gpl.html ''' import random import sys import traceback from PyQt5.QtCore import (QRectF, QTimer, Qt) from PyQt5.QtGui import (QBrush, QColor, QImage) from PyQt5.QtWidgets import (QApplication, QGraphicsItem, QGraphicsScene, QGraphicsView, QMainWindow, QPushButton) # Custom classes from FieldClasses import (PlayerQGraphics, SquareQGrapics) from FieldFunctions import (create_obstacles, create_squares, create_players, print_main, print_rules) # Gui generated by Qt5 from gui import Ui_Field as Ui_MainWindow '''Exceptions hadling block. Needed to track errors during operation.'''
{ "domain": "codereview.stackexchange", "id": 22242, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, game, python-3.x, pyqt", "url": null }
python, performance, programming-challenge, primes, comparative-review Python: from math import log n = 10001 max = n*(log(n) + log(log(n))) marked = [False] * int(max/2) for i in range(1, len(marked)): for j in range(1, i + 1): m = i + j + 2*i*j if m > len(marked): break marked[m] = True count = 0 for i in range(0, len(marked)): if not marked[i]: count += 1 if count == n: print 2*i + 1 break TL;DR: Just use PyPy; it gets you to about 10x the time of C++. If you really want to use CPython, a lot of clever optimizations (not algorithm changes) gets you as fast as PyPy and then using Numpy gets you close to C++ (2x the time). The first thing of note is that your Python code is broken: if m > len(marked): break Remember that Python is 0-indexed. What about when m == len(marked)? So that's the first thing to fix. Going from the top, I'd do the translation so: from math import log
{ "domain": "codereview.stackexchange", "id": 10836, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, programming-challenge, primes, comparative-review", "url": null }
c#, performance, linq, entity-framework, asp.net-mvc Title: ASP.NET MVC 5, EF 6 filter performance I'm creating a filter with Linq in an ASP.NET MVC application. I was hoping I could get some tips on performance enhancements, aside from any possible performance enhancements. I have a few questions: Should I ToList before my extension methods that use .Select? Would adding AsNoTracking help performance? If so, if my GetAllIncluding method returns IEnumerable, where should I add AsQueriable().AsNoTracking()? The Entities SubProject and Activity are self referencing Entities I'm trying to eager load them as all the lazy loading looping is extremely slow. Am I doing this in the correct manner? I know this is using Repo pattern and UOW, but that's just the way this app was built so I would like to build this around that. Here is the DTO I'm sending to the client: public class GanttDto { public IEnumerable<ProductLineDto> ProductLines { get; set; } public IEnumerable<ProjectDto> Projects { get; set; } public IEnumerable<SubProjectDto> Subprojects { get; set; } public IEnumerable<ActivityDto> Activities { get; set; } public IEnumerable<ProjectTypeDto> ProjectTypes { get; set; } } Here are my filter methods public GanttDto Filter(GanttFilterDto filterCriteria) { FilterCriteria = filterCriteria; var projects = FilterProjects().ToList(); var pIds = projects.Select(x => x.ProjectID); var data = new GanttDto { ProductLines = FilterProductLines(), Projects = projects.ToProjectDtoEnumerable(), Subprojects = FilterSubProjects(pIds), Activities = GetActivities(pIds), ProjectTypes = UnitOfWork.ProjectTypeRepository.GetAll().OrderBy(z => z.SortOrder).ToList().ToProjectTypeDtoEnumerable() }; return data; }
{ "domain": "codereview.stackexchange", "id": 35983, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, linq, entity-framework, asp.net-mvc", "url": null }
c#, wpf foreach (var order in ordersToUpdate) { order.Status = status; order.StatusChanged = DateTime.Now; dbContext.SubmitChanges(); } var index = mainDataItems.IndexOf(mainDataItems.Where(x => (rowValue as MainData).OrderNumber == x.OrderNumber).FirstOrDefault()); mainDataItems.RemoveAt(index); dxgMainGrid.RefreshData(); } }
{ "domain": "codereview.stackexchange", "id": 11060, "lm_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#, wpf", "url": null }
neural-networks, ai-basics, activation-functions, hidden-layers, weights This forms the first layer of a neural network with linear activation functions. Assuming $ x_{i} $ and $ x_{j} $ as the two independent variables, the first layer computes $$ y_{1} = w_{1}x_{i} + w_{2}x_{j} + b_{1} $$ Note that while $ y_{1} $ is the output of the first layer, the set $ [w_{1}, w_{2}, b_{1}] $ is the model of the first layer and can be plotted as a plane in 3D space. The second layer, again a linear layer, computes $$ y_{2} = w_{3}y_{1} + b_{2} $$ Substitute $ y_{1} $ in above and what do you get? Another linear model! $$ y_{2} = w_{3}(w_{1}x_{i} + w_{2}x_{j} + b_{1}) + b_{2} $$ Adding layers to a neural network is only compounding of functions. Compounding linear functions on linear functions result in linear functions. Well, then, what was the point of adding a layer? Seems useless, right? Yes, adding linear layers to a neural network is absolutely useless. But what happens if the activation functions of each perceptron, each layer was not linear? For example the sigmoid or the most widely used today, ReLU. Compounding non-linear functions on non-linear functions can increase non-linearity. The ReLU looks like this $$ y = max(0, x) $$ This is definitely non-linear but not as non-linear as let's say the sine wave. But can we approximate the sine wave by somehow "compounding" multiple, say $ N $ ReLUs? $$ \sin(x) \approx a + \sum_{N}b*max(0, c + dx)$$ And here the variables $ a, b,c, d $ are the trainable "weights" in neural network terminology.
{ "domain": "ai.stackexchange", "id": 1912, "lm_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, ai-basics, activation-functions, hidden-layers, weights", "url": null }
javascript, angular.js if (isFiltered) { result.push(value); // add item to filterd result } }); return result; }; return _filter; }); Named functions I like the idea of named functions. It helps when you debug your app - you are getting error with name of function instead of "anonymous". Defalt options The default options location is good place to keep it. Filter has to be independant from controller and should manage its own data. Although, the default options object is created at every reference to filter. This is waste of resources. angular.module('app', []).filter('myObjectFilter', function myObjectFilter() { //default filter setting var defaultFilters = { pending: false, refusedAt: null }; function _filter(source, search) { if (!source) { return source; } var result = []; search = angular.extend({}, defaultFilters, search); ... Last if This code: isFiltered = isFiltered && isEqual; if(!isEqual) { break; //exit loop if filter not passed } checks for isEqual two times. //isFiltered = isFiltered && isEqual; //you can delete this line if(!isEqual) { isFiltered = false; break; //exit loop if filter not passed } My version checks it only once. I know that you don't get much performance here, but imagine situation when you would like to change the statement for making isFiltered false. You need to change condition in two places. This can lead to serious headache and long debugging in case one of them is forgotten ;)
{ "domain": "codereview.stackexchange", "id": 22905, "lm_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, angular.js", "url": null }
gazebo, simulation, urdf, simulator-gazebo Title: Why import my own robot model goes to mess? I want to create my own robot model and simulate that with C or C++ code through gazebo. First I create my own robot model by Solidwork software and export the model to xml and STl files by using the plug-in SimMechanics Link. Then I transformed urdf fil from the xml file by the simmechanics_to_urdf packet. my code likes below: rosrun simmechanics_to_urdf convert.py jixiebi.xml xml > jixiebi.urdf After that, I copy all of the STL files to the catalog of /simulator_gazebo/gazebo_worlds/Media/models. Finally,I run the below code rosrun gazebo spawn_model -file `pwd`/jixiebi.urdf -urdf -z 1 -model my_jixiebi and now I can see my model. But the model goes to mess. I guess it's the coordinate error, but I don't know how to deal with. I know the urdf has origin tag but I find it's very difficult to fix all link's and joint's coordinate correctly. What's worse, my model has hundreds of links and joints. So, here is my questions. Is there any wrongs in my process? How to deal with my problem? If the mess model problem could figure out, the next step is how to do? Thanks a lot and look forward to your answer. Originally posted by shenhaobin on ROS Answers with karma: 19 on 2011-08-03 Post score: 1 simmechanics_to_urdf is desiged to save a lot of work when creating a URDF file for a complex robot, but it does not do everything. Definitely check out this tutorial. Also, before moving into gazebo, I would ensure that your model looks right and moves correctly in rviz first. Originally posted by David Lu with karma: 10932 on 2011-08-04 This answer was ACCEPTED on the original site Post score: 4
{ "domain": "robotics.stackexchange", "id": 6336, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo, simulation, urdf, simulator-gazebo", "url": null }
time-series, neural-network From here, find the modulus of the elements (since they will be complex), and define the result as $\bar{S} = |S|$. Then I recommend performing a Non-negative Matrix factorization on $\bar{S}$ such that you get the low-rank approximation $\bar{S} \approx FW$ with some small specified number of features. $F$ in this case will be your features (they will be column vectors in $F$) and $W$ will be your new data in feature-space. You can look at $W$ to see where a given feature from $F$ appears. Given you've generated $F$, all you need to do to do to find $W$ for individual/new time series results is compute the spectrogram for that time series, call it $\hat{S}$, and then do $\hat{W} = F^{+} |\hat{S}|$ where $F^{+}$ is the pseudo inverse of $F$. Now you can look at $\hat{W}$ to get an idea of where certain features are being used and also build models using this lower dimensional representation. Note that the number of features you use will have to be played with. I would look at the modulus of a sample spectrogram to get a feel for how much the frequencies are changing over time and consider roughly how many dominant features you think could be used to approximate it and then set the number of features as that to start. As an example, I have done this stuff above to identify different sounds in an audio clip and I only had to reduce it to the number of dominant sounds (there were 3 of them) so that hugely minimized my dataset size. Images from this example are shown below:
{ "domain": "dsp.stackexchange", "id": 5650, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "time-series, neural-network", "url": null }